diff --git a/app/assets/javascripts/discourse/models/user.js.es6 b/app/assets/javascripts/discourse/models/user.js.es6 index 9d0f228640d..95e851d3ca5 100644 --- a/app/assets/javascripts/discourse/models/user.js.es6 +++ b/app/assets/javascripts/discourse/models/user.js.es6 @@ -146,39 +146,39 @@ const User = RestModel.extend({ save() { const data = this.getProperties( - 'bio_raw', - 'website', - 'location', - 'name', - 'locale', - 'custom_fields', - 'user_fields', - 'muted_usernames', - 'profile_background', - 'card_background', - 'muted_tags', - 'tracked_tags', - 'watched_tags' - ); + 'bio_raw', + 'website', + 'location', + 'name', + 'locale', + 'custom_fields', + 'user_fields', + 'muted_usernames', + 'profile_background', + 'card_background', + 'muted_tags', + 'tracked_tags', + 'watched_tags', + 'watching_first_post_tags'); - [ 'email_always', - 'mailing_list_mode', - 'mailing_list_mode_frequency', - 'external_links_in_new_tab', - 'email_digests', - 'email_direct', - 'email_in_reply_to', - 'email_private_messages', - 'email_previous_replies', - 'dynamic_favicon', - 'enable_quoting', - 'disable_jump_reply', - 'automatically_unpin_topics', - 'digest_after_minutes', - 'new_topic_duration_minutes', - 'auto_track_topics_after_msecs', - 'like_notification_frequency', - 'include_tl0_in_digests' + ['email_always', + 'mailing_list_mode', + 'mailing_list_mode_frequency', + 'external_links_in_new_tab', + 'email_digests', + 'email_direct', + 'email_in_reply_to', + 'email_private_messages', + 'email_previous_replies', + 'dynamic_favicon', + 'enable_quoting', + 'disable_jump_reply', + 'automatically_unpin_topics', + 'digest_after_minutes', + 'new_topic_duration_minutes', + 'auto_track_topics_after_msecs', + 'like_notification_frequency', + 'include_tl0_in_digests' ].forEach(s => { data[s] = this.get(`user_option.${s}`); }); diff --git a/app/assets/javascripts/discourse/templates/user/preferences.hbs b/app/assets/javascripts/discourse/templates/user/preferences.hbs index 2644c964e19..75c3bc10f58 100644 --- a/app/assets/javascripts/discourse/templates/user/preferences.hbs +++ b/app/assets/javascripts/discourse/templates/user/preferences.hbs @@ -288,6 +288,11 @@ {{tag-chooser tags=model.tracked_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}}
{{i18n 'user.tracked_tags_instructions'}}
+
+ + {{tag-chooser tags=model.watching_first_post_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}} +
+
{{i18n 'user.watched_first_post_tags_instructions'}}
{{tag-chooser tags=model.muted_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}} diff --git a/app/serializers/user_serializer.rb b/app/serializers/user_serializer.rb index 475b8f751ca..b9be71f4d5b 100644 --- a/app/serializers/user_serializer.rb +++ b/app/serializers/user_serializer.rb @@ -84,6 +84,7 @@ class UserSerializer < BasicUserSerializer private_attributes :locale, :muted_category_ids, :watched_tags, + :watching_first_post_tags, :tracked_tags, :muted_tags, :tracked_category_ids, @@ -258,6 +259,10 @@ class UserSerializer < BasicUserSerializer TagUser.lookup(object, :tracking).joins(:tag).pluck('tags.name') end + def watching_first_post_tags + TagUser.lookup(object, :watching_first_post).joins(:tag).pluck('tags.name') + end + def watched_tags TagUser.lookup(object, :watching).joins(:tag).pluck('tags.name') end diff --git a/app/services/user_updater.rb b/app/services/user_updater.rb index 5038ea4aaf9..8595260120c 100644 --- a/app/services/user_updater.rb +++ b/app/services/user_updater.rb @@ -8,6 +8,7 @@ class UserUpdater } TAG_NAMES = { + watching_first_post_tags: :watching_first_post, watched_tags: :watching, tracked_tags: :tracking, muted_tags: :muted diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 553fee8d542..e538562fc3d 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -553,6 +553,9 @@ en: tracked_categories_instructions: "You will automatically track all topics in these categories. A count of new posts will appear next to the topic." watched_first_post_categories: "Watching First Post" watched_first_post_categories_instructions: "You will be notified of the first post in each new topic in these categories." + watched_first_post_tags: "Watching First Post" + watched_first_post_tags_instructions: "You will be notified of the first post in each new topic with these tags." + muted_categories: "Muted" muted_categories_instructions: "You will not be notified of anything about new topics in these categories, and they will not appear in latest." delete_account: "Delete My Account"