Api tweaks
Dieser Commit ist enthalten in:
Ursprung
79fc4eee24
Commit
c24c7f7b44
8 geänderte Dateien mit 74 neuen und 77 gelöschten Zeilen
|
@ -266,7 +266,7 @@ const actionProperties = {
|
|||
}
|
||||
}
|
||||
|
||||
if (Discourse.SiteSettings.wizard_api_features) {
|
||||
if (Discourse.SiteSettings.wizard_apis_enabled) {
|
||||
actionProperties.types.send_to_api = {
|
||||
api: null,
|
||||
api_endpoint: null,
|
||||
|
|
|
@ -30,7 +30,7 @@ export default DiscourseRoute.extend({
|
|||
},
|
||||
|
||||
_getApis(model) {
|
||||
return ajax('/admin/wizards/apis')
|
||||
return ajax('/admin/wizards/api')
|
||||
.then((result) => set(model, 'apis', result));
|
||||
},
|
||||
|
||||
|
|
3
assets/javascripts/discourse/templates/admin-wizards-api.hbs
Normale Datei
3
assets/javascripts/discourse/templates/admin-wizards-api.hbs
Normale Datei
|
@ -0,0 +1,3 @@
|
|||
<div class="admin-wizard-container">
|
||||
{{outlet}}
|
||||
</div>
|
|
@ -1,8 +1,8 @@
|
|||
{{#admin-nav}}
|
||||
{{nav-item route='adminWizardsWizard' label='admin.wizard.nav_label'}}
|
||||
{{nav-item route='adminWizardsSubmissions' label='admin.wizard.submissions.nav_label'}}
|
||||
{{#if siteSettings.wizard_api_features}}
|
||||
{{nav-item route='adminWizardsApis' label='admin.wizard.api.nav_label'}}
|
||||
{{#if siteSettings.wizard_apis_enabled}}
|
||||
{{nav-item route='adminWizardsApi' label='admin.wizard.api.nav_label'}}
|
||||
{{/if}}
|
||||
{{nav-item route='adminWizardsLogs' label='admin.wizard.log.nav_label'}}
|
||||
{{nav-item route='adminWizardsTransfer' label='admin.wizard.transfer.nav_label'}}
|
||||
|
|
|
@ -34,69 +34,67 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{{#if siteSettings.wizard_step_advanced}}
|
||||
{{wizard-advanced-toggle showAdvanced=step.showAdvanced}}
|
||||
{{wizard-advanced-toggle showAdvanced=step.showAdvanced}}
|
||||
|
||||
{{#if step.showAdvanced}}
|
||||
<div class="advanced-settings">
|
||||
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n 'admin.wizard.step.required_data.label'}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=step.required_data
|
||||
options=(hash
|
||||
inputTypes='validation'
|
||||
inputConnector='and'
|
||||
wizardFieldSelection='value'
|
||||
userFieldSelection='value'
|
||||
keyPlaceholder="admin.wizard.submission_key"
|
||||
context='step'
|
||||
)}}
|
||||
{{#if step.required_data}}
|
||||
<div class="required-data-message">
|
||||
<div class="label">
|
||||
{{i18n 'admin.wizard.step.required_data.not_permitted_message'}}
|
||||
</div>
|
||||
{{input value=step.required_data_message}}
|
||||
{{#if step.showAdvanced}}
|
||||
<div class="advanced-settings">
|
||||
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n 'admin.wizard.step.required_data.label'}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=step.required_data
|
||||
options=(hash
|
||||
inputTypes='validation'
|
||||
inputConnector='and'
|
||||
wizardFieldSelection='value'
|
||||
userFieldSelection='value'
|
||||
keyPlaceholder="admin.wizard.submission_key"
|
||||
context='step'
|
||||
)}}
|
||||
{{#if step.required_data}}
|
||||
<div class="required-data-message">
|
||||
<div class="label">
|
||||
{{i18n 'admin.wizard.step.required_data.not_permitted_message'}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{input value=step.required_data_message}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</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>
|
||||
{{/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}}
|
||||
|
||||
{{wizard-links itemType="field" current=currentField items=step.fields}}
|
||||
|
|
|
@ -29,5 +29,4 @@ en:
|
|||
custom_wizard_enabled: "Enable custom wizards."
|
||||
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_step_advanced: "Enable advanced settings for wizard steps (experimental)."
|
||||
wizard_api_features: "Enable API features (experimental)."
|
||||
wizard_apis_enabled: "Enable API features (experimental)."
|
|
@ -23,14 +23,14 @@ Discourse::Application.routes.append do
|
|||
get 'admin/wizards/submissions/:wizard_id' => 'admin_submissions#show'
|
||||
get 'admin/wizards/submissions/:wizard_id/download' => 'admin_submissions#download'
|
||||
|
||||
get 'admin/wizards/apis' => 'admin_api#list'
|
||||
get 'admin/wizards/apis/new' => 'admin_api#index'
|
||||
get 'admin/wizards/apis/:name' => 'admin_api#find'
|
||||
put 'admin/wizards/apis/:name' => 'admin_api#save'
|
||||
delete 'admin/wizards/apis/:name' => 'admin_api#remove'
|
||||
delete 'admin/wizards/apis/logs/:name' => 'admin_api#clearlogs'
|
||||
get 'admin/wizards/apis/:name/redirect' => 'admin_api#redirect'
|
||||
get 'admin/wizards/apis/:name/authorize' => 'admin_api#authorize'
|
||||
get 'admin/wizards/api' => 'admin_api#list'
|
||||
get 'admin/wizards/api/new' => 'admin_api#index'
|
||||
get 'admin/wizards/api/:name' => 'admin_api#find'
|
||||
put 'admin/wizards/api/:name' => 'admin_api#save'
|
||||
delete 'admin/wizards/api/:name' => 'admin_api#remove'
|
||||
delete 'admin/wizards/api/log/:name' => 'admin_api#clearlogs'
|
||||
get 'admin/wizards/api/:name/redirect' => 'admin_api#redirect'
|
||||
get 'admin/wizards/api/:name/authorize' => 'admin_api#authorize'
|
||||
|
||||
get 'admin/wizards/logs' => 'admin_logs#index'
|
||||
|
||||
|
|
|
@ -15,9 +15,6 @@ plugins:
|
|||
refresh: true
|
||||
type: list
|
||||
list_type: compact
|
||||
wizard_step_advanced:
|
||||
client: true
|
||||
default: false
|
||||
wizard_api_features:
|
||||
wizard_apis_enabled:
|
||||
client: true
|
||||
default: false
|
Laden …
In neuem Issue referenzieren