mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 11:48:08 +08:00
Remove support for disable_jump_reply user setting (#7359)
This commit is contained in:
@ -261,10 +261,8 @@ export default MountWidget.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_posted(staged) {
|
_posted(staged) {
|
||||||
const disableJumpReply = this.currentUser.get("disable_jump_reply");
|
|
||||||
|
|
||||||
this.queueRerender(() => {
|
this.queueRerender(() => {
|
||||||
if (staged && !disableJumpReply) {
|
if (staged) {
|
||||||
const postNumber = staged.get("post_number");
|
const postNumber = staged.get("post_number");
|
||||||
DiscourseURL.jumpToPost(postNumber, { skipIfOnScreen: true });
|
DiscourseURL.jumpToPost(postNumber, { skipIfOnScreen: true });
|
||||||
}
|
}
|
||||||
|
@ -719,14 +719,9 @@ export default Ember.Controller.extend({
|
|||||||
currentUser.set("reply_count", currentUser.get("reply_count") + 1);
|
currentUser.set("reply_count", currentUser.get("reply_count") + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const disableJumpReply = Discourse.User.currentProp(
|
const post = result.target;
|
||||||
"disable_jump_reply"
|
if (post && !staged) {
|
||||||
);
|
DiscourseURL.routeTo(post.get("url"));
|
||||||
if (!composer.get("replyingToTopic") || !disableJumpReply) {
|
|
||||||
const post = result.target;
|
|
||||||
if (post && !staged) {
|
|
||||||
DiscourseURL.routeTo(post.get("url"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
@ -31,7 +31,6 @@ export default Ember.Controller.extend(PreferencesTabController, {
|
|||||||
"external_links_in_new_tab",
|
"external_links_in_new_tab",
|
||||||
"dynamic_favicon",
|
"dynamic_favicon",
|
||||||
"enable_quoting",
|
"enable_quoting",
|
||||||
"disable_jump_reply",
|
|
||||||
"automatically_unpin_topics",
|
"automatically_unpin_topics",
|
||||||
"allow_private_messages",
|
"allow_private_messages",
|
||||||
"homepage_id",
|
"homepage_id",
|
||||||
|
@ -274,7 +274,6 @@ const User = RestModel.extend({
|
|||||||
"email_previous_replies",
|
"email_previous_replies",
|
||||||
"dynamic_favicon",
|
"dynamic_favicon",
|
||||||
"enable_quoting",
|
"enable_quoting",
|
||||||
"disable_jump_reply",
|
|
||||||
"automatically_unpin_topics",
|
"automatically_unpin_topics",
|
||||||
"digest_after_minutes",
|
"digest_after_minutes",
|
||||||
"new_topic_duration_minutes",
|
"new_topic_duration_minutes",
|
||||||
|
@ -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.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.enable_quoting" checked=model.user_option.enable_quoting}}
|
||||||
{{preference-checkbox labelKey="user.dynamic_favicon" checked=model.user_option.dynamic_favicon}}
|
{{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}}
|
{{#if siteSettings.automatically_unpin_topics}}
|
||||||
{{preference-checkbox labelKey="user.automatically_unpin_topics" checked=model.user_option.automatically_unpin_topics}}
|
{{preference-checkbox labelKey="user.automatically_unpin_topics" checked=model.user_option.automatically_unpin_topics}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -53,7 +53,6 @@ class UserOption < ActiveRecord::Base
|
|||||||
self.enable_quoting = SiteSetting.default_other_enable_quoting
|
self.enable_quoting = SiteSetting.default_other_enable_quoting
|
||||||
self.external_links_in_new_tab = SiteSetting.default_other_external_links_in_new_tab
|
self.external_links_in_new_tab = SiteSetting.default_other_external_links_in_new_tab
|
||||||
self.dynamic_favicon = SiteSetting.default_other_dynamic_favicon
|
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.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
|
self.auto_track_topics_after_msecs = SiteSetting.default_other_auto_track_topics_after_msecs
|
||||||
@ -187,6 +186,8 @@ class UserOption < ActiveRecord::Base
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO: Drop disable_jump_reply column. Functionality removed April 2019
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: user_options
|
# Table name: user_options
|
||||||
|
@ -24,7 +24,6 @@ class CurrentUserSerializer < BasicUserSerializer
|
|||||||
:can_delete_account,
|
:can_delete_account,
|
||||||
:should_be_redirected_to_top,
|
:should_be_redirected_to_top,
|
||||||
:redirected_to_top,
|
:redirected_to_top,
|
||||||
:disable_jump_reply,
|
|
||||||
:custom_fields,
|
:custom_fields,
|
||||||
:muted_category_ids,
|
:muted_category_ids,
|
||||||
:dismissed_banner_key,
|
:dismissed_banner_key,
|
||||||
@ -78,10 +77,6 @@ class CurrentUserSerializer < BasicUserSerializer
|
|||||||
object.user_option.enable_quoting
|
object.user_option.enable_quoting
|
||||||
end
|
end
|
||||||
|
|
||||||
def disable_jump_reply
|
|
||||||
object.user_option.disable_jump_reply
|
|
||||||
end
|
|
||||||
|
|
||||||
def external_links_in_new_tab
|
def external_links_in_new_tab
|
||||||
object.user_option.external_links_in_new_tab
|
object.user_option.external_links_in_new_tab
|
||||||
end
|
end
|
||||||
|
@ -8,7 +8,6 @@ class UserOptionSerializer < ApplicationSerializer
|
|||||||
:external_links_in_new_tab,
|
:external_links_in_new_tab,
|
||||||
:dynamic_favicon,
|
:dynamic_favicon,
|
||||||
:enable_quoting,
|
:enable_quoting,
|
||||||
:disable_jump_reply,
|
|
||||||
:digest_after_minutes,
|
:digest_after_minutes,
|
||||||
:automatically_unpin_topics,
|
:automatically_unpin_topics,
|
||||||
:auto_track_topics_after_msecs,
|
:auto_track_topics_after_msecs,
|
||||||
|
@ -23,7 +23,6 @@ class UserUpdater
|
|||||||
:external_links_in_new_tab,
|
:external_links_in_new_tab,
|
||||||
:enable_quoting,
|
:enable_quoting,
|
||||||
:dynamic_favicon,
|
:dynamic_favicon,
|
||||||
:disable_jump_reply,
|
|
||||||
:automatically_unpin_topics,
|
:automatically_unpin_topics,
|
||||||
:digest_after_minutes,
|
:digest_after_minutes,
|
||||||
:new_topic_duration_minutes,
|
:new_topic_duration_minutes,
|
||||||
|
@ -772,7 +772,6 @@ en:
|
|||||||
dismiss_notifications: "Dismiss All"
|
dismiss_notifications: "Dismiss All"
|
||||||
dismiss_notifications_tooltip: "Mark all unread notifications as read"
|
dismiss_notifications_tooltip: "Mark all unread notifications as read"
|
||||||
first_notification: "Your first notification! Select it to begin."
|
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"
|
dynamic_favicon: "Show new / updated topic count on browser icon"
|
||||||
theme_default_on_all_devices: "Make this the default theme on all my devices"
|
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"
|
text_size_default_on_all_devices: "Make this the default text size on all my devices"
|
||||||
|
@ -1952,7 +1952,6 @@ en:
|
|||||||
default_other_external_links_in_new_tab: "Open external links in a new tab by default."
|
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_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_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"
|
default_other_like_notification_frequency: "Notify users on likes by default"
|
||||||
|
|
||||||
|
@ -1879,7 +1879,6 @@ user_preferences:
|
|||||||
default_other_external_links_in_new_tab: false
|
default_other_external_links_in_new_tab: false
|
||||||
default_other_enable_quoting: true
|
default_other_enable_quoting: true
|
||||||
default_other_dynamic_favicon: false
|
default_other_dynamic_favicon: false
|
||||||
default_other_disable_jump_reply: false
|
|
||||||
default_other_like_notification_frequency:
|
default_other_like_notification_frequency:
|
||||||
enum: "LikeNotificationFrequencySiteSetting"
|
enum: "LikeNotificationFrequencySiteSetting"
|
||||||
default: 1
|
default: 1
|
||||||
|
@ -548,19 +548,17 @@ class PostCreator
|
|||||||
def track_topic
|
def track_topic
|
||||||
return if @opts[:import_mode] || @opts[:auto_track] == false
|
return if @opts[:import_mode] || @opts[:auto_track] == false
|
||||||
|
|
||||||
unless @user.user_option.disable_jump_reply?
|
TopicUser.change(@post.user_id,
|
||||||
TopicUser.change(@post.user_id,
|
@topic.id,
|
||||||
@topic.id,
|
posted: true,
|
||||||
posted: true,
|
last_read_post_number: @post.post_number,
|
||||||
last_read_post_number: @post.post_number,
|
highest_seen_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
|
# assume it took us 5 seconds of reading time to make a post
|
||||||
PostTiming.record_timing(topic_id: @post.topic_id,
|
PostTiming.record_timing(topic_id: @post.topic_id,
|
||||||
user_id: @post.user_id,
|
user_id: @post.user_id,
|
||||||
post_number: @post.post_number,
|
post_number: @post.post_number,
|
||||||
msecs: 5000)
|
msecs: 5000)
|
||||||
end
|
|
||||||
|
|
||||||
if @user.staged
|
if @user.staged
|
||||||
TopicUser.auto_notification_for_staging(@user.id, @topic.id, TopicUser.notification_reasons[:auto_watch])
|
TopicUser.auto_notification_for_staging(@user.id, @topic.id, TopicUser.notification_reasons[:auto_watch])
|
||||||
|
@ -154,7 +154,6 @@ def insert_user_options
|
|||||||
enable_quoting,
|
enable_quoting,
|
||||||
external_links_in_new_tab,
|
external_links_in_new_tab,
|
||||||
dynamic_favicon,
|
dynamic_favicon,
|
||||||
disable_jump_reply,
|
|
||||||
new_topic_duration_minutes,
|
new_topic_duration_minutes,
|
||||||
auto_track_topics_after_msecs,
|
auto_track_topics_after_msecs,
|
||||||
notification_level_when_replying,
|
notification_level_when_replying,
|
||||||
@ -174,7 +173,6 @@ def insert_user_options
|
|||||||
, #{SiteSetting.default_other_enable_quoting}
|
, #{SiteSetting.default_other_enable_quoting}
|
||||||
, #{SiteSetting.default_other_external_links_in_new_tab}
|
, #{SiteSetting.default_other_external_links_in_new_tab}
|
||||||
, #{SiteSetting.default_other_dynamic_favicon}
|
, #{SiteSetting.default_other_dynamic_favicon}
|
||||||
, #{SiteSetting.default_other_disable_jump_reply}
|
|
||||||
, #{SiteSetting.default_other_new_topic_duration_minutes}
|
, #{SiteSetting.default_other_new_topic_duration_minutes}
|
||||||
, #{SiteSetting.default_other_auto_track_topics_after_msecs}
|
, #{SiteSetting.default_other_auto_track_topics_after_msecs}
|
||||||
, #{SiteSetting.default_other_notification_level_when_replying}
|
, #{SiteSetting.default_other_notification_level_when_replying}
|
||||||
|
@ -1491,7 +1491,6 @@ describe User do
|
|||||||
SiteSetting.default_other_external_links_in_new_tab = true
|
SiteSetting.default_other_external_links_in_new_tab = true
|
||||||
SiteSetting.default_other_enable_quoting = false
|
SiteSetting.default_other_enable_quoting = false
|
||||||
SiteSetting.default_other_dynamic_favicon = true
|
SiteSetting.default_other_dynamic_favicon = true
|
||||||
SiteSetting.default_other_disable_jump_reply = true
|
|
||||||
|
|
||||||
SiteSetting.default_topics_automatic_unpin = false
|
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.external_links_in_new_tab).to eq(true)
|
||||||
expect(options.enable_quoting).to eq(false)
|
expect(options.enable_quoting).to eq(false)
|
||||||
expect(options.dynamic_favicon).to eq(true)
|
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.automatically_unpin_topics).to eq(false)
|
||||||
expect(options.new_topic_duration_minutes).to eq(-1)
|
expect(options.new_topic_duration_minutes).to eq(-1)
|
||||||
expect(options.auto_track_topics_after_msecs).to eq(0)
|
expect(options.auto_track_topics_after_msecs).to eq(0)
|
||||||
|
@ -23,7 +23,6 @@ export default {
|
|||||||
can_edit: true,
|
can_edit: true,
|
||||||
can_invite_to_forum: true,
|
can_invite_to_forum: true,
|
||||||
should_be_redirected_to_top: false,
|
should_be_redirected_to_top: false,
|
||||||
disable_jump_reply: false,
|
|
||||||
custom_fields: {},
|
custom_fields: {},
|
||||||
muted_category_ids: [],
|
muted_category_ids: [],
|
||||||
dismissed_banner_key: null,
|
dismissed_banner_key: null,
|
||||||
|
@ -182,7 +182,6 @@ export default {
|
|||||||
watched_category_ids: [3],
|
watched_category_ids: [3],
|
||||||
watched_first_post_category_ids: [],
|
watched_first_post_category_ids: [],
|
||||||
private_messages_stats: { all: 101, mine: 13, unread: 3 },
|
private_messages_stats: { all: 101, mine: 13, unread: 3 },
|
||||||
disable_jump_reply: false,
|
|
||||||
gravatar_avatar_upload_id: 5275,
|
gravatar_avatar_upload_id: 5275,
|
||||||
custom_avatar_upload_id: 1573,
|
custom_avatar_upload_id: 1573,
|
||||||
card_image_badge: "/images/avatar.png",
|
card_image_badge: "/images/avatar.png",
|
||||||
@ -2514,7 +2513,6 @@ export default {
|
|||||||
external_links_in_new_tab: false,
|
external_links_in_new_tab: false,
|
||||||
dynamic_favicon: false,
|
dynamic_favicon: false,
|
||||||
enable_quoting: true,
|
enable_quoting: true,
|
||||||
disable_jump_reply: false,
|
|
||||||
digest_after_minutes: 10080,
|
digest_after_minutes: 10080,
|
||||||
automatically_unpin_topics: true,
|
automatically_unpin_topics: true,
|
||||||
auto_track_topics_after_msecs: 240000,
|
auto_track_topics_after_msecs: 240000,
|
||||||
|
Reference in New Issue
Block a user