A platform for community discussion. Free, open, simple.
UX: Rewind feedback and fixes 2 (#36614)
Martin Brennan63257772c40a
diff --git a/plugins/discourse-rewind/app/services/discourse_rewind/action/best_topics.rb b/plugins/discourse-rewind/app/services/discourse_rewind/action/best_topics.rbindex b844c184037..78b3697fae7 100644--- a/plugins/discourse-rewind/app/services/discourse_rewind/action/best_topics.rb+++ b/plugins/discourse-rewind/app/services/discourse_rewind/action/best_topics.rb@@ -13,7 +13,7 @@ module DiscourseRewind},{topic_id: 2,- title: "Best practices for database optimization",+ title: ":file_cabinet: Best practices for database optimization",excerpt: "Learn how to optimize your database queries for better performance...",yearly_score: 38.2,},diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/best-topics.gjs b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/best-topics.gjsindex b2e3c239999..fe9b4ef2658 100644--- a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/best-topics.gjs+++ b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/best-topics.gjs@@ -28,7 +28,9 @@ export default class BestTopics extends Component {><span class="best-topics --rank"></span><span class="best-topics --rank"></span>- <h2 class="best-topics__header">{{topic.title}}</h2>+ <h2 class="best-topics__header">{{replaceEmoji+ topic.title+ }}</h2><span class="best-topics__excerpt">{{replaceEmoji (htmlSafe topic.excerpt)}}</span>diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/new-user-interactions.gjs b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/new-user-interactions.gjsindex f67fe241d72..b077e64ee9d 100644--- a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/new-user-interactions.gjs+++ b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/new-user-interactions.gjs@@ -14,7 +14,11 @@ export default class NewUserInteractions extends Component {<template><div class="rewind-report-page --new-user-interactions"><div class="wordart-container">- <div class="wordart-text">your contributions helped</div>+ <div class="wordart-text">+ {{i18n+ "discourse_rewind.reports.new_user_interactions.your_contributions_helped"+ }}+ </div><div class="wordart-3d">{{#each this.wavyWords as |word|}}<span class="wordart-word">diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/connectors/after-header-panel/rewind-decoration.gjs b/plugins/discourse-rewind/assets/javascripts/discourse/connectors/after-header-panel/rewind-decoration.gjsindex ef6c82ae1e4..ba4ffafa0b8 100644--- a/plugins/discourse-rewind/assets/javascripts/discourse/connectors/after-header-panel/rewind-decoration.gjs+++ b/plugins/discourse-rewind/assets/javascripts/discourse/connectors/after-header-panel/rewind-decoration.gjs@@ -3,14 +3,11 @@ import { service } from "@ember/service";import bodyClass from "discourse/helpers/body-class";export default class AvatarDecorator extends Component {- @service currentUser;@service rewind;get showDecorator() {return (- this.currentUser?.is_rewind_active &&- !this.rewind.dismissed &&- !this.rewind.disabled+ this.rewind.active && !this.rewind.dismissed && !this.rewind.disabled);}diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/connectors/before-panel-body/rewind-callout.gjs b/plugins/discourse-rewind/assets/javascripts/discourse/connectors/before-panel-body/rewind-callout.gjsindex 493d1f170d6..932a142a39c 100644--- a/plugins/discourse-rewind/assets/javascripts/discourse/connectors/before-panel-body/rewind-callout.gjs+++ b/plugins/discourse-rewind/assets/javascripts/discourse/connectors/before-panel-body/rewind-callout.gjs@@ -7,14 +7,11 @@ import { i18n } from "discourse-i18n";export default class RewindCallout extends Component {@service router;- @service currentUser;@service rewind;get showCallout() {return (- this.currentUser?.is_rewind_active &&- !this.rewind.dismissed &&- !this.rewind.disabled+ this.rewind.active && !this.rewind.dismissed && !this.rewind.disabled);}diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/connectors/user-activity-bottom/rewind-tab.gjs b/plugins/discourse-rewind/assets/javascripts/discourse/connectors/user-activity-bottom/rewind-tab.gjsindex ac259a7f5f9..ad87fe86bf2 100644--- a/plugins/discourse-rewind/assets/javascripts/discourse/connectors/user-activity-bottom/rewind-tab.gjs+++ b/plugins/discourse-rewind/assets/javascripts/discourse/connectors/user-activity-bottom/rewind-tab.gjs@@ -5,11 +5,10 @@ import icon from "discourse/helpers/d-icon";import { i18n } from "discourse-i18n";export default class RewindTab extends Component {- @service currentUser;@service rewind;get showNavTab() {- return this.currentUser?.is_rewind_active && !this.rewind.disabled;+ return this.rewind.active && !this.rewind.disabled;}<template>diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/initializers/rewind-setup.js b/plugins/discourse-rewind/assets/javascripts/discourse/initializers/rewind-setup.jsindex 27d3dadf8a2..b7f0f2c6fd4 100644--- a/plugins/discourse-rewind/assets/javascripts/discourse/initializers/rewind-setup.js+++ b/plugins/discourse-rewind/assets/javascripts/discourse/initializers/rewind-setup.js@@ -13,18 +13,20 @@ export default {return;}- if (!this.currentUser.is_rewind_active) {+ if (!this.rewind.active) {return;}withPluginApi((api) => {- api.addQuickAccessProfileItem({- icon: "repeat",- href: "/my/activity/rewind",- content: i18n("discourse_rewind.profile_link", {- rewindYear: this.rewind.fetchRewindYear,- }),- });+ if (!this.rewind.disabled) {+ api.addQuickAccessProfileItem({+ icon: "repeat",+ href: "/my/activity/rewind",+ content: i18n("discourse_rewind.profile_link", {+ rewindYear: this.rewind.fetchRewindYear,+ }),+ });+ }});},};diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/services/rewind.js b/plugins/discourse-rewind/assets/javascripts/discourse/services/rewind.jsindex 05658a9908c..70a34632ff1 100644--- a/plugins/discourse-rewind/assets/javascripts/discourse/services/rewind.js+++ b/plugins/discourse-rewind/assets/javascripts/discourse/services/rewind.js@@ -12,6 +12,10 @@ export default class Rewind extends Service {@tracked_isDisabled = this.currentUser?.user_option?.discourse_rewind_disabled;+ get active() {+ return this.currentUser?.is_rewind_active;+ }+get disabled() {return this._isDisabled ?? false;}diff --git a/plugins/discourse-rewind/config/locales/client.en.yml b/plugins/discourse-rewind/config/locales/client.en.ymlindex da930c3a176..192516c2d16 100644--- a/plugins/discourse-rewind/config/locales/client.en.yml+++ b/plugins/discourse-rewind/config/locales/client.en.yml@@ -133,6 +133,7 @@ en:replies: Replies to Postsmentions: Mentionstopics_with_new_users: Topics with New Users+ your_contributions_helped: your contributions helpedtime_of_day_activity:title: Daily Activity Rhythmplay_button: Play your activity as sounddiff --git a/plugins/discourse-rewind/plugin.rb b/plugins/discourse-rewind/plugin.rbindex c39308a8c44..5848a0dea46 100644--- a/plugins/discourse-rewind/plugin.rb+++ b/plugins/discourse-rewind/plugin.rb@@ -65,8 +65,6 @@ after_initialize doendadd_to_serializer(:current_user, :is_rewind_active) do- return false if object.user_option&.discourse_rewind_disabled-Rails.env.development? || Date.today.month == 1 || Date.today.month == 12end