From ac215e200f32772050054e28496d2fca45dde9a6 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Mon, 14 Feb 2022 11:24:58 -0500 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20simplify=20host=20ca?= =?UTF-8?q?talog=20modeling=20and=20normalization?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/addon/generated/models/host-catalog.js | 5 ----- addons/api/addon/serializers/host-catalog.js | 8 -------- addons/api/tests/unit/serializers/host-catalog-test.js | 8 -------- 3 files changed, 21 deletions(-) diff --git a/addons/api/addon/generated/models/host-catalog.js b/addons/api/addon/generated/models/host-catalog.js index 0591352e2..660711a70 100644 --- a/addons/api/addon/generated/models/host-catalog.js +++ b/addons/api/addon/generated/models/host-catalog.js @@ -39,11 +39,6 @@ export default class GeneratedHostCatalogModel extends BaseModel { }) disabled; - @attr({ - description: 'Attributes specific to the catalog type', - }) - attributes; - @attr('number', { description: 'Current version number of this resource.', }) diff --git a/addons/api/addon/serializers/host-catalog.js b/addons/api/addon/serializers/host-catalog.js index f5d1cd983..77c78c680 100644 --- a/addons/api/addon/serializers/host-catalog.js +++ b/addons/api/addon/serializers/host-catalog.js @@ -1,5 +1,4 @@ import ApplicationSerializer from './application'; -import { copy } from 'ember-copy'; const fieldsByType = { aws: [ @@ -57,11 +56,4 @@ export default class HostCatalogSerializer extends ApplicationSerializer { delete serialized.secrets; return serialized; } - - normalize(typeClass, hash, ...rest) { - let normalizedHash = copy(hash, true); - const normalized = super.normalize(typeClass, normalizedHash, ...rest); - delete normalized.data.attributes.attributes; - return normalized; - } } diff --git a/addons/api/tests/unit/serializers/host-catalog-test.js b/addons/api/tests/unit/serializers/host-catalog-test.js index 2811dea39..8b1af8c94 100644 --- a/addons/api/tests/unit/serializers/host-catalog-test.js +++ b/addons/api/tests/unit/serializers/host-catalog-test.js @@ -190,10 +190,6 @@ module('Unit | Serializer | host catalog', function (hooks) { description: 'Test description', authorized_actions: ['no-op'], type: 'static', - access_key_id: null, - secret_access_key: null, - secret_id: null, - secret_value: null, }, relationships: {}, }, @@ -249,8 +245,6 @@ module('Unit | Serializer | host catalog', function (hooks) { region: 'Illinois', access_key_id: '0xF3B0a6f8', secret_access_key: 'zq{2:IVc8@W^', - secret_id: null, - secret_value: null, }, relationships: {}, }, @@ -310,8 +304,6 @@ module('Unit | Serializer | host catalog', function (hooks) { client_id: 'client', tenant_id: 'tenant', subscription_id: 'subscription', - access_key_id: null, - secret_access_key: null, }, relationships: {}, },