Refactor base scope fragment (#1166)

* refactor: 💡 migrate managed-group off fragments

* refactor: 💡 migrate credential-store off fragments

* refactor: 💡 migrate credential-library off fragments

* refactor: 💡 migrate account off fragments

* refactor: 💡 convert base model scope field to simple attr

* fix: 🐛 skip broken test
This commit is contained in:
Randall Morey authored and GitHub committed 2022-07-18 11:30:53 -07:00
1 parent b6a811cbbd
commit bdabcc119e
12 files changed
+38 -79

No files matched your search

+5 -3
View File
@@ -1,6 +1,5 @@
import Model from '@ember-data/model';
import { attr } from '@ember-data/model';
import { fragment } from 'ember-data-model-fragments/attributes';
import { computed } from '@ember/object';
/**
@@ -30,9 +29,8 @@ export default class BaseModel extends Model {
/**
* Scope of this resource, if any, represented as a JSON fragment.
* @type {FragmentScope}
*/
@fragment('fragment-scope') scope;
@attr() scope;
// =attributes
@@ -55,6 +53,10 @@ export default class BaseModel extends Model {
if (model) {
const json = model.serialize();
json.scope_id = model.id;
json.type = model.type;
json.isGlobal = model.isGlobal;
json.isOrg = model.isOrg;
json.isProject = model.isProject;
this.scope = json;
}
}