FIX: makes user-selector use real booleans (#8909)

This commit is contained in:
Joffrey JAFFEUX 2020-02-11 20:20:12 +01:00 committed by GitHub
parent 567b7263fd
commit 78a0ca53bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 19 deletions

View File

@ -5,7 +5,7 @@
<label for='last-seen'>{{i18n 'admin.email.last_seen_user'}}</label>
{{date-picker-past value=lastSeen id="last-seen"}}
<label>{{i18n 'admin.email.user'}}:</label>
{{user-selector single="true" usernames=username canReceiveUpdates="true"}}
{{user-selector single="true" usernames=username canReceiveUpdates=true}}
{{d-button
class="btn-primary digest-refresh-button"
action=(action "refresh")

View File

@ -8,9 +8,13 @@ export default TextField.extend({
autocorrect: false,
autocapitalize: false,
name: "user-selector",
canReceiveUpdates: false,
single: false,
fullWidthWrap: false,
init() {
this._super();
this._super(...arguments);
this._paste = e => {
let pastedText = "";
if (window.clipboardData && window.clipboardData.getData) {
@ -28,9 +32,10 @@ export default TextField.extend({
};
},
@observes("usernames")
_update() {
if (this.canReceiveUpdates === "true") {
didUpdateAttrs() {
this._super(...arguments);
if (this.canReceiveUpdates) {
this._createAutocompleteInstance({ updateData: true });
}
},
@ -167,7 +172,8 @@ export default TextField.extend({
}
});
this.set("usernames", usernames.uniq().join(","));
if (this.canReceiveUpdates !== "true") {
if (!this.canReceiveUpdates) {
this._createAutocompleteInstance({ updateData: true });
}
},

View File

@ -31,9 +31,9 @@
usernames=emailOrUsername
placeholderKey=placeholderKey
allowEmails=true
canReceiveUpdates=(if showContactPicker "true" "false")
class="invite-user-input"
autocomplete="discourse"}}
autocomplete="discourse"
}}
{{else}}
{{text-field
class="email-or-username-input"

View File

@ -5,11 +5,12 @@
<label class="control-label" for="search-posted-by">{{i18n "search.advanced.posted_by.label"}}</label>
<div class="controls">
{{user-selector
excludeCurrentUser=false
usernames=searchedTerms.username
class="user-selector"
single="true"
canReceiveUpdates="true"}}
excludeCurrentUser=false
usernames=searchedTerms.username
single=true
canReceiveUpdates=true
class="user-selector"
}}
</div>
</div>
<div class="control-group pull-left">

View File

@ -2,9 +2,9 @@
<div class="controls tracking-controls">
<label>{{d-icon "far-eye-slash" class="icon"}} {{i18n "user.user_notifications.ignore_duration_username"}}</label>
{{user-selector excludeCurrentUser=true
single="true"
usernames=ignoredUsername
class="user-selector"}}
single=true
class="user-selector"
usernames=ignoredUsername}}
</div>
{{future-date-input
label="user.user_notifications.ignore_duration_when"

View File

@ -63,10 +63,10 @@
{{user-selector
excludeCurrentUser=false
usernames=filterUsername
fullWidthWrap="true"
fullWidthWrap=true
single=true
class="user-selector"
single="true"
canReceiveUpdates="true"}}
canReceiveUpdates=true}}
</div>
{{#if filterTopic}}