DEV: Avoid using the old action helper (#26935)

This commit is contained in:
Jarek Radosz 2024-05-08 20:26:48 +02:00 committed by GitHub
parent 1b80ee9eb7
commit e579cfc08f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 14 additions and 15 deletions

View File

@ -38,7 +38,7 @@
<ComboBox
@content={{this.validValues}}
@value={{this.newValue}}
@onChange={{action this.addValue}}
@onChange={{this.addValue}}
@valueProperty={{this.setting.computedValueProperty}}
@nameProperty={{this.setting.computedNameProperty}}
@options={{hash castInteger=true allowAny=false}}

View File

@ -3,7 +3,7 @@
<WatchedWords
@id="watched-words"
@value={{this.words}}
@onChange={{action (mut this.words)}}
@onChange={{fn (mut this.words)}}
@options={{hash
filterPlaceholder=this.placeholderKey
disabled=this.formSubmitted

View File

@ -47,7 +47,7 @@
<ComboBox
@value={{this.group}}
@content={{this.groupOptions}}
@onChange={{action this.groupChanged}}
@onChange={{this.groupChanged}}
@options={{hash none="directory.group.all"}}
class="directory-group-selector"
/>

View File

@ -15,16 +15,16 @@ export default class AutomationNew extends Controller {
}
@action
saveAutomation(automation) {
saveAutomation() {
this.set("error", null);
automation
this.model.automation
.save(this.form.getProperties("name", "script"))
.then(() => {
this._resetForm();
this.router.transitionTo(
"adminPlugins.discourse-automation.edit",
automation.id
this.model.automation.id
);
})
.catch((e) => {

View File

@ -27,7 +27,7 @@
<DropdownSelectBox
@value={{form.script}}
@content={{model.scriptables.content}}
@onChange={{action (mut form.script)}}
@onChange={{fn (mut form.script)}}
@options={{hash
showCaret=true
filterable=true
@ -39,12 +39,11 @@
</div>
<div class="control-group">
<div class="controls">
<DButton
@icon="plus"
@label="discourse_automation.create"
@action={{action "saveAutomation" model.automation}}
@action={{this.saveAutomation}}
class="btn-primary create-automation"
/>
</div>

View File

@ -58,7 +58,7 @@
</label>
<CategoryChooser
@value={{this.categoryId}}
@onChange={{action this.onCategoryChange}}
@onChange={{this.onCategoryChange}}
@options={{hash
formName="chatable_id"
none="chat.create_channel.choose_category.none"

View File

@ -74,8 +74,8 @@
@minDate={{this.minDate}}
@timeFormat={{this.timeFormat}}
@dateFormat={{this.dateFormat}}
@onChangeDate={{action this.changeSelectedDate}}
@onChangeTime={{action this.changeSelectedTime}}
@onChangeDate={{this.changeSelectedDate}}
@onChangeTime={{this.changeSelectedTime}}
/>
</div>

View File

@ -59,7 +59,7 @@
@content={{this.groupableUserFields}}
@value={{this.groupedBy}}
@nameProperty="label"
@onChange={{action this.setGrouping}}
@onChange={{this.setGrouping}}
class="poll-breakdown-dropdown"
/>
</div>

View File

@ -7,8 +7,8 @@
@minDate={{this.minDate}}
@timeFormat={{this.timeFormat}}
@dateFormat={{this.dateFormat}}
@onChangeDate={{action this.changeDate}}
@onChangeTime={{action this.changeTime}}
@onChangeDate={{this.changeDate}}
@onChangeTime={{this.changeTime}}
/>
</Styleguide::Component>