DEV: remove slightly less trivial {{action}} usages (#24289)

Follow-up to #24278 that is slightly less trivial.

* Some were "trivial" usages that were missed in the previous PR because the same file that had at least one other non-trivial usage.
* These involve extra arguments or inheritance but I have checked that they seem correct.
This commit is contained in:
Godfrey Chan 2023-11-13 04:29:20 -08:00 committed by GitHub
parent fcafc8872f
commit 8444c865e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 31 additions and 31 deletions

View File

@ -28,7 +28,7 @@
<Input
@type="checkbox"
disabled={{not (get user this.penaltyField)}}
{{on "click" (action "selectUserId" user.id)}}
{{on "click" (fn this.selectUserId user.id)}}
/>
</td>
<td>{{avatar user imageSize="small"}} {{user.username}}</td>

View File

@ -8,7 +8,7 @@
@currentSortDirection={{this.sortDirection}}
@currentSortLabel={{this.sortLabel}}
@label={{label}}
@sortByLabel={{action "sortByLabel" label}}
@sortByLabel={{fn this.sortByLabel label}}
/>
{{/each}}
{{else}}

View File

@ -79,8 +79,8 @@
<Input
@type={{this.text}}
@value={{this.newFieldName}}
@enter={{action "addField"}}
@escape-press={{action "cancelAddField"}}
@enter={{this.addField}}
@escape-press={{this.cancelAddField}}
/>
<DButton
@action={{fn this.addField this.newFieldName}}
@ -126,5 +126,5 @@
@placeholder={{this.placeholder}}
@htmlPlaceholder={{true}}
@save={{this.save}}
@setWarning={{action "setWarning"}}
@setWarning={{this.setWarning}}
/>

View File

@ -2,7 +2,7 @@
@class="hex-input"
@value={{this.hexValue}}
@maxlength={{this.maxlength}}
@input={{action "onHexInput" value="target.value"}}
@input={{this.onHexInput}}
/>
<input
class="picker"

View File

@ -44,9 +44,9 @@ export default class ColorInput extends Component {
}
@action
onHexInput(color) {
onHexInput(event) {
if (this.attrs.onChangeColor) {
this.attrs.onChangeColor(this.normalize(color || ""));
this.attrs.onChangeColor(this.normalize(event.target.value || ""));
}
}

View File

@ -4,7 +4,7 @@
<Input
@value={{this.buffered.host}}
placeholder="example.com"
@enter={{action "save"}}
@enter={{this.save}}
class="host-name"
autofocus={{true}}
/>
@ -14,7 +14,7 @@
<Input
@value={{this.buffered.allowed_paths}}
placeholder="/blog/.*"
@enter={{action "save"}}
@enter={{this.save}}
class="path-allowlist"
/>
</td>

View File

@ -25,7 +25,7 @@
@placeholderKey={{this.permalinkTypePlaceholder}}
@autocorrect="off"
@autocapitalize="off"
@keyDown={{action "submitFormOnEnter"}}
@keyDown={{this.submitFormOnEnter}}
/>
<DButton

View File

@ -2,7 +2,7 @@
@valueProperty="value"
@content={{this.groupOptions}}
@value={{this.groupId}}
@onChange={{action "onChange"}}
@onChange={{this.onChange}}
@options={{hash
allowAny=this.filter.allow_any
filterable=true

View File

@ -1,7 +1,7 @@
<ComboBox
@content={{this.filter.choices}}
@value={{this.filter.default}}
@onChange={{action "onChange"}}
@onChange={{this.onChange}}
@options={{hash
allowAny=this.filter.allow_any
filterable=true

View File

@ -12,7 +12,7 @@
title={{value}}
@value={{value}}
class="value-input"
{{on "focusout" (fn (action "changeValue") index)}}
{{on "focusout" (fn this.changeValue index)}}
/>
{{#if this.showUpDownButtons}}

View File

@ -34,7 +34,7 @@
{{#each this.activeThemes as |theme|}}
<ThemesListItem
@theme={{theme}}
@navigateToTheme={{action "navigateToTheme" theme}}
@navigateToTheme={{fn this.navigateToTheme theme}}
/>
{{/each}}
@ -106,7 +106,7 @@
<ThemesListItem
@classNames="inactive-theme"
@theme={{theme}}
@navigateToTheme={{action "navigateToTheme" theme}}
@navigateToTheme={{fn this.navigateToTheme theme}}
@selectInactiveMode={{this.selectInactiveMode}}
/>
{{/each}}

View File

@ -62,7 +62,7 @@
<TimeShortcutPicker
@timeShortcuts={{this.timeOptions}}
@prefilledDatetime={{this.prefilledDatetime}}
@onTimeSelected={{action "onTimeSelected"}}
@onTimeSelected={{this.onTimeSelected}}
@hiddenOptions={{this.hiddenTimeShortcutOptions}}
@customLabels={{this.customTimeShortcutLabels}}
@_itsatrap={{this._itsatrap}}
@ -82,7 +82,7 @@
id="save-bookmark"
class="btn-primary"
/>
<DModalCancel @close={{action "closeWithoutSavingBookmark"}} />
<DModalCancel @close={{this.closeWithoutSavingBookmark}} />
{{#if this.showDelete}}
<DButton
@icon="trash-alt"

View File

@ -40,7 +40,7 @@
{{/if}}
<div class="input-group create-account-email">
<Input
{{on "focusout" (action "checkEmailAvailability")}}
{{on "focusout" this.checkEmailAvailability}}
@type="email"
@value={{this.model.accountEmail}}
disabled={{this.emailDisabled}}
@ -253,7 +253,7 @@
</div>
<DButton
@action={{action "createAccount"}}
@action={{this.createAccount}}
@disabled={{this.submitDisabled}}
@label="create_account.title"
@isLoading={{this.formSubmitted}}
@ -279,7 +279,7 @@
{{#if this.showExternalLoginButtons}}
<div class="create-account-login-buttons">
<LoginButtons @externalLogin={{action "externalLogin"}} />
<LoginButtons @externalLogin={{this.externalLogin}} />
</div>
{{/if}}

View File

@ -59,7 +59,7 @@
disabled={{not
(includes this.filteredCategoryIds category.id)
}}
{{on "click" (action "toggleCategory" category.id)}}
{{on "click" (fn this.toggleCategory category.id)}}
/>
</label>
</div>

View File

@ -34,7 +34,7 @@
class="sidebar-tags-form__input"
@type="checkbox"
@checked={{includes this.selectedTags tag.name}}
{{on "click" (action "toggleTag" tag.name)}}
{{on "click" (fn this.toggleTag tag.name)}}
/>
<label

View File

@ -26,7 +26,7 @@
id="public-channels-caret"
role="button"
title="toggle nav list"
{{on "click" (action "toggleChannelSection" "public-channels")}}
{{on "click" (fn this.toggleChannelSection "public-channels")}}
data-toggleable="public-channels"
>
{{d-icon "angle-up"}}
@ -86,7 +86,7 @@
title="toggle nav list"
{{on
"click"
(action "toggleChannelSection" "direct-message-channels")
(fn this.toggleChannelSection "direct-message-channels")
}}
data-toggleable="direct-message-channels"
>

View File

@ -43,7 +43,7 @@
<DcFilterInput
@class="filter-input"
@filterAction={{action "debouncedFiltering"}}
@filterAction={{this.debouncedFiltering}}
@icons={{hash right="search"}}
placeholder={{i18n "chat.browse.filter_input_placeholder"}}
{{did-insert (action this.focusFilterInput)}}

View File

@ -18,7 +18,7 @@
}}
@type="text"
@value={{this.editedName}}
{{on "input" (action "onChangeChatChannelName" value="target.value")}}
{{on "input" this.onChangeChatChannelName}}
/>
</div>
@ -34,7 +34,7 @@
name="channel-slug"
class="chat-channel-edit-name-slug-modal__slug-input"
placeholder={{this.autoGeneratedSlug}}
{{on "input" (action "onChangeChatChannelSlug" value="target.value")}}
{{on "input" this.onChangeChatChannelSlug}}
@type="text"
@value={{this.editedSlug}}
/>

View File

@ -57,9 +57,9 @@ export default class ChatModalEditChannelName extends Component {
}
@action
onChangeChatChannelName(title) {
onChangeChatChannelName(event) {
this.flash = null;
this.#debouncedGenerateSlug(title);
this.#debouncedGenerateSlug(event?.target?.value);
}
@action

View File

@ -53,7 +53,7 @@
}}</label>
<Textarea
@value={{this.pollOptionsText}}
{{on "input" (action "onOptionsTextChange")}}
{{on "input" this.onOptionsTextChange}}
/>
{{#if this.showMinNumOfOptionsValidation}}
{{#unless this.minNumOfOptionsValidation.ok}}