diff --git a/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 b/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 index 8721f3ba734..db395dd2ee9 100644 --- a/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 +++ b/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 @@ -261,10 +261,8 @@ export default MountWidget.extend({ }, _posted(staged) { - const disableJumpReply = this.currentUser.get("disable_jump_reply"); - this.queueRerender(() => { - if (staged && !disableJumpReply) { + if (staged) { const postNumber = staged.get("post_number"); DiscourseURL.jumpToPost(postNumber, { skipIfOnScreen: true }); } diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6 index a8897802c90..0641f1120ee 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer.js.es6 @@ -719,14 +719,9 @@ export default Ember.Controller.extend({ currentUser.set("reply_count", currentUser.get("reply_count") + 1); } - const disableJumpReply = Discourse.User.currentProp( - "disable_jump_reply" - ); - if (!composer.get("replyingToTopic") || !disableJumpReply) { - const post = result.target; - if (post && !staged) { - DiscourseURL.routeTo(post.get("url")); - } + const post = result.target; + if (post && !staged) { + DiscourseURL.routeTo(post.get("url")); } }) .catch(error => { diff --git a/app/assets/javascripts/discourse/controllers/preferences/interface.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/interface.js.es6 index cba47fa2393..8629f612556 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/interface.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/interface.js.es6 @@ -31,7 +31,6 @@ export default Ember.Controller.extend(PreferencesTabController, { "external_links_in_new_tab", "dynamic_favicon", "enable_quoting", - "disable_jump_reply", "automatically_unpin_topics", "allow_private_messages", "homepage_id", diff --git a/app/assets/javascripts/discourse/models/user.js.es6 b/app/assets/javascripts/discourse/models/user.js.es6 index f29a4e1b1f7..e80e060cef3 100644 --- a/app/assets/javascripts/discourse/models/user.js.es6 +++ b/app/assets/javascripts/discourse/models/user.js.es6 @@ -274,7 +274,6 @@ const User = RestModel.extend({ "email_previous_replies", "dynamic_favicon", "enable_quoting", - "disable_jump_reply", "automatically_unpin_topics", "digest_after_minutes", "new_topic_duration_minutes", diff --git a/app/assets/javascripts/discourse/templates/preferences/interface.hbs b/app/assets/javascripts/discourse/templates/preferences/interface.hbs index 6323af8e19d..61f1303c270 100644 --- a/app/assets/javascripts/discourse/templates/preferences/interface.hbs +++ b/app/assets/javascripts/discourse/templates/preferences/interface.hbs @@ -50,7 +50,6 @@ {{preference-checkbox labelKey="user.external_links_in_new_tab" checked=model.user_option.external_links_in_new_tab}} {{preference-checkbox labelKey="user.enable_quoting" checked=model.user_option.enable_quoting}} {{preference-checkbox labelKey="user.dynamic_favicon" checked=model.user_option.dynamic_favicon}} - {{preference-checkbox labelKey="user.disable_jump_reply" checked=model.user_option.disable_jump_reply}} {{#if siteSettings.automatically_unpin_topics}} {{preference-checkbox labelKey="user.automatically_unpin_topics" checked=model.user_option.automatically_unpin_topics}} {{/if}} diff --git a/app/models/user_option.rb b/app/models/user_option.rb index d75149b7878..8f84c5958cc 100644 --- a/app/models/user_option.rb +++ b/app/models/user_option.rb @@ -53,7 +53,6 @@ class UserOption < ActiveRecord::Base self.enable_quoting = SiteSetting.default_other_enable_quoting self.external_links_in_new_tab = SiteSetting.default_other_external_links_in_new_tab self.dynamic_favicon = SiteSetting.default_other_dynamic_favicon - self.disable_jump_reply = SiteSetting.default_other_disable_jump_reply self.new_topic_duration_minutes = SiteSetting.default_other_new_topic_duration_minutes self.auto_track_topics_after_msecs = SiteSetting.default_other_auto_track_topics_after_msecs @@ -187,6 +186,8 @@ class UserOption < ActiveRecord::Base end +# TODO: Drop disable_jump_reply column. Functionality removed April 2019 + # == Schema Information # # Table name: user_options diff --git a/app/serializers/current_user_serializer.rb b/app/serializers/current_user_serializer.rb index 2894b6983c6..20bad77d006 100644 --- a/app/serializers/current_user_serializer.rb +++ b/app/serializers/current_user_serializer.rb @@ -24,7 +24,6 @@ class CurrentUserSerializer < BasicUserSerializer :can_delete_account, :should_be_redirected_to_top, :redirected_to_top, - :disable_jump_reply, :custom_fields, :muted_category_ids, :dismissed_banner_key, @@ -78,10 +77,6 @@ class CurrentUserSerializer < BasicUserSerializer object.user_option.enable_quoting end - def disable_jump_reply - object.user_option.disable_jump_reply - end - def external_links_in_new_tab object.user_option.external_links_in_new_tab end diff --git a/app/serializers/user_option_serializer.rb b/app/serializers/user_option_serializer.rb index 1ec5f4d27af..57a8dede499 100644 --- a/app/serializers/user_option_serializer.rb +++ b/app/serializers/user_option_serializer.rb @@ -8,7 +8,6 @@ class UserOptionSerializer < ApplicationSerializer :external_links_in_new_tab, :dynamic_favicon, :enable_quoting, - :disable_jump_reply, :digest_after_minutes, :automatically_unpin_topics, :auto_track_topics_after_msecs, diff --git a/app/services/user_updater.rb b/app/services/user_updater.rb index 24e0c2dd92b..eda38fb0736 100644 --- a/app/services/user_updater.rb +++ b/app/services/user_updater.rb @@ -23,7 +23,6 @@ class UserUpdater :external_links_in_new_tab, :enable_quoting, :dynamic_favicon, - :disable_jump_reply, :automatically_unpin_topics, :digest_after_minutes, :new_topic_duration_minutes, diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index b6ccfaca793..7ba9a8f11e9 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -772,7 +772,6 @@ en: dismiss_notifications: "Dismiss All" dismiss_notifications_tooltip: "Mark all unread notifications as read" first_notification: "Your first notification! Select it to begin." - disable_jump_reply: "Don't jump to my post after I reply" dynamic_favicon: "Show new / updated topic count on browser icon" theme_default_on_all_devices: "Make this the default theme on all my devices" text_size_default_on_all_devices: "Make this the default text size on all my devices" diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index eeeb371170d..198aa364cec 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1952,7 +1952,6 @@ en: default_other_external_links_in_new_tab: "Open external links in a new tab by default." default_other_enable_quoting: "Enable quote reply for highlighted text by default." default_other_dynamic_favicon: "Show new/updated topic count on browser icon by default." - default_other_disable_jump_reply: "Don't jump to user's post after they reply by default." default_other_like_notification_frequency: "Notify users on likes by default" diff --git a/config/site_settings.yml b/config/site_settings.yml index 00a79e67c34..8ac802f1ae0 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -1879,7 +1879,6 @@ user_preferences: default_other_external_links_in_new_tab: false default_other_enable_quoting: true default_other_dynamic_favicon: false - default_other_disable_jump_reply: false default_other_like_notification_frequency: enum: "LikeNotificationFrequencySiteSetting" default: 1 diff --git a/lib/post_creator.rb b/lib/post_creator.rb index e05bd0c4d7e..38d62ab11ee 100644 --- a/lib/post_creator.rb +++ b/lib/post_creator.rb @@ -548,19 +548,17 @@ class PostCreator def track_topic return if @opts[:import_mode] || @opts[:auto_track] == false - unless @user.user_option.disable_jump_reply? - TopicUser.change(@post.user_id, - @topic.id, - posted: true, - last_read_post_number: @post.post_number, - highest_seen_post_number: @post.post_number) + TopicUser.change(@post.user_id, + @topic.id, + posted: true, + last_read_post_number: @post.post_number, + highest_seen_post_number: @post.post_number) - # assume it took us 5 seconds of reading time to make a post - PostTiming.record_timing(topic_id: @post.topic_id, - user_id: @post.user_id, - post_number: @post.post_number, - msecs: 5000) - end + # assume it took us 5 seconds of reading time to make a post + PostTiming.record_timing(topic_id: @post.topic_id, + user_id: @post.user_id, + post_number: @post.post_number, + msecs: 5000) if @user.staged TopicUser.auto_notification_for_staging(@user.id, @topic.id, TopicUser.notification_reasons[:auto_watch]) diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 936232ed98d..d5de7b792dc 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -154,7 +154,6 @@ def insert_user_options enable_quoting, external_links_in_new_tab, dynamic_favicon, - disable_jump_reply, new_topic_duration_minutes, auto_track_topics_after_msecs, notification_level_when_replying, @@ -174,7 +173,6 @@ def insert_user_options , #{SiteSetting.default_other_enable_quoting} , #{SiteSetting.default_other_external_links_in_new_tab} , #{SiteSetting.default_other_dynamic_favicon} - , #{SiteSetting.default_other_disable_jump_reply} , #{SiteSetting.default_other_new_topic_duration_minutes} , #{SiteSetting.default_other_auto_track_topics_after_msecs} , #{SiteSetting.default_other_notification_level_when_replying} diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 15b25b93b8b..4bf3c572b1d 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1491,7 +1491,6 @@ describe User do SiteSetting.default_other_external_links_in_new_tab = true SiteSetting.default_other_enable_quoting = false SiteSetting.default_other_dynamic_favicon = true - SiteSetting.default_other_disable_jump_reply = true SiteSetting.default_topics_automatic_unpin = false @@ -1511,7 +1510,6 @@ describe User do expect(options.external_links_in_new_tab).to eq(true) expect(options.enable_quoting).to eq(false) expect(options.dynamic_favicon).to eq(true) - expect(options.disable_jump_reply).to eq(true) expect(options.automatically_unpin_topics).to eq(false) expect(options.new_topic_duration_minutes).to eq(-1) expect(options.auto_track_topics_after_msecs).to eq(0) diff --git a/test/javascripts/fixtures/session-fixtures.js.es6 b/test/javascripts/fixtures/session-fixtures.js.es6 index fd9e41008a8..b04d5b27960 100644 --- a/test/javascripts/fixtures/session-fixtures.js.es6 +++ b/test/javascripts/fixtures/session-fixtures.js.es6 @@ -23,7 +23,6 @@ export default { can_edit: true, can_invite_to_forum: true, should_be_redirected_to_top: false, - disable_jump_reply: false, custom_fields: {}, muted_category_ids: [], dismissed_banner_key: null, diff --git a/test/javascripts/fixtures/user_fixtures.js.es6 b/test/javascripts/fixtures/user_fixtures.js.es6 index 79937a4d263..954fb14ff9f 100644 --- a/test/javascripts/fixtures/user_fixtures.js.es6 +++ b/test/javascripts/fixtures/user_fixtures.js.es6 @@ -182,7 +182,6 @@ export default { watched_category_ids: [3], watched_first_post_category_ids: [], private_messages_stats: { all: 101, mine: 13, unread: 3 }, - disable_jump_reply: false, gravatar_avatar_upload_id: 5275, custom_avatar_upload_id: 1573, card_image_badge: "/images/avatar.png", @@ -2514,7 +2513,6 @@ export default { external_links_in_new_tab: false, dynamic_favicon: false, enable_quoting: true, - disable_jump_reply: false, digest_after_minutes: 10080, automatically_unpin_topics: true, auto_track_topics_after_msecs: 240000,