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
9 changed files with 14 additions and 15 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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