From 2114b80185bfc5b1fa42ea195e6be7cab2899d66 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Mon, 3 Apr 2023 12:37:09 +1000 Subject: [PATCH] Add wizard-subscription-selector support to field type selection --- assets/javascripts/discourse/lib/wizard-schema.js.es6 | 1 + .../templates/components/wizard-custom-field.hbs | 9 ++++++--- .../templates/components/wizard-custom-step.hbs | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/discourse/lib/wizard-schema.js.es6 b/assets/javascripts/discourse/lib/wizard-schema.js.es6 index 24bda1d3..47257d82 100644 --- a/assets/javascripts/discourse/lib/wizard-schema.js.es6 +++ b/assets/javascripts/discourse/lib/wizard-schema.js.es6 @@ -244,6 +244,7 @@ const custom_field = { export function buildFieldTypes(types) { wizardSchema.field.types = types; + wizardSchema.field.type = Object.keys(types); } field.type = Object.keys(field.types); diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs index 6273f9a9..26f6051f 100644 --- a/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs @@ -56,13 +56,16 @@
- {{combo-box + {{wizard-subscription-selector value=field.type - content=fieldTypes + feature="field" + attribute="type" onChange=(action "changeType") + wizard=wizard options=(hash none="admin.wizard.select_type" - )}} + ) + }}
diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs index 40ac09e0..431c3ae3 100644 --- a/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs @@ -111,6 +111,7 @@ {{wizard-custom-field field=field step=step + wizard=wizard currentFieldId=currentField.id fieldTypes=fieldTypes removeField="removeField"