DEV: Use fn+mut instead of action+mut (#26057)

One step closer to removing all `action` helper usage
This commit is contained in:
Jarek Radosz 2024-03-06 18:05:03 +01:00 committed by GitHub
parent ac083ffca6
commit 11067c73d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
61 changed files with 111 additions and 117 deletions

View File

@ -4,7 +4,7 @@
<ComboBox
@content={{this.fieldTypes}}
@value={{this.buffered.field_type}}
@onChange={{action (mut this.buffered.field_type)}}
@onChange={{fn (mut this.buffered.field_type)}}
/>
</AdminFormRow>

View File

@ -22,7 +22,7 @@
<div class="label">{{i18n "admin.embedding.category"}}</div>
<CategoryChooser
@value={{this.categoryId}}
@onChange={{action (mut this.categoryId)}}
@onChange={{fn (mut this.categoryId)}}
class="small"
/>
</td>

View File

@ -7,7 +7,7 @@
<ComboBox
@content={{@model.baseColorSchemes}}
@value={{this.selectedBaseThemeId}}
@onChange={{action (mut this.selectedBaseThemeId)}}
@onChange={{fn (mut this.selectedBaseThemeId)}}
@valueProperty="base_scheme_id"
/>
</:body>

View File

@ -12,7 +12,7 @@
@label="admin.user.suspend_duration"
@clearable={{false}}
@input={{this.penalizeUntil}}
@onChangeInput={{action (mut this.penalizeUntil)}}
@onChangeInput={{fn (mut this.penalizeUntil)}}
class="suspend-until"
/>
{{else if (eq @model.penaltyType "silence")}}
@ -20,7 +20,7 @@
@label="admin.user.silence_duration"
@clearable={{false}}
@input={{this.penalizeUntil}}
@onChangeInput={{action (mut this.penalizeUntil)}}
@onChangeInput={{fn (mut this.penalizeUntil)}}
class="silence-until"
/>
{{/if}}

View File

@ -14,7 +14,7 @@
<ComboBox
@content={{this.permalinkTypes}}
@value={{this.permalinkType}}
@onChange={{action (mut this.permalinkType)}}
@onChange={{fn (mut this.permalinkType)}}
class="permalink-type"
/>

View File

@ -11,7 +11,7 @@
<ComboBox
@content={{this.actionNames}}
@value={{this.actionName}}
@onChange={{action (mut this.actionName)}}
@onChange={{fn (mut this.actionName)}}
/>
<DButton

View File

@ -1,6 +1,6 @@
<CategoryChooser
@value={{this.value}}
@onChange={{action (mut this.value)}}
@onChange={{fn (mut this.value)}}
@options={{hash allowUncategorized=true none=(eq this.setting.default "")}}
/>
<SettingValidationMessage @message={{this.validationMessage}} />

View File

@ -1,7 +1,7 @@
<ComboBox
@content={{this.setting.validValues}}
@value={{this.value}}
@onChange={{action (mut this.value)}}
@onChange={{fn (mut this.value)}}
@valueProperty={{this.setting.computedValueProperty}}
@nameProperty={{this.setting.computedNameProperty}}
@options={{hash castInteger=true allowAny=this.setting.allowsNone}}

View File

@ -72,7 +72,7 @@
@name="icon"
@value={{this.buffered.icon}}
@options={{hash maximum=1}}
@onChange={{action (mut this.buffered.icon)}}
@onChange={{fn (mut this.buffered.icon)}}
/>
{{/if}}
</div>
@ -83,7 +83,7 @@
@name="badge_type_id"
@value={{this.buffered.badge_type_id}}
@content={{this.badgeTypes}}
@onChange={{action (mut this.buffered.badge_type_id)}}
@onChange={{fn (mut this.buffered.badge_type_id)}}
@options={{hash disabled=this.readOnly}}
/>
</div>
@ -100,7 +100,7 @@
@content={{this.badgeGroupings}}
class="badge-selector"
@nameProperty="name"
@onChange={{action (mut this.buffered.badge_grouping_id)}}
@onChange={{fn (mut this.buffered.badge_grouping_id)}}
/>
<DButton
@action={{route-action "editGroupings"}}
@ -220,7 +220,7 @@
name="trigger"
@value={{this.buffered.trigger}}
@content={{this.badgeTriggers}}
@onChange={{action (mut this.buffered.trigger)}}
@onChange={{fn (mut this.buffered.trigger)}}
@options={{hash disabled=this.readOnly}}
/>
</div>

View File

@ -1,12 +1,9 @@
<div class="admin-title">
<PeriodChooser
@period={{this.period}}
@onChange={{action (mut this.period)}}
/>
<PeriodChooser @period={{this.period}} @onChange={{fn (mut this.period)}} />
<ComboBox
@content={{this.searchTypeOptions}}
@value={{this.searchType}}
@onChange={{action (mut this.searchType)}}
@onChange={{fn (mut this.searchType)}}
class="search-logs-filter"
/>
</div>

View File

@ -1,12 +1,9 @@
<div class="admin-title">
<PeriodChooser
@period={{this.period}}
@onChange={{action (mut this.period)}}
/>
<PeriodChooser @period={{this.period}} @onChange={{fn (mut this.period)}} />
<ComboBox
@content={{this.searchTypeOptions}}
@value={{this.searchType}}
@onChange={{action (mut this.searchType)}}
@onChange={{fn (mut this.searchType)}}
class="search-logs-filter"
/>
</div>

View File

@ -22,7 +22,7 @@
<ComboBox
@value={{this.selectedBadgeId}}
@content={{this.availableBadges}}
@onChange={{action (mut this.selectedBadgeId)}}
@onChange={{fn (mut this.selectedBadgeId)}}
@options={{hash filterable=true}}
/>
</div>

View File

@ -411,7 +411,7 @@
@content={{this.site.trustLevels}}
@nameProperty="detailedName"
@value={{this.model.trustLevel.id}}
@onChange={{action (mut this.model.trust_level)}}
@onChange={{fn (mut this.model.trust_level)}}
/>
{{#if this.model.dirty}}
@ -609,7 +609,7 @@
@content={{this.availableGroups}}
@value={{this.customGroupIdsBuffer}}
@labelProperty="name"
@onChange={{action (mut this.customGroupIdsBuffer)}}
@onChange={{fn (mut this.customGroupIdsBuffer)}}
/>
</div>
{{#if this.customGroupsDirty}}
@ -630,7 +630,7 @@
<ComboBox
@content={{this.model.customGroups}}
@value={{this.model.primary_group_id}}
@onChange={{action (mut this.model.primary_group_id)}}
@onChange={{fn (mut this.model.primary_group_id)}}
@options={{hash none="admin.groups.no_primary"}}
/>
</div>

View File

@ -23,7 +23,7 @@
@content={{this.contentTypes}}
@name="content-type"
@value={{this.model.content_type}}
@onChange={{action (mut this.model.content_type)}}
@onChange={{fn (mut this.model.content_type)}}
/>
</div>
@ -43,7 +43,7 @@
<label class="subscription-choice">
<RadioButton
@name="subscription-choice"
@onChange={{action (mut this.model.wildcard_web_hook) false}}
@onChange={{fn (mut this.model.wildcard_web_hook) false}}
@value={{false}}
@selection={{this.model.wildcard_web_hook}}
/>
@ -71,7 +71,7 @@
<label class="subscription-choice">
<RadioButton
@name="subscription-choice"
@onChange={{action (mut this.model.wildcard_web_hook) true}}
@onChange={{fn (mut this.model.wildcard_web_hook) true}}
@value={{true}}
@selection={{this.model.wildcard_web_hook}}
/>
@ -86,7 +86,7 @@
}}</label>
<CategorySelector
@categories={{this.model.categories}}
@onChange={{action (mut this.model.categories)}}
@onChange={{fn (mut this.model.categories)}}
/>
<div class="instructions">{{i18n
"admin.web_hooks.categories_filter_instructions"

View File

@ -9,7 +9,7 @@
@value={{this._selectedUserBadgeId}}
@nameProperty="badge.name"
@content={{this.selectableUserBadges}}
@onChange={{action (mut this._selectedUserBadgeId)}}
@onChange={{fn (mut this._selectedUserBadgeId)}}
/>
</div>
</div>

View File

@ -3,7 +3,7 @@
<p>
<CategoryChooser
@value={{this.categoryId}}
@onChange={{action (mut this.categoryId)}}
@onChange={{fn (mut this.categoryId)}}
/>
</p>

View File

@ -197,7 +197,7 @@
{{#if this.composer.canEditTags}}
<MiniTagChooser
@value={{this.composer.model.tags}}
@onChange={{action (mut this.composer.model.tags)}}
@onChange={{fn (mut this.composer.model.tags)}}
@options={{hash
disabled=this.composer.disableTagsChooser
categoryId=this.composer.model.categoryId

View File

@ -21,7 +21,7 @@
@value={{this.category.parent_category_id}}
@allowSubCategories={{true}}
@allowRestrictedCategories={{true}}
@onChange={{action (mut this.category.parent_category_id)}}
@onChange={{fn (mut this.category.parent_category_id)}}
@options={{hash
allowUncategorized=false
excludeCategoryId=this.category.id

View File

@ -58,7 +58,7 @@
@id="category-search-priority"
@content={{this.searchPrioritiesOptions}}
@value={{this.category.search_priority}}
@onChange={{action (mut this.category.search_priority)}}
@onChange={{fn (mut this.category.search_priority)}}
@options={{hash placementStrategy="absolute"}}
/>
</div>
@ -267,7 +267,7 @@
@content={{this.availableSorts}}
@value={{this.category.sort_order}}
@options={{hash none="category.sort_options.default"}}
@onChange={{action (mut this.category.sort_order)}}
@onChange={{fn (mut this.category.sort_order)}}
/>
{{#unless this.isDefaultSortOrder}}
<ComboBox
@ -278,7 +278,7 @@
none="category.sort_options.default"
placementStrategy="absolute"
}}
@onChange={{action (mut this.category.sort_ascending)}}
@onChange={{fn (mut this.category.sort_ascending)}}
/>
{{/unless}}
</div>

View File

@ -17,7 +17,7 @@
@everyTag={{true}}
@excludeSynonyms={{true}}
@unlimitedTagCount={{true}}
@onChange={{action (mut this.category.allowed_tags)}}
@onChange={{fn (mut this.category.allowed_tags)}}
@options={{hash filterPlaceholder="category.tags_placeholder"}}
/>
</section>
@ -27,7 +27,7 @@
<TagGroupChooser
@id="category-allowed-tag-groups"
@tagGroups={{this.category.allowed_tag_groups}}
@onChange={{action (mut this.category.allowed_tag_groups)}}
@onChange={{fn (mut this.category.allowed_tag_groups)}}
/>
<LinkTo @route="tagGroups" class="manage-tag-groups">{{i18n
"category.manage_tag_groups_link"

View File

@ -12,7 +12,7 @@
<div class="control-group">
<FormTemplateChooser
@value={{this.category.form_template_ids}}
@onChange={{action (mut this.category.form_template_ids)}}
@onChange={{fn (mut this.category.form_template_ids)}}
class="select-category-template"
/>

View File

@ -14,7 +14,7 @@
}}</label>
<CategoryChooser
@value={{this.topicTimer.category_id}}
@onChange={{action (mut this.topicTimer.category_id)}}
@onChange={{fn (mut this.topicTimer.category_id)}}
@options={{hash excludeCategoryId=this.excludeCategoryId}}
/>
</div>

View File

@ -10,7 +10,7 @@
@content={{this.shortcuts}}
@clearable={{this.clearable}}
@onChangeInput={{this.onChangeInput}}
@onChange={{action (mut this.selection)}}
@onChange={{fn (mut this.selection)}}
@options={{hash none="time_shortcut.select_timeframe"}}
/>
</div>

View File

@ -30,7 +30,7 @@
@name="icon"
@value={{this.model.flair_icon}}
@options={{hash maximum=1}}
@onChange={{action (mut this.model.flair_icon)}}
@onChange={{fn (mut this.model.flair_icon)}}
/>
{{else if this.flairPreviewImage}}
<UppyImageUploader

View File

@ -54,7 +54,7 @@
@valueProperty="value"
@content={{this.mailboxes}}
@tabindex="10"
@onChange={{action (mut this.group.imap_mailbox_name)}}
@onChange={{fn (mut this.group.imap_mailbox_name)}}
@options={{hash none="groups.manage.email.mailboxes.disabled"}}
/>
{{/if}}

View File

@ -12,7 +12,7 @@
@valueProperty="value"
@value={{this.model.visibility_level}}
@content={{this.visibilityLevelOptions}}
@onChange={{action (mut this.model.visibility_level)}}
@onChange={{fn (mut this.model.visibility_level)}}
@options={{hash castInteger=true}}
class="groups-form-visibility-level"
/>
@ -32,7 +32,7 @@
@valueProperty="value"
@value={{this.membersVisibilityLevel}}
@content={{this.visibilityLevelOptions}}
@onChange={{action (mut this.model.members_visibility_level)}}
@onChange={{fn (mut this.model.members_visibility_level)}}
class="groups-form-members-visibility-level"
/>
@ -57,7 +57,7 @@
@valueProperty="value"
@value={{this.mentionableLevel}}
@content={{this.aliasLevelOptions}}
@onChange={{action (mut this.model.mentionable_level)}}
@onChange={{fn (mut this.model.mentionable_level)}}
class="groups-form-mentionable-level"
/>
</div>
@ -70,7 +70,7 @@
@valueProperty="value"
@value={{this.messageableLevel}}
@content={{this.aliasLevelOptions}}
@onChange={{action (mut this.model.messageable_level)}}
@onChange={{fn (mut this.model.messageable_level)}}
class="groups-form-messageable-level"
/>
</div>
@ -130,7 +130,7 @@
<NotificationsButton
@value={{this.defaultNotificationLevel}}
@options={{hash i18nPrefix="groups.notifications"}}
@onChange={{action (mut this.model.default_notification_level)}}
@onChange={{fn (mut this.model.default_notification_level)}}
class="groups-form-default-notification-level"
/>
</div>

View File

@ -92,7 +92,7 @@
@settingName="name"
@nameProperty="label"
@valueProperty="id"
@onChange={{action (mut this.model.associated_group_ids)}}
@onChange={{fn (mut this.model.associated_group_ids)}}
class="group-form-automatic-membership-associated-groups"
/>
{{/if}}
@ -119,7 +119,7 @@
@valueProperty="value"
@value={{this.groupTrustLevel}}
@content={{this.trustLevelOptions}}
@onChange={{action (mut this.model.grant_trust_level)}}
@onChange={{fn (mut this.model.grant_trust_level)}}
class="groups-form-grant-trust-level"
/>
<label>

View File

@ -60,7 +60,7 @@
@content={{this.allGroups}}
@value={{this.groupIds}}
@labelProperty="name"
@onChange={{action (mut this.groupIds)}}
@onChange={{fn (mut this.groupIds)}}
/>
</div>
{{/if}}

View File

@ -37,7 +37,7 @@
@content={{this.autoDeletePreferences}}
@value={{this.bookmark.autoDeletePreference}}
@id="bookmark-auto-delete-preference"
@onChange={{action (mut this.bookmark.autoDeletePreference)}}
@onChange={{fn (mut this.bookmark.autoDeletePreference)}}
class="bookmark-option-selector"
/>
</div>

View File

@ -15,7 +15,7 @@
<DatePickerPast
@value={{readonly this.date}}
@containerId="date-container"
@onSelect={{action (mut this.date)}}
@onSelect={{fn (mut this.date)}}
/>
<Input @type="time" @value={{this.time}} />
</form>

View File

@ -10,7 +10,7 @@
</div>
<CategoryChooser
@value={{this.publicCategoryId}}
@onChange={{action (mut this.publicCategoryId)}}
@onChange={{fn (mut this.publicCategoryId)}}
/>
</:body>
<:footer>

View File

@ -152,7 +152,7 @@
@content={{this.allGroups}}
@value={{this.buffered.groupIds}}
@labelProperty="name"
@onChange={{action (mut this.buffered.groupIds)}}
@onChange={{fn (mut this.buffered.groupIds)}}
/>
</div>
{{/if}}
@ -165,7 +165,7 @@
@customShortcuts={{this.timeShortcuts}}
@clearable={{true}}
@input={{this.buffered.expires_at}}
@onChangeInput={{action (mut this.buffered.expires_at)}}
@onChangeInput={{fn (mut this.buffered.expires_at)}}
/>
</div>
{{else}}

View File

@ -46,7 +46,7 @@
@customShortcuts={{this.timeShortcuts}}
@clearable={{true}}
@input={{@model.topic.slow_mode_enabled_until}}
@onChangeInput={{action (mut @model.topic.slow_mode_enabled_until)}}
@onChangeInput={{fn (mut @model.topic.slow_mode_enabled_until)}}
/>
</div>
</:body>

View File

@ -16,7 +16,7 @@
<ComboBox
@value={{this.selectedBadgeId}}
@content={{this.availableBadges}}
@onChange={{action (mut this.selectedBadgeId)}}
@onChange={{fn (mut this.selectedBadgeId)}}
@options={{hash filterable=true none="badges.none"}}
/>
</p>

View File

@ -22,7 +22,7 @@
@input={{readonly this.ignoredUntil}}
@customShortcuts={{this.timeShortcuts}}
@includeDateTime={{false}}
@onChangeInput={{action (mut this.ignoredUntil)}}
@onChangeInput={{fn (mut this.ignoredUntil)}}
/>
<p>{{i18n "user.user_notifications.ignore_duration_note"}}</p>
</:body>

View File

@ -77,7 +77,7 @@
<EmailGroupUserChooser
class="participant-selector"
@value={{this.participants}}
@onChange={{action (mut this.participants)}}
@onChange={{fn (mut this.participants)}}
/>
{{#if this.selectedTopicId}}
@ -190,7 +190,7 @@
<CategoryChooser
@value={{this.categoryId}}
class="small"
@onChange={{action (mut this.categoryId)}}
@onChange={{fn (mut this.categoryId)}}
/>
<PluginOutlet
@name="split-new-topic-category-after"

View File

@ -16,7 +16,7 @@
@name="reason"
@content={{this.configuredReasons}}
@value={{this.reason}}
@onChange={{action (mut this.reason)}}
@onChange={{fn (mut this.reason)}}
class="revise-and-reject-reviewable__reason"
/>
</div>
@ -46,7 +46,7 @@
<DTextarea
@name="feedback"
@value={{this.feedback}}
@onChange={{action (mut this.feedback)}}
@onChange={{fn (mut this.feedback)}}
class="revise-and-reject-reviewable__feedback"
/>
</div>

View File

@ -31,7 +31,7 @@
}}
class={{@link.iconCssClass}}
@onlyAvailable={{true}}
@onChange={{action (mut @link.icon)}}
@onChange={{fn (mut @link.icon)}}
ariaLabel={{i18n "sidebar.sections.custom.links.icon.label"}}
/>
{{#if @link.invalidIconMessage}}

View File

@ -20,7 +20,7 @@
<DatePickerFuture
@value={{this.customDate}}
@defaultDate={{this.defaultCustomDate}}
@onSelect={{action (mut this.customDate)}}
@onSelect={{fn (mut this.customDate)}}
@id="custom-date"
/>
</div>

View File

@ -15,7 +15,7 @@
@valueProperty={{null}}
@nameProperty={{null}}
@value={{this.value}}
@onChange={{action (mut this.value)}}
@onChange={{fn (mut this.value)}}
@options={{hash none=this.noneLabel}}
/>
<div class="instructions">{{html-safe this.field.description}}</div>

View File

@ -15,7 +15,7 @@
@valueProperty={{null}}
@nameProperty={{null}}
@value={{this.value}}
@onChange={{action (mut this.value)}}
@onChange={{fn (mut this.value)}}
@options={{hash none=this.noneLabel}}
/>
<div class="instructions">{{html-safe this.field.description}}</div>

View File

@ -11,7 +11,7 @@
<CategorySelector
@categories={{@model.watchedCategories}}
@blockedCategories={{@selectedCategories}}
@onChange={{action (mut @model.watchedCategories)}}
@onChange={{fn (mut @model.watchedCategories)}}
/>
</div>
<div class="instructions">{{i18n
@ -28,7 +28,7 @@
<CategorySelector
@categories={{@model.trackedCategories}}
@blockedCategories={{@selectedCategories}}
@onChange={{action (mut @model.trackedCategories)}}
@onChange={{fn (mut @model.trackedCategories)}}
/>
</div>
<div class="instructions">{{i18n
@ -43,7 +43,7 @@
<CategorySelector
@categories={{@model.watchedFirstPostCategories}}
@blockedCategories={{@selectedCategories}}
@onChange={{action (mut @model.watchedFirstPostCategories)}}
@onChange={{fn (mut @model.watchedFirstPostCategories)}}
/>
</div>
<div class="instructions">{{i18n
@ -58,7 +58,7 @@
<CategorySelector
@categories={{@model.regularCategories}}
@blockedCategories={{@selectedCategories}}
@onChange={{action (mut @model.regularCategories)}}
@onChange={{fn (mut @model.regularCategories)}}
/>
</div>
<div class="instructions">{{i18n
@ -77,7 +77,7 @@
<CategorySelector
@categories={{@model.mutedCategories}}
@blockedCategories={{@selectedCategories}}
@onChange={{action (mut @model.mutedCategories)}}
@onChange={{fn (mut @model.mutedCategories)}}
/>
</div>

View File

@ -5,7 +5,7 @@
@valueProperty="value"
@content={{@considerNewTopicOptions}}
@value={{@model.user_option.new_topic_duration_minutes}}
@onChange={{action (mut @model.user_option.new_topic_duration_minutes)}}
@onChange={{fn (mut @model.user_option.new_topic_duration_minutes)}}
class="duration"
/>
</div>

View File

@ -34,7 +34,7 @@
@id="search-type"
@value={{this.search_type}}
@content={{this.searchTypes}}
@onChange={{action (mut this.search_type)}}
@onChange={{fn (mut this.search_type)}}
@options={{hash castInteger=true}}
/>
<DButton
@ -64,7 +64,7 @@
<div class="search-filters">
<SearchAdvancedOptions
@searchTerm={{readonly this.searchTerm}}
@onChangeSearchTerm={{action (mut this.searchTerm)}}
@onChangeSearchTerm={{fn (mut this.searchTerm)}}
@search={{action "search" (hash collapseFilters=true)}}
@searchButtonDisabled={{this.searchButtonDisabled}}
@expandFilters={{this.expandFilters}}

View File

@ -13,7 +13,7 @@
<CategorySelector
@categories={{this.model.watchingCategories}}
@blockedCategories={{this.selectedCategories}}
@onChange={{action (mut this.model.watchingCategories)}}
@onChange={{fn (mut this.model.watchingCategories)}}
/>
<div class="control-instructions">
@ -28,7 +28,7 @@
<CategorySelector
@categories={{this.model.trackingCategories}}
@blockedCategories={{this.selectedCategories}}
@onChange={{action (mut this.model.trackingCategories)}}
@onChange={{fn (mut this.model.trackingCategories)}}
/>
<div class="control-instructions">
@ -43,7 +43,7 @@
<CategorySelector
@categories={{this.model.watchingFirstPostCategories}}
@blockedCategories={{this.selectedCategories}}
@onChange={{action (mut this.model.watchingFirstPostCategories)}}
@onChange={{fn (mut this.model.watchingFirstPostCategories)}}
/>
<div class="control-instructions">
@ -60,7 +60,7 @@
<CategorySelector
@categories={{this.model.regularCategories}}
@blockedCategories={{this.selectedCategories}}
@onChange={{action (mut this.model.regularCategories)}}
@onChange={{fn (mut this.model.regularCategories)}}
/>
<div class="control-instructions">
@ -75,7 +75,7 @@
<CategorySelector
@categories={{this.model.mutedCategories}}
@blockedCategories={{this.selectedCategories}}
@onChange={{action (mut this.model.mutedCategories)}}
@onChange={{fn (mut this.model.mutedCategories)}}
/>
<div class="control-instructions">

View File

@ -30,7 +30,7 @@
<ComboBox
@value={{this.type}}
@content={{this.types}}
@onChange={{action (mut this.type)}}
@onChange={{fn (mut this.type)}}
@options={{hash clearable=true none="groups.index.filter"}}
class="groups-header-filters-type"
/>

View File

@ -212,7 +212,7 @@
<ComboBox
@value={{this.newTitleInput}}
@content={{this.model.availableTitles}}
@onChange={{action (mut this.newTitleInput)}}
@onChange={{fn (mut this.newTitleInput)}}
@options={{hash none="user.title.none"}}
/>
</div>
@ -229,7 +229,7 @@
<FlairChooser
@value={{this.newFlairGroupId}}
@content={{this.model.availableFlairs}}
@onChange={{action (mut this.newFlairGroupId)}}
@onChange={{fn (mut this.newFlairGroupId)}}
@options={{hash none="user.flair.none"}}
/>
</div>

View File

@ -20,7 +20,7 @@
@content={{this.emailLevelOptions}}
@value={{this.model.user_option.email_messages_level}}
@id="user-email-messages-level"
@onChange={{action (mut this.model.user_option.email_messages_level)}}
@onChange={{fn (mut this.model.user_option.email_messages_level)}}
/>
{{#if this.emailMessagesLevelAway}}
<div class="instructions">{{this.emailFrequencyInstructions}}</div>
@ -34,7 +34,7 @@
@content={{this.emailLevelOptions}}
@value={{this.model.user_option.email_level}}
@id="user-email-level"
@onChange={{action (mut this.model.user_option.email_level)}}
@onChange={{fn (mut this.model.user_option.email_level)}}
/>
{{#if this.emailLevelAway}}
<div class="instructions">{{this.emailFrequencyInstructions}}</div>
@ -50,7 +50,7 @@
@valueProperty="value"
@content={{this.previousRepliesOptions}}
@value={{this.model.user_option.email_previous_replies}}
@onChange={{action (mut this.model.user_option.email_previous_replies)}}
@onChange={{fn (mut this.model.user_option.email_previous_replies)}}
/>
</div>
<PreferenceCheckbox
@ -86,7 +86,7 @@
@valueProperty="value"
@content={{this.digestFrequencies}}
@value={{this.model.user_option.digest_after_minutes}}
@onChange={{action (mut this.model.user_option.digest_after_minutes)}}
@onChange={{fn (mut this.model.user_option.digest_after_minutes)}}
@options={{hash filterable=true}}
/>
</div>

View File

@ -139,7 +139,7 @@
@langProperty="value"
@content={{this.availableLocales}}
@value={{this.model.locale}}
@onChange={{action (mut this.model.locale)}}
@onChange={{fn (mut this.model.locale)}}
@options={{hash filterable=true none="user.locale.default"}}
/>
</div>
@ -157,7 +157,7 @@
@content={{this.userSelectableHome}}
@valueProperty="value"
@value={{this.homepageId}}
@onChange={{action (mut this.model.user_option.homepage_id)}}
@onChange={{fn (mut this.model.user_option.homepage_id)}}
/>
</div>
</div>
@ -217,7 +217,7 @@
@content={{this.titleCountModes}}
@value={{this.model.user_option.title_count_mode}}
@id="user-title-count-mode"
@onChange={{action (mut this.model.user_option.title_count_mode)}}
@onChange={{fn (mut this.model.user_option.title_count_mode)}}
/>
</div>
<div

View File

@ -11,7 +11,7 @@
<label class="control-label">{{i18n "user.timezone"}}</label>
<TimezoneInput
@value={{this.model.user_option.timezone}}
@onChange={{action (mut this.model.user_option.timezone)}}
@onChange={{fn (mut this.model.user_option.timezone)}}
class="input-xxlarge"
/>
<DButton
@ -149,7 +149,7 @@
@content={{this.calendarOptions}}
@value={{this.model.user_option.default_calendar}}
@id="user-default-calendar"
@onChange={{action (mut this.model.user_option.default_calendar)}}
@onChange={{fn (mut this.model.user_option.default_calendar)}}
/>
</div>
<div class="instructions">

View File

@ -24,7 +24,7 @@
<ComboBox
@value={{this.filterStatus}}
@content={{this.statuses}}
@onChange={{action (mut this.filterStatus)}}
@onChange={{fn (mut this.filterStatus)}}
/>
</div>
@ -48,7 +48,7 @@
<ComboBox
@value={{this.filterType}}
@content={{this.allTypes}}
@onChange={{action (mut this.filterType)}}
@onChange={{fn (mut this.filterType)}}
@options={{hash none="review.filters.type.all"}}
/>
</div>
@ -60,7 +60,7 @@
<ComboBox
@value={{this.filterPriority}}
@content={{this.priorities}}
@onChange={{action (mut this.filterPriority)}}
@onChange={{fn (mut this.filterPriority)}}
/>
</div>
@ -70,7 +70,7 @@
</label>
<CategoryChooser
@value={{this.filterCategoryId}}
@onChange={{action (mut this.filterCategoryId)}}
@onChange={{fn (mut this.filterCategoryId)}}
@options={{hash none="review.filters.all_categories"}}
/>
</div>
@ -140,7 +140,7 @@
<ComboBox
@value={{this.filterSortOrder}}
@content={{this.sortOrders}}
@onChange={{action (mut this.filterSortOrder)}}
@onChange={{fn (mut this.filterSortOrder)}}
/>
</div>
{{/if}}

View File

@ -8,7 +8,7 @@
<ComboBox
@value={{rst.reviewable_priority}}
@content={{this.settings.reviewable_priorities}}
@onChange={{action (mut rst.reviewable_priority)}}
@onChange={{fn (mut rst.reviewable_priority)}}
/>
</div>
</div>

View File

@ -21,7 +21,7 @@
<div class="period-controls">
<PeriodChooser
@period={{this.period}}
@onChange={{action (mut this.period)}}
@onChange={{fn (mut this.period)}}
@fullDay={{false}}
/>
{{#if this.lastUpdatedAt}}

View File

@ -31,7 +31,7 @@ module("Integration | Component | date-time-input-range", function (hooks) {
this.setProperties({ state: { from: DEFAULT_DATE_TIME, to: null } });
await render(
hbs`<DateTimeInputRange @from={{this.state.from}} @to={{this.state.to}} @onChange={{action (mut this.state)}} />`
hbs`<DateTimeInputRange @from={{this.state.from}} @to={{this.state.to}} @onChange={{fn (mut this.state)}} />`
);
assert.strictEqual(fromDateInput().value, "2019-01-29");
@ -58,7 +58,7 @@ module("Integration | Component | date-time-input-range", function (hooks) {
this.setProperties({ state: { from: DEFAULT_DATE_TIME, to: null } });
await render(
hbs`<DateTimeInputRange @from={{this.state.from}} @to={{this.state.to}} @relativeDate={{this.state.from}} @onChange={{action (mut this.state)}} />`
hbs`<DateTimeInputRange @from={{this.state.from}} @to={{this.state.to}} @relativeDate={{this.state.from}} @onChange={{fn (mut this.state)}} />`
);
await fillIn(toDateInput(), "2019-01-29");
@ -78,7 +78,7 @@ module("Integration | Component | date-time-input-range", function (hooks) {
});
await render(
hbs`<DateTimeInputRange @from={{this.state.from}} @to={{this.state.to}} @onChange={{action (mut this.state)}} @timezone="Europe/Paris" />`
hbs`<DateTimeInputRange @from={{this.state.from}} @to={{this.state.to}} @onChange={{fn (mut this.state)}} @timezone="Europe/Paris" />`
);
assert.strictEqual(fromDateInput().value, "2019-01-29");

View File

@ -129,7 +129,7 @@ module(
this.set("input", moment("2032-01-01 11:10"));
await render(
hbs`<FutureDateInput @input={{this.input}} @onChangeInput={{action (mut this.input)}} />`
hbs`<FutureDateInput @input={{this.input}} @onChangeInput={{fn (mut this.input)}} />`
);
await fillIn(".time-input", "11:15");

View File

@ -52,7 +52,7 @@
<CategoryChooser
@id="new-topic-category-selector"
@value={{this.categoryId}}
@onChange={{action (mut this.categoryId)}}
@onChange={{fn (mut this.categoryId)}}
class="small"
/>

View File

@ -70,7 +70,7 @@
@isActive={{this.emojiPickerIsActive}}
@isEditorFocused={{true}}
@emojiSelected={{action "emojiSelected"}}
@onEmojiPickerClose={{action (mut this.emojiPickerIsActive) false}}
@onEmojiPickerClose={{fn (mut this.emojiPickerIsActive) false}}
/>
{{#unless this.emojiPickerIsActive}}
@ -121,7 +121,7 @@
<ChatChannelChooser
@content={{this.model.chat_channels}}
@value={{this.newWebhookChannelId}}
@onChange={{action (mut this.newWebhookChannelId)}}
@onChange={{fn (mut this.newWebhookChannelId)}}
/>
<DButton
@label="chat.create"

View File

@ -72,7 +72,7 @@
@content={{this.emailFrequencyOptions}}
@value={{this.model.user_option.chat_email_frequency}}
@id="user_chat_email_frequency"
@onChange={{action (mut this.model.user_option.chat_email_frequency)}}
@onChange={{fn (mut this.model.user_option.chat_email_frequency)}}
/>
{{#if (eq this.model.user_option.chat_email_frequency "when_away")}}
<div class="control-instructions">
@ -112,7 +112,7 @@
@content={{this.chatSeparateSidebarModeOptions}}
@value={{this.chatSeparateSidebarMode}}
@id="user_chat_separate_sidebar_mode"
@onChange={{action (mut this.model.user_option.chat_separate_sidebar_mode)}}
@onChange={{fn (mut this.model.user_option.chat_separate_sidebar_mode)}}
/>
</div>

View File

@ -61,7 +61,7 @@
<TimezoneInput
@options={{hash icon="globe"}}
@value={{this.timezone}}
@onChange={{action (mut this.timezone)}}
@onChange={{fn (mut this.timezone)}}
/>
{{/unless}}
</div>
@ -83,7 +83,7 @@
<TimezoneInput
@value={{this.timezone}}
@options={{hash icon="globe"}}
@onChange={{action (mut this.timezone)}}
@onChange={{fn (mut this.timezone)}}
/>
{{/if}}
</div>
@ -104,7 +104,7 @@
<ComboBox
@content={{this.recurringOptions}}
@value={{this.recurring}}
@onChange={{action (mut this.recurring)}}
@onChange={{fn (mut this.recurring)}}
@options={{hash
none="discourse_local_dates.create.form.recurring_none"
}}

View File

@ -162,7 +162,7 @@
<GroupChooser
@content={{this.siteGroups}}
@value={{this.pollGroups}}
@onChange={{action (mut this.pollGroups)}}
@onChange={{fn (mut this.pollGroups)}}
@labelProperty="name"
@valueProperty="name"
/>
@ -174,7 +174,7 @@
}}</label>
<DateTimeInput
@date={{this.pollAutoClose}}
@onChange={{action (mut this.pollAutoClose)}}
@onChange={{fn (mut this.pollAutoClose)}}
@clearable={{true}}
@useGlobalPickerContainer={{true}}
/>
@ -188,7 +188,7 @@
@content={{this.pollResults}}
@value={{this.pollResult}}
@valueProperty="value"
@onChange={{action (mut this.pollResult)}}
@onChange={{fn (mut this.pollResult)}}
class="poll-result"
/>
</div>

View File

@ -83,7 +83,7 @@
@name="icon"
@value={{this.icon}}
@options={{hash maximum=1}}
@onChange={{action (mut this.icon)}}
@onChange={{fn (mut this.icon)}}
/>
</Styleguide::Controls::Row>
<Styleguide::Controls::Row @name="With an action">