diff --git a/addons/api/addon/models/host.js b/addons/api/addon/models/host.js index 62274032b..7748e023b 100644 --- a/addons/api/addon/models/host.js +++ b/addons/api/addon/models/host.js @@ -7,11 +7,4 @@ export default class HostModel extends GeneratedHostModel { * @type {FragmentHostAttributesModel} */ @fragment('fragment-host-attributes', { defaultValue: {} }) attributes; - - /** - * @type {boolean} - */ - get isStatic() { - return this.type === 'static'; - } } diff --git a/addons/api/mirage/factories/host-catalog.js b/addons/api/mirage/factories/host-catalog.js index c08d2786a..75bcc3928 100644 --- a/addons/api/mirage/factories/host-catalog.js +++ b/addons/api/mirage/factories/host-catalog.js @@ -18,9 +18,9 @@ export default factory.extend({ }, withChildren: trait({ afterCreate(hostCatalog, server) { - const { scope } = hostCatalog; - const hosts = server.createList('host', 10, { scope, hostCatalog }); - server.createList('host-set', 3, { scope, hostCatalog, hosts }); + const { scope, type } = hostCatalog; + const hosts = server.createList('host', 10, { scope, hostCatalog, type }); + server.createList('host-set', 3, { scope, hostCatalog, hosts, type }); }, }), }); diff --git a/addons/api/mirage/generated/factories/host-catalog.js b/addons/api/mirage/generated/factories/host-catalog.js index 36d5e64c6..1b2bb8af6 100644 --- a/addons/api/mirage/generated/factories/host-catalog.js +++ b/addons/api/mirage/generated/factories/host-catalog.js @@ -5,7 +5,7 @@ import { random, date, datatype } from 'faker'; * GeneratedHostCatalogModelFactory */ export default Factory.extend({ - type: 'static', + type: () => random.arrayElement(['static', 'plugin']), name: () => random.words(), description: () => random.words(), created_time: () => date.recent(), diff --git a/addons/api/mirage/generated/factories/host.js b/addons/api/mirage/generated/factories/host.js index 08ac8a5f3..db9de3b56 100644 --- a/addons/api/mirage/generated/factories/host.js +++ b/addons/api/mirage/generated/factories/host.js @@ -5,7 +5,7 @@ import { random, date, internet, datatype } from 'faker'; * GeneratedHostModelFactory */ export default Factory.extend({ - type: () => random.arrayElement(['static', 'plugin']), + type: 'static', name: () => random.words(), description: () => random.words(), created_time: () => date.recent(), diff --git a/addons/api/tests/unit/models/host-test.js b/addons/api/tests/unit/models/host-test.js index 9cd08b5aa..625774e71 100644 --- a/addons/api/tests/unit/models/host-test.js +++ b/addons/api/tests/unit/models/host-test.js @@ -22,14 +22,4 @@ module('Unit | Model | host', function (hooks) { }); assert.equal(model.attributes.address, '127.0.0.1'); }); - - test('it has isStatic function and returns the expected values', async function (assert) { - assert.expect(3); - const store = this.owner.lookup('service:store'); - const modelA = store.createRecord('host', { type: 'static' }); - const modelB = store.createRecord('host', { type: 'plugin' }); - assert.equal(typeof modelA.isStatic, 'boolean'); - assert.true(modelA.isStatic); - assert.false(modelB.isStatic); - }); }); diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs index eb69b4d5d..afd87cccc 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs @@ -11,41 +11,39 @@
{{host.description}}
-{{host.id}}
- {{host.attributes.address}}
- {{host.description}}
+ +{{host.id}}
+ {{host.attributes.address}}
+