Fixed custom theme settings not showing in groups

no issue

- custom theme model was missing the `group` attr so the nav menu couldn't see it to assign to groups
- changed homepage group from `home` to `homepage` to match gscan
- added fallback to showing in the "Site-wide" group if an unknown group value is seen
This commit is contained in:
Kevin Ansfield 2021-10-12 07:36:03 +01:00
parent b2177e636e
commit ddac463514
2 changed files with 6 additions and 3 deletions

View File

@ -14,6 +14,8 @@ export default class DesignMenuComponent extends Component {
@tracked openSections = new TrackedSet();
KNOWN_GROUPS = ['homepage', 'post'];
constructor() {
super(...arguments);
this.fetchThemeSettingsTask.perform();
@ -25,11 +27,11 @@ export default class DesignMenuComponent extends Component {
}
get siteWideSettings() {
return this.customThemeSettings.settings.filter(setting => !setting.group);
return this.customThemeSettings.settings.filter(setting => !this.KNOWN_GROUPS.includes(setting.group));
}
get homepageSettings() {
return this.customThemeSettings.settings.filter(setting => setting.group === 'home');
return this.customThemeSettings.settings.filter(setting => setting.group === 'homepage');
}
get postPageSettings() {

View File

@ -5,5 +5,6 @@ export default Model.extend({
type: attr('string'),
options: attr(),
default: attr('string'),
value: attr('string')
value: attr('string'),
group: attr('string')
});