From cbc732e9dd60d13dc9971b7dfa9e7d68a32d62d4 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 26 Jan 2022 12:30:21 -0800 Subject: [PATCH] Move mirage plugin field to a factory. Now plugin inherits from host-catalog --- addons/api/mirage/factories/host-set.js | 5 +++++ addons/api/mirage/generated/factories/host-set.js | 9 --------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/addons/api/mirage/factories/host-set.js b/addons/api/mirage/factories/host-set.js index 3b88650b7..dec391c17 100644 --- a/addons/api/mirage/factories/host-set.js +++ b/addons/api/mirage/factories/host-set.js @@ -12,4 +12,9 @@ export default factory.extend({ 'remove-hosts', ], id: (i) => `host-set-id-${i}`, + plugin() { + if (this.type === 'plugin') { + return this.hostCatalog.plugin; + } + }, }); diff --git a/addons/api/mirage/generated/factories/host-set.js b/addons/api/mirage/generated/factories/host-set.js index 84e635d58..5e0e4836e 100644 --- a/addons/api/mirage/generated/factories/host-set.js +++ b/addons/api/mirage/generated/factories/host-set.js @@ -11,13 +11,4 @@ export default Factory.extend({ updated_time: () => date.recent(), version: () => datatype.number(), size: () => datatype.number(), - plugin: function (i) { - if (this.type == 'plugin') { - return { - id: `pl_${datatype.hexaDecimal(5)}`, - name: i % 2 ? 'aws' : 'azure', - description: random.words(), - }; - } - }, });