From 3049646b65c0a3595d46f77a29353e68fda49b92 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 13 Jan 2025 14:40:07 +0100 Subject: [PATCH] favorite categories/tags --- .../discourse_rewind/rewind/action/favorite_tags.rb | 13 +++++++++++++ .../components/reports/favorite-categories.gjs | 5 ++++- .../discourse/components/reports/favorite-tags.gjs | 7 +++++-- assets/javascripts/discourse/components/rewind.gjs | 1 + assets/stylesheets/common/activity-calendar.scss | 2 +- assets/stylesheets/common/favorite-categories.scss | 9 +++++++++ assets/stylesheets/common/favorite-tags.scss | 9 +++++++++ assets/stylesheets/common/top-words.scss | 2 +- assets/stylesheets/mobile/activity-calendar.scss | 2 +- 9 files changed, 44 insertions(+), 6 deletions(-) diff --git a/app/services/discourse_rewind/rewind/action/favorite_tags.rb b/app/services/discourse_rewind/rewind/action/favorite_tags.rb index 30b5161..088bc2c 100644 --- a/app/services/discourse_rewind/rewind/action/favorite_tags.rb +++ b/app/services/discourse_rewind/rewind/action/favorite_tags.rb @@ -3,7 +3,20 @@ # Topics visited grouped by tag module DiscourseRewind class Rewind::Action::FavoriteTags < Rewind::Action::BaseReport + FakeData = { + data: [ + { tag_id: 1, name: "cats" }, + { tag_id: 2, name: "dogs" }, + { tag_id: 3, name: "countries" }, + { tag_id: 4, name: "management" }, + { tag_id: 5, name: "things" }, + ], + identifier: "favorite-tags", + } + def call + return FakeData if Rails.env.development? + favorite_tags = TopicViewItem .joins(:topic) diff --git a/assets/javascripts/discourse/components/reports/favorite-categories.gjs b/assets/javascripts/discourse/components/reports/favorite-categories.gjs index b71b666..05e679c 100644 --- a/assets/javascripts/discourse/components/reports/favorite-categories.gjs +++ b/assets/javascripts/discourse/components/reports/favorite-categories.gjs @@ -11,7 +11,10 @@ const FavoriteCategories =