From 61ec6123d7597c2dbbc77bea60ad3f03996b7ad4 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Mon, 3 Apr 2023 12:28:06 +1000 Subject: [PATCH] Handle admin template deprecations --- .../wizard-subscription-container.js.es6 | 2 +- .../templates/admin-wizards-api-show.hbs | 58 +++++++++++---- .../templates/admin-wizards-manager.hbs | 21 +++--- .../templates/admin-wizards-wizard-show.hbs | 51 +++++++++---- .../components/custom-field-input.hbs | 7 +- .../components/custom-wizard-editor.hbs | 7 +- .../components/wizard-custom-action.hbs | 27 +++++-- .../components/wizard-custom-field.hbs | 74 +++++++++++++------ .../components/wizard-custom-step.hbs | 14 +++- .../components/wizard-mapper-selector.hbs | 11 +-- .../wizard-realtime-validations.hbs | 11 ++- 11 files changed, 200 insertions(+), 83 deletions(-) diff --git a/assets/javascripts/discourse/components/wizard-subscription-container.js.es6 b/assets/javascripts/discourse/components/wizard-subscription-container.js.es6 index 5cc6b17c..3a1eac9c 100644 --- a/assets/javascripts/discourse/components/wizard-subscription-container.js.es6 +++ b/assets/javascripts/discourse/components/wizard-subscription-container.js.es6 @@ -7,7 +7,7 @@ export default Component.extend(Subscription, { @discourseComputed("subscribed") subscribedIcon(subscribed) { - return subscribed ? "check" : "dash"; + return subscribed ? "check" : "times"; }, @discourseComputed("subscribed") diff --git a/assets/javascripts/discourse/templates/admin-wizards-api-show.hbs b/assets/javascripts/discourse/templates/admin-wizards-api-show.hbs index 303b3f6d..7fe0fd21 100644 --- a/assets/javascripts/discourse/templates/admin-wizards-api-show.hbs +++ b/assets/javascripts/discourse/templates/admin-wizards-api-show.hbs @@ -32,13 +32,19 @@
- {{input value=api.title placeholder=(i18n "admin.wizard.api.title_placeholder")}} +
{{#if api.isNew}} - {{input value=api.name placeholder=(i18n "admin.wizard.api.name_placeholder")}} + {{else}} {{api.name}} {{/if}} @@ -104,7 +110,9 @@
- {{input value=api.authUrl}} +
{{/if}} @@ -112,21 +120,27 @@
- {{input value=api.tokenUrl}} +
- {{input value=api.clientId}} +
- {{input value=api.clientSecret}} +
@@ -135,8 +149,14 @@
{{#each api.authParams as |param|}}
- {{input value=param.key placeholder=(i18n "admin.wizard.key")}} - {{input value=param.value placeholder=(i18n "admin.wizard.value")}} + + {{d-button action=(action "removeParam") actionParam=param icon="times"}}
{{/each}} @@ -149,14 +169,18 @@
- {{input value=api.username}} +
- {{input value=api.password}} +
{{/if}} @@ -235,11 +259,15 @@
- {{input value=endpoint.name - placeholder=(i18n "admin.wizard.api.endpoint.name")}} - {{input value=endpoint.url - placeholder=(i18n "admin.wizard.api.endpoint.url") - class="endpoint-url"}} + + {{d-button action=(action "removeEndpoint") actionParam=endpoint icon="times" diff --git a/assets/javascripts/discourse/templates/admin-wizards-manager.hbs b/assets/javascripts/discourse/templates/admin-wizards-manager.hbs index 4b91bd3d..38ef54d2 100644 --- a/assets/javascripts/discourse/templates/admin-wizards-manager.hbs +++ b/assets/javascripts/discourse/templates/admin-wizards-manager.hbs @@ -11,11 +11,12 @@
{{/if}} - {{input + {{d-button id="upload-button" label="admin.wizard.manager.upload" @@ -65,16 +66,18 @@ {{/link-to}} - {{input - type="checkbox" + - {{input - type="checkbox" + {{/each}} diff --git a/assets/javascripts/discourse/templates/admin-wizards-wizard-show.hbs b/assets/javascripts/discourse/templates/admin-wizards-wizard-show.hbs index a81ec6db..4b04878e 100644 --- a/assets/javascripts/discourse/templates/admin-wizards-wizard-show.hbs +++ b/assets/javascripts/discourse/templates/admin-wizards-wizard-show.hbs @@ -1,9 +1,10 @@ {{#if wizard}}
- {{input +
{{#if wizard.name}} @@ -23,11 +24,12 @@
- {{input +
@@ -58,7 +60,10 @@
- {{input type="checkbox" checked=wizard.save_submissions}} + {{i18n "admin.wizard.save_submissions_label"}}
@@ -68,7 +73,10 @@
- {{input type="checkbox" checked=wizard.multiple_submissions}} + {{i18n "admin.wizard.multiple_submissions_label"}}
@@ -78,7 +86,10 @@
- {{input type="checkbox" checked=wizard.after_signup}} + {{i18n "admin.wizard.after_signup_label"}}
@@ -88,7 +99,10 @@
- {{input type="checkbox" checked=wizard.prompt_completion}} + {{i18n "admin.wizard.prompt_completion_label"}}
@@ -98,7 +112,10 @@
- {{input type="checkbox" checked=wizard.after_time}} + {{i18n "admin.wizard.after_time_label"}} {{d-button action=(action "setNextSessionScheduled") @@ -114,7 +131,10 @@
- {{input type="checkbox" checked=wizard.required}} + {{i18n "admin.wizard.required_label"}}
@@ -124,7 +144,10 @@
- {{input type="checkbox" checked=wizard.restart_on_revisit}} + {{i18n "admin.wizard.restart_on_revisit_label"}}
diff --git a/assets/javascripts/discourse/templates/components/custom-field-input.hbs b/assets/javascripts/discourse/templates/components/custom-field-input.hbs index c0bdaaff..8c532cc9 100644 --- a/assets/javascripts/discourse/templates/components/custom-field-input.hbs +++ b/assets/javascripts/discourse/templates/components/custom-field-input.hbs @@ -20,9 +20,10 @@ )}} - {{input - value=field.name - placeholder=(i18n "admin.wizard.custom_field.name.select")}} + {{multi-select diff --git a/assets/javascripts/discourse/templates/components/custom-wizard-editor.hbs b/assets/javascripts/discourse/templates/components/custom-wizard-editor.hbs index 5c1cc45b..6350594c 100644 --- a/assets/javascripts/discourse/templates/components/custom-wizard-editor.hbs +++ b/assets/javascripts/discourse/templates/components/custom-wizard-editor.hbs @@ -40,7 +40,12 @@ {{conditional-loading-spinner condition=loading}} - {{textarea tabindex=tabindex value=value class="d-editor-input" placeholder=placeholder}} +