FIX: Correct issues in admin-theme-editor (#20435)
Followup to a433b30650
- `discourseComputed` -> `computed` on a getter (human error)
- `this.model` -> `this.theme` (human error)
- missing `setField` target param (human error)
- `onlyOverriddenChanged` and `save` action method name clashes (native-class-codemod error)
This commit is contained in:
parent
c052df412a
commit
ad0fd9919b
|
@ -44,7 +44,7 @@
|
||||||
@checked={{this.onlyOverridden}}
|
@checked={{this.onlyOverridden}}
|
||||||
{{on
|
{{on
|
||||||
"click"
|
"click"
|
||||||
(action "onlyOverriddenChanged" value="target.checked")
|
(action this.onlyOverriddenChanged value="target.checked")
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{{i18n "admin.customize.theme.hide_unused_fields"}}
|
{{i18n "admin.customize.theme.hide_unused_fields"}}
|
||||||
|
@ -125,6 +125,6 @@
|
||||||
@autofocus="true"
|
@autofocus="true"
|
||||||
@placeholder={{this.placeholder}}
|
@placeholder={{this.placeholder}}
|
||||||
@htmlPlaceholder={{true}}
|
@htmlPlaceholder={{true}}
|
||||||
@save={{action "save"}}
|
@save={{this.save}}
|
||||||
@setWarning={{action "setWarning"}}
|
@setWarning={{action "setWarning"}}
|
||||||
/>
|
/>
|
|
@ -3,7 +3,7 @@ import I18n from "I18n";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import { fmt } from "discourse/lib/computed";
|
import { fmt } from "discourse/lib/computed";
|
||||||
import { isDocumentRTL } from "discourse/lib/text-direction";
|
import { isDocumentRTL } from "discourse/lib/text-direction";
|
||||||
import { action } from "@ember/object";
|
import { action, computed } from "@ember/object";
|
||||||
import { next } from "@ember/runloop";
|
import { next } from "@ember/runloop";
|
||||||
|
|
||||||
export default class AdminThemeEditor extends Component {
|
export default class AdminThemeEditor extends Component {
|
||||||
|
@ -62,13 +62,13 @@ export default class AdminThemeEditor extends Component {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@discourseComputed("fieldName", "currentTargetName", "theme")
|
@computed("fieldName", "currentTargetName", "theme")
|
||||||
get activeSection() {
|
get activeSection() {
|
||||||
return this.model.getField(this.currentTargetName, this.fieldName);
|
return this.theme.getField(this.currentTargetName, this.fieldName);
|
||||||
}
|
}
|
||||||
|
|
||||||
set activeSection(value) {
|
set activeSection(value) {
|
||||||
this.theme.setField(this.fieldName, value);
|
this.theme.setField(this.currentTargetName, this.fieldName, value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,16 +126,6 @@ export default class AdminThemeEditor extends Component {
|
||||||
this.fieldAdded(this.currentTargetName, name);
|
this.fieldAdded(this.currentTargetName, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
|
||||||
onlyOverriddenChanged(value) {
|
|
||||||
this.onlyOverriddenChanged(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@action
|
|
||||||
save() {
|
|
||||||
this.attrs.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
@action
|
@action
|
||||||
setWarning(message) {
|
setWarning(message) {
|
||||||
this.set("warning", message);
|
this.set("warning", message);
|
||||||
|
|
Loading…
Reference in New Issue