1
0
Fork 0
Dieser Commit ist enthalten in:
Angus McLeod 2020-04-15 14:29:47 +10:00
Ursprung 79fc4eee24
Commit c24c7f7b44
8 geänderte Dateien mit 74 neuen und 77 gelöschten Zeilen

Datei anzeigen

@ -266,7 +266,7 @@ const actionProperties = {
} }
} }
if (Discourse.SiteSettings.wizard_api_features) { if (Discourse.SiteSettings.wizard_apis_enabled) {
actionProperties.types.send_to_api = { actionProperties.types.send_to_api = {
api: null, api: null,
api_endpoint: null, api_endpoint: null,

Datei anzeigen

@ -30,7 +30,7 @@ export default DiscourseRoute.extend({
}, },
_getApis(model) { _getApis(model) {
return ajax('/admin/wizards/apis') return ajax('/admin/wizards/api')
.then((result) => set(model, 'apis', result)); .then((result) => set(model, 'apis', result));
}, },

Datei anzeigen

@ -0,0 +1,3 @@
<div class="admin-wizard-container">
{{outlet}}
</div>

Datei anzeigen

@ -1,8 +1,8 @@
{{#admin-nav}} {{#admin-nav}}
{{nav-item route='adminWizardsWizard' label='admin.wizard.nav_label'}} {{nav-item route='adminWizardsWizard' label='admin.wizard.nav_label'}}
{{nav-item route='adminWizardsSubmissions' label='admin.wizard.submissions.nav_label'}} {{nav-item route='adminWizardsSubmissions' label='admin.wizard.submissions.nav_label'}}
{{#if siteSettings.wizard_api_features}} {{#if siteSettings.wizard_apis_enabled}}
{{nav-item route='adminWizardsApis' label='admin.wizard.api.nav_label'}} {{nav-item route='adminWizardsApi' label='admin.wizard.api.nav_label'}}
{{/if}} {{/if}}
{{nav-item route='adminWizardsLogs' label='admin.wizard.log.nav_label'}} {{nav-item route='adminWizardsLogs' label='admin.wizard.log.nav_label'}}
{{nav-item route='adminWizardsTransfer' label='admin.wizard.transfer.nav_label'}} {{nav-item route='adminWizardsTransfer' label='admin.wizard.transfer.nav_label'}}

Datei anzeigen

@ -34,69 +34,67 @@
</div> </div>
</div> </div>
{{#if siteSettings.wizard_step_advanced}} {{wizard-advanced-toggle showAdvanced=step.showAdvanced}}
{{wizard-advanced-toggle showAdvanced=step.showAdvanced}}
{{#if step.showAdvanced}} {{#if step.showAdvanced}}
<div class="advanced-settings"> <div class="advanced-settings">
<div class="setting full field-mapper-setting"> <div class="setting full field-mapper-setting">
<div class="setting-label"> <div class="setting-label">
<label>{{i18n 'admin.wizard.step.required_data.label'}}</label> <label>{{i18n 'admin.wizard.step.required_data.label'}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=step.required_data inputs=step.required_data
options=(hash options=(hash
inputTypes='validation' inputTypes='validation'
inputConnector='and' inputConnector='and'
wizardFieldSelection='value' wizardFieldSelection='value'
userFieldSelection='value' userFieldSelection='value'
keyPlaceholder="admin.wizard.submission_key" keyPlaceholder="admin.wizard.submission_key"
context='step' context='step'
)}} )}}
{{#if step.required_data}} {{#if step.required_data}}
<div class="required-data-message"> <div class="required-data-message">
<div class="label"> <div class="label">
{{i18n 'admin.wizard.step.required_data.not_permitted_message'}} {{i18n 'admin.wizard.step.required_data.not_permitted_message'}}
</div>
{{input value=step.required_data_message}}
</div> </div>
{{/if}} {{input value=step.required_data_message}}
</div> </div>
{{/if}}
</div> </div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.step.permitted_params.label'}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=step.permitted_params
options=(hash
pairConnector='set'
inputTypes='association'
keyPlaceholder='admin.wizard.param_key'
valuePlaceholder='admin.wizard.submission_key'
context='step'
)}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.translation'}}</label>
</div>
<div class="setting-value">
{{input
name="key"
value=step.key
placeholderKey="admin.wizard.translation_placeholder"}}
</div>
</div>
</div> </div>
{{/if}}
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.step.permitted_params.label'}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=step.permitted_params
options=(hash
pairConnector='set'
inputTypes='association'
keyPlaceholder='admin.wizard.param_key'
valuePlaceholder='admin.wizard.submission_key'
context='step'
)}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.translation'}}</label>
</div>
<div class="setting-value">
{{input
name="key"
value=step.key
placeholderKey="admin.wizard.translation_placeholder"}}
</div>
</div>
</div>
{{/if}} {{/if}}
{{wizard-links itemType="field" current=currentField items=step.fields}} {{wizard-links itemType="field" current=currentField items=step.fields}}

Datei anzeigen

@ -29,5 +29,4 @@ en:
custom_wizard_enabled: "Enable custom wizards." custom_wizard_enabled: "Enable custom wizards."
wizard_redirect_exclude_paths: "Routes excluded from wizard redirects." wizard_redirect_exclude_paths: "Routes excluded from wizard redirects."
wizard_recognised_image_upload_formats: "File types which will result in upload displaying an image preview" wizard_recognised_image_upload_formats: "File types which will result in upload displaying an image preview"
wizard_step_advanced: "Enable advanced settings for wizard steps (experimental)." wizard_apis_enabled: "Enable API features (experimental)."
wizard_api_features: "Enable API features (experimental)."

Datei anzeigen

@ -23,14 +23,14 @@ Discourse::Application.routes.append do
get 'admin/wizards/submissions/:wizard_id' => 'admin_submissions#show' get 'admin/wizards/submissions/:wizard_id' => 'admin_submissions#show'
get 'admin/wizards/submissions/:wizard_id/download' => 'admin_submissions#download' get 'admin/wizards/submissions/:wizard_id/download' => 'admin_submissions#download'
get 'admin/wizards/apis' => 'admin_api#list' get 'admin/wizards/api' => 'admin_api#list'
get 'admin/wizards/apis/new' => 'admin_api#index' get 'admin/wizards/api/new' => 'admin_api#index'
get 'admin/wizards/apis/:name' => 'admin_api#find' get 'admin/wizards/api/:name' => 'admin_api#find'
put 'admin/wizards/apis/:name' => 'admin_api#save' put 'admin/wizards/api/:name' => 'admin_api#save'
delete 'admin/wizards/apis/:name' => 'admin_api#remove' delete 'admin/wizards/api/:name' => 'admin_api#remove'
delete 'admin/wizards/apis/logs/:name' => 'admin_api#clearlogs' delete 'admin/wizards/api/log/:name' => 'admin_api#clearlogs'
get 'admin/wizards/apis/:name/redirect' => 'admin_api#redirect' get 'admin/wizards/api/:name/redirect' => 'admin_api#redirect'
get 'admin/wizards/apis/:name/authorize' => 'admin_api#authorize' get 'admin/wizards/api/:name/authorize' => 'admin_api#authorize'
get 'admin/wizards/logs' => 'admin_logs#index' get 'admin/wizards/logs' => 'admin_logs#index'

Datei anzeigen

@ -15,9 +15,6 @@ plugins:
refresh: true refresh: true
type: list type: list
list_type: compact list_type: compact
wizard_step_advanced: wizard_apis_enabled:
client: true
default: false
wizard_api_features:
client: true client: true
default: false default: false