Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-09 20:02:54 +01:00
Fix step component current objects
Dieser Commit ist enthalten in:
Ursprung
dc1cbfbfe4
Commit
b8e0291512
2 geänderte Dateien mit 14 neuen und 2 gelöschten Zeilen
|
@ -1,6 +1,18 @@
|
||||||
|
import { observes } from 'ember-addons/ember-computed-decorators';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
classNames: 'wizard-custom-step',
|
classNames: 'wizard-custom-step',
|
||||||
currentField: null,
|
currentField: null,
|
||||||
currentAction: null,
|
currentAction: null,
|
||||||
disableId: Ember.computed.not('step.isNew')
|
disableId: Ember.computed.not('step.isNew'),
|
||||||
|
|
||||||
|
@observes('step')
|
||||||
|
resetCurrentObjects() {
|
||||||
|
const fields = this.get('step.fields');
|
||||||
|
const actions = this.get('step.actions');
|
||||||
|
this.setProperties({
|
||||||
|
currentField: fields.length ? fields[0] : null,
|
||||||
|
currentAction: actions.length ? actions[0] : null
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
<div class="wizard-header small">
|
<div class="wizard-header small">
|
||||||
{{i18n 'admin.wizard.field.choices_preset.label'}}
|
{{i18n 'admin.wizard.field.choices_preset.label'}}
|
||||||
</div>
|
</div>
|
||||||
{{combo-box value=field.choices_preset content=presetChoices none='admin.wizard.field.choices_preset.none'}}
|
{{combo-box value=field.choices_preset content=presetChoices none='admin.wizard.none'}}
|
||||||
<label>{{i18n 'admin.wizard.field.choices_preset.filter'}}</label>
|
<label>{{i18n 'admin.wizard.field.choices_preset.filter'}}</label>
|
||||||
{{wizard-custom-input inputs=field.choices_filters}}
|
{{wizard-custom-input inputs=field.choices_filters}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Laden …
In neuem Issue referenzieren