1
0
Fork 0

updated some ember actions to closure actions to remove deprecation warnings, fixed issue where you could not remove last auth parameter as key would never be cleared

Dieser Commit ist enthalten in:
Robert Barrow 2019-06-12 21:57:38 +01:00
Ursprung b9f8cc61b2
Commit c6fed81d28
2 geänderte Dateien mit 15 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -8,10 +8,10 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
{{d-button label="admin.wizard.api.save" action="save" class="btn-primary" disabled=saveDisabled}} {{d-button label="admin.wizard.api.save" action=(action "save") class="btn-primary" disabled=saveDisabled}}
{{#if showRemove}} {{#if showRemove}}
{{d-button action="remove" label="admin.wizard.api.remove"}} {{d-button action=(action "remove") label="admin.wizard.api.remove"}}
{{/if}} {{/if}}
{{#if error}} {{#if error}}
@ -57,7 +57,7 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
{{d-button label="admin.wizard.api.auth.btn" {{d-button label="admin.wizard.api.auth.btn"
action="authorize" action=(action "authorize")
disabled=authDisabled disabled=authDisabled
class="btn-primary"}} class="btn-primary"}}
{{/if}} {{/if}}
@ -131,10 +131,10 @@
<div class="param"> <div class="param">
{{input value=param.key placeholder=(i18n 'admin.wizard.api.auth.params.key')}} {{input value=param.key placeholder=(i18n 'admin.wizard.api.auth.params.key')}}
{{input value=param.value placeholder=(i18n 'admin.wizard.api.auth.params.value')}} {{input value=param.value placeholder=(i18n 'admin.wizard.api.auth.params.value')}}
{{d-button action='removeParam' actionParam=param icon='times'}} {{d-button action=(action "removeParam") actionParam=param icon='times'}}
</div> </div>
{{/each}} {{/each}}
{{d-button label='admin.wizard.api.auth.params.new' icon='plus' action='addParam'}} {{d-button label='admin.wizard.api.auth.params.new' icon='plus' action=(action "addParam")}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -219,7 +219,7 @@
</div> </div>
<div class="wizard-api-endpoints"> <div class="wizard-api-endpoints">
{{d-button action='addEndpoint' label='admin.wizard.api.endpoint.add' icon='plus'}} {{d-button action=(action "addEndpoint") label='admin.wizard.api.endpoint.add' icon='plus'}}
{{#if api.endpoints}} {{#if api.endpoints}}
<div class="endpoint-list"> <div class="endpoint-list">
@ -236,7 +236,7 @@
{{input value=endpoint.url {{input value=endpoint.url
placeholder=(i18n 'admin.wizard.api.endpoint.url') placeholder=(i18n 'admin.wizard.api.endpoint.url')
class='endpoint-url'}} class='endpoint-url'}}
{{d-button action='removeEndpoint' {{d-button action=(action "removeEndpoint")
actionParam=endpoint actionParam=endpoint
icon='times' icon='times'
class='remove-endpoint'}} class='remove-endpoint'}}
@ -251,7 +251,7 @@
<div class="wizard-header"> <div class="wizard-header">
{{i18n 'admin.wizard.api.log.label'}} {{i18n 'admin.wizard.api.log.label'}}
{{d-button action='clearLogs' {{d-button action=(action "clearLogs")
icon='trash-alt' icon='trash-alt'
class='clear-logs'}} class='clear-logs'}}
</div> </div>

Datei anzeigen

@ -32,6 +32,7 @@ class CustomWizard::Api::Authorization
end end
def self.set(api_name, new_data = {}) def self.set(api_name, new_data = {})
api_name = api_name.underscore api_name = api_name.underscore
data = self.get(api_name, data_only: true) || {} data = self.get(api_name, data_only: true) || {}
@ -40,6 +41,12 @@ class CustomWizard::Api::Authorization
data[k.to_sym] = v data[k.to_sym] = v
end end
data.each do |k, v|
unless new_data.key?(k.to_s)
data.delete(k)
end
end
PluginStore.set("custom_wizard_api_#{api_name}", 'authorization', data) PluginStore.set("custom_wizard_api_#{api_name}", 'authorization', data)
self.get(api_name) self.get(api_name)