UX: Add suggestions label to assign modal (#429)

This commit is contained in:
Bianca Nenciu 2023-01-18 17:43:23 +02:00 committed by GitHub
parent a20eed02f3
commit 02b9d9423e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 59 additions and 1 deletions

View File

@ -0,0 +1,3 @@
import EmailGroupUserChooserRow from "select-kit/components/email-group-user-chooser-row";
export default EmailGroupUserChooserRow.extend();

View File

@ -0,0 +1,7 @@
import EmailGroupUserChooser from "select-kit/components/email-group-user-chooser";
export default EmailGroupUserChooser.extend({
modifyComponentForRow() {
return "assignee-chooser-row";
},
});

View File

@ -0,0 +1,26 @@
{{#if this.item.isUser}}
{{avatar this.item imageSize="tiny"}}
<span class="identifier">{{format-username this.item.id}}</span>
<span class="name">{{this.item.name}}</span>
{{#if (and this.item.showUserStatus this.item.status)}}
<UserStatusMessage @status={{this.item.status}} @showDescription={{true}} />
{{/if}}
{{decorate-username-selector this.item.id}}
{{else if this.item.isGroup}}
{{d-icon "users"}}
<span class="identifier">{{this.item.id}}</span>
<span class="name">{{this.item.full_name}}</span>
{{else}}
{{d-icon "envelope"}}
<span class="identifier">{{this.item.id}}</span>
{{/if}}
{{#if
(and
(or (eq this.selectKit.filter null) (eq this.selectKit.filter.length 0))
(eq this.index 0)
)
}}
<span class="suggestions-label">
{{i18n "discourse_assign.assign_modal.suggestions"}}
</span>
{{/if}}

View File

@ -2,7 +2,7 @@
<div>
<div class="control-group {{if this.assigneeError 'assignee-error'}}">
<label>{{i18n "discourse_assign.assign_modal.assignee_label"}}</label>
{{email-group-user-chooser
{{assignee-chooser
autocomplete="off"
value=assigneeName
onChange=(action "assignUsername")

View File

@ -94,6 +94,27 @@
.identifier {
margin-right: 0.5rem;
}
.user-status-message {
color: var(--primary-medium);
font-size: var(--font-down-2);
margin-left: 0.5em;
.emoji {
height: var(--font-up-1);
width: var(--font-up-1);
}
}
.suggestions-label {
color: var(--primary-low-mid);
font-size: var(--font-down-2);
font-weight: bold;
margin-left: auto;
margin-right: -0.25em;
margin-top: -1em;
text-transform: uppercase;
}
}
.control-group.assignee-error {

View File

@ -59,6 +59,7 @@ en:
note_label: Note
optional_label: "(optional)"
status_label: Status
suggestions: suggestions
assign_post_modal:
title: "Assign Post"
claim: