1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/components/wizard-custom-field.js.es6
2019-07-01 12:31:50 +10:00

27 Zeilen
902 B
JavaScript

import { default as computed } from 'ember-addons/ember-computed-decorators';
export default Ember.Component.extend({
classNames: 'wizard-custom-field',
isDropdown: Ember.computed.equal('field.type', 'dropdown'),
disableId: Ember.computed.not('field.isNew'),
choicesTypes: ['translation', 'preset', 'custom'],
choicesTranslation: Ember.computed.equal('field.choices_type', 'translation'),
choicesPreset: Ember.computed.equal('field.choices_type', 'preset'),
choicesCustom: Ember.computed.equal('field.choices_type', 'custom'),
@computed('field.type')
isInput: (type) => type === 'text' || type === 'textarea',
@computed()
presetChoices() {
return [
{
id: 'categories',
name: I18n.t('admin.wizard.field.choices_preset.categories')
},{
id: 'groups',
name: I18n.t('admin.wizard.field.choices_preset.groups')
}
];
},
});