Use compositeType in isAws and isAzure
This commit is contained in:
1 parent
4c0cc5375b
commit
cc20e5a076
2 files changed
+5
-3
No files matched your search
@@ -22,7 +22,7 @@ export default class HostCatalogModel extends GeneratedHostCatalogModel {
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isAWS() {
|
||||
return this.plugin.name === 'aws';
|
||||
return this.compositeType === 'aws';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,7 @@ export default class HostCatalogModel extends GeneratedHostCatalogModel {
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isAzure() {
|
||||
return this.plugin.name === 'azure';
|
||||
return this.compositeType === 'azure';
|
||||
}
|
||||
|
||||
/** If host-catalog is a plugins returns its name,
|
||||
@@ -49,7 +49,7 @@ export default class HostCatalogModel extends GeneratedHostCatalogModel {
|
||||
this.type = 'static';
|
||||
} else {
|
||||
this.type = 'plugin';
|
||||
this.plugin.name = type;
|
||||
this.plugin = { name: type }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ module('Unit | Model | host catalog', function (hooks) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelAws = store.createRecord('host-catalog', {
|
||||
type: 'plugin',
|
||||
plugin: { name: 'aws' },
|
||||
});
|
||||
const modelRandom = store.createRecord('host-catalog', {
|
||||
@@ -48,6 +49,7 @@ module('Unit | Model | host catalog', function (hooks) {
|
||||
assert.expect(3);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelAzure = store.createRecord('host-catalog', {
|
||||
type: 'plugin',
|
||||
plugin: { name: 'azure' },
|
||||
});
|
||||
const modelRandom = store.createRecord('host-catalog', {
|
||||
|
||||
Reference in new issue
Block a user