Added auto-check of match helper flag when enabling custom theme settings

no issue

- custom themes settings isn't really usable without the `{{match}}` helper so to help avoid confusion we'll now enable it whenever the custom theme settings flag is enabled
- added `requires` array to the feature definition which when set will enable all flags in the array when the main feature is enabled
This commit is contained in:
Kevin Ansfield 2021-10-12 15:33:03 +01:00
parent 3477be5974
commit 3f7cdb34d9

View File

@ -56,7 +56,7 @@ export default Service.extend({
multipleProducts: feature('multipleProducts'),
offers: feature('offers', {developer: true}),
oauthLogin: feature('oauthLogin', {developer: true}),
customThemeSettings: feature('customThemeSettings', {developer: true}),
customThemeSettings: feature('customThemeSettings', {developer: true, requires: ['matchHelper']}),
membersActivity: feature('membersActivity', {developer: true}),
_user: null,
@ -96,6 +96,12 @@ export default Service.extend({
// set the new key value for either the labs property or the accessibility property
set(featureObject, key, value);
if (options.requires && value === true) {
options.requires.forEach((flag) => {
set(featureObject, flag, true);
});
}
// update the 'labs' or 'accessibility' key of the model
model.set(serviceProperty, JSON.stringify(featureObject));