Michael Klein 123047d5b5
ui: use environment variable for feature flagging peers (#13703)
* ui: use environment variable for feature flagging peers

* Add documentation for `features`-service

* Allow setting feature flag for peers via bookmarklet

* don't use features service for flagging peers

* add ability for checking if peers feature is enabled

* Use abilities to conditionally use peers feature

* Remove unused features service
2022-07-12 12:02:45 +01:00

22 lines
503 B
JavaScript

import BaseAbility from 'consul-ui/abilities/base';
import { inject as service } from '@ember/service';
export default class PeerAbility extends BaseAbility {
@service('env') env;
resource = 'operator';
segmented = false;
get isLinkable() {
return this.canDelete;
}
get canDelete() {
// TODO: Need to confirm these states
return !['DELETING', 'TERMINATED', 'UNDEFINED'].includes(this.item.State);
}
get canUse() {
return this.env.var('CONSUL_PEERING_ENABLED');
}
}