open-nomad/ui/app/abilities/recommendation.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
715 B
JavaScript
Raw Normal View History

import AbstractAbility from './abstract';
import { computed } from '@ember/object';
import { and, or } from '@ember/object/computed';
export default class Recommendation extends AbstractAbility {
@and('dynamicApplicationSizingIsPresent', 'hasPermissions')
canAccept;
2021-12-28 16:08:12 +00:00
@or(
'bypassAuthorization',
'selfTokenIsManagement',
'policiesSupportAcceptingOnAnyNamespace'
)
hasPermissions;
@computed('capabilitiesForAllNamespaces.[]')
get policiesSupportAcceptingOnAnyNamespace() {
return this.capabilitiesForAllNamespaces.includes('submit-job');
}
@computed('features.[]')
get dynamicApplicationSizingIsPresent() {
return this.featureIsPresent('Dynamic Application Sizing');
}
}