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) => {
const [postId, assignment_map] = entry;
const assignee = assignment_map.assigned_to;
console.log("!!!!!!!!!!!!!!!!!!!");
options = options.concat({
id: `unassign_post_${postId}`,
icon: assignee.username ? "user-xmark" : "group-times",
name: i18n("discourse_assign.unassign_post.title"),
description: i18n("discourse_assign.unassign_post.help", {
username: !siteSettings.prioritize_full_name_in_ux
? assignee.username
: assignee.name,
username: assignee.username || assignee.name,
}),
});
});

View File

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

View File

@ -485,10 +485,6 @@ function initialize(api) {
? `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(
note
)}">${name}</span></${tagName}>`;
@ -568,6 +564,10 @@ function initialize(api) {
];
const assigneeElements = [];
const nameOrUsername = siteSettings.prioritize_full_name_in_ux
? assignedToUser.name
: assignedToUser.username;
const assignedHtml = (username, path, type) => {
return `<span class="assigned-to--${type}">${htmlSafe(
i18n("discourse_assign.assigned_topic_to", {
@ -583,7 +583,7 @@ function initialize(api) {
"span.assignee",
new RawHtml({
html: assignedHtml(
assignedToUser.username,
nameOrUsername,
assignedToUserPath(assignedToUser),
"user"
),