mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:11:04 +08:00
DEV: Avoid using the old action helper (#26935)
This commit is contained in:
@ -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}}
|
||||||
|
@ -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
|
||||||
|
@ -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"
|
||||||
/>
|
/>
|
||||||
|
@ -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) => {
|
||||||
|
@ -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>
|
||||||
|
@ -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"
|
||||||
|
@ -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>
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user