0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00

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}}
{{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}}
{{d-button action="remove" label="admin.wizard.api.remove"}}
{{d-button action=(action "remove") label="admin.wizard.api.remove"}}
{{/if}}
{{#if error}}
@ -57,7 +57,7 @@
{{/if}}
{{/if}}
{{d-button label="admin.wizard.api.auth.btn"
action="authorize"
action=(action "authorize")
disabled=authDisabled
class="btn-primary"}}
{{/if}}
@ -131,10 +131,10 @@
<div class="param">
{{input value=param.key placeholder=(i18n 'admin.wizard.api.auth.params.key')}}
{{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>
{{/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>
{{/if}}
@ -219,7 +219,7 @@
</div>
<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}}
<div class="endpoint-list">
@ -236,7 +236,7 @@
{{input value=endpoint.url
placeholder=(i18n 'admin.wizard.api.endpoint.url')
class='endpoint-url'}}
{{d-button action='removeEndpoint'
{{d-button action=(action "removeEndpoint")
actionParam=endpoint
icon='times'
class='remove-endpoint'}}
@ -251,7 +251,7 @@
<div class="wizard-header">
{{i18n 'admin.wizard.api.log.label'}}
{{d-button action='clearLogs'
{{d-button action=(action "clearLogs")
icon='trash-alt'
class='clear-logs'}}
</div>

Datei anzeigen

@ -32,6 +32,7 @@ class CustomWizard::Api::Authorization
end
def self.set(api_name, new_data = {})
api_name = api_name.underscore
data = self.get(api_name, data_only: true) || {}
@ -40,6 +41,12 @@ class CustomWizard::Api::Authorization
data[k.to_sym] = v
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)
self.get(api_name)