more messing around

This commit is contained in:
brrusselburg 2025-02-17 17:44:44 -06:00 committed by Juan David Martinez
parent 9bd1a19f99
commit 8f11f6c599
No known key found for this signature in database
GPG Key ID: FE50F4B983E68D5B
3 changed files with 7 additions and 9 deletions

View File

@ -40,15 +40,12 @@ export default class AssignActionsDropdown extends DropdownSelectBoxComponent {
Object.entries(this.topic.indirectly_assigned_to).forEach((entry) => { Object.entries(this.topic.indirectly_assigned_to).forEach((entry) => {
const [postId, assignment_map] = entry; const [postId, assignment_map] = entry;
const assignee = assignment_map.assigned_to; const assignee = assignment_map.assigned_to;
console.log("!!!!!!!!!!!!!!!!!!!");
options = options.concat({ options = options.concat({
id: `unassign_post_${postId}`, id: `unassign_post_${postId}`,
icon: assignee.username ? "user-xmark" : "group-times", icon: assignee.username ? "user-xmark" : "group-times",
name: i18n("discourse_assign.unassign_post.title"), name: i18n("discourse_assign.unassign_post.title"),
description: i18n("discourse_assign.unassign_post.help", { description: i18n("discourse_assign.unassign_post.help", {
username: !siteSettings.prioritize_full_name_in_ux username: assignee.username || assignee.name,
? assignee.username
: assignee.name,
}), }),
}); });
}); });

View File

@ -9,6 +9,7 @@ import DMenu from "float-kit/components/d-menu";
export default class AssignedToPost extends Component { export default class AssignedToPost extends Component {
@service taskActions; @service taskActions;
@service siteSettings;
@action @action
unassign() { unassign() {

View File

@ -485,10 +485,6 @@ function initialize(api) {
? `href="${getURL(assignedPath)}" data-auto-route="true"` ? `href="${getURL(assignedPath)}" data-auto-route="true"`
: ""; : "";
const name = !siteSettings.prioritize_full_name_in_ux
? assignee.username
: assignee.name;
return `<${tagName} class="assigned-to discourse-tag simple" ${href}>${icon}<span title="${escapeExpression( return `<${tagName} class="assigned-to discourse-tag simple" ${href}>${icon}<span title="${escapeExpression(
note note
)}">${name}</span></${tagName}>`; )}">${name}</span></${tagName}>`;
@ -568,6 +564,10 @@ function initialize(api) {
]; ];
const assigneeElements = []; const assigneeElements = [];
const nameOrUsername = siteSettings.prioritize_full_name_in_ux
? assignedToUser.name
: assignedToUser.username;
const assignedHtml = (username, path, type) => { const assignedHtml = (username, path, type) => {
return `<span class="assigned-to--${type}">${htmlSafe( return `<span class="assigned-to--${type}">${htmlSafe(
i18n("discourse_assign.assigned_topic_to", { i18n("discourse_assign.assigned_topic_to", {
@ -583,7 +583,7 @@ function initialize(api) {
"span.assignee", "span.assignee",
new RawHtml({ new RawHtml({
html: assignedHtml( html: assignedHtml(
assignedToUser.username, nameOrUsername,
assignedToUserPath(assignedToUser), assignedToUserPath(assignedToUser),
"user" "user"
), ),