diff --git a/assets/javascripts/discourse/components/wizard-custom-field.js.es6 b/assets/javascripts/discourse/components/wizard-custom-field.js.es6 index abd9f459..f7a7bb8b 100644 --- a/assets/javascripts/discourse/components/wizard-custom-field.js.es6 +++ b/assets/javascripts/discourse/components/wizard-custom-field.js.es6 @@ -7,9 +7,8 @@ export default Ember.Component.extend({ isUpload: Ember.computed.equal('field.type', 'upload'), isCategory: Ember.computed.equal('field.type', 'category'), disableId: Ember.computed.not('field.isNew'), - choicesTypes: generateSelectKitContent(['translation', 'preset', 'custom']), + choicesTypes: generateSelectKitContent(['translation', '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'), categoryPropertyTypes: generateSelectKitContent(['id', 'slug']), @@ -19,24 +18,6 @@ export default Ember.Component.extend({ @computed('field.type') isCategoryOrTag: (type) => type === 'tag' || type === 'category', - @computed() - presetChoices() { - let presets = [ - { - id: 'categories', - name: I18n.t('admin.wizard.field.choices_preset.categories') - },{ - id: 'groups', - name: I18n.t('admin.wizard.field.choices_preset.groups') - },{ - id: 'tags', - name: I18n.t('admin.wizard.field.choices_preset.tags') - } - ]; - - return presets; - }, - @on('didInsertElement') @observes('isUpload') setupFileType() { diff --git a/assets/javascripts/discourse/models/custom-wizard.js.es6 b/assets/javascripts/discourse/models/custom-wizard.js.es6 index e7860c01..fa056c9a 100644 --- a/assets/javascripts/discourse/models/custom-wizard.js.es6 +++ b/assets/javascripts/discourse/models/custom-wizard.js.es6 @@ -106,7 +106,7 @@ const CustomWizard = Discourse.Model.extend({ if (f.type === 'dropdown') { const choices = f.choices; - if ((!choices || choices.length < 1) && !f.choices_key && !f.choices_preset) { + if ((!choices || choices.length < 1) && !f.choices_key) { error = 'field.need_choices'; return; } diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs index aa91b615..8b66ea2b 100644 --- a/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs @@ -94,20 +94,6 @@ {{input name="key" value=field.choices_key placeholderKey="admin.wizard.key_placeholder"}} {{/if}} - {{#if choicesPreset}} -
cat1
") - end - - it 'returns a filtered preset dropdown' do - template['steps'][0]['fields'][0] = dropdown_categories_filtered_field - choices = build_wizard(template, user).steps[0].fields[0].choices - expect(choices.present?).to eq(true) - expect(choices.length).to eq(1) - expect(choices.first.label).to eq("cat2
") - end end context 'on update' do diff --git a/spec/serializers/custom_wizard/wizard_serializer_spec.rb b/spec/serializers/custom_wizard/wizard_serializer_spec.rb index 41568336..eabe26e4 100644 --- a/spec/serializers/custom_wizard/wizard_serializer_spec.rb +++ b/spec/serializers/custom_wizard/wizard_serializer_spec.rb @@ -12,7 +12,6 @@ describe CustomWizardSerializer do ).read) end - let(:dropdown_categories_field) {{"id": "dropdown_categories","type": "dropdown","label": "Dropdown Categories","choices_type": "preset","choices_preset": "categories"}} let(:category_field) {{"id": "category","type": "category","limit": "1","label": "Category"}} def build_wizard(t = template, u = user, build_opts = {}, params = {}) @@ -41,13 +40,6 @@ describe CustomWizardSerializer do expect(json[:custom_wizard][:uncategorized_category_id].present?).to eq(false) end - it "should return category attributes if there are dropdown category fields" do - template['steps'][0]['fields'][0] = dropdown_categories_field - json = CustomWizardSerializer.new(build_wizard(template), scope: Guardian.new(user)).as_json - expect(json[:custom_wizard][:categories].present?).to eq(true) - expect(json[:custom_wizard][:uncategorized_category_id].present?).to eq(true) - end - it "should return category attributes if there is a category selector field" do template['steps'][0]['fields'][0] = category_field json = CustomWizardSerializer.new(build_wizard(template), scope: Guardian.new(user)).as_json