github.com/hernad/nomad@v1.6.112/ui/app/abilities/recommendation.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import AbstractAbility from './abstract';
     7  import { computed } from '@ember/object';
     8  import { and, or } from '@ember/object/computed';
     9  
    10  export default class Recommendation extends AbstractAbility {
    11    @and('dynamicApplicationSizingIsPresent', 'hasPermissions')
    12    canAccept;
    13  
    14    @or(
    15      'bypassAuthorization',
    16      'selfTokenIsManagement',
    17      'policiesSupportAcceptingOnAnyNamespace'
    18    )
    19    hasPermissions;
    20  
    21    @computed('capabilitiesForAllNamespaces.[]')
    22    get policiesSupportAcceptingOnAnyNamespace() {
    23      return this.capabilitiesForAllNamespaces.includes('submit-job');
    24    }
    25  
    26    @computed('features.[]')
    27    get dynamicApplicationSizingIsPresent() {
    28      return this.featureIsPresent('Dynamic Application Sizing');
    29    }
    30  }