From 16974df1e9ebd1f814f5429e4ac5a2fdc6ace8b4 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Sat, 1 Sep 2018 02:08:11 +0200 Subject: [PATCH] FIX: Resetting site setting didn't remove "overriden" state --- .../admin/mixins/setting-component.js.es6 | 4 +- .../templates/components/site-setting.hbs | 2 +- .../admin/templates/site-settings.hbs | 6 +- .../admin-site-settings-test.js.es6 | 45 +++++++++++++ .../javascripts/fixtures/site_settings.js.es6 | 63 +++++++++++++++++++ 5 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 test/javascripts/acceptance/admin-site-settings-test.js.es6 create mode 100644 test/javascripts/fixtures/site_settings.js.es6 diff --git a/app/assets/javascripts/admin/mixins/setting-component.js.es6 b/app/assets/javascripts/admin/mixins/setting-component.js.es6 index 9636c47732d..532abe8f20c 100644 --- a/app/assets/javascripts/admin/mixins/setting-component.js.es6 +++ b/app/assets/javascripts/admin/mixins/setting-component.js.es6 @@ -84,7 +84,7 @@ export default Ember.Mixin.create({ this.$().on("keydown.setting-enter", ".input-setting-string", function(e) { if (e.keyCode === 13) { // enter key - self._save(); + self.send("save"); } }); }.on("didInsertElement"), @@ -122,7 +122,7 @@ export default Ember.Mixin.create({ resetDefault() { this.set("buffered.value", this.get("setting.default")); - this._save(); + this.send("save"); }, toggleSecret() { diff --git a/app/assets/javascripts/admin/templates/components/site-setting.hbs b/app/assets/javascripts/admin/templates/components/site-setting.hbs index 03e5433fd05..558781c33d5 100644 --- a/app/assets/javascripts/admin/templates/components/site-setting.hbs +++ b/app/assets/javascripts/admin/templates/components/site-setting.hbs @@ -13,5 +13,5 @@ {{#if setting.secret}} {{d-button action="toggleSecret" icon="eye-slash"}} {{/if}} - {{d-button action="resetDefault" icon="undo" label="admin.settings.reset"}} + {{d-button class="undo" action="resetDefault" icon="undo" label="admin.settings.reset"}} {{/if}} diff --git a/app/assets/javascripts/admin/templates/site-settings.hbs b/app/assets/javascripts/admin/templates/site-settings.hbs index 61e57209b76..8a1b8afcf3b 100644 --- a/app/assets/javascripts/admin/templates/site-settings.hbs +++ b/app/assets/javascripts/admin/templates/site-settings.hbs @@ -1,9 +1,9 @@
- +
{{d-button action="toggleMenu" class="menu-toggle" icon="bars"}} - {{text-field value=filter placeholderKey="type_to_filter" class="no-blur"}} - {{d-button action="clearFilter" label="admin.site_settings.clear_filter"}} + {{text-field id="setting-filter" value=filter placeholderKey="type_to_filter" class="no-blur"}} + {{d-button id="clear-filter" action="clearFilter" label="admin.site_settings.clear_filter"}}