mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 03:42:27 +03:00
8f1cca9f9d
refs https://github.com/TryGhost/Team/issues/1294 - added `dashboardHideGettingStarted` feature flag that uses the `user.accessibility` JSON blob - added `{{toggle-feature}}` helper which returns a function that can be used with the `{{on}}` helper to toggle a feature flag on or off from templates - hooked up the dismiss behaviour for the dashboard widget using the `toggle-feature` helper - hid the dashboard when `dashboardHideGettingStarted` feature is enabled
14 lines
351 B
JavaScript
14 lines
351 B
JavaScript
import Helper from '@ember/component/helper';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class ToggleFeature extends Helper {
|
|
@service feature;
|
|
|
|
compute([featureFlag]) {
|
|
return () => {
|
|
const flag = !!this.feature.get(featureFlag);
|
|
this.feature.set(featureFlag, !flag);
|
|
};
|
|
}
|
|
}
|