A platform for community discussion. Free, open, simple.
Revert "DEV: Prioritize full name when setting active (#15820)" (#15869)
janzenisaac8abc4a0fd60e
diff --git a/app/assets/javascripts/discourse/app/components/quote-button.js b/app/assets/javascripts/discourse/app/components/quote-button.jsindex 0f739d3298e..a8a4de73de5 100644--- a/app/assets/javascripts/discourse/app/components/quote-button.js+++ b/app/assets/javascripts/discourse/app/components/quote-button.js@@ -173,9 +173,6 @@ export default Component.extend(KeyEnterEscape, {selectedRange().startOffset > 0? false: _selectedText === toMarkdown(cooked.innerHTML),- displayName:- this.siteSettings.display_name_on_posts &&- !this.siteSettings.prioritize_username_in_ux,};for (diff --git a/app/assets/javascripts/discourse/app/lib/quote.js b/app/assets/javascripts/discourse/app/lib/quote.jsindex 650223acbde..d965833a6ee 100644--- a/app/assets/javascripts/discourse/app/lib/quote.js+++ b/app/assets/javascripts/discourse/app/lib/quote.js@@ -6,12 +6,8 @@ export function buildQuote(post, contents, opts = {}) {return "";}- const name = opts.displayName- ? opts.name || post.name- : opts.username || post.username;-const params = [- name,+ opts.username || post.username,`post:${opts.post || post.post_number}`,`topic:${opts.topic || post.topic_id}`,];diff --git a/app/assets/javascripts/discourse/app/lib/transform-post.js b/app/assets/javascripts/discourse/app/lib/transform-post.jsindex 14244853de7..37a1e4940f4 100644--- a/app/assets/javascripts/discourse/app/lib/transform-post.js+++ b/app/assets/javascripts/discourse/app/lib/transform-post.js@@ -74,7 +74,6 @@ export function transformBasicPost(post) {actionsSummary: null,read: post.read,replyToUsername: null,- replyToName: null,replyToAvatarTemplate: null,reply_to_post_number: post.reply_to_post_number,cooked_hidden: !!post.cooked_hidden,@@ -228,7 +227,6 @@ export default function transformPost(const replyToUser = post.get("reply_to_user");if (replyToUser) {postAtts.replyToUsername = replyToUser.username;- postAtts.replyToName = replyToUser.name;postAtts.replyToAvatarTemplate = replyToUser.avatar_template;}diff --git a/app/assets/javascripts/discourse/app/models/composer.js b/app/assets/javascripts/discourse/app/models/composer.jsindex 259149c11bb..4f9194b414d 100644--- a/app/assets/javascripts/discourse/app/models/composer.js+++ b/app/assets/javascripts/discourse/app/models/composer.js@@ -23,7 +23,6 @@ import deprecated from "discourse-common/lib/deprecated";import { isEmpty } from "@ember/utils";import { propertyNotEqual } from "discourse/lib/computed";import { throwAjaxError } from "discourse/lib/ajax-error";-import { prioritizeNameInUx } from "discourse/lib/settings";let _customizations = [];export function registerCustomizationCallback(cb) {@@ -357,10 +356,6 @@ const Composer = RestModel.extend({if (topic && post) {const postNumber = post.post_number;- const name =- this.siteSettings.display_name_on_posts && prioritizeNameInUx(post.name)- ? post.name- : post.username;options.postLink = {href: `${topic.url}/${postNumber}`,@@ -369,7 +364,7 @@ const Composer = RestModel.extend({options.userLink = {href: `${topic.url}/${postNumber}`,- anchor: name,+ anchor: post.username,};}diff --git a/app/assets/javascripts/discourse/app/widgets/post.js b/app/assets/javascripts/discourse/app/widgets/post.jsindex 889e66dd905..ca41e8eabed 100644--- a/app/assets/javascripts/discourse/app/widgets/post.js+++ b/app/assets/javascripts/discourse/app/widgets/post.js@@ -134,21 +134,16 @@ createWidget("reply-to-tab", {html(attrs, state) {const icon = state.loading ? h("div.spinner.small") : iconNode("share");- const name =- this.siteSettings.display_name_on_posts &&- prioritizeNameInUx(attrs.replyToName)- ? attrs.replyToName- : attrs.replyToUsername;return [icon," ",avatarImg("small", {template: attrs.replyToAvatarTemplate,- username: name,+ username: attrs.replyToUsername,})," ",- h("span", formatUsername(name)),+ h("span", formatUsername(attrs.replyToUsername)),];},diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-actions-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-actions-test.jsindex a289708080f..acc54f4a38e 100644--- a/app/assets/javascripts/discourse/tests/acceptance/composer-actions-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/composer-actions-test.js@@ -4,7 +4,6 @@ import {exists,query,queryAll,- selectText,updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";import { click, fillIn, visit } from "@ember/test-helpers";@@ -19,11 +18,7 @@ import { toggleCheckDraftPopup } from "discourse/controllers/composer";acceptance("Composer Actions", function (needs) {needs.user();- needs.settings({- prioritize_username_in_ux: true,- display_name_on_post: false,- enable_whispers: true,- });+ needs.settings({ enable_whispers: true });needs.site({ can_tag_topics: true });test("creating new topic and then reply_as_private_message keeps attributes", async function (assert) {@@ -556,59 +551,3 @@ acceptance("Composer Actions With New Topic Draft", function (needs) {sinon.restore();});});--acceptance("Prioritize Username", function (needs) {- needs.user();- needs.settings({- prioritize_username_in_ux: true,- display_name_on_post: false,- });-- test("Reply to post use username", async function (assert) {- await visit("/t/internationalization-localization/280");- await click("article#post_3 button.reply");-- assert.strictEqual(- queryAll(".action-title .user-link").text().trim(),- "codinghorror"- );- });-- test("Quotes use username", async function (assert) {- await visit("/t/internationalization-localization/280");- await selectText("#post_3 p");- await click(".insert-quote");- assert.strictEqual(- queryAll(".d-editor-input").val().trim(),- '[quote="codinghorror, post:3, topic:280"]\nYep, all strings are going through a lookup table.*\n[/quote]'- );- });-});--acceptance("Prioritize Full Name", function (needs) {- needs.user();- needs.settings({- prioritize_username_in_ux: false,- display_name_on_post: true,- });-- test("Reply to post use full name", async function (assert) {- await visit("/t/internationalization-localization/280");- await click("article#post_3 button.reply");-- assert.strictEqual(- queryAll(".action-title .user-link").text().trim(),- "Jeff Atwood"- );- });-- test("Quotes use full name", async function (assert) {- await visit("/t/internationalization-localization/280");- await selectText("#post_3 p");- await click(".insert-quote");- assert.strictEqual(- queryAll(".d-editor-input").val().trim(),- '[quote="Jeff Atwood, post:3, topic:280"]\nYep, all strings are going through a lookup table.*\n[/quote]'- );- });-});diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.jsindex c156488a3b3..6c9c7bb9c25 100644--- a/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.js@@ -13,11 +13,10 @@ import { test } from "qunit";acceptance("Topic - Quote button - logged in", function (needs) {needs.user();needs.settings({- display_name_on_posts: false,- prioritize_username_in_ux: true,share_quote_visibility: "anonymous",share_quote_buttons: "twitter|email",});+chromeTest("Does not show the quote share buttons by default",async function (assert) {diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-test.jsindex db7d8e6ed10..da2305ba7d1 100644--- a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-test.js@@ -241,8 +241,6 @@ acceptance("Topic", function (needs) {acceptance("Topic featured links", function (needs) {needs.user();needs.settings({- display_name_on_posts: false,- prioritize_username_in_ux: true,topic_featured_link_enabled: true,max_topic_title_length: 80,exclude_rel_nofollow_domains: "example.com",diff --git a/app/serializers/post_serializer.rb b/app/serializers/post_serializer.rbindex bbab210afde..2a2eec117b6 100644--- a/app/serializers/post_serializer.rb+++ b/app/serializers/post_serializer.rb@@ -256,7 +256,6 @@ class PostSerializer < BasicPostSerializerdef reply_to_user{username: object.reply_to_user.username,- name: object.reply_to_user.name,avatar_template: object.reply_to_user.avatar_template}end