mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 19:02:29 +03:00
23 lines
565 B
JavaScript
23 lines
565 B
JavaScript
|
import Helper from '@ember/component/helper';
|
||
|
import {get} from '@ember/object';
|
||
|
import {inject as service} from '@ember/service';
|
||
|
|
||
|
export default class CardIsAvailableHelper extends Helper {
|
||
|
@service config;
|
||
|
@service feature;
|
||
|
|
||
|
compute([card]) {
|
||
|
let cardIsAvailable = true;
|
||
|
|
||
|
if (card.developerExperiment) {
|
||
|
cardIsAvailable = this.config.get('enableDeveloperExperiments');
|
||
|
}
|
||
|
|
||
|
if (card.feature) {
|
||
|
cardIsAvailable = get(this.feature, card.feature);
|
||
|
}
|
||
|
|
||
|
return cardIsAvailable;
|
||
|
}
|
||
|
}
|