Files
threshold-ui/addons/api/addon/models/fragment-scope.js
T

36 lines
754 B
JavaScript
Raw Normal View History

import Fragment from 'ember-data-model-fragments/fragment';
import { computed } from '@ember/object';
import { attr } from '@ember-data/model';
import { scopeTypes } from './scope';
2020-07-22 12:44:41 -04:00
export default class FragmentScope extends Fragment {
// =attributes
@attr('string', {
description: 'ID of the related scope'
}) scope_id;
@attr('string', {
description: 'The type of the resource'
}) type;
/**
* @type {boolean}
*/
@computed('type')
get isGlobal() { return this.type === scopeTypes.global; }
/**
* @type {boolean}
*/
@computed('type')
get isOrg() { return this.type === scopeTypes.org; }
/**
* @type {boolean}
*/
@computed('type')
get isProject() { return this.type === scopeTypes.project; }
}