Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 0437516

Browse files
FIX: Incorrect ussage of prioritize_full_name_in_ux replaced by prioritize_username_in_ux (#645)
* FIX: Incorrect usssage of prioritize_full_name_in_ux replaced by prioritize_username_in_ux * fixed failing test
1 parent ec8a785 commit 0437516

File tree

6 files changed

+11
-15
lines changed

6 files changed

+11
-15
lines changed

assets/javascripts/discourse/components/assigned-to-post.gjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default class AssignedToPost extends Component {
1212
@service siteSettings;
1313

1414
get nameOrUsername() {
15-
if (this.siteSettings.prioritize_full_name_in_ux) {
15+
if (!this.siteSettings.prioritize_username_in_ux) {
1616
return this.args.assignedToUser.name || this.args.assignedToUser.username;
1717
} else {
1818
return this.args.assignedToUser.username;

assets/javascripts/discourse/components/topic-level-assign-menu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default {
7575
content.push(
7676
unassignFromTopicButton(
7777
this.topic,
78-
this.siteSettings.prioritize_full_name_in_ux
78+
this.siteSettings.prioritize_username_in_ux
7979
)
8080
);
8181
}
@@ -136,11 +136,11 @@ function reassignToSelfButton() {
136136
};
137137
}
138138

139-
function unassignFromTopicButton(topic, prioritize_full_name_in_ux) {
139+
function unassignFromTopicButton(topic, prioritize_username_in_ux) {
140140
let username =
141141
topic.assigned_to_user?.username || topic.assigned_to_group?.name;
142142

143-
if (topic.assigned_to_user && prioritize_full_name_in_ux) {
143+
if (topic.assigned_to_user && !prioritize_username_in_ux) {
144144
username = topic.assigned_to_user?.name || topic.assigned_to_user?.username;
145145
}
146146

assets/javascripts/discourse/initializers/extend-for-assigns.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ function initialize(api) {
483483

484484
const icon = iconHTML(assignee.username ? "user-plus" : "group-plus");
485485
const name =
486-
siteSettings.prioritize_full_name_in_ux || !assignee.username
486+
!siteSettings.prioritize_username_in_ux || !assignee.username
487487
? assignee.name || assignee.username
488488
: assignee.username;
489489

@@ -560,7 +560,7 @@ function initialize(api) {
560560

561561
let displayedName = "";
562562
if (assignedToUser) {
563-
displayedName = this.siteSettings.prioritize_full_name_in_ux
563+
displayedName = !this.siteSettings.prioritize_username_in_ux
564564
? assignedToUser.name || assignedToUser.username
565565
: assignedToUser.username;
566566

@@ -598,7 +598,7 @@ function initialize(api) {
598598
const postNumber = indirectlyAssignedTo[postId].post_number;
599599

600600
displayedName =
601-
this.siteSettings.prioritize_full_name_in_ux || !assignee.username
601+
!this.siteSettings.prioritize_username_in_ux || !assignee.username
602602
? assignee.name || assignee.username
603603
: assignee.username;
604604

lib/assigner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def queue_notification(assignment)
492492
end
493493

494494
def small_action_username_or_name(assign_to)
495-
if (assign_to.is_a?(User) && SiteSetting.prioritize_full_name_in_ux) ||
495+
if (assign_to.is_a?(User) && !SiteSetting.prioritize_username_in_ux) ||
496496
!assign_to.try(:username)
497497
custom_fields = { "action_code_who" => assign_to.name || assign_to.username }
498498
else

spec/system/assign_post_spec.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
before do
1313
SiteSetting.assign_enabled = true
14-
SiteSetting.prioritize_full_name_in_ux = false
15-
14+
SiteSetting.prioritize_username_in_ux = true
1615
# The system tests in this file are flaky and auth token related so turning this on
1716
SiteSetting.verbose_auth_token_logging = true
1817

@@ -26,8 +25,6 @@ def assign_post(post, assignee)
2625
end
2726

2827
describe "with open topic" do
29-
before { SiteSetting.prioritize_full_name_in_ux = false }
30-
3128
it "can assign and unassign" do
3229
visit "/t/#{topic.id}"
3330
assign_post(post2, staff_user)
@@ -63,7 +60,7 @@ def assign_post(post, assignee)
6360
end
6461

6562
context "when prioritize_full_name_in_ux setting is enabled" do
66-
before { SiteSetting.prioritize_full_name_in_ux = true }
63+
before { SiteSetting.prioritize_username_in_ux = false }
6764

6865
it "shows the user's name after assign" do
6966
visit "/t/#{topic.id}"

spec/system/assign_topic_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
before do
1212
SiteSetting.assign_enabled = true
13-
SiteSetting.prioritize_full_name_in_ux = false
1413

1514
# The system tests in this file are flaky and auth token related so turning this on
1615
SiteSetting.verbose_auth_token_logging = true
@@ -51,7 +50,7 @@
5150
end
5251

5352
context "when prioritize_full_name_in_ux setting is enabled" do
54-
before { SiteSetting.prioritize_full_name_in_ux = true }
53+
before { SiteSetting.prioritize_username_in_ux = false }
5554

5655
it "shows the user's name after assign" do
5756
visit "/t/#{topic.id}"

0 commit comments

Comments
 (0)