From de4955eb608c8d42be2ff4c4ea4ab0f0fd4cb72c Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 25 Jan 2022 16:12:03 -0800 Subject: [PATCH 01/18] =?UTF-8?q?fix:=20=F0=9F=90=9B=20add=20radiocard=20s?= =?UTF-8?q?upport=20to=20group?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rose/form/radio/group/index.hbs | 7 +- .../rose/form/radio/group/index.stories.mdx | 156 ++++++++++++++++++ .../styles/rose/components/form/_radio.scss | 11 ++ 3 files changed, 172 insertions(+), 2 deletions(-) diff --git a/addons/rose/addon/components/rose/form/radio/group/index.hbs b/addons/rose/addon/components/rose/form/radio/group/index.hbs index de2b010b6..11f60d571 100644 --- a/addons/rose/addon/components/rose/form/radio/group/index.hbs +++ b/addons/rose/addon/components/rose/form/radio/group/index.hbs @@ -1,3 +1,6 @@ -{{yield (hash +
+ {{yield (hash radio=(component 'rose/form/radio/radio' name=@name selectedValue=@selectedValue disabled=@disabled changed=@changed inline=@inline) -)}} \ No newline at end of file + card=(component 'rose/form/radio/card' name=@name selectedValue=@selectedValue disabled=@disabled changed=@changed inline=@inline layout=@layout) +)}} +
\ No newline at end of file diff --git a/addons/rose/addon/components/rose/form/radio/group/index.stories.mdx b/addons/rose/addon/components/rose/form/radio/group/index.stories.mdx index e8b8a087a..6425e79d6 100644 --- a/addons/rose/addon/components/rose/form/radio/group/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/radio/group/index.stories.mdx @@ -81,3 +81,159 @@ Renders a form radiofield group. } }} + +```htmlbars + + + + + +``` + + {{ + template: hbs` + + + + + + `, + context: { + name: text('name', 'mustagree'), + disabled: boolean('disabled', false), + inline: boolean('inline', true), + selectedValue: text('selectedValue', 'disagree'), + firstFieldLabel: text('first label', 'Agree'), + firstFieldValue: text('first value', 'agree'), + firstFieldIcon: select( + 'firstFieldIcon', + { + 'none': null, + 'flight-icons/svg/azure-color-16': 'flight-icons/svg/azure-color-16', + }, + null + ), + secondFieldLabel: text('second label', 'Maybe'), + secondFieldValue: text('second value', 'maybe'), + thirdFieldLabel: text('third label', 'Disagree'), + thirdFieldValue: text('third value', 'disagree'), + changed: action('changed') + } + }} + + +```htmlbars + + + + +``` + + {{ + template: hbs` + + + + + + `, + context: { + name: text('name', 'mustagree'), + disabled: boolean('disabled', false), + inline: boolean('inline', true), + selectedValue: text('selectedValue', 'disagree'), + firstFieldLabel: text('first label', 'Agree'), + firstFieldValue: text('first value', 'agree'), + firstFieldIcon: select( + 'firstFieldIcon', + { + 'none': null, + 'flight-icons/svg/azure-color-16': 'flight-icons/svg/azure-color-16', + }, + null + ), + secondFieldLabel: text('second label', 'Maybe'), + secondFieldValue: text('second value', 'maybe'), + thirdFieldLabel: text('third label', 'Disagree'), + thirdFieldValue: text('third value', 'disagree'), + changed: action('changed') + } + }} + \ No newline at end of file diff --git a/addons/rose/addon/styles/rose/components/form/_radio.scss b/addons/rose/addon/styles/rose/components/form/_radio.scss index 32be9a8c5..8c41f98c2 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio.scss @@ -22,6 +22,17 @@ $radio-svg: ( ); $data-svg-prefix: 'data:image/svg+xml;utf-8,'; +.radio-field-wrapper { + &.inline { + display: inline-flex; + .rose-form-radio-label { + margin-right: sizing.rems(s); + } + } + .rose-form-radio-card { + margin-bottom: sizing.rems(s); + } +} .rose-form-radio { &.inline { display: inline-block; From 26887b3cfe5d0420563d66946d0406f689573214 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 26 Jan 2022 07:56:36 -0800 Subject: [PATCH 02/18] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Add=20basic=20type?= =?UTF-8?q?=20support=20for=20host-set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add basic type support for host-set --- addons/api/addon/generated/models/host-set.js | 6 ++ addons/api/addon/models/host-set.js | 52 ++++++++++++ .../mirage/generated/factories/host-set.js | 9 +++ addons/api/tests/unit/models/host-set-test.js | 80 +++++++++++++++++++ 4 files changed, 147 insertions(+) diff --git a/addons/api/addon/generated/models/host-set.js b/addons/api/addon/generated/models/host-set.js index 44c0991d6..048badc73 100644 --- a/addons/api/addon/generated/models/host-set.js +++ b/addons/api/addon/generated/models/host-set.js @@ -50,4 +50,10 @@ export default class GeneratedHostSetModel extends BaseModel { readOnly: true, }) size; + + @attr({ + description: 'Plugin information for this resource', + readOnly: true, + }) + plugin; } diff --git a/addons/api/addon/models/host-set.js b/addons/api/addon/models/host-set.js index 66dd96d52..b453195d1 100644 --- a/addons/api/addon/models/host-set.js +++ b/addons/api/addon/models/host-set.js @@ -4,6 +4,58 @@ import { fragmentArray } from 'ember-data-model-fragments/attributes'; export default class HostSetModel extends GeneratedHostSetModel { // =attributes + /** + * Returns if the host-set is static or not. + * @type {boolean} + */ + get isStatic() { + return this.type === 'static'; + } + + /** + * Returns if the host-set is plugin or not. + * @type {boolean} + */ + get isPlugin() { + return this.type === 'plugin'; + } + + /** + * Returns if a host-set plugin is AWS or not + * @type {boolean} + */ + get isAWS() { + return this.compositeType === 'aws'; + } + + /** + * Return if a host-set plugin is Azure or not. + */ + get isAzure() { + return this.compositeType === 'azure'; + } + + /** + * If a host-set is a plugin return its name, + * otherwise returns the host-set type + * @type {string} + */ + get compositeType() { + return this.plugin ? this.plugin.name : this.type; + } + + /** + * Sets type, if type is different than static, set plugin name to type + */ + set compositeType(type) { + if (type === 'static') { + this.type = 'static'; + } else { + this.type = 'plugin'; + this.plugin = { name: type }; + } + } + /** * Host IDs are read-only under normal circumstances. But these can * be persisted via a dedicated call to `addHosts()`. diff --git a/addons/api/mirage/generated/factories/host-set.js b/addons/api/mirage/generated/factories/host-set.js index 9a8000ef9..057b88926 100644 --- a/addons/api/mirage/generated/factories/host-set.js +++ b/addons/api/mirage/generated/factories/host-set.js @@ -12,4 +12,13 @@ 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(), + }; + } + }, }); diff --git a/addons/api/tests/unit/models/host-set-test.js b/addons/api/tests/unit/models/host-set-test.js index f1cf1c110..33189d3d4 100644 --- a/addons/api/tests/unit/models/host-set-test.js +++ b/addons/api/tests/unit/models/host-set-test.js @@ -129,4 +129,84 @@ module('Unit | Model | host set', function (hooks) { const model = store.peekRecord('host-set', '123abc'); await model.removeHost('3'); }); + + test('it has isStatic and returns the expected values', async function (assert) { + assert.expect(3); + const store = this.owner.lookup('service:store'); + const modelA = store.createRecord('host-set', { type: 'static' }); + const modelB = store.createRecord('host-set', { type: 'plugin' }); + assert.equal(typeof modelA.isStatic, 'boolean'); + assert.true(modelA.isStatic); + assert.false(modelB.isStatic); + }); + + test('it has isPlugin and returns the expected values', async function (assert) { + assert.expect(3); + const store = this.owner.lookup('service:store'); + const modelPlugin = store.createRecord('host-set', { type: 'plugin' }); + const modelStatic = store.createRecord('host-set', { type: 'static' }); + assert.equal(typeof modelPlugin.isPlugin, 'boolean'); + assert.true(modelPlugin.isPlugin); + assert.false(modelStatic.isPlugin); + }); + + test('it has isAws and return the expected values', async function (assert) { + assert.expect(3); + const store = this.owner.lookup('service:store'); + const modelAws = store.createRecord('host-set', { + type: 'plugin', + plugin: { name: 'aws' }, + }); + const modelRandom = store.createRecord('host-set', { + plugin: { name: 'random' }, + }); + assert.equal(typeof modelAws.isAWS, 'boolean'); + assert.true(modelAws.isAWS); + assert.false(modelRandom.isAWS); + }); + + test('it has isAzure and return the expected values', async function (assert) { + assert.expect(3); + const store = this.owner.lookup('service:store'); + const modelAzure = store.createRecord('host-set', { + type: 'plugin', + plugin: { name: 'azure' }, + }); + const modelRandom = store.createRecord('host-set', { + plugin: { name: 'random' }, + }); + assert.equal(typeof modelAzure.isAzure, 'boolean'); + assert.true(modelAzure.isAzure); + assert.false(modelRandom.isAzure); + }); + + test('get compositeType return expected values', async function (assert) { + assert.expect(3); + const store = this.owner.lookup('service:store'); + const modelPlugin = store.createRecord('host-set', { + type: 'plugin', + plugin: { name: 'Test name' }, + }); + const modelStatic = store.createRecord('host-set', { + type: 'static', + }); + assert.equal(typeof modelPlugin.compositeType, 'string'); + assert.equal(modelPlugin.compositeType, 'Test name'); + assert.equal(modelStatic.compositeType, 'static'); + }); + + test('set compositeType sets expected values', async function (assert) { + assert.expect(3); + const store = this.owner.lookup('service:store'); + const modelPlugin = store.createRecord('host-set', { + compositeType: 'aws', + }); + const modelStatic = store.createRecord('host-set', { + compositeType: 'static', + }); + + assert.equal(modelPlugin.type, 'plugin'); + assert.equal(modelPlugin.plugin.name, 'aws'); + assert.equal(modelStatic.type, 'static'); + }); }); From 995c79804a703a7f5b858f4b9d6366d8228ebddc Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 26 Jan 2022 07:59:27 -0800 Subject: [PATCH 03/18] Add random type values in mirage --- addons/api/mirage/generated/factories/host-set.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/api/mirage/generated/factories/host-set.js b/addons/api/mirage/generated/factories/host-set.js index 057b88926..9d14e3e4f 100644 --- a/addons/api/mirage/generated/factories/host-set.js +++ b/addons/api/mirage/generated/factories/host-set.js @@ -5,7 +5,7 @@ import { random, date, datatype } from 'faker'; * GeneratedHostSetModelFactory */ export default Factory.extend({ - type: 'static', + type: () => random.arrayElement(['static', 'plugin']), name: () => random.words(), description: () => random.words(), created_time: () => date.recent(), From 3c794dfa4be0e6398eca02ba7af41bb4dee40dae Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 26 Jan 2022 08:26:32 -0800 Subject: [PATCH 04/18] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Add=20type=20badge?= =?UTF-8?q?s=20for=20host-set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add type badges for host-set --- .../host-catalog/host-sets/index.hbs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/index.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/index.hbs index 3868852e4..b13cf374d 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/index.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/index.hbs @@ -25,9 +25,21 @@

{{hostSet.description}}

- - {{t (concat 'resources.host-set.types.' hostSet.type)}} - + {{#if hostSet.isStatic}} + + {{t (concat 'resources.host-set.types.' hostSet.type)}} + + {{else}} + + {{hostSet.compositeType}} + + {{/if}} Date: Wed, 26 Jan 2022 10:11:25 -0800 Subject: [PATCH 05/18] Type gets inherit from host-catalog --- addons/api/mirage/generated/factories/host-set.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/api/mirage/generated/factories/host-set.js b/addons/api/mirage/generated/factories/host-set.js index 9d14e3e4f..84e635d58 100644 --- a/addons/api/mirage/generated/factories/host-set.js +++ b/addons/api/mirage/generated/factories/host-set.js @@ -5,7 +5,6 @@ import { random, date, datatype } from 'faker'; * GeneratedHostSetModelFactory */ export default Factory.extend({ - type: () => random.arrayElement(['static', 'plugin']), name: () => random.words(), description: () => random.words(), created_time: () => date.recent(), From 36375ae0be0f2e241f9028691c2fdad17c53a65a Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 26 Jan 2022 11:43:30 -0800 Subject: [PATCH 06/18] =?UTF-8?q?fix:=20=F0=9F=90=9B=20remove=20wrapper=20?= =?UTF-8?q?and=20make=20card=20always=20inline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rose/form/radio/group/index.hbs | 4 +--- .../rose/form/radio/group/index.stories.mdx | 22 +++++++++++++++---- .../rose/components/form/_radio-card.scss | 2 +- .../styles/rose/components/form/_radio.scss | 11 ---------- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/addons/rose/addon/components/rose/form/radio/group/index.hbs b/addons/rose/addon/components/rose/form/radio/group/index.hbs index 11f60d571..187aad87b 100644 --- a/addons/rose/addon/components/rose/form/radio/group/index.hbs +++ b/addons/rose/addon/components/rose/form/radio/group/index.hbs @@ -1,6 +1,4 @@ -
{{yield (hash radio=(component 'rose/form/radio/radio' name=@name selectedValue=@selectedValue disabled=@disabled changed=@changed inline=@inline) - card=(component 'rose/form/radio/card' name=@name selectedValue=@selectedValue disabled=@disabled changed=@changed inline=@inline layout=@layout) + card=(component 'rose/form/radio/card' name=@name selectedValue=@selectedValue disabled=@disabled changed=@changed layout=@layout) )}} -
\ No newline at end of file diff --git a/addons/rose/addon/components/rose/form/radio/group/index.stories.mdx b/addons/rose/addon/components/rose/form/radio/group/index.stories.mdx index 6425e79d6..9e2c01009 100644 --- a/addons/rose/addon/components/rose/form/radio/group/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/radio/group/index.stories.mdx @@ -119,7 +119,6 @@ Renders a form radiofield group. @name={{name}} @selectedValue={{selectedValue}} @changed={{changed}} - @inline={{inline}} as |radioGroup| > @@ -143,7 +144,6 @@ Renders a form radiofield group. context: { name: text('name', 'mustagree'), disabled: boolean('disabled', false), - inline: boolean('inline', true), selectedValue: text('selectedValue', 'disagree'), firstFieldLabel: text('first label', 'Agree'), firstFieldValue: text('first value', 'agree'), @@ -154,6 +154,22 @@ Renders a form radiofield group. 'flight-icons/svg/azure-color-16': 'flight-icons/svg/azure-color-16', }, null + ), + secondFieldIcon: select( + 'secondFieldIcon', + { + 'none': null, + 'flight-icons/svg/azure-color-16': 'flight-icons/svg/azure-color-16', + }, + null + ), + thirdFieldIcon: select( + 'thirdFieldIcon', + { + 'none': null, + 'flight-icons/svg/azure-color-16': 'flight-icons/svg/azure-color-16', + }, + null ), secondFieldLabel: text('second label', 'Maybe'), secondFieldValue: text('second value', 'maybe'), @@ -193,7 +209,6 @@ Renders a form radiofield group. @name={{name}} @selectedValue={{selectedValue}} @changed={{changed}} - @inline={{inline}} as |radioGroup| > Date: Wed, 26 Jan 2022 12:30:21 -0800 Subject: [PATCH 07/18] 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(), - }; - } - }, }); From f0b21521303e5561130c003f2362182593b90d40 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 26 Jan 2022 12:34:31 -0800 Subject: [PATCH 08/18] Inherit type from host-catalog --- addons/api/mirage/generated/factories/host-set.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/api/mirage/generated/factories/host-set.js b/addons/api/mirage/generated/factories/host-set.js index 5e0e4836e..adb20315c 100644 --- a/addons/api/mirage/generated/factories/host-set.js +++ b/addons/api/mirage/generated/factories/host-set.js @@ -5,6 +5,7 @@ import { random, date, datatype } from 'faker'; * GeneratedHostSetModelFactory */ export default Factory.extend({ + type: () => this.hostCatalog.type, name: () => random.words(), description: () => random.words(), created_time: () => date.recent(), From f28f113509fc504d2aed3a3d5bc9d2bd95755517 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 26 Jan 2022 13:27:47 -0800 Subject: [PATCH 09/18] =?UTF-8?q?fix:=20=F0=9F=90=9B=20adjust=20margin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/addon/styles/rose/components/form/_radio-card.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/addon/styles/rose/components/form/_radio-card.scss b/addons/rose/addon/styles/rose/components/form/_radio-card.scss index 4ed548c55..e948334f6 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio-card.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio-card.scss @@ -61,7 +61,7 @@ $radio-svg: ( display: inline-flex; align-items: center; justify-content: center; - + margin-right: $size-xs; .radio-card-overlay { position: absolute; height: $size-l + $size-xxs; From 87bb8e3e394fa0166adec80bff5ace183e63d1fa Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 26 Jan 2022 13:38:31 -0800 Subject: [PATCH 10/18] add margin bottom --- addons/rose/addon/styles/rose/components/form/_radio-card.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/rose/addon/styles/rose/components/form/_radio-card.scss b/addons/rose/addon/styles/rose/components/form/_radio-card.scss index e948334f6..d296245d6 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio-card.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio-card.scss @@ -62,6 +62,8 @@ $radio-svg: ( align-items: center; justify-content: center; margin-right: $size-xs; + margin-bottom: $size-s; + .radio-card-overlay { position: absolute; height: $size-l + $size-xxs; From 92b4dccf78c9e9940f5bd6fbc008538ee5f48c65 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 26 Jan 2022 13:42:58 -0800 Subject: [PATCH 11/18] Default state for type, then if there is host-catalog as parent, inherit its type --- addons/api/mirage/factories/host-set.js | 5 +++++ addons/api/mirage/generated/factories/host-set.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/api/mirage/factories/host-set.js b/addons/api/mirage/factories/host-set.js index dec391c17..d4372bef5 100644 --- a/addons/api/mirage/factories/host-set.js +++ b/addons/api/mirage/factories/host-set.js @@ -12,6 +12,11 @@ export default factory.extend({ 'remove-hosts', ], id: (i) => `host-set-id-${i}`, + type() { + if (this.hostCatalog) { + return this.hostCatalog.type; + } + }, 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 adb20315c..9a8000ef9 100644 --- a/addons/api/mirage/generated/factories/host-set.js +++ b/addons/api/mirage/generated/factories/host-set.js @@ -5,7 +5,7 @@ import { random, date, datatype } from 'faker'; * GeneratedHostSetModelFactory */ export default Factory.extend({ - type: () => this.hostCatalog.type, + type: 'static', name: () => random.words(), description: () => random.words(), created_time: () => date.recent(), From bb0eacb108933b99deadd5e3267d08fc6a699d76 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 26 Jan 2022 13:55:19 -0800 Subject: [PATCH 12/18] border-color change --- addons/rose/addon/styles/rose/components/form/_radio-card.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/addon/styles/rose/components/form/_radio-card.scss b/addons/rose/addon/styles/rose/components/form/_radio-card.scss index d296245d6..e8cdb0c1c 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio-card.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio-card.scss @@ -84,7 +84,7 @@ $radio-svg: ( position: relative; text-align: left; word-break: break-all; - border: $size-xxxxs solid var(--ui-gray-subtler-6); + border: $size-xxxxs solid var(--ui-gray-subtler-2); box-shadow: 0 $size-xxs $size-xxs rgba(var(--stark-components), var(--opacity-2)); border-radius: $size-xxs; From e7cf4c99a577bc9b91b4c4152d97a1f75ecd8855 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 26 Jan 2022 14:41:39 -0800 Subject: [PATCH 13/18] Refactor type in host-set factory --- addons/api/mirage/factories/host-set.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/api/mirage/factories/host-set.js b/addons/api/mirage/factories/host-set.js index d4372bef5..4bb6ad7bb 100644 --- a/addons/api/mirage/factories/host-set.js +++ b/addons/api/mirage/factories/host-set.js @@ -13,9 +13,7 @@ export default factory.extend({ ], id: (i) => `host-set-id-${i}`, type() { - if (this.hostCatalog) { - return this.hostCatalog.type; - } + return this.hostCatalog?.type || factory.attrs.type; }, plugin() { if (this.type === 'plugin') { From 27582e7c19383fdb02b3b1046c51d6bc76615872 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 26 Jan 2022 15:28:16 -0800 Subject: [PATCH 14/18] needs more bottom margin when used in CRUD forms --- addons/rose/addon/styles/rose/components/form/_radio-card.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/addon/styles/rose/components/form/_radio-card.scss b/addons/rose/addon/styles/rose/components/form/_radio-card.scss index e8cdb0c1c..06d5d2c97 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio-card.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio-card.scss @@ -62,7 +62,7 @@ $radio-svg: ( align-items: center; justify-content: center; margin-right: $size-xs; - margin-bottom: $size-s; + margin-bottom: $size-m; .radio-card-overlay { position: absolute; From f454ef988f87d4b4b03f0b0023758650f2ff90f6 Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Wed, 26 Jan 2022 15:51:05 -0800 Subject: [PATCH 15/18] Update _radio-card.scss --- addons/rose/addon/styles/rose/components/form/_radio-card.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/addon/styles/rose/components/form/_radio-card.scss b/addons/rose/addon/styles/rose/components/form/_radio-card.scss index 06d5d2c97..a4bae3cb3 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio-card.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio-card.scss @@ -62,7 +62,7 @@ $radio-svg: ( align-items: center; justify-content: center; margin-right: $size-xs; - margin-bottom: $size-m; + margin-bottom: $size-xl; .radio-card-overlay { position: absolute; From bfd0b32cb364d110ceadb22517e346d86080d98d Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Wed, 26 Jan 2022 16:19:21 -0800 Subject: [PATCH 16/18] Update _radio-card.scss --- .../rose/addon/styles/rose/components/form/_radio-card.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/rose/addon/styles/rose/components/form/_radio-card.scss b/addons/rose/addon/styles/rose/components/form/_radio-card.scss index a4bae3cb3..870e14ead 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio-card.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio-card.scss @@ -61,8 +61,8 @@ $radio-svg: ( display: inline-flex; align-items: center; justify-content: center; - margin-right: $size-xs; - margin-bottom: $size-xl; + margin: $size-m $size-xs $size-xl 0; + .radio-card-overlay { position: absolute; From f9e3656ce9bef5769e0473e4f6a731ff1634051e Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Wed, 26 Jan 2022 16:19:51 -0800 Subject: [PATCH 17/18] Update _radio-card.scss --- addons/rose/addon/styles/rose/components/form/_radio-card.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/rose/addon/styles/rose/components/form/_radio-card.scss b/addons/rose/addon/styles/rose/components/form/_radio-card.scss index 870e14ead..8a682bbb1 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio-card.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio-card.scss @@ -63,7 +63,6 @@ $radio-svg: ( justify-content: center; margin: $size-m $size-xs $size-xl 0; - .radio-card-overlay { position: absolute; height: $size-l + $size-xxs; From a011278c41f8fe40ebf61ad50f6d44df01574cbc Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Thu, 27 Jan 2022 10:03:17 -0500 Subject: [PATCH 18/18] =?UTF-8?q?chore:=20=F0=9F=A4=96=20tweak=20storybook?= =?UTF-8?q?=20names=20and=20fix=20word=20breaking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addon/components/rose/form/radio/card/index.stories.mdx | 4 ++-- .../rose/addon/components/rose/form/radio/group/index.hbs | 2 +- .../components/rose/form/radio/group/index.stories.mdx | 6 +++--- .../rose/addon/styles/rose/components/form/_radio-card.scss | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/rose/addon/components/rose/form/radio/card/index.stories.mdx b/addons/rose/addon/components/rose/form/radio/card/index.stories.mdx index 360108563..a730607c7 100644 --- a/addons/rose/addon/components/rose/form/radio/card/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/radio/card/index.stories.mdx @@ -21,7 +21,7 @@ Renders a form radiofield in a Wide format. ``` - {{ + {{ template: hbs` - {{ + {{ template: hbs` ``` - {{ + {{ template: hbs` ``` - {{ + {{ template: hbs` - \ No newline at end of file + diff --git a/addons/rose/addon/styles/rose/components/form/_radio-card.scss b/addons/rose/addon/styles/rose/components/form/_radio-card.scss index 8a682bbb1..5e8018b40 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio-card.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio-card.scss @@ -82,7 +82,6 @@ $radio-svg: ( display: block; position: relative; text-align: left; - word-break: break-all; border: $size-xxxxs solid var(--ui-gray-subtler-2); box-shadow: 0 $size-xxs $size-xxs rgba(var(--stark-components), var(--opacity-2));