From 8544d61e9c63d05178ee21688166a136d920eaff Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Thu, 15 Jul 2021 13:24:59 -0700 Subject: [PATCH 01/15] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Upgrade=20ember-c?= =?UTF-8?q?li-inject-live-reload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upgrade ember-cli-inject-live-reload dependency. --- addons/api/package.json | 2 +- addons/auth/package.json | 2 +- addons/core/package.json | 2 +- addons/rose/package.json | 2 +- ui/admin/package.json | 2 +- ui/desktop/package.json | 2 +- yarn.lock | 8 ++++---- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/api/package.json b/addons/api/package.json index 511f490ba..52ebe6aab 100644 --- a/addons/api/package.json +++ b/addons/api/package.json @@ -42,7 +42,7 @@ "ember-auto-import": "^1.10.1", "ember-cli": "~3.24.0", "ember-cli-dependency-checker": "^3.2.0", - "ember-cli-inject-live-reload": "^2.0.2", + "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-sri": "^2.1.1", "ember-cli-terser": "^4.0.1", "ember-cli-update": "^0.54.6", diff --git a/addons/auth/package.json b/addons/auth/package.json index be69ac5b2..9e892171d 100644 --- a/addons/auth/package.json +++ b/addons/auth/package.json @@ -37,7 +37,7 @@ "ember-auto-import": "^1.10.1", "ember-cli": "~3.24.0", "ember-cli-dependency-checker": "^3.2.0", - "ember-cli-inject-live-reload": "^2.0.2", + "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-sri": "^2.1.1", "ember-cli-terser": "^4.0.1", "ember-cli-update": "^0.54.6", diff --git a/addons/core/package.json b/addons/core/package.json index 3a7ce78d2..652ab7130 100644 --- a/addons/core/package.json +++ b/addons/core/package.json @@ -52,7 +52,7 @@ "ember-auto-import": "^1.10.1", "ember-cli": "~3.24.0", "ember-cli-dependency-checker": "^3.2.0", - "ember-cli-inject-live-reload": "^2.0.2", + "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-sri": "^2.1.1", "ember-cli-terser": "^4.0.1", "ember-disable-prototype-extensions": "^1.1.3", diff --git a/addons/rose/package.json b/addons/rose/package.json index 3dd1fc405..d42a683c7 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -55,7 +55,7 @@ "ember-auto-import": "^1.10.1", "ember-cli": "~3.24.0", "ember-cli-dependency-checker": "^3.2.0", - "ember-cli-inject-live-reload": "^2.0.2", + "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-sass": "^10.0.1", "ember-cli-sri": "^2.1.1", "ember-cli-terser": "^4.0.1", diff --git a/ui/admin/package.json b/ui/admin/package.json index 5027fb775..258a8f748 100644 --- a/ui/admin/package.json +++ b/ui/admin/package.json @@ -57,7 +57,7 @@ "ember-cli-content-security-policy": "^1.1.1", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-htmlbars": "^5.3.1", - "ember-cli-inject-live-reload": "^2.0.2", + "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-sass": "^10.0.1", "ember-cli-sri": "^2.1.1", "ember-cli-template-lint": "^2.0.2", diff --git a/ui/desktop/package.json b/ui/desktop/package.json index c5068c5cd..c458ba6c8 100755 --- a/ui/desktop/package.json +++ b/ui/desktop/package.json @@ -72,7 +72,7 @@ "ember-cli-code-coverage": "^1.0.2", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-htmlbars": "^5.3.1", - "ember-cli-inject-live-reload": "^2.0.2", + "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-sass": "^10.0.1", "ember-cli-sri": "^2.1.1", "ember-cli-template-lint": "^2.0.2", diff --git a/yarn.lock b/yarn.lock index 31d873708..f16109b70 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8615,10 +8615,10 @@ ember-cli-htmlbars@^5.3.1, ember-cli-htmlbars@^5.3.2, ember-cli-htmlbars@^5.7.1: strip-bom "^4.0.0" walk-sync "^2.2.0" -ember-cli-inject-live-reload@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ember-cli-inject-live-reload/-/ember-cli-inject-live-reload-2.0.2.tgz#95edb543b386239d35959e5ea9579f5382976ac7" - integrity sha512-HDD6o/kBHT/kUtazklU0OW23q2jigIN42QmcpFdXUSvJ2/2SYA6yIqSUxWfJgISmtn5gTNZ2KPq1p3dLkhJxSQ== +ember-cli-inject-live-reload@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ember-cli-inject-live-reload/-/ember-cli-inject-live-reload-2.1.0.tgz#ef63c733c133024d5726405a3c247fa12e88a385" + integrity sha512-YV5wYRD5PJHmxaxaJt18u6LE6Y+wo455BnmcpN+hGNlChy2piM9/GMvYgTAz/8Vin8RJ5KekqP/w/NEaRndc/A== dependencies: clean-base-url "^1.0.0" ember-cli-version-checker "^3.1.3" From 9c93ff6c131d531c640da3e6f02e2ba28833841d Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Fri, 16 Jul 2021 13:55:33 -0700 Subject: [PATCH 02/15] =?UTF-8?q?test:=20=F0=9F=92=8D=20Add=20test=20cases?= =?UTF-8?q?=20to=20credential=20stores=20route?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add new test cases to credential stores route --- .../acceptance/credential-stores-test.js | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/ui/admin/tests/acceptance/credential-stores-test.js b/ui/admin/tests/acceptance/credential-stores-test.js index b62c0f3fe..4a8f46177 100644 --- a/ui/admin/tests/acceptance/credential-stores-test.js +++ b/ui/admin/tests/acceptance/credential-stores-test.js @@ -1,13 +1,16 @@ import { module, test } from 'qunit'; -import { visit, currentURL } from '@ember/test-helpers'; +import { visit, currentURL, click, fillIn } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import a11yAudit from 'ember-a11y-testing/test-support/audit'; +import { authenticateSession } from 'ember-simple-auth/test-support'; module('Acceptance | credential-stores', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); + let getCredentialStoresCount; + const instances = { scopes: { global: null, @@ -32,17 +35,40 @@ module('Acceptance | credential-stores', function (hooks) { type: 'project', scope: { id: instances.scopes.org.id, type: 'org' }, }); + instances.credentialStore = this.server.create('credential-store', { + scope: instances.scopes.project, + }); // Generate route URLs for resources urls.globalScope = `/scopes/global/scopes`; urls.orgScope = `/scopes/${instances.scopes.org.id}/scopes`; urls.projectScope = `/scopes/${instances.scopes.project.id}`; urls.credentialStores = `${urls.projectScope}/credential-stores`; + urls.credentialStore = `${urls.credentialStores}/${instances.credentialStore.id}`; + urls.unknownCredentialStore = `${urls.credentialStores}/foo`; + urls.newCredentialStore = `${urls.credentialStores}/new`; + // Generate resource counter + getCredentialStoresCount = () => { + return this.server.schema.credentialStores.all().models.length; + }; + authenticateSession({}); }); test('visiting /credential-stores', async function (assert) { - assert.expect(1); + assert.expect(2); await visit(urls.credentialStores); await a11yAudit(); assert.equal(currentURL(), urls.credentialStores); + await visit(urls.credentialStore); + await a11yAudit(); + assert.equal(currentURL(), urls.credentialStore); + }); + + test('can create a new credential store', async function (assert) { + assert.expect(1); + const count = getCredentialStoresCount(); + await visit(urls.newCredentialStore); + await fillIn('[name="name"]', 'random string'); + await click('[type="submit"]'); + assert.equal(getCredentialStoresCount(), count + 1); }); }); From 44510ea8d4d601e1bff600ac4a43cf32fb397605 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Mon, 19 Jul 2021 14:16:40 -0700 Subject: [PATCH 03/15] =?UTF-8?q?test:=20=F0=9F=92=8D=20Adding=20integrati?= =?UTF-8?q?on=20test=20for=20credential=20stores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding more integration test cases for credential stores --- .../acceptance/credential-stores-test.js | 145 +++++++++++++++++- 1 file changed, 143 insertions(+), 2 deletions(-) diff --git a/ui/admin/tests/acceptance/credential-stores-test.js b/ui/admin/tests/acceptance/credential-stores-test.js index 4a8f46177..1a79f6bc5 100644 --- a/ui/admin/tests/acceptance/credential-stores-test.js +++ b/ui/admin/tests/acceptance/credential-stores-test.js @@ -1,5 +1,5 @@ import { module, test } from 'qunit'; -import { visit, currentURL, click, fillIn } from '@ember/test-helpers'; +import { visit, currentURL, find, click, fillIn } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import a11yAudit from 'ember-a11y-testing/test-support/audit'; @@ -21,7 +21,12 @@ module('Acceptance | credential-stores', function (hooks) { const urls = { globalScope: null, + orgScope: null, + projectScope: null, credentialStores: null, + credentialStore: null, + unknownCredentialStore: null, + newCredentialStore: null, }; hooks.beforeEach(function () { @@ -63,7 +68,14 @@ module('Acceptance | credential-stores', function (hooks) { assert.equal(currentURL(), urls.credentialStore); }); - test('can create a new credential store', async function (assert) { + test.skip('visiting an unknown credential store display 404 message', async function (assert) { + assert.expect(1); + await visit(urls.unknownCredentialStore); + await a11yAudit(); + assert.ok(find('.rose-message-subtitle').textContent.trim(), 'Error 404'); + }); + + test('can create a new credential stores', async function (assert) { assert.expect(1); const count = getCredentialStoresCount(); await visit(urls.newCredentialStore); @@ -71,4 +83,133 @@ module('Acceptance | credential-stores', function (hooks) { await click('[type="submit"]'); assert.equal(getCredentialStoresCount(), count + 1); }); + + test('can cancel create new credential stores', async function (assert) { + assert.expect(2); + const count = getCredentialStoresCount(); + await visit(urls.newCredentialStore); + await fillIn('[name="name"]', 'random string'); + await click('.rose-form-actions [type="button"]'); + assert.equal(currentURL(), urls.credentialStores); + assert.equal(getCredentialStoresCount(), count); + }); + + // Skip this test for now. The request is successful + // but we are expecting to not be. + test.skip('saving a new credential store with invalid fields displays error messages', async function (assert) { + assert.expect(2); + this.server.post('/credential-stores', () => { + return new Response( + 400, + {}, + { + status: 400, + code: 'invalid_argument', + message: 'The request was invalid.', + details: { + request_fields: [ + { + name: 'name', + description: 'Name is required.', + }, + ], + }, + } + ); + }); + await visit(urls.newCredentialStore); + await click('form [type="submit"]', 'Click new'); // Issue starts here + assert.ok( + find('[role="alert"]').textContent.trim(), + 'The request was invalid.' + ); + assert.ok( + find('.rose-form-error-message').textContent.trim(), + 'Name is required.' + ); + }); + + test('can save changes to existing credential store', async function (assert) { + assert.expect(3); + assert.notEqual(instances.credentialStore.name, 'random string'); + await visit(urls.credentialStore); + await click('form [type="button"]', 'Activate edit mode'); + await fillIn('[name="name"]', 'random string'); + await click('.rose-form-actions [type="submit"]'); + assert.equal(currentURL(), urls.credentialStore); + assert.equal( + this.server.schema.credentialStores.all().models[0].name, + 'random string' + ); + }); + + test('can cancel changes to existing credential store', async function (assert) { + assert.expect(2); + await visit(urls.credentialStore); + await click('form [type="button"]', 'Activate edit mode'); + await fillIn('[name="name"]', 'random string'); + await click('.rose-form-actions [type="button"]'); + assert.notEqual(instances.credentialStore.name, 'random string'); + assert.equal(find('[name="name"]').value, instances.credentialStore.name); + }); + + // Skip this test for now. The request is successful + // but we are expecting to not be. + test.skip('saving an existing credential store with invalid fields displays error messages', async function (assert) { + assert.expect(2); + this.server.patch('/credential-stores/:id', () => { + return new Response( + 400, + {}, + { + status: 400, + code: 'invalid_argument', + message: 'The request was invalid.', + details: { + request_fields: [ + { + name: 'name', + description: 'Name is required.', + }, + ], + }, + } + ); + }); + await visit(urls.credentialStore); + await click('form [type="button"]', 'Activate edit mode'); + await fillIn('[name="name"]', 'random string'); + await click('[type="submit"]'); + assert.ok( + find('[role="alert"]').textContent.trim(), + 'The request was invalid.' + ); + assert.ok( + find('.rose-form-error-message').textContent.trim(), + 'Name is required.' + ); + }); + + test.skip('can discard unsaved credential store changes via dialog', async function (assert) { + assert.expect(5); + const confirmService = this.owner.lookup('service:confirm'); + confirmService.enabled = true; + assert.notEqual(instances.credentialStore.name, 'random string'); + + await visit(urls.credentialStore); + await click('form [type="button"]', 'Activate edit mode'); + assert.equal(currentURL(), urls.credentialStore); + + try { + await visit(urls.credentialStores); + } catch (e) { + assert.ok(find('.rose-dialog')); + await click('.rose-dialog-footer button:first-child'); + assert.equal(currentURL(), urls.credentialStores); + assert.notEqual( + this.server.schema.credentialStores.all().models[0].name, + 'random string' + ); + } + }); }); From a1117529e5207b1c730a103985263c262de1920f Mon Sep 17 00:00:00 2001 From: dharini Date: Mon, 19 Jul 2021 15:45:58 -0700 Subject: [PATCH 04/15] =?UTF-8?q?style:=20=F0=9F=92=84=20update=20rose=20f?= =?UTF-8?q?ieldset=20font-size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/addon/styles/rose/components/form/_fieldset.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/addon/styles/rose/components/form/_fieldset.scss b/addons/rose/addon/styles/rose/components/form/_fieldset.scss index 33f5ad5d9..f35d3755c 100644 --- a/addons/rose/addon/styles/rose/components/form/_fieldset.scss +++ b/addons/rose/addon/styles/rose/components/form/_fieldset.scss @@ -5,7 +5,7 @@ margin-bottom: sizing.rems(m); .rose-form-fieldset-title { - @include type.type(l, bold); + @include type.type(s, bold); } .rose-form-fieldset-description { From f69477e55647b80b2f8017f71519149d5c7b5555 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Tue, 20 Jul 2021 10:36:34 -0700 Subject: [PATCH 05/15] =?UTF-8?q?test:=20=F0=9F=92=8D=20Add=20credential?= =?UTF-8?q?=20stores=20create=20and=20edit=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add credential store create and edit acceptance tests --- .../form/credential-store/index.hbs | 27 +++++++++++- .../acceptance/credential-stores-test.js | 41 +++++++++++++++---- 2 files changed, 57 insertions(+), 11 deletions(-) diff --git a/ui/admin/app/components/form/credential-store/index.hbs b/ui/admin/app/components/form/credential-store/index.hbs index f972854c1..b70183ed3 100644 --- a/ui/admin/app/components/form/credential-store/index.hbs +++ b/ui/admin/app/components/form/credential-store/index.hbs @@ -2,6 +2,7 @@ @onSubmit={{@submit}} @cancel={{@cancel}} @disabled={{@model.isSaving}} + @error={{@model.errors.base}} @showEditToggle={{if @model.isNew false true}} as |form| > @@ -18,16 +19,38 @@ @value={{@model.name}} @label={{t 'form.name.label'}} @helperText={{t 'form.name.help'}} + @error={{@model.errors.name}} readonly={{false}} - /> + as |field| + > + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + disabled={{@model.isSaving}} + readonly={{false}} + as |field| + > + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + { return new Response( @@ -118,7 +119,7 @@ module('Acceptance | credential-stores', function (hooks) { ); }); await visit(urls.newCredentialStore); - await click('form [type="submit"]', 'Click new'); // Issue starts here + await click('[type="submit"]'); assert.ok( find('[role="alert"]').textContent.trim(), 'The request was invalid.' @@ -153,9 +154,7 @@ module('Acceptance | credential-stores', function (hooks) { assert.equal(find('[name="name"]').value, instances.credentialStore.name); }); - // Skip this test for now. The request is successful - // but we are expecting to not be. - test.skip('saving an existing credential store with invalid fields displays error messages', async function (assert) { + test('saving an existing credential store with invalid fields displays error messages', async function (assert) { assert.expect(2); this.server.patch('/credential-stores/:id', () => { return new Response( @@ -190,7 +189,7 @@ module('Acceptance | credential-stores', function (hooks) { ); }); - test.skip('can discard unsaved credential store changes via dialog', async function (assert) { + test('can discard unsaved credential store changes via dialog', async function (assert) { assert.expect(5); const confirmService = this.owner.lookup('service:confirm'); confirmService.enabled = true; @@ -198,13 +197,14 @@ module('Acceptance | credential-stores', function (hooks) { await visit(urls.credentialStore); await click('form [type="button"]', 'Activate edit mode'); + await fillIn('[name="name"]', 'random string'); assert.equal(currentURL(), urls.credentialStore); try { await visit(urls.credentialStores); } catch (e) { assert.ok(find('.rose-dialog')); - await click('.rose-dialog-footer button:first-child'); + await click('.rose-dialog-footer button:first-child', 'Click Discard'); assert.equal(currentURL(), urls.credentialStores); assert.notEqual( this.server.schema.credentialStores.all().models[0].name, @@ -212,4 +212,27 @@ module('Acceptance | credential-stores', function (hooks) { ); } }); + + test('can cancel discard unsaved credential store via dialog', async function (assert) { + assert.expect(5); + const confirmService = this.owner.lookup('service:confirm'); + confirmService.enabled = true; + assert.notEqual(instances.credentialStore.name, 'random string'); + await visit(urls.credentialStore); + await click('form [type="button"]', 'Activate edit mode'); + await fillIn('[name="name"]', 'random string'); + assert.equal(currentURL(), urls.credentialStore); + + try { + await visit(urls.credentialStores); + } catch (e) { + assert.ok(find('.rose-dialog')); + await click('.rose-dialog-footer button:last-child'); + assert.equal(currentURL(), urls.credentialStore); + assert.notEqual( + this.server.schema.credentialStores.all().models[0].name, + 'random string' + ); + } + }); }); From 699d5063d9635e4dd0ab2a322b15368562a0df40 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Tue, 20 Jul 2021 13:28:39 -0700 Subject: [PATCH 06/15] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Fix=20style=20and?= =?UTF-8?q?=20accessibility=20issues=20for=20hidden=20secret?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix style and accessibility issues for hidden secret component --- addons/core/translations/resources/en-us.yaml | 2 ++ .../app/components/hidden-secret/index.hbs | 12 +++++++----- ui/desktop/app/styles/app.scss | 18 ++++++++++-------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index 2c9712a67..0e8a331b8 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -267,6 +267,8 @@ target: add: title: Add Host Sets description: Select host sets to assign to this target. + secret: + toggle: Toggle secret visibility. credential-store: title: Credential Store title_plural: Credential Stores diff --git a/ui/desktop/app/components/hidden-secret/index.hbs b/ui/desktop/app/components/hidden-secret/index.hbs index 8b5cc1cac..18474329c 100644 --- a/ui/desktop/app/components/hidden-secret/index.hbs +++ b/ui/desktop/app/components/hidden-secret/index.hbs @@ -1,9 +1,11 @@
- + > + {{t 'resources.target.secret.toggle'}} + {{this.textMask}} {{/if}}
\ No newline at end of file diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index f65623c56..617f09ea5 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -478,20 +478,22 @@ $chevron-down: url("data:image/svg+xml;utf-8, - {{t 'resources.target.secret.toggle'}} + {{t 'actions.toggle-secret'}} Date: Tue, 20 Jul 2021 16:11:57 -0700 Subject: [PATCH 08/15] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20inline=20ali?= =?UTF-8?q?gntment=20support=20to=20checkbox=20and=20radio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/addon/components/rose/form/checkbox/index.hbs | 2 +- .../rose/addon/components/rose/form/radio/group/index.hbs | 2 ++ .../rose/addon/components/rose/form/radio/radio/index.hbs | 4 ++-- .../rose/addon/styles/rose/components/form/_checkbox.scss | 4 ++++ addons/rose/addon/styles/rose/components/form/_radio.scss | 6 ++++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/addons/rose/addon/components/rose/form/checkbox/index.hbs b/addons/rose/addon/components/rose/form/checkbox/index.hbs index a660c270d..e4a2c11d5 100644 --- a/addons/rose/addon/components/rose/form/checkbox/index.hbs +++ b/addons/rose/addon/components/rose/form/checkbox/index.hbs @@ -1,4 +1,4 @@ -
+
{{yield (hash radio=(component 'rose/form/radio/radio' name=@name selectedValue=@selectedValue disabled=@disabled changed=@changed) )}} +
\ No newline at end of file diff --git a/addons/rose/addon/components/rose/form/radio/radio/index.hbs b/addons/rose/addon/components/rose/form/radio/radio/index.hbs index eb45384c6..86edfd524 100644 --- a/addons/rose/addon/components/rose/form/radio/radio/index.hbs +++ b/addons/rose/addon/components/rose/form/radio/radio/index.hbs @@ -1,8 +1,8 @@ -
+
Date: Tue, 20 Jul 2021 16:26:13 -0700 Subject: [PATCH 09/15] =?UTF-8?q?fix:=20=F0=9F=90=9B=20undo=20unnecessary?= =?UTF-8?q?=20change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/addon/components/rose/form/radio/group/index.hbs | 2 -- addons/rose/addon/components/rose/form/radio/radio/index.hbs | 2 +- 2 files changed, 1 insertion(+), 3 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 a503c3bc9..fc34bd1cc 100644 --- a/addons/rose/addon/components/rose/form/radio/group/index.hbs +++ b/addons/rose/addon/components/rose/form/radio/group/index.hbs @@ -1,5 +1,3 @@ -
{{yield (hash radio=(component 'rose/form/radio/radio' name=@name selectedValue=@selectedValue disabled=@disabled changed=@changed) )}} -
\ No newline at end of file diff --git a/addons/rose/addon/components/rose/form/radio/radio/index.hbs b/addons/rose/addon/components/rose/form/radio/radio/index.hbs index 86edfd524..d38bc3680 100644 --- a/addons/rose/addon/components/rose/form/radio/radio/index.hbs +++ b/addons/rose/addon/components/rose/form/radio/radio/index.hbs @@ -2,7 +2,7 @@ Date: Wed, 21 Jul 2021 10:36:16 -0700 Subject: [PATCH 10/15] Fix skip test with false positive --- ui/admin/tests/acceptance/credential-stores-test.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/admin/tests/acceptance/credential-stores-test.js b/ui/admin/tests/acceptance/credential-stores-test.js index 7507f5ba8..f41d31a12 100644 --- a/ui/admin/tests/acceptance/credential-stores-test.js +++ b/ui/admin/tests/acceptance/credential-stores-test.js @@ -69,13 +69,14 @@ module('Acceptance | credential-stores', function (hooks) { assert.equal(currentURL(), urls.credentialStore); }); - // This test is returning an issue regarding not finding resource. - // It is a false positive. - test.skip('visiting an unknown credential store display 404 message', async function (assert) { + test('visiting an unknown credential store display 404 message', async function (assert) { assert.expect(1); await visit(urls.unknownCredentialStore); await a11yAudit(); - assert.ok(find('.rose-message-subtitle').textContent.trim(), 'Error 404'); + assert.equal( + find('.rose-message-subtitle').textContent.trim(), + 'Error 404' + ); }); test('can create a new credential stores', async function (assert) { From d034631e4d586dddc595cba30cac54fee31bc43a Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 21 Jul 2021 10:51:33 -0700 Subject: [PATCH 11/15] =?UTF-8?q?fix:=20=F0=9F=90=9B=20add=20attr=20in=20s?= =?UTF-8?q?torybook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rose/addon/components/rose/form/checkbox/index.stories.mdx | 1 + .../addon/components/rose/form/radio/radio/index.stories.mdx | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx b/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx index 4f98fed53..fe92b59ec 100644 --- a/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx @@ -16,6 +16,7 @@ Renders a form input checkbox. @checked={{false}} @error={{false}} @disabled={{false}} + @inline={{true}} /> ``` diff --git a/addons/rose/addon/components/rose/form/radio/radio/index.stories.mdx b/addons/rose/addon/components/rose/form/radio/radio/index.stories.mdx index 633a5c082..6ac5d9f15 100644 --- a/addons/rose/addon/components/rose/form/radio/radio/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/radio/radio/index.stories.mdx @@ -16,6 +16,7 @@ Renders a form radiofield. @selectedValue="yes-agree" @disabled={{false}} @changed={{fn}} + @inline={{true}} /> ``` From 0823c1cb2d467f26601a2d94776fbc19fd3626fa Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 21 Jul 2021 12:39:24 -0700 Subject: [PATCH 12/15] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20stories=20fo?= =?UTF-8?q?r=20inline=20radio=20&=20checkbox,=20radiogrp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rose/form/checkbox/index.stories.mdx | 58 +++++++++++++++- .../rose/form/radio/group/index.hbs | 4 +- .../rose/form/radio/group/index.stories.mdx | 3 + .../rose/form/radio/radio/index.stories.mdx | 68 ++++++++++++++++++- .../styles/rose/components/form/_radio.scss | 15 ++-- 5 files changed, 138 insertions(+), 10 deletions(-) diff --git a/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx b/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx index fe92b59ec..11405c643 100644 --- a/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx @@ -16,7 +16,6 @@ Renders a form input checkbox. @checked={{false}} @error={{false}} @disabled={{false}} - @inline={{true}} /> ``` @@ -69,3 +68,60 @@ Renders a form input checkbox. } }} + + +```htmlbars + +``` + + + {{ + template: hbs` + + + + `, + context: { + description: text('description', 'Short description in label'), + helperText: text('helperText', 'This is an optional help text.'), + checked: boolean('checked', false), + error: boolean('error', false), + disabled: boolean('disabled', false), + } + }} + + 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 fc34bd1cc..de2b010b6 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,3 @@ {{yield (hash - radio=(component 'rose/form/radio/radio' name=@name selectedValue=@selectedValue disabled=@disabled changed=@changed) -)}} + radio=(component 'rose/form/radio/radio' name=@name selectedValue=@selectedValue disabled=@disabled changed=@changed inline=@inline) +)}} \ 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 bafffaaa4..515c7ca35 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 @@ -15,6 +15,7 @@ Renders a form radiofield group. @name={{name}} @selectedValue="disagree" @changed={{fn}} + @inline={{false}} as |radioGroup| > ``` @@ -55,3 +54,70 @@ Renders a form radiofield. } }} + + +```htmlbars + +``` + + + {{ + template: hbs` + + + + `, + context: { + error: boolean('error', false), + value: text('value', 'value and selectedValue must match to select radiofield'), + selectedValue: text( + 'selectedValue', + 'value and selectedValue must match to select radiofield' + ), + disabled: boolean('disabled', false), + icon: select( + 'icon', + { + 'none': null, + 'user-organization': 'user-organization', + 'copy-action': 'copy-action', + 'unfold-more': 'unfold-more', + 'unfold-less': 'unfold-less', + }, + null + ), + } + }} + \ 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 723407017..f248d0b7a 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio.scss @@ -21,14 +21,17 @@ $radio-svg: ( ); $data-svg-prefix: 'data:image/svg+xml;utf-8,'; -.radio-group-inline { - display: flex; - .rose-form-radio { + .rose-form-radio { + &.inline { + display: inline-block; + .rose-form-radio-label { + margin-right: sizing.rems(s); + } + } + .radio-group-inline { + display: flex; margin-right: sizing.rems(s); } -} - -.rose-form-radio { @include type.type(m); position: relative; margin-bottom: sizing.rems(xs); From c43ced038030e82395b32fc947272e0c342f9db7 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 21 Jul 2021 13:01:59 -0700 Subject: [PATCH 13/15] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20toggle=20fun?= =?UTF-8?q?ctionality?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/rose/form/checkbox/index.stories.mdx | 9 +++++---- .../components/rose/form/radio/radio/index.stories.mdx | 7 ++++--- .../rose/addon/styles/rose/components/form/_radio.scss | 4 ---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx b/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx index 11405c643..39925964b 100644 --- a/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/checkbox/index.stories.mdx @@ -77,7 +77,7 @@ Renders a form input checkbox. @checked={{false}} @error={{false}} @disabled={{false}} - @inline={{true}} + @inline={{false}} /> ``` @@ -92,7 +92,7 @@ Renders a form input checkbox. @checked={{checked}} @error={{error}} @disabled={{disabled}} - @inline={{true}} + @inline={{inline}} /> `, context: { @@ -121,6 +121,7 @@ Renders a form input checkbox. checked: boolean('checked', false), error: boolean('error', false), disabled: boolean('disabled', false), + inline: boolean('inline', false) } }} diff --git a/addons/rose/addon/components/rose/form/radio/radio/index.stories.mdx b/addons/rose/addon/components/rose/form/radio/radio/index.stories.mdx index feb783d31..4d6a4153e 100644 --- a/addons/rose/addon/components/rose/form/radio/radio/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/radio/radio/index.stories.mdx @@ -78,7 +78,7 @@ Renders a form radiofield. @selectedValue={{selectedValue}} @disabled={{disabled}} @icon={{icon}} - @inline={{true}} + @inline={{inline}} /> `, context: { @@ -118,6 +118,7 @@ Renders a form radiofield. }, null ), + inline: boolean('inline', false) } }} \ 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 f248d0b7a..4ce25f95b 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio.scss @@ -28,10 +28,6 @@ $data-svg-prefix: 'data:image/svg+xml;utf-8,'; margin-right: sizing.rems(s); } } - .radio-group-inline { - display: flex; - margin-right: sizing.rems(s); - } @include type.type(m); position: relative; margin-bottom: sizing.rems(xs); From 0ad6d027e61f9a4f3f21fab81cb4bc55920416ea Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 21 Jul 2021 13:33:03 -0700 Subject: [PATCH 14/15] =?UTF-8?q?fix:=20=F0=9F=90=9B=20space?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rose/addon/styles/rose/components/form/_radio.scss | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/rose/addon/styles/rose/components/form/_radio.scss b/addons/rose/addon/styles/rose/components/form/_radio.scss index 4ce25f95b..2b547edce 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio.scss @@ -23,11 +23,11 @@ $radio-svg: ( $data-svg-prefix: 'data:image/svg+xml;utf-8,'; .rose-form-radio { &.inline { - display: inline-block; - .rose-form-radio-label { - margin-right: sizing.rems(s); - } - } + display: inline-block; + .rose-form-radio-label { + margin-right: sizing.rems(s); + } + } @include type.type(m); position: relative; margin-bottom: sizing.rems(xs); From 2dd3e13cd3b9ea8be08e486a7c1a97fe64605229 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 21 Jul 2021 14:07:29 -0700 Subject: [PATCH 15/15] =?UTF-8?q?fix:=20=F0=9F=90=9B=20lint=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addon/components/rose/form/checkbox/index.hbs | 2 +- .../addon/styles/rose/components/form/_radio.scss | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/rose/addon/components/rose/form/checkbox/index.hbs b/addons/rose/addon/components/rose/form/checkbox/index.hbs index e4a2c11d5..d9b655458 100644 --- a/addons/rose/addon/components/rose/form/checkbox/index.hbs +++ b/addons/rose/addon/components/rose/form/checkbox/index.hbs @@ -1,4 +1,4 @@ -
+