From dc0e86679693bbcdf8f4bd360a7fc0e6e2de7849 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 17 Aug 2021 15:53:21 -0400 Subject: [PATCH 01/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20upgrade=20global,?= =?UTF-8?q?=20org,=20and=20project=20icons=20to=20flight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/public/app-icons/global.svg | 8 +++++--- addons/core/public/app-icons/org.svg | 15 ++++++++++++--- addons/core/public/app-icons/project.svg | 11 ++++++++--- .../addon/components/rose/badge/index.stories.mdx | 8 ++++---- .../components/rose/card/link/index.stories.mdx | 6 +++--- .../addon/components/rose/cards/index.stories.mdx | 14 +++++++------- .../components/rose/dropdown/index.stories.mdx | 4 ++-- .../rose/form/radio/group/index.stories.mdx | 4 ++-- .../rose/form/radio/radio/index.stories.mdx | 6 +++--- addons/rose/public/flight/globe-16.svg | 5 +++++ addons/rose/public/flight/grid-16.svg | 8 ++++++++ addons/rose/public/flight/org-16.svg | 12 ++++++++++++ ui/admin/app/components/form/role/index.hbs | 6 ++---- ui/admin/app/templates/scopes/scope.hbs | 10 +++++----- .../app/templates/scopes/scope/-header-nav.hbs | 6 +++--- .../app/templates/scopes/scope/authenticate.hbs | 2 +- .../app/templates/scopes/scope/scopes/index.hbs | 2 +- ui/admin/ember-cli-build.js | 2 +- .../app/templates/scopes/scope/-header-nav.hbs | 4 ++-- .../app/templates/scopes/scope/authenticate.hbs | 2 +- ui/desktop/ember-cli-build.js | 2 +- 21 files changed, 88 insertions(+), 49 deletions(-) create mode 100644 addons/rose/public/flight/globe-16.svg create mode 100644 addons/rose/public/flight/grid-16.svg create mode 100644 addons/rose/public/flight/org-16.svg diff --git a/addons/core/public/app-icons/global.svg b/addons/core/public/app-icons/global.svg index 0e5b84d47..0c5298171 100644 --- a/addons/core/public/app-icons/global.svg +++ b/addons/core/public/app-icons/global.svg @@ -1,3 +1,5 @@ - - - + + + + + \ No newline at end of file diff --git a/addons/core/public/app-icons/org.svg b/addons/core/public/app-icons/org.svg index 238cc8435..213323766 100644 --- a/addons/core/public/app-icons/org.svg +++ b/addons/core/public/app-icons/org.svg @@ -1,3 +1,12 @@ - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/core/public/app-icons/project.svg b/addons/core/public/app-icons/project.svg index 5b9515d08..b65333af2 100644 --- a/addons/core/public/app-icons/project.svg +++ b/addons/core/public/app-icons/project.svg @@ -1,3 +1,8 @@ - - - + + + + + + + + \ No newline at end of file diff --git a/addons/rose/addon/components/rose/badge/index.stories.mdx b/addons/rose/addon/components/rose/badge/index.stories.mdx index 1f91c7beb..0011927a7 100644 --- a/addons/rose/addon/components/rose/badge/index.stories.mdx +++ b/addons/rose/addon/components/rose/badge/index.stories.mdx @@ -13,7 +13,7 @@ When style definition isn't supplied, a default style will be supplied. Styles: outline, dark, informational, informational-outline, success, success-outline, error, error-outline, warning, warning-outline, alert, alert-outline ```html -Badge +Badge ``` @@ -43,11 +43,11 @@ Styles: outline, dark, informational, informational-outline, success, success-ou 'none' ), icon: select('icon', { - 'user-organization': 'user-organization', + 'flight/org-16': 'flight/org-16', 'partner': 'partner', 'gift-fill': 'gift-fill', }, - 'user-organization' + 'flight/org-16' ), } }} @@ -58,7 +58,7 @@ Styles: outline, dark, informational, informational-outline, success, success-ou template: hbs` default style outline - default style with icon + default style with icon dark informational informational-outline diff --git a/addons/rose/addon/components/rose/card/link/index.stories.mdx b/addons/rose/addon/components/rose/card/link/index.stories.mdx index 57171eaf6..960fc709f 100644 --- a/addons/rose/addon/components/rose/card/link/index.stories.mdx +++ b/addons/rose/addon/components/rose/card/link/index.stories.mdx @@ -13,7 +13,7 @@ Card link component wraps content with `LinkTo` component. Supports title and de @title='Card title' @description='Card description' @id='resource_id_1234' - @icon='user-organization' + @icon='flight/org-16' @route='about'/> ``` @@ -32,11 +32,11 @@ Card link component wraps content with `LinkTo` component. Supports title and de description: text('description', 'Card description'), id: text('id', 'resource_id_1234'), icon: select('icon', { - 'user-organization': 'user-organization', + 'flight/org-16': 'flight/org-16', 'partner': 'partner', 'gift-fill': 'gift-fill', }, - 'user-organization' + 'flight/org-16' ), }, }} diff --git a/addons/rose/addon/components/rose/cards/index.stories.mdx b/addons/rose/addon/components/rose/cards/index.stories.mdx index 166d8fd83..72c503e85 100644 --- a/addons/rose/addon/components/rose/cards/index.stories.mdx +++ b/addons/rose/addon/components/rose/cards/index.stories.mdx @@ -18,35 +18,35 @@ A set of cards arranged side-by-side. @title="Card Title" @description="Description" @id="resource_id_1234" - @icon="user-organization" + @icon="flight/org-16" /> `, @@ -62,14 +62,14 @@ A set of cards arranged side-by-side. @title="Card Title" @description="Description" @id="resource_id_1234" - @icon="user-organization" + @icon="flight/org-16" /> ``` diff --git a/addons/rose/addon/components/rose/dropdown/index.stories.mdx b/addons/rose/addon/components/rose/dropdown/index.stories.mdx index 58a0575bf..8ca5ff6dc 100644 --- a/addons/rose/addon/components/rose/dropdown/index.stories.mdx +++ b/addons/rose/addon/components/rose/dropdown/index.stories.mdx @@ -11,7 +11,7 @@ A simple dropdown component with support for links and buttons. {{ template: hbs` - + Menu item Menu item @@ -31,7 +31,7 @@ A simple dropdown component with support for links and buttons. {{ template: hbs` - + Menu item Menu item 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 515c7ca35..6c81d2f94 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 @@ -68,12 +68,12 @@ Renders a form radiofield group. firstFieldIcon: select( 'first icon', { - 'user-organization': 'user-organization', + 'flight/org-16': 'flight/org-16', 'copy-action': 'copy-action', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, - 'user-organization' + 'flight/org-16' ), secondFieldLabel: text('second label', 'Maybe'), secondFieldValue: text('second value', 'maybe'), 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 4d6a4153e..2d1585c38 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 @@ -44,7 +44,7 @@ Renders a form radiofield. 'icon', { 'none': null, - 'user-organization': 'user-organization', + 'flight/org-16': 'flight/org-16', 'copy-action': 'copy-action', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', @@ -111,7 +111,7 @@ Renders a form radiofield. 'icon', { 'none': null, - 'user-organization': 'user-organization', + 'flight/org-16': 'flight/org-16', 'copy-action': 'copy-action', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', @@ -121,4 +121,4 @@ Renders a form radiofield. inline: boolean('inline', false) } }} - \ No newline at end of file + diff --git a/addons/rose/public/flight/globe-16.svg b/addons/rose/public/flight/globe-16.svg new file mode 100644 index 000000000..0c5298171 --- /dev/null +++ b/addons/rose/public/flight/globe-16.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/grid-16.svg b/addons/rose/public/flight/grid-16.svg new file mode 100644 index 000000000..b65333af2 --- /dev/null +++ b/addons/rose/public/flight/grid-16.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/org-16.svg b/addons/rose/public/flight/org-16.svg new file mode 100644 index 000000000..213323766 --- /dev/null +++ b/addons/rose/public/flight/org-16.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ui/admin/app/components/form/role/index.hbs b/ui/admin/app/components/form/role/index.hbs index 169621362..dde4c73d5 100644 --- a/ui/admin/app/components/form/role/index.hbs +++ b/ui/admin/app/components/form/role/index.hbs @@ -69,10 +69,8 @@ @text={{this.selectedGrantScope.displayName}} @icon={{if this.selectedGrantScope.isProject - 'app-icons/project' - (if - this.selectedGrantScope.isOrg 'app-icons/org' 'app-icons/global' - ) + 'flight/grid-16' + (if this.selectedGrantScope.isOrg 'flight/org-16' 'flight/globe-16') }} as |dropdown| > diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index 65e456c51..8385f4759 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -18,7 +18,7 @@ {{#if @model.isGlobal}} - + {{t 'resources.org.title_plural'}} @@ -28,12 +28,12 @@ {{#if this.session.data.authenticated.isGlobal}} - + {{t 'resources.org.title_plural'}} {{/if}} - + {{t 'resources.project.title_plural'}} @@ -43,12 +43,12 @@ {{#if this.session.data.authenticated.isGlobal}} - + {{t 'resources.org.title_plural'}} {{/if}} - + {{t 'resources.project.title_plural'}} diff --git a/ui/admin/app/templates/scopes/scope/-header-nav.hbs b/ui/admin/app/templates/scopes/scope/-header-nav.hbs index ebfc3ffad..0a0f9c3b9 100644 --- a/ui/admin/app/templates/scopes/scope/-header-nav.hbs +++ b/ui/admin/app/templates/scopes/scope/-header-nav.hbs @@ -2,8 +2,8 @@ @text={{this.scopes.selectedOrg.displayName}} @icon={{if this.scopes.selectedOrg.isGlobal - 'app-icons/global' - 'app-icons/org' + 'flight/globe-16' + 'flight/org-16' }} as |dropdown| > @@ -23,7 +23,7 @@ {{#if this.scopes.selectedProject}} {{#each this.scopes.projects as |scope|}} diff --git a/ui/admin/app/templates/scopes/scope/authenticate.hbs b/ui/admin/app/templates/scopes/scope/authenticate.hbs index 55977a188..847987db3 100644 --- a/ui/admin/app/templates/scopes/scope/authenticate.hbs +++ b/ui/admin/app/templates/scopes/scope/authenticate.hbs @@ -16,7 +16,7 @@ }}

diff --git a/ui/admin/app/templates/scopes/scope/scopes/index.hbs b/ui/admin/app/templates/scopes/scope/scopes/index.hbs index 93df2c2cd..c4fce49b5 100644 --- a/ui/admin/app/templates/scopes/scope/scopes/index.hbs +++ b/ui/admin/app/templates/scopes/scope/scopes/index.hbs @@ -43,7 +43,7 @@ @title={{scope.name}} @description={{scope.description}} @id={{scope.id}} - @icon={{if scope.isOrg 'app-icons/org' 'app-icons/project'}} + @icon={{if scope.isOrg 'flight/org-16' 'flight/grid-16'}} @route='scopes.scope' @model={{scope.id}} /> diff --git a/ui/admin/ember-cli-build.js b/ui/admin/ember-cli-build.js index a7b391110..ab3b6e0f1 100644 --- a/ui/admin/ember-cli-build.js +++ b/ui/admin/ember-cli-build.js @@ -23,7 +23,7 @@ module.exports = function (defaults) { importCss: false, }, svg: { - paths: ['../../addons/core/public'], + paths: ['../../addons/core/public', '../../addons/rose/public'], }, }); diff --git a/ui/desktop/app/templates/scopes/scope/-header-nav.hbs b/ui/desktop/app/templates/scopes/scope/-header-nav.hbs index cbb597ea5..d8baa5042 100644 --- a/ui/desktop/app/templates/scopes/scope/-header-nav.hbs +++ b/ui/desktop/app/templates/scopes/scope/-header-nav.hbs @@ -2,8 +2,8 @@ @text={{this.scopes.selectedOrg.displayName}} @icon={{if this.scopes.selectedOrg.isGlobal - 'app-icons/global' - 'app-icons/org' + 'flight/globe-16' + 'flight/org-16' }} as |dropdown| > diff --git a/ui/desktop/app/templates/scopes/scope/authenticate.hbs b/ui/desktop/app/templates/scopes/scope/authenticate.hbs index 60ccaefa0..0472b5fce 100644 --- a/ui/desktop/app/templates/scopes/scope/authenticate.hbs +++ b/ui/desktop/app/templates/scopes/scope/authenticate.hbs @@ -11,7 +11,7 @@ diff --git a/ui/desktop/ember-cli-build.js b/ui/desktop/ember-cli-build.js index 91b6adad0..c1ba1af03 100644 --- a/ui/desktop/ember-cli-build.js +++ b/ui/desktop/ember-cli-build.js @@ -23,7 +23,7 @@ module.exports = function (defaults) { importCss: false, }, svg: { - paths: ['../../addons/core/public'], + paths: ['../../addons/core/public', '../../addons/rose/public'], }, }); From 3a1416e2ff5ce23caf27757affeaaa129cf83e5a Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 17 Aug 2021 16:13:36 -0400 Subject: [PATCH 02/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20update=20user=20p?= =?UTF-8?q?rofile=20icon=20to=20flight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/addon/components/rose/header/index.stories.mdx | 6 +++--- addons/rose/public/flight/user-circle-16.svg | 6 ++++++ addons/rose/tests/dummy/app/templates/playground.hbs | 2 +- .../rose/tests/integration/components/rose/dropdown-test.js | 2 +- .../integration/components/rose/form/radio/radio-test.js | 4 +++- ui/admin/app/templates/application.hbs | 2 +- ui/desktop/app/templates/application.hbs | 2 +- 7 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 addons/rose/public/flight/user-circle-16.svg diff --git a/addons/rose/addon/components/rose/header/index.stories.mdx b/addons/rose/addon/components/rose/header/index.stories.mdx index bffd410b7..c7e0149a8 100644 --- a/addons/rose/addon/components/rose/header/index.stories.mdx +++ b/addons/rose/addon/components/rose/header/index.stories.mdx @@ -27,7 +27,7 @@ A header component that allows three distinct sections to be configured: brand, Menu item Menu item @@ -69,13 +69,13 @@ A header component that allows three distinct sections to be configured: brand, dropdownIcon: select( 'dropdownIcon', { - 'user-square-fill': 'user-square-fill', + 'flight/user-circle-16': 'flight/user-circle-16', 'check-circle-outline': 'check-circle-outline', 'copy-action': 'copy-action', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, - 'user-square-fill' + 'flight/user-circle-16' ), }, }} diff --git a/addons/rose/public/flight/user-circle-16.svg b/addons/rose/public/flight/user-circle-16.svg new file mode 100644 index 000000000..b74c95d07 --- /dev/null +++ b/addons/rose/public/flight/user-circle-16.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/addons/rose/tests/dummy/app/templates/playground.hbs b/addons/rose/tests/dummy/app/templates/playground.hbs index e9ace3c02..1ff6dcc6f 100644 --- a/addons/rose/tests/dummy/app/templates/playground.hbs +++ b/addons/rose/tests/dummy/app/templates/playground.hbs @@ -19,7 +19,7 @@ Menu item Menu item diff --git a/addons/rose/tests/integration/components/rose/dropdown-test.js b/addons/rose/tests/integration/components/rose/dropdown-test.js index 24d4d7758..a80d5d365 100644 --- a/addons/rose/tests/integration/components/rose/dropdown-test.js +++ b/addons/rose/tests/integration/components/rose/dropdown-test.js @@ -24,7 +24,7 @@ module('Integration | Component | rose/dropdown', function (hooks) { }); test('it supports an icon', async function (assert) { - await render(hbs``); + await render(hbs``); assert.ok(find('svg')); }); diff --git a/addons/rose/tests/integration/components/rose/form/radio/radio-test.js b/addons/rose/tests/integration/components/rose/form/radio/radio-test.js index 9f1677571..15547dab8 100644 --- a/addons/rose/tests/integration/components/rose/form/radio/radio-test.js +++ b/addons/rose/tests/integration/components/rose/form/radio/radio-test.js @@ -18,7 +18,9 @@ module('Integration | Component | rose/form/radio/radio', function (hooks) { }); test('it supports an icon', async function (assert) { - await render(hbs``); + await render( + hbs`` + ); assert.ok(find('svg')); }); diff --git a/ui/admin/app/templates/application.hbs b/ui/admin/app/templates/application.hbs index 9408904ce..e0bf5a1e5 100644 --- a/ui/admin/app/templates/application.hbs +++ b/ui/admin/app/templates/application.hbs @@ -16,7 +16,7 @@ diff --git a/ui/desktop/app/templates/application.hbs b/ui/desktop/app/templates/application.hbs index 50c65b475..c7f3fbccc 100644 --- a/ui/desktop/app/templates/application.hbs +++ b/ui/desktop/app/templates/application.hbs @@ -43,7 +43,7 @@ {{#if this.session.isAuthenticated}} From 4ed0178c7a75276bb50489d11f627ebe97f6f10b Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 17 Aug 2021 17:12:45 -0400 Subject: [PATCH 03/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20upgrade=20resourc?= =?UTF-8?q?e=20icons=20to=20flight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/flight/arrow-right-circle-16.svg | 6 ++++++ addons/rose/public/flight/collections-16.svg | 7 +++++++ addons/rose/public/flight/crosshair-16.svg | 5 +++++ addons/rose/public/flight/folder-users-16.svg | 9 +++++++++ .../rose/public/flight/identity-user-16.svg | 7 +++++++ addons/rose/public/flight/key-16.svg | 6 ++++++ addons/rose/public/flight/lock-16.svg | 6 ++++++ addons/rose/public/flight/users-16.svg | 8 ++++++++ ui/admin/app/templates/scopes/scope.hbs | 20 +++++++++---------- .../app/templates/scopes/scope/-sidebar.hbs | 8 ++++---- .../templates/scopes/scope/sessions/index.hbs | 2 +- .../app/templates/scopes/scope/projects.hbs | 4 ++-- .../scopes/scope/projects/sessions/index.hbs | 2 +- .../scopes/scope/projects/targets.hbs | 2 +- .../projects/targets/target/sessions.hbs | 2 +- 15 files changed, 74 insertions(+), 20 deletions(-) create mode 100644 addons/rose/public/flight/arrow-right-circle-16.svg create mode 100644 addons/rose/public/flight/collections-16.svg create mode 100644 addons/rose/public/flight/crosshair-16.svg create mode 100644 addons/rose/public/flight/folder-users-16.svg create mode 100644 addons/rose/public/flight/identity-user-16.svg create mode 100644 addons/rose/public/flight/key-16.svg create mode 100644 addons/rose/public/flight/lock-16.svg create mode 100644 addons/rose/public/flight/users-16.svg diff --git a/addons/rose/public/flight/arrow-right-circle-16.svg b/addons/rose/public/flight/arrow-right-circle-16.svg new file mode 100644 index 000000000..24003e7de --- /dev/null +++ b/addons/rose/public/flight/arrow-right-circle-16.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/collections-16.svg b/addons/rose/public/flight/collections-16.svg new file mode 100644 index 000000000..cb96ffef0 --- /dev/null +++ b/addons/rose/public/flight/collections-16.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/crosshair-16.svg b/addons/rose/public/flight/crosshair-16.svg new file mode 100644 index 000000000..facad35a7 --- /dev/null +++ b/addons/rose/public/flight/crosshair-16.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/folder-users-16.svg b/addons/rose/public/flight/folder-users-16.svg new file mode 100644 index 000000000..bb81c2b6c --- /dev/null +++ b/addons/rose/public/flight/folder-users-16.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/identity-user-16.svg b/addons/rose/public/flight/identity-user-16.svg new file mode 100644 index 000000000..47cb2ba13 --- /dev/null +++ b/addons/rose/public/flight/identity-user-16.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/key-16.svg b/addons/rose/public/flight/key-16.svg new file mode 100644 index 000000000..e3ec42abd --- /dev/null +++ b/addons/rose/public/flight/key-16.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/lock-16.svg b/addons/rose/public/flight/lock-16.svg new file mode 100644 index 000000000..5b5dba1c1 --- /dev/null +++ b/addons/rose/public/flight/lock-16.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/users-16.svg b/addons/rose/public/flight/users-16.svg new file mode 100644 index 000000000..0648faa9f --- /dev/null +++ b/addons/rose/public/flight/users-16.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index 8385f4759..f896df85a 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -58,13 +58,13 @@ {{t "resources.group.title_plural"}} {{t "resources.role.title_plural"}} @@ -72,20 +72,20 @@ --}} - + {{t 'resources.session.title_plural'}} - + {{t 'resources.target.title_plural'}} - + {{t 'resources.host-catalog.title_plural'}} {{#if (feature-flag 'credential-store')}} - + {{t 'resources.credential-store.title_plural'}} {{/if}} @@ -95,19 +95,19 @@ {{#unless @model.isProject}} - + {{t 'resources.user.title_plural'}} - + {{t 'resources.group.title_plural'}} - + {{t 'resources.role.title_plural'}} - + {{t 'resources.auth-method.title_plural'}} diff --git a/ui/admin/app/templates/scopes/scope/-sidebar.hbs b/ui/admin/app/templates/scopes/scope/-sidebar.hbs index 3b06e303e..f592804ce 100644 --- a/ui/admin/app/templates/scopes/scope/-sidebar.hbs +++ b/ui/admin/app/templates/scopes/scope/-sidebar.hbs @@ -1,18 +1,18 @@ - + {{t 'resources.user.title_plural'}} - + {{t 'resources.group.title_plural'}} - + {{t 'resources.role.title_plural'}} - + {{t 'resources.auth-method.title_plural'}} \ No newline at end of file diff --git a/ui/admin/app/templates/scopes/scope/sessions/index.hbs b/ui/admin/app/templates/scopes/scope/sessions/index.hbs index d97fc2fd0..e1844e23b 100644 --- a/ui/admin/app/templates/scopes/scope/sessions/index.hbs +++ b/ui/admin/app/templates/scopes/scope/sessions/index.hbs @@ -36,7 +36,7 @@ 'session-status-' sessionAggregate.session.status }} - @name='app-icons/action-session' + @name='flight/arrow-right-circle-16' @size='medium' /> - + {{t 'resources.target.title_plural'}} - + {{t 'resources.session.title_plural'}} diff --git a/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs b/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs index 58abacbc3..5aeffbf98 100644 --- a/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs @@ -29,7 +29,7 @@ <:header> Date: Wed, 18 Aug 2021 10:03:16 -0400 Subject: [PATCH 04/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20upgrade=20clipboa?= =?UTF-8?q?rd=20copy=20icons=20to=20flight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rose/addon/components/rose/button/index.stories.mdx | 8 ++++---- .../rose/addon/components/rose/dialog/index.stories.mdx | 2 +- .../components/rose/form/radio/group/index.stories.mdx | 2 +- .../components/rose/form/radio/radio/index.stories.mdx | 4 ++-- .../rose/addon/components/rose/header/index.stories.mdx | 2 +- addons/rose/addon/components/rose/icon/index.stories.mdx | 2 +- .../addon/components/rose/link-button/index.stories.mdx | 6 +++--- addons/rose/public/flight/clipboard-checked-16.svg | 5 +++++ addons/rose/public/flight/clipboard-copy-16.svg | 9 +++++++++ ui/admin/app/components/copyable/index.js | 4 ++-- ui/desktop/app/components/copyable/index.js | 4 ++-- 11 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 addons/rose/public/flight/clipboard-checked-16.svg create mode 100644 addons/rose/public/flight/clipboard-copy-16.svg diff --git a/addons/rose/addon/components/rose/button/index.stories.mdx b/addons/rose/addon/components/rose/button/index.stories.mdx index 7617f0ba3..81cdb5ce2 100644 --- a/addons/rose/addon/components/rose/button/index.stories.mdx +++ b/addons/rose/addon/components/rose/button/index.stories.mdx @@ -50,7 +50,7 @@ other routes. For accessibility, use links instead. 'iconLeft', { 'check-circle-outline': 'check-circle-outline', - 'copy-action': 'copy-action', + 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, @@ -60,8 +60,8 @@ other routes. For accessibility, use links instead. 'iconRight', { 'check-circle-outline': 'check-circle-outline', - 'copy-action': 'chevron-right', - 'copy-action': 'copy-action', + 'chevron-right': 'chevron-right', + 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, @@ -87,7 +87,7 @@ button in this case for accessibility. 'iconOnly', { 'check-circle-outline': 'check-circle-outline', - 'copy-action': 'copy-action', + 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, diff --git a/addons/rose/addon/components/rose/dialog/index.stories.mdx b/addons/rose/addon/components/rose/dialog/index.stories.mdx index 9ea81df93..500fe17eb 100644 --- a/addons/rose/addon/components/rose/dialog/index.stories.mdx +++ b/addons/rose/addon/components/rose/dialog/index.stories.mdx @@ -37,7 +37,7 @@ A dialog component with optional modal capabilities. 'icon', { 'check-circle-outline': 'check-circle-outline', - 'copy-action': 'copy-action', + 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less' }, 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 6c81d2f94..d6119ea5f 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 @@ -69,7 +69,7 @@ Renders a form radiofield group. 'first icon', { 'flight/org-16': 'flight/org-16', - 'copy-action': 'copy-action', + 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, 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 2d1585c38..7eeec093e 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 @@ -45,7 +45,7 @@ Renders a form radiofield. { 'none': null, 'flight/org-16': 'flight/org-16', - 'copy-action': 'copy-action', + 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, @@ -112,7 +112,7 @@ Renders a form radiofield. { 'none': null, 'flight/org-16': 'flight/org-16', - 'copy-action': 'copy-action', + 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, diff --git a/addons/rose/addon/components/rose/header/index.stories.mdx b/addons/rose/addon/components/rose/header/index.stories.mdx index c7e0149a8..75eb07d5e 100644 --- a/addons/rose/addon/components/rose/header/index.stories.mdx +++ b/addons/rose/addon/components/rose/header/index.stories.mdx @@ -71,7 +71,7 @@ A header component that allows three distinct sections to be configured: brand, { 'flight/user-circle-16': 'flight/user-circle-16', 'check-circle-outline': 'check-circle-outline', - 'copy-action': 'copy-action', + 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, diff --git a/addons/rose/addon/components/rose/icon/index.stories.mdx b/addons/rose/addon/components/rose/icon/index.stories.mdx index ffb0e32ca..a25fb7997 100644 --- a/addons/rose/addon/components/rose/icon/index.stories.mdx +++ b/addons/rose/addon/components/rose/icon/index.stories.mdx @@ -25,7 +25,7 @@ Renders a simple icon from [Structure Icons][structure-icons]. 'name', { 'check-circle-outline': 'check-circle-outline', - 'copy-action': 'copy-action', + 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, diff --git a/addons/rose/addon/components/rose/link-button/index.stories.mdx b/addons/rose/addon/components/rose/link-button/index.stories.mdx index 0ca00a2ee..e6c717d8a 100644 --- a/addons/rose/addon/components/rose/link-button/index.stories.mdx +++ b/addons/rose/addon/components/rose/link-button/index.stories.mdx @@ -46,17 +46,17 @@ Disabling link button is not supported as it is an action on form components onl 'iconLeft', { 'check-circle-outline': 'check-circle-outline', - 'copy-action': 'copy-action', + 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', }, - 'copy-action' + 'flight/clipboard-copy-16' ), iconRight: select( 'iconRight', { 'check-circle-outline': 'check-circle-outline', 'chevron-right': 'chevron-right', - 'copy-action': 'copy-action', + 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'search': 'search', }, 'chevron-right' diff --git a/addons/rose/public/flight/clipboard-checked-16.svg b/addons/rose/public/flight/clipboard-checked-16.svg new file mode 100644 index 000000000..04db58a2c --- /dev/null +++ b/addons/rose/public/flight/clipboard-checked-16.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/clipboard-copy-16.svg b/addons/rose/public/flight/clipboard-copy-16.svg new file mode 100644 index 000000000..865e5d45d --- /dev/null +++ b/addons/rose/public/flight/clipboard-copy-16.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/ui/admin/app/components/copyable/index.js b/ui/admin/app/components/copyable/index.js index 09da77365..6f13e6ce7 100644 --- a/ui/admin/app/components/copyable/index.js +++ b/ui/admin/app/components/copyable/index.js @@ -12,8 +12,8 @@ export default class CopyableComponent extends Component { id = generateComponentID(); copyableButtonId = `copyable-button-${this.id}`; - actionIcon = 'copy-action'; - successIcon = 'copy-success'; + actionIcon = 'flight/clipboard-copy-16'; + successIcon = 'flight/clipboard-checked-16'; actionText = this.args.buttonText; successText = this.args.acknowledgeText; diff --git a/ui/desktop/app/components/copyable/index.js b/ui/desktop/app/components/copyable/index.js index a30ff3aca..8af16d028 100644 --- a/ui/desktop/app/components/copyable/index.js +++ b/ui/desktop/app/components/copyable/index.js @@ -13,8 +13,8 @@ export default class CopyableComponent extends Component { id = generateComponentID(); copyableButtonId = `copyable-button-${this.id}`; - actionIcon = 'copy-action'; - successIcon = 'copy-success'; + actionIcon = 'flight/clipboard-copy-16'; + successIcon = 'flight/clipboard-checked-16'; actionText = this.args.buttonText; successText = this.args.acknowledgeText; From 2d32726207962ad59a0f5cbf82c5a78ef56e57bd Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 18 Aug 2021 10:46:11 -0400 Subject: [PATCH 05/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20upgrade=20trash?= =?UTF-8?q?=20icon=20to=20flight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/rose/list/key-value/index.stories.mdx | 4 ++-- .../rose/addon/components/rose/table/index.stories.mdx | 2 +- addons/rose/public/flight/trash-16.svg | 7 +++++++ addons/rose/tests/dummy/app/templates/playground.hbs | 2 +- .../app/components/form/auth-method/oidc/index.hbs | 10 +++++----- ui/admin/app/components/form/role/grants/index.hbs | 2 +- 6 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 addons/rose/public/flight/trash-16.svg diff --git a/addons/rose/addon/components/rose/list/key-value/index.stories.mdx b/addons/rose/addon/components/rose/list/key-value/index.stories.mdx index b37e554ff..cded0db99 100644 --- a/addons/rose/addon/components/rose/list/key-value/index.stories.mdx +++ b/addons/rose/addon/components/rose/list/key-value/index.stories.mdx @@ -46,7 +46,7 @@ A simple key/value list with support for embedded form fields and buttons. - Remove + Remove @@ -94,7 +94,7 @@ A simple key/value list with support for embedded form fields and buttons. - Remove + Remove diff --git a/addons/rose/addon/components/rose/table/index.stories.mdx b/addons/rose/addon/components/rose/table/index.stories.mdx index 444419be4..0b786556a 100644 --- a/addons/rose/addon/components/rose/table/index.stories.mdx +++ b/addons/rose/addon/components/rose/table/index.stories.mdx @@ -122,7 +122,7 @@ Cell shrink should be applied to all the cells in a row. Otherwise the bigger ce - Remove + Remove diff --git a/addons/rose/public/flight/trash-16.svg b/addons/rose/public/flight/trash-16.svg new file mode 100644 index 000000000..9686f6d23 --- /dev/null +++ b/addons/rose/public/flight/trash-16.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/addons/rose/tests/dummy/app/templates/playground.hbs b/addons/rose/tests/dummy/app/templates/playground.hbs index 1ff6dcc6f..dc477136d 100644 --- a/addons/rose/tests/dummy/app/templates/playground.hbs +++ b/addons/rose/tests/dummy/app/templates/playground.hbs @@ -82,7 +82,7 @@ - Remove + Remove diff --git a/ui/admin/app/components/form/auth-method/oidc/index.hbs b/ui/admin/app/components/form/auth-method/oidc/index.hbs index 7d43d2e67..33e29d67e 100644 --- a/ui/admin/app/components/form/auth-method/oidc/index.hbs +++ b/ui/admin/app/components/form/auth-method/oidc/index.hbs @@ -178,7 +178,7 @@ From 7f022fc64c559bdc1079d1cb98bac6f7f9702fa7 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 18 Aug 2021 11:53:44 -0400 Subject: [PATCH 06/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20upgrade=20help=20?= =?UTF-8?q?and=20alert=20icons=20to=20flight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/addon/components/doc-link/index.hbs | 2 +- .../addon/components/error/message/index.js | 7 ++-- addons/core/index.js | 39 +++++++++++++++++++ .../rose/link-button/index.stories.mdx | 6 +-- .../components/rose/message/index.stories.mdx | 9 ++--- addons/rose/public/flight/alert-circle-16.svg | 7 ++++ addons/rose/public/flight/help-16.svg | 7 ++++ .../components/rose/card/link-test.js | 2 +- .../components/rose/link-button-test.js | 2 +- ui/admin/app/templates/scopes/index.hbs | 2 +- .../templates/scopes/scope/authenticate.hbs | 2 +- .../scopes/scope/authenticate/index.hbs | 2 +- .../templates/scopes/scope/authenticate.hbs | 2 +- .../scopes/scope/authenticate/index.hbs | 2 +- 14 files changed, 71 insertions(+), 20 deletions(-) create mode 100644 addons/rose/public/flight/alert-circle-16.svg create mode 100644 addons/rose/public/flight/help-16.svg diff --git a/addons/core/addon/components/doc-link/index.hbs b/addons/core/addon/components/doc-link/index.hbs index e654aac4a..c7b7e1a8e 100644 --- a/addons/core/addon/components/doc-link/index.hbs +++ b/addons/core/addon/components/doc-link/index.hbs @@ -4,5 +4,5 @@ target="_blank" rel="noreferrer noopener" title={{t "actions.get-topic-help"}}> - + diff --git a/addons/core/addon/components/error/message/index.js b/addons/core/addon/components/error/message/index.js index 22c587595..f121d7d7b 100644 --- a/addons/core/addon/components/error/message/index.js +++ b/addons/core/addon/components/error/message/index.js @@ -27,13 +27,12 @@ export default class ErrorMessageComponent extends MessageComponent { @computed('args.status') get icon() { switch (this.args.status) { + case '404': + return 'flight/help-16'; case '401': case '403': - return 'disabled'; - case '404': - return 'help-circle-outline'; default: - return 'alert-circle-outline'; + return 'flight/alert-circle-16'; } } diff --git a/addons/core/index.js b/addons/core/index.js index fa6be2662..f1a668631 100644 --- a/addons/core/index.js +++ b/addons/core/index.js @@ -1,4 +1,43 @@ 'use strict'; + +var path = require('path'); + module.exports = { name: require('./package').name, + + included(app) { + this._super.included.apply(this, arguments); + this.includePublic(app); + this.setupSVGO(app); + }, + + /** + * Finds the public folder and includes it into the ember-inline-svg addon. + */ + includePublic(app) { + const publicPath = path.resolve('public'); + const rosePublicPath = path.resolve('../rose/public'); + const dummyPublicPath = path.resolve('tests/dummy/public'); + + app.options.svg = app.options.svg || {}; + app.options.svg.paths = app.options.svg.paths || []; + + app.options.svg.paths.push(publicPath); + app.options.svg.paths.push(rosePublicPath); + if (this.isDevelopingAddon()) app.options.svg.paths.push(dummyPublicPath); + + this.addons.forEach((addon) => { + if (addon.name === 'ember-inline-svg') addon.included(app); + }); + }, + + /** + * Adjust SVG optimizer defaults (used by ember-inline-svg). + */ + setupSVGO(app) { + app.options.svg = app.options.svg || {}; + app.options.svg.optimize = app.options.svg.optimize || {}; + app.options.svg.optimize.plugins = app.options.svg.optimize.plugins || []; + app.options.svg.optimize.plugins.push({ removeViewBox: false }); + }, }; diff --git a/addons/rose/addon/components/rose/link-button/index.stories.mdx b/addons/rose/addon/components/rose/link-button/index.stories.mdx index e6c717d8a..f4e850bf9 100644 --- a/addons/rose/addon/components/rose/link-button/index.stories.mdx +++ b/addons/rose/addon/components/rose/link-button/index.stories.mdx @@ -68,7 +68,7 @@ Disabling link button is not supported as it is an action on form components onl Similar to `Rose::Button`, icon only link button is supported. ```html - + ``` @@ -92,11 +92,11 @@ Similar to `Rose::Button`, icon only link button is supported. 'iconOnly', { 'check-circle-outline': 'check-circle-outline', - 'help-circle-outline': 'help-circle-outline', + 'flight/help-16': 'flight/help-16', 'plus-circle-fill': 'plus-circle-fill', 'user-square-outline': 'user-square-outline', }, - 'help-circle-outline' + 'flight/help-16' ), }, }} diff --git a/addons/rose/addon/components/rose/message/index.stories.mdx b/addons/rose/addon/components/rose/message/index.stories.mdx index 89447aca1..c11095d2a 100644 --- a/addons/rose/addon/components/rose/message/index.stories.mdx +++ b/addons/rose/addon/components/rose/message/index.stories.mdx @@ -33,18 +33,17 @@ Title can be configured with optional icon and subtitle. icon: select( 'icon', { - 'alert-circle-outline': 'alert-circle-outline', - 'help-circle-outline': 'help-circle-outline', - 'disabled': 'disabled', + 'flight/alert-circle-16': 'flight/alert-circle-16', + 'flight/help-16': 'flight/help-16', }, - 'help-circle-outline' + 'flight/help-16' ), }, }} ```html - + You must be granted permissions to view this data. Ask your administrator if you think you should have access. diff --git a/addons/rose/public/flight/alert-circle-16.svg b/addons/rose/public/flight/alert-circle-16.svg new file mode 100644 index 000000000..55d000d4c --- /dev/null +++ b/addons/rose/public/flight/alert-circle-16.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/addons/rose/public/flight/help-16.svg b/addons/rose/public/flight/help-16.svg new file mode 100644 index 000000000..acaf4b376 --- /dev/null +++ b/addons/rose/public/flight/help-16.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/addons/rose/tests/integration/components/rose/card/link-test.js b/addons/rose/tests/integration/components/rose/card/link-test.js index af9003ef3..f4eb10074 100644 --- a/addons/rose/tests/integration/components/rose/card/link-test.js +++ b/addons/rose/tests/integration/components/rose/card/link-test.js @@ -42,7 +42,7 @@ module('Integration | Component | rose/card/link', function (hooks) { test('it renders with @icon', async function (assert) { await render( - hbs`` + hbs`` ); assert.ok(find('.rose-icon')); }); diff --git a/addons/rose/tests/integration/components/rose/link-button-test.js b/addons/rose/tests/integration/components/rose/link-button-test.js index ac2be94aa..243a4fbc5 100644 --- a/addons/rose/tests/integration/components/rose/link-button-test.js +++ b/addons/rose/tests/integration/components/rose/link-button-test.js @@ -51,7 +51,7 @@ module('Integration | Component | rose/link-button', function (hooks) { test('it supports only icon with @iconOnly', async function (assert) { await render( - hbs`` + hbs`` ); assert.ok(find('.rose-icon')); assert.ok(find('.has-icon-only')); diff --git a/ui/admin/app/templates/scopes/index.hbs b/ui/admin/app/templates/scopes/index.hbs index f4a0d7cfe..4ef9a35e2 100644 --- a/ui/admin/app/templates/scopes/index.hbs +++ b/ui/admin/app/templates/scopes/index.hbs @@ -8,7 +8,7 @@ diff --git a/ui/admin/app/templates/scopes/scope/authenticate.hbs b/ui/admin/app/templates/scopes/scope/authenticate.hbs index 847987db3..755b72578 100644 --- a/ui/admin/app/templates/scopes/scope/authenticate.hbs +++ b/ui/admin/app/templates/scopes/scope/authenticate.hbs @@ -79,7 +79,7 @@ diff --git a/ui/admin/app/templates/scopes/scope/authenticate/index.hbs b/ui/admin/app/templates/scopes/scope/authenticate/index.hbs index b8dbc824f..014f21a9a 100644 --- a/ui/admin/app/templates/scopes/scope/authenticate/index.hbs +++ b/ui/admin/app/templates/scopes/scope/authenticate/index.hbs @@ -2,7 +2,7 @@ diff --git a/ui/desktop/app/templates/scopes/scope/authenticate.hbs b/ui/desktop/app/templates/scopes/scope/authenticate.hbs index 0472b5fce..da49bb798 100644 --- a/ui/desktop/app/templates/scopes/scope/authenticate.hbs +++ b/ui/desktop/app/templates/scopes/scope/authenticate.hbs @@ -67,7 +67,7 @@ diff --git a/ui/desktop/app/templates/scopes/scope/authenticate/index.hbs b/ui/desktop/app/templates/scopes/scope/authenticate/index.hbs index b8dbc824f..014f21a9a 100644 --- a/ui/desktop/app/templates/scopes/scope/authenticate/index.hbs +++ b/ui/desktop/app/templates/scopes/scope/authenticate/index.hbs @@ -2,7 +2,7 @@ From c9b90db36d9e3db4689d95ad7b94e7b41c0675b9 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 18 Aug 2021 12:01:31 -0400 Subject: [PATCH 07/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20upgrade=20more-ho?= =?UTF-8?q?rizontal=20icon=20to=20flight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rose/addon/components/rose/dropdown/index.stories.mdx | 2 +- addons/rose/public/flight/more-horizontal-16.svg | 7 +++++++ ui/admin/app/templates/scopes/scope/auth-methods/index.hbs | 2 +- .../app/templates/scopes/scope/groups/group/members.hbs | 2 +- .../host-catalog/host-sets/host-set/hosts.hbs | 2 +- .../app/templates/scopes/scope/roles/role/principals.hbs | 2 +- .../scopes/scope/targets/target/credential-libraries.hbs | 2 +- .../templates/scopes/scope/targets/target/host-sets.hbs | 2 +- .../app/templates/scopes/scope/users/user/accounts.hbs | 2 +- 9 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 addons/rose/public/flight/more-horizontal-16.svg diff --git a/addons/rose/addon/components/rose/dropdown/index.stories.mdx b/addons/rose/addon/components/rose/dropdown/index.stories.mdx index 8ca5ff6dc..8ac807a63 100644 --- a/addons/rose/addon/components/rose/dropdown/index.stories.mdx +++ b/addons/rose/addon/components/rose/dropdown/index.stories.mdx @@ -117,7 +117,7 @@ Dropdown supports `danger` styling through `style` attribute. Dropdown indicator can be hidden using `showCaret` attribute. ```html - + Menu item Button menu item diff --git a/addons/rose/public/flight/more-horizontal-16.svg b/addons/rose/public/flight/more-horizontal-16.svg new file mode 100644 index 000000000..79143ccd4 --- /dev/null +++ b/addons/rose/public/flight/more-horizontal-16.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs index 6d4460c1e..0dd6e167f 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs @@ -123,7 +123,7 @@ @dropdownRight={{true}} @iconOnly={{true}} @showCaret={{false}} - @icon='more-horizontal' + @icon='flight/more-horizontal-16' as |dropdown| > {{#unless authMethod.isPrimary}} diff --git a/ui/admin/app/templates/scopes/scope/groups/group/members.hbs b/ui/admin/app/templates/scopes/scope/groups/group/members.hbs index a6512ef59..ee394abb1 100644 --- a/ui/admin/app/templates/scopes/scope/groups/group/members.hbs +++ b/ui/admin/app/templates/scopes/scope/groups/group/members.hbs @@ -27,7 +27,7 @@ Date: Wed, 18 Aug 2021 12:09:20 -0400 Subject: [PATCH 08/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20upgrade=20auth=20?= =?UTF-8?q?method=20state=20icons=20to=20flight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addon/components/rose/button/index.stories.mdx | 10 +++++----- .../addon/components/rose/dialog/index.stories.mdx | 6 +++--- .../addon/components/rose/header/index.stories.mdx | 2 +- .../rose/addon/components/rose/icon/index.stories.mdx | 4 ++-- .../components/rose/link-button/index.stories.mdx | 6 +++--- addons/rose/public/flight/check-circle-16.svg | 6 ++++++ addons/rose/public/flight/x-circle-16.svg | 6 ++++++ .../scopes/scope/auth-methods/auth-method/-actions.hbs | 4 ++-- 8 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 addons/rose/public/flight/check-circle-16.svg create mode 100644 addons/rose/public/flight/x-circle-16.svg diff --git a/addons/rose/addon/components/rose/button/index.stories.mdx b/addons/rose/addon/components/rose/button/index.stories.mdx index 81cdb5ce2..5e00e39aa 100644 --- a/addons/rose/addon/components/rose/button/index.stories.mdx +++ b/addons/rose/addon/components/rose/button/index.stories.mdx @@ -49,17 +49,17 @@ other routes. For accessibility, use links instead. iconLeft: select( 'iconLeft', { - 'check-circle-outline': 'check-circle-outline', + 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, - 'check-circle-outline' + 'flight/check-circle-16' ), iconRight: select( 'iconRight', { - 'check-circle-outline': 'check-circle-outline', + 'flight/check-circle-16': 'flight/check-circle-16', 'chevron-right': 'chevron-right', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', @@ -86,12 +86,12 @@ button in this case for accessibility. iconOnly: select( 'iconOnly', { - 'check-circle-outline': 'check-circle-outline', + 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, - 'check-circle-outline' + 'flight/check-circle-16' ), }, }} diff --git a/addons/rose/addon/components/rose/dialog/index.stories.mdx b/addons/rose/addon/components/rose/dialog/index.stories.mdx index 500fe17eb..70a0a1f0e 100644 --- a/addons/rose/addon/components/rose/dialog/index.stories.mdx +++ b/addons/rose/addon/components/rose/dialog/index.stories.mdx @@ -36,12 +36,12 @@ A dialog component with optional modal capabilities. icon: select( 'icon', { - 'check-circle-outline': 'check-circle-outline', + 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less' }, - 'check-circle-outline' + 'flight/check-circle-16' ), style: select( 'style', @@ -60,7 +60,7 @@ A dialog component with optional modal capabilities. diff --git a/addons/rose/addon/components/rose/header/index.stories.mdx b/addons/rose/addon/components/rose/header/index.stories.mdx index 75eb07d5e..629644e10 100644 --- a/addons/rose/addon/components/rose/header/index.stories.mdx +++ b/addons/rose/addon/components/rose/header/index.stories.mdx @@ -70,7 +70,7 @@ A header component that allows three distinct sections to be configured: brand, 'dropdownIcon', { 'flight/user-circle-16': 'flight/user-circle-16', - 'check-circle-outline': 'check-circle-outline', + 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', diff --git a/addons/rose/addon/components/rose/icon/index.stories.mdx b/addons/rose/addon/components/rose/icon/index.stories.mdx index a25fb7997..8027e7352 100644 --- a/addons/rose/addon/components/rose/icon/index.stories.mdx +++ b/addons/rose/addon/components/rose/icon/index.stories.mdx @@ -24,12 +24,12 @@ Renders a simple icon from [Structure Icons][structure-icons]. name: select( 'name', { - 'check-circle-outline': 'check-circle-outline', + 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', 'unfold-less': 'unfold-less', }, - 'check-circle-outline' + 'flight/check-circle-16' ), } }} diff --git a/addons/rose/addon/components/rose/link-button/index.stories.mdx b/addons/rose/addon/components/rose/link-button/index.stories.mdx index f4e850bf9..94ca8d54d 100644 --- a/addons/rose/addon/components/rose/link-button/index.stories.mdx +++ b/addons/rose/addon/components/rose/link-button/index.stories.mdx @@ -45,7 +45,7 @@ Disabling link button is not supported as it is an action on form components onl iconLeft: select( 'iconLeft', { - 'check-circle-outline': 'check-circle-outline', + 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'unfold-more': 'unfold-more', }, @@ -54,7 +54,7 @@ Disabling link button is not supported as it is an action on form components onl iconRight: select( 'iconRight', { - 'check-circle-outline': 'check-circle-outline', + 'flight/check-circle-16': 'flight/check-circle-16', 'chevron-right': 'chevron-right', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', 'search': 'search', @@ -91,7 +91,7 @@ Similar to `Rose::Button`, icon only link button is supported. iconOnly: select( 'iconOnly', { - 'check-circle-outline': 'check-circle-outline', + 'flight/check-circle-16': 'flight/check-circle-16', 'flight/help-16': 'flight/help-16', 'plus-circle-fill': 'plus-circle-fill', 'user-square-outline': 'user-square-outline', diff --git a/addons/rose/public/flight/check-circle-16.svg b/addons/rose/public/flight/check-circle-16.svg new file mode 100644 index 000000000..4d296da62 --- /dev/null +++ b/addons/rose/public/flight/check-circle-16.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/x-circle-16.svg b/addons/rose/public/flight/x-circle-16.svg new file mode 100644 index 000000000..5b0aa3f78 --- /dev/null +++ b/addons/rose/public/flight/x-circle-16.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-actions.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-actions.hbs index 2d6e7d9a9..200cc9912 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-actions.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-actions.hbs @@ -3,8 +3,8 @@ @text={{t (concat 'states.' @model.attributes.state)}} @icon={{if @model.isInactive - 'disabled' - (if @model.isPrivate 'lock-closed-outline' 'check-circle-outline') + 'flight/x-circle-16' + (if @model.isPrivate 'flight/lock-16' 'flight/check-circle-16') }} @dropdownRight={{true}} as |dropdown| From e248bbe2008c07e318de0a2508ca467440f3bfee Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 18 Aug 2021 12:38:17 -0400 Subject: [PATCH 09/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20upgrade=20alert?= =?UTF-8?q?=20and=20cancel=20icons=20to=20flight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/addon/components/rose/dialog/index.hbs | 4 ++-- .../addon/components/rose/form/errors/message/index.hbs | 2 +- addons/rose/addon/components/rose/notification/index.hbs | 2 +- addons/rose/addon/components/rose/notification/index.js | 8 ++++---- addons/rose/public/flight/alert-triangle-16.svg | 7 +++++++ addons/rose/public/flight/info-16.svg | 7 +++++++ addons/rose/public/flight/x-16.svg | 5 +++++ addons/rose/public/flight/x-square-16.svg | 6 ++++++ ui/admin/app/templates/application.hbs | 4 ++-- ui/desktop/app/templates/application.hbs | 6 +++--- 10 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 addons/rose/public/flight/alert-triangle-16.svg create mode 100644 addons/rose/public/flight/info-16.svg create mode 100644 addons/rose/public/flight/x-16.svg create mode 100644 addons/rose/public/flight/x-square-16.svg diff --git a/addons/rose/addon/components/rose/dialog/index.hbs b/addons/rose/addon/components/rose/dialog/index.hbs index aa03d38de..7876f5349 100644 --- a/addons/rose/addon/components/rose/dialog/index.hbs +++ b/addons/rose/addon/components/rose/dialog/index.hbs @@ -27,7 +27,7 @@ title={{@dismissButtonText}} {{on "click" (fn this.dismiss @dismiss)}} > - + @@ -62,7 +62,7 @@ title={{@dismissButtonText}} {{on "click" (fn this.dismiss @dismiss)}} > - + diff --git a/addons/rose/addon/components/rose/form/errors/message/index.hbs b/addons/rose/addon/components/rose/form/errors/message/index.hbs index fb4b2ebe0..443829171 100644 --- a/addons/rose/addon/components/rose/form/errors/message/index.hbs +++ b/addons/rose/addon/components/rose/form/errors/message/index.hbs @@ -1,4 +1,4 @@

- + {{yield}}

diff --git a/addons/rose/addon/components/rose/notification/index.hbs b/addons/rose/addon/components/rose/notification/index.hbs index 04d60df5f..3d9290695 100644 --- a/addons/rose/addon/components/rose/notification/index.hbs +++ b/addons/rose/addon/components/rose/notification/index.hbs @@ -26,7 +26,7 @@ {{on "click" @dismiss}} > {{@dismissText}} diff --git a/addons/rose/addon/components/rose/notification/index.js b/addons/rose/addon/components/rose/notification/index.js index 881d11355..c3c23b44b 100644 --- a/addons/rose/addon/components/rose/notification/index.js +++ b/addons/rose/addon/components/rose/notification/index.js @@ -8,17 +8,17 @@ export default class RoseNotificationComponent extends Component { */ @computed('style') get icon() { - let icon = 'info-circle-fill'; + let icon = 'flight/info-16'; switch (this.style) { case 'error': - icon = 'cancel-square-fill'; + icon = 'flight/x-square-16'; break; case 'success': - icon = 'check-circle-fill'; + icon = 'flight/check-circle-16'; break; case 'warning': - icon = 'alert-triangle'; + icon = 'flight/alert-triangle-16'; break; } diff --git a/addons/rose/public/flight/alert-triangle-16.svg b/addons/rose/public/flight/alert-triangle-16.svg new file mode 100644 index 000000000..9367dbd4c --- /dev/null +++ b/addons/rose/public/flight/alert-triangle-16.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/info-16.svg b/addons/rose/public/flight/info-16.svg new file mode 100644 index 000000000..1c7f58c50 --- /dev/null +++ b/addons/rose/public/flight/info-16.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/x-16.svg b/addons/rose/public/flight/x-16.svg new file mode 100644 index 000000000..f41d39dd5 --- /dev/null +++ b/addons/rose/public/flight/x-16.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/x-square-16.svg b/addons/rose/public/flight/x-square-16.svg new file mode 100644 index 000000000..9bf270d7e --- /dev/null +++ b/addons/rose/public/flight/x-square-16.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ui/admin/app/templates/application.hbs b/ui/admin/app/templates/application.hbs index e0bf5a1e5..7413d948e 100644 --- a/ui/admin/app/templates/application.hbs +++ b/ui/admin/app/templates/application.hbs @@ -100,7 +100,7 @@ {{#if this.isWindowsOS}} Date: Wed, 18 Aug 2021 12:49:51 -0400 Subject: [PATCH 10/60] chore: remove storybook usage of non-flight icons --- .../rose/addon/components/rose/badge/index.stories.mdx | 2 -- .../rose/addon/components/rose/button/index.stories.mdx | 9 +-------- .../addon/components/rose/card/link/index.stories.mdx | 2 -- .../rose/addon/components/rose/dialog/index.stories.mdx | 2 -- .../components/rose/form/radio/group/index.stories.mdx | 2 -- .../components/rose/form/radio/radio/index.stories.mdx | 4 ---- .../rose/addon/components/rose/header/index.stories.mdx | 2 -- .../addon/components/rose/link-button/index.stories.mdx | 7 +------ 8 files changed, 2 insertions(+), 28 deletions(-) diff --git a/addons/rose/addon/components/rose/badge/index.stories.mdx b/addons/rose/addon/components/rose/badge/index.stories.mdx index 0011927a7..1d65b3d0a 100644 --- a/addons/rose/addon/components/rose/badge/index.stories.mdx +++ b/addons/rose/addon/components/rose/badge/index.stories.mdx @@ -44,8 +44,6 @@ Styles: outline, dark, informational, informational-outline, success, success-ou ), icon: select('icon', { 'flight/org-16': 'flight/org-16', - 'partner': 'partner', - 'gift-fill': 'gift-fill', }, 'flight/org-16' ), diff --git a/addons/rose/addon/components/rose/button/index.stories.mdx b/addons/rose/addon/components/rose/button/index.stories.mdx index 5e00e39aa..0e9380eaa 100644 --- a/addons/rose/addon/components/rose/button/index.stories.mdx +++ b/addons/rose/addon/components/rose/button/index.stories.mdx @@ -51,8 +51,6 @@ other routes. For accessibility, use links instead. { 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', - 'unfold-more': 'unfold-more', - 'unfold-less': 'unfold-less', }, 'flight/check-circle-16' ), @@ -60,12 +58,9 @@ other routes. For accessibility, use links instead. 'iconRight', { 'flight/check-circle-16': 'flight/check-circle-16', - 'chevron-right': 'chevron-right', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', - 'unfold-more': 'unfold-more', - 'unfold-less': 'unfold-less', }, - 'chevron-right' + 'flight/clipboard-copy-16' ), onClick: action('clicked'), }, @@ -88,8 +83,6 @@ button in this case for accessibility. { 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', - 'unfold-more': 'unfold-more', - 'unfold-less': 'unfold-less', }, 'flight/check-circle-16' ), diff --git a/addons/rose/addon/components/rose/card/link/index.stories.mdx b/addons/rose/addon/components/rose/card/link/index.stories.mdx index 960fc709f..8aaf7e693 100644 --- a/addons/rose/addon/components/rose/card/link/index.stories.mdx +++ b/addons/rose/addon/components/rose/card/link/index.stories.mdx @@ -33,8 +33,6 @@ Card link component wraps content with `LinkTo` component. Supports title and de id: text('id', 'resource_id_1234'), icon: select('icon', { 'flight/org-16': 'flight/org-16', - 'partner': 'partner', - 'gift-fill': 'gift-fill', }, 'flight/org-16' ), diff --git a/addons/rose/addon/components/rose/dialog/index.stories.mdx b/addons/rose/addon/components/rose/dialog/index.stories.mdx index 70a0a1f0e..0315a3c87 100644 --- a/addons/rose/addon/components/rose/dialog/index.stories.mdx +++ b/addons/rose/addon/components/rose/dialog/index.stories.mdx @@ -38,8 +38,6 @@ A dialog component with optional modal capabilities. { 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', - 'unfold-more': 'unfold-more', - 'unfold-less': 'unfold-less' }, 'flight/check-circle-16' ), 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 d6119ea5f..be4aa2b3f 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 @@ -70,8 +70,6 @@ Renders a form radiofield group. { 'flight/org-16': 'flight/org-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', - 'unfold-more': 'unfold-more', - 'unfold-less': 'unfold-less', }, 'flight/org-16' ), 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 7eeec093e..e2f15d63a 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 @@ -46,8 +46,6 @@ Renders a form radiofield. 'none': null, 'flight/org-16': 'flight/org-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', - 'unfold-more': 'unfold-more', - 'unfold-less': 'unfold-less', }, null ), @@ -113,8 +111,6 @@ Renders a form radiofield. 'none': null, 'flight/org-16': 'flight/org-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', - 'unfold-more': 'unfold-more', - 'unfold-less': 'unfold-less', }, null ), diff --git a/addons/rose/addon/components/rose/header/index.stories.mdx b/addons/rose/addon/components/rose/header/index.stories.mdx index 629644e10..be894c503 100644 --- a/addons/rose/addon/components/rose/header/index.stories.mdx +++ b/addons/rose/addon/components/rose/header/index.stories.mdx @@ -72,8 +72,6 @@ A header component that allows three distinct sections to be configured: brand, 'flight/user-circle-16': 'flight/user-circle-16', 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', - 'unfold-more': 'unfold-more', - 'unfold-less': 'unfold-less', }, 'flight/user-circle-16' ), diff --git a/addons/rose/addon/components/rose/link-button/index.stories.mdx b/addons/rose/addon/components/rose/link-button/index.stories.mdx index 94ca8d54d..381beb8cd 100644 --- a/addons/rose/addon/components/rose/link-button/index.stories.mdx +++ b/addons/rose/addon/components/rose/link-button/index.stories.mdx @@ -47,7 +47,6 @@ Disabling link button is not supported as it is an action on form components onl { 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', - 'unfold-more': 'unfold-more', }, 'flight/clipboard-copy-16' ), @@ -55,11 +54,9 @@ Disabling link button is not supported as it is an action on form components onl 'iconRight', { 'flight/check-circle-16': 'flight/check-circle-16', - 'chevron-right': 'chevron-right', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', - 'search': 'search', }, - 'chevron-right' + 'flight/clipboard-copy-16' ), }, }} @@ -93,8 +90,6 @@ Similar to `Rose::Button`, icon only link button is supported. { 'flight/check-circle-16': 'flight/check-circle-16', 'flight/help-16': 'flight/help-16', - 'plus-circle-fill': 'plus-circle-fill', - 'user-square-outline': 'user-square-outline', }, 'flight/help-16' ), From 6b9c8192a95aae80127b7f1bece3c2d05bdf2422 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 18 Aug 2021 12:51:40 -0400 Subject: [PATCH 11/60] chore: convert test icon usage to flight --- ui/desktop/tests/integration/components/card-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/desktop/tests/integration/components/card-test.js b/ui/desktop/tests/integration/components/card-test.js index fdb37919b..e0d627d13 100644 --- a/ui/desktop/tests/integration/components/card-test.js +++ b/ui/desktop/tests/integration/components/card-test.js @@ -30,7 +30,7 @@ module('Integration | Component | card', function (hooks) { await render(hbs` + @icon='flight/key-16'> <:header> <:body> <:footer> From 5cdc7af5882ec400cf34891b0092b5ebe7a2a14c Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 18 Aug 2021 13:33:40 -0400 Subject: [PATCH 12/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20remove=20last=20u?= =?UTF-8?q?sage=20of=20structure-icons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/rose/button/index.stories.mdx | 2 +- .../components/rose/icon/index.stories.mdx | 6 +----- .../rose/link-button/index.stories.mdx | 2 +- addons/rose/index.js | 19 ------------------- addons/rose/package.json | 1 - addons/rose/public/chevron-left.svg | 3 +++ addons/rose/public/chevron-right.svg | 3 +++ addons/rose/public/flight/chevron-left-16.svg | 5 +++++ addons/rose/public/flight/eye-16.svg | 6 ++++++ addons/rose/public/flight/eye-off-16.svg | 6 ++++++ addons/rose/public/flight/plus-circle-16.svg | 6 ++++++ .../integration/components/rose/badge-test.js | 2 +- .../integration/components/rose/icon-test.js | 4 ++-- .../components/rose/link-button-test.js | 2 +- .../auth-method/accounts/index.hbs | 2 +- .../scopes/scope/auth-methods/index.hbs | 2 +- .../credential-libraries/index.hbs | 2 +- .../scopes/scope/credential-stores/index.hbs | 2 +- .../scopes/scope/groups/group/members.hbs | 2 +- .../templates/scopes/scope/groups/index.hbs | 2 +- .../host-catalog/host-sets/host-set/hosts.hbs | 2 +- .../host-catalog/host-sets/index.hbs | 2 +- .../host-catalog/hosts/index.hbs | 2 +- .../scopes/scope/host-catalogs/index.hbs | 2 +- .../templates/scopes/scope/roles/index.hbs | 2 +- .../scopes/scope/roles/role/principals.hbs | 2 +- .../templates/scopes/scope/scopes/index.hbs | 4 ++-- .../templates/scopes/scope/targets/index.hbs | 2 +- .../targets/target/credential-libraries.hbs | 2 +- .../scopes/scope/targets/target/host-sets.hbs | 2 +- .../templates/scopes/scope/users/index.hbs | 2 +- .../scopes/scope/users/user/accounts.hbs | 2 +- .../app/components/hidden-secret/index.hbs | 2 +- yarn.lock | 5 ----- 34 files changed, 56 insertions(+), 56 deletions(-) create mode 100644 addons/rose/public/chevron-left.svg create mode 100644 addons/rose/public/chevron-right.svg create mode 100644 addons/rose/public/flight/chevron-left-16.svg create mode 100644 addons/rose/public/flight/eye-16.svg create mode 100644 addons/rose/public/flight/eye-off-16.svg create mode 100644 addons/rose/public/flight/plus-circle-16.svg diff --git a/addons/rose/addon/components/rose/button/index.stories.mdx b/addons/rose/addon/components/rose/button/index.stories.mdx index 0e9380eaa..76010a51c 100644 --- a/addons/rose/addon/components/rose/button/index.stories.mdx +++ b/addons/rose/addon/components/rose/button/index.stories.mdx @@ -12,7 +12,7 @@ to trigger actions or to submit forms. Avoid using buttons as simple links to other routes. For accessibility, use links instead. ```htmlbars - + Action ``` diff --git a/addons/rose/addon/components/rose/icon/index.stories.mdx b/addons/rose/addon/components/rose/icon/index.stories.mdx index 8027e7352..d22b1bcac 100644 --- a/addons/rose/addon/components/rose/icon/index.stories.mdx +++ b/addons/rose/addon/components/rose/icon/index.stories.mdx @@ -7,9 +7,7 @@ import { text, boolean, select } from '@storybook/addon-knobs'; # Icon -Renders a simple icon from [Structure Icons][structure-icons]. - -[structure-icons]: https://github.com/hashicorp/structure-icons +Renders a simple icon. ```htmlbars @@ -26,8 +24,6 @@ Renders a simple icon from [Structure Icons][structure-icons]. { 'flight/check-circle-16': 'flight/check-circle-16', 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', - 'unfold-more': 'unfold-more', - 'unfold-less': 'unfold-less', }, 'flight/check-circle-16' ), diff --git a/addons/rose/addon/components/rose/link-button/index.stories.mdx b/addons/rose/addon/components/rose/link-button/index.stories.mdx index 381beb8cd..9f8831694 100644 --- a/addons/rose/addon/components/rose/link-button/index.stories.mdx +++ b/addons/rose/addon/components/rose/link-button/index.stories.mdx @@ -12,7 +12,7 @@ Styles supported: primary, secondary, warning, and ghost. Disabling link button is not supported as it is an action on form components only. ```html - + Content ``` diff --git a/addons/rose/index.js b/addons/rose/index.js index 6de73c3ca..4da13fee7 100644 --- a/addons/rose/index.js +++ b/addons/rose/index.js @@ -10,7 +10,6 @@ module.exports = { this._super.included.apply(this, arguments); this.includeStyles(app); - this.includeIcons(app); this.includePublic(app); this.setupSVGO(app); }, @@ -41,24 +40,6 @@ module.exports = { app.options.sassOptions.includePaths.push(styleTree); }, - /** - * Finds the structure-icons folder and includes it into the - * ember-inline-svg addon. - */ - includeIcons(app) { - const iconPackagePath = require.resolve('@hashicorp/structure-icons'); - const iconsPath = path.resolve(iconPackagePath, '..'); - - app.options.svg = app.options.svg || {}; - app.options.svg.paths = app.options.svg.paths || []; - - app.options.svg.paths.push(iconsPath); - - this.addons.forEach((addon) => { - if (addon.name === 'ember-inline-svg') addon.included(app); - }); - }, - /** * Finds the public folder and includes it into the ember-inline-svg addon. */ diff --git a/addons/rose/package.json b/addons/rose/package.json index 6e1f5fadb..88718fbbd 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -43,7 +43,6 @@ "@ember/test-helpers": "^2.2.8", "@glimmer/component": "^1.0.3", "@glimmer/tracking": "^1.0.3", - "@hashicorp/structure-icons": "^1.9.0-0", "@storybook/addon-actions": "^6.3.1", "@storybook/addon-docs": "^6.3.1", "@storybook/addon-knobs": "^6.3.0", diff --git a/addons/rose/public/chevron-left.svg b/addons/rose/public/chevron-left.svg new file mode 100644 index 000000000..6b6f3a0ea --- /dev/null +++ b/addons/rose/public/chevron-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/addons/rose/public/chevron-right.svg b/addons/rose/public/chevron-right.svg new file mode 100644 index 000000000..be0fbc667 --- /dev/null +++ b/addons/rose/public/chevron-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/addons/rose/public/flight/chevron-left-16.svg b/addons/rose/public/flight/chevron-left-16.svg new file mode 100644 index 000000000..62fda4d33 --- /dev/null +++ b/addons/rose/public/flight/chevron-left-16.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/eye-16.svg b/addons/rose/public/flight/eye-16.svg new file mode 100644 index 000000000..8eb2e59a7 --- /dev/null +++ b/addons/rose/public/flight/eye-16.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/eye-off-16.svg b/addons/rose/public/flight/eye-off-16.svg new file mode 100644 index 000000000..105f1d3e3 --- /dev/null +++ b/addons/rose/public/flight/eye-off-16.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/addons/rose/public/flight/plus-circle-16.svg b/addons/rose/public/flight/plus-circle-16.svg new file mode 100644 index 000000000..6cef57c52 --- /dev/null +++ b/addons/rose/public/flight/plus-circle-16.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/addons/rose/tests/integration/components/rose/badge-test.js b/addons/rose/tests/integration/components/rose/badge-test.js index 8665085e7..7b5a62abe 100644 --- a/addons/rose/tests/integration/components/rose/badge-test.js +++ b/addons/rose/tests/integration/components/rose/badge-test.js @@ -17,7 +17,7 @@ module('Integration | Component | rose/badge', function (hooks) { }); test('it renders an icon using @icon', async function (assert) { - await render(hbs``); + await render(hbs``); assert.ok(find('.rose-icon')); }); diff --git a/addons/rose/tests/integration/components/rose/icon-test.js b/addons/rose/tests/integration/components/rose/icon-test.js index 43a429077..2caad0943 100644 --- a/addons/rose/tests/integration/components/rose/icon-test.js +++ b/addons/rose/tests/integration/components/rose/icon-test.js @@ -7,12 +7,12 @@ module('Integration | Component | rose/icon', function (hooks) { setupRenderingTest(hooks); test('it renders', async function (assert) { - await render(hbs``); + await render(hbs``); assert.ok(find('svg')); }); test('it supports optional @size', async function (assert) { - await render(hbs``); + await render(hbs``); assert.ok(find('.small')); }); }); diff --git a/addons/rose/tests/integration/components/rose/link-button-test.js b/addons/rose/tests/integration/components/rose/link-button-test.js index 243a4fbc5..0312d94ea 100644 --- a/addons/rose/tests/integration/components/rose/link-button-test.js +++ b/addons/rose/tests/integration/components/rose/link-button-test.js @@ -43,7 +43,7 @@ module('Integration | Component | rose/link-button', function (hooks) { test('it supports left icon with @iconRight', async function (assert) { await render( - hbs`` + hbs`` ); assert.ok(find('.rose-icon')); assert.ok(find('.has-icon-right')); diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/accounts/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/accounts/index.hbs index c35071bf7..ee9b1091d 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/accounts/index.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/accounts/index.hbs @@ -115,7 +115,7 @@ {{t 'resources.account.messages.welcome.description'}} - + {{t 'resources.account.actions.create'}} diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs index 0dd6e167f..0a4fbd8d8 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs @@ -165,7 +165,7 @@ @route='scopes.scope.auth-methods.new' @query={{hash type='password'}} > - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs b/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs index 2bb3101c2..60d720c91 100644 --- a/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs +++ b/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs @@ -58,7 +58,7 @@ - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs b/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs index e614dd097..cf059f762 100644 --- a/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs +++ b/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs @@ -78,7 +78,7 @@ {{t 'resources.credential-store.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/groups/group/members.hbs b/ui/admin/app/templates/scopes/scope/groups/group/members.hbs index ee394abb1..07503d0d3 100644 --- a/ui/admin/app/templates/scopes/scope/groups/group/members.hbs +++ b/ui/admin/app/templates/scopes/scope/groups/group/members.hbs @@ -58,7 +58,7 @@ {{t 'resources.group.messages.members.description'}} - + {{t 'resources.group.actions.add-members'}} diff --git a/ui/admin/app/templates/scopes/scope/groups/index.hbs b/ui/admin/app/templates/scopes/scope/groups/index.hbs index cb59fde2e..c290f9948 100644 --- a/ui/admin/app/templates/scopes/scope/groups/index.hbs +++ b/ui/admin/app/templates/scopes/scope/groups/index.hbs @@ -72,7 +72,7 @@ {{t 'resources.group.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs index 07392abcb..1b1f21949 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs @@ -70,7 +70,7 @@ {{!-- - + {{t "resources.host-set.actions.create-and-add-host"}} --}} 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 4f0c433bf..defdee52e 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 @@ -52,7 +52,7 @@ - + {{t 'titles.new'}} 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 c7079adec..3079c54c2 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 @@ -54,7 +54,7 @@ {{t 'resources.host.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs index dcc1f811c..6affad96b 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs @@ -81,7 +81,7 @@ {{t 'resources.host-catalog.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/roles/index.hbs b/ui/admin/app/templates/scopes/scope/roles/index.hbs index 7fb62530c..30cc00e38 100644 --- a/ui/admin/app/templates/scopes/scope/roles/index.hbs +++ b/ui/admin/app/templates/scopes/scope/roles/index.hbs @@ -67,7 +67,7 @@ {{t 'resources.role.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs b/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs index 9767bab5e..b67e32aa7 100644 --- a/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs +++ b/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs @@ -62,7 +62,7 @@ {{t 'resources.role.principal.messages.welcome.description'}} - + {{t 'resources.role.principal.actions.add-principals'}} diff --git a/ui/admin/app/templates/scopes/scope/scopes/index.hbs b/ui/admin/app/templates/scopes/scope/scopes/index.hbs index c4fce49b5..542404b4e 100644 --- a/ui/admin/app/templates/scopes/scope/scopes/index.hbs +++ b/ui/admin/app/templates/scopes/scope/scopes/index.hbs @@ -62,7 +62,7 @@ {{t 'resources.org.description'}} - + {{t 'titles.new'}} @@ -79,7 +79,7 @@ {{t 'resources.project.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/targets/index.hbs b/ui/admin/app/templates/scopes/scope/targets/index.hbs index f8dcec9b4..a3cf56314 100644 --- a/ui/admin/app/templates/scopes/scope/targets/index.hbs +++ b/ui/admin/app/templates/scopes/scope/targets/index.hbs @@ -82,7 +82,7 @@ {{t 'resources.target.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/targets/target/credential-libraries.hbs b/ui/admin/app/templates/scopes/scope/targets/target/credential-libraries.hbs index 38b00b4c0..b62c5d4d2 100644 --- a/ui/admin/app/templates/scopes/scope/targets/target/credential-libraries.hbs +++ b/ui/admin/app/templates/scopes/scope/targets/target/credential-libraries.hbs @@ -82,7 +82,7 @@ - + {{t 'resources.target.actions.add-credential-libraries'}} diff --git a/ui/admin/app/templates/scopes/scope/targets/target/host-sets.hbs b/ui/admin/app/templates/scopes/scope/targets/target/host-sets.hbs index d013f5fd9..5f0f96421 100644 --- a/ui/admin/app/templates/scopes/scope/targets/target/host-sets.hbs +++ b/ui/admin/app/templates/scopes/scope/targets/target/host-sets.hbs @@ -68,7 +68,7 @@ {{t 'resources.target.host-set.messages.welcome.description'}} - + {{t 'resources.target.actions.add-host-sets'}} diff --git a/ui/admin/app/templates/scopes/scope/users/index.hbs b/ui/admin/app/templates/scopes/scope/users/index.hbs index ab31bc1cf..b282a6993 100644 --- a/ui/admin/app/templates/scopes/scope/users/index.hbs +++ b/ui/admin/app/templates/scopes/scope/users/index.hbs @@ -71,7 +71,7 @@ {{t 'resources.user.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/users/user/accounts.hbs b/ui/admin/app/templates/scopes/scope/users/user/accounts.hbs index 1ab874bcd..ec8d3704e 100644 --- a/ui/admin/app/templates/scopes/scope/users/user/accounts.hbs +++ b/ui/admin/app/templates/scopes/scope/users/user/accounts.hbs @@ -68,7 +68,7 @@ {{t 'resources.user.messages.accounts.description'}} - + {{t 'resources.user.actions.add-accounts'}} diff --git a/ui/desktop/app/components/hidden-secret/index.hbs b/ui/desktop/app/components/hidden-secret/index.hbs index 6660a77e5..afca5e4d3 100644 --- a/ui/desktop/app/components/hidden-secret/index.hbs +++ b/ui/desktop/app/components/hidden-secret/index.hbs @@ -1,7 +1,7 @@
{{t 'actions.toggle-secret'}} diff --git a/yarn.lock b/yarn.lock index d398e26ee..d35304465 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2066,11 +2066,6 @@ resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-1.1.0.tgz#d6dbc7574774b238114582410e8fee0dc3532bdf" integrity sha512-rR7tJoSwJ2eooOpYGxGGW95sLq6GXUaS1UtWvN7pei6n2/okYvCGld9vsUTvkl2migxbkszsycwtMf/GEc1k1A== -"@hashicorp/structure-icons@^1.9.0-0": - version "1.9.2" - resolved "https://registry.yarnpkg.com/@hashicorp/structure-icons/-/structure-icons-1.9.2.tgz#c75f955b2eec414ecb92f3926c79b4ca01731d3c" - integrity sha512-AffJv0V9npr1EWlM1XrpaKPG9PzddV48OE+jspqy7aRoFZB5++oNnPx4MZQKmFInOljnzNwfktVRkJiQHy7haw== - "@humanwhocodes/config-array@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" From bdb38a5324677fdc3c3a42510791d6bc021d71b7 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Fri, 20 Aug 2021 13:51:45 -0400 Subject: [PATCH 13/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20upgrade=20to=20ch?= =?UTF-8?q?evron-left=20from=20flight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/addon/components/rose/message/index.stories.mdx | 4 ++-- addons/rose/public/chevron-left.svg | 3 --- addons/rose/public/chevron-right.svg | 3 --- addons/rose/public/flight/chevron-left-16.svg | 4 ++-- .../rose/tests/integration/components/rose/button-test.js | 6 +++--- .../integration/components/rose/dropdown/button-test.js | 4 +++- .../tests/integration/components/rose/link-button-test.js | 2 +- ui/admin/app/components/form/group/add-members/index.hbs | 2 +- ui/admin/app/components/form/host-set/add-hosts/index.hbs | 2 +- ui/admin/app/components/form/role/add-principals/index.hbs | 2 +- .../form/target/add-credential-libraries/index.hbs | 2 +- ui/admin/app/components/form/target/add-host-sets/index.hbs | 2 +- ui/admin/app/components/form/user/add-accounts/index.hbs | 2 +- .../scope/targets/target/add-credential-libraries.hbs | 2 +- .../templates/scopes/scope/targets/target/add-host-sets.hbs | 2 +- .../app/templates/scopes/scope/users/user/add-accounts.hbs | 2 +- 16 files changed, 20 insertions(+), 24 deletions(-) delete mode 100644 addons/rose/public/chevron-left.svg delete mode 100644 addons/rose/public/chevron-right.svg diff --git a/addons/rose/addon/components/rose/message/index.stories.mdx b/addons/rose/addon/components/rose/message/index.stories.mdx index c11095d2a..60fa1b9f0 100644 --- a/addons/rose/addon/components/rose/message/index.stories.mdx +++ b/addons/rose/addon/components/rose/message/index.stories.mdx @@ -18,7 +18,7 @@ Title can be configured with optional icon and subtitle. {{description}} - + Go back @@ -49,7 +49,7 @@ Title can be configured with optional icon and subtitle. if you think you should have access. - + Go back Need help? diff --git a/addons/rose/public/chevron-left.svg b/addons/rose/public/chevron-left.svg deleted file mode 100644 index 6b6f3a0ea..000000000 --- a/addons/rose/public/chevron-left.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/addons/rose/public/chevron-right.svg b/addons/rose/public/chevron-right.svg deleted file mode 100644 index be0fbc667..000000000 --- a/addons/rose/public/chevron-right.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/addons/rose/public/flight/chevron-left-16.svg b/addons/rose/public/flight/chevron-left-16.svg index 62fda4d33..eeb214c72 100644 --- a/addons/rose/public/flight/chevron-left-16.svg +++ b/addons/rose/public/flight/chevron-left-16.svg @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/addons/rose/tests/integration/components/rose/button-test.js b/addons/rose/tests/integration/components/rose/button-test.js index d313e9b0a..f41d8b686 100644 --- a/addons/rose/tests/integration/components/rose/button-test.js +++ b/addons/rose/tests/integration/components/rose/button-test.js @@ -34,14 +34,14 @@ module('Integration | Component | rose/button', function (hooks) { }); test('it supports left and right icons', async function (assert) { - await render(hbs``); + await render(hbs``); assert.ok(find('.has-icon-left .rose-icon')); - await render(hbs``); + await render(hbs``); assert.ok(find('.has-icon-right .rose-icon')); }); test('it supports an icon-only type', async function (assert) { - await render(hbs``); + await render(hbs``); assert.ok(find('.has-icon-only .rose-icon')); }); }); diff --git a/addons/rose/tests/integration/components/rose/dropdown/button-test.js b/addons/rose/tests/integration/components/rose/dropdown/button-test.js index 971e378d6..11ef9ed53 100644 --- a/addons/rose/tests/integration/components/rose/dropdown/button-test.js +++ b/addons/rose/tests/integration/components/rose/dropdown/button-test.js @@ -32,7 +32,9 @@ module('Integration | Component | rose/dropdown/button', function (hooks) { }); test('it supports an icon-only type', async function (assert) { - await render(hbs``); + await render( + hbs`` + ); assert.ok(find('.has-icon-only .rose-icon')); }); }); diff --git a/addons/rose/tests/integration/components/rose/link-button-test.js b/addons/rose/tests/integration/components/rose/link-button-test.js index 0312d94ea..49ba9d843 100644 --- a/addons/rose/tests/integration/components/rose/link-button-test.js +++ b/addons/rose/tests/integration/components/rose/link-button-test.js @@ -35,7 +35,7 @@ module('Integration | Component | rose/link-button', function (hooks) { test('it supports left icon with @iconLeft', async function (assert) { await render( - hbs`` + hbs`` ); assert.ok(find('.rose-icon')); assert.ok(find('.has-icon-left')); diff --git a/ui/admin/app/components/form/group/add-members/index.hbs b/ui/admin/app/components/form/group/add-members/index.hbs index 341d0e03f..e4321b138 100644 --- a/ui/admin/app/components/form/group/add-members/index.hbs +++ b/ui/admin/app/components/form/group/add-members/index.hbs @@ -49,7 +49,7 @@ {{t 'resources.group.messages.no-members.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/components/form/host-set/add-hosts/index.hbs b/ui/admin/app/components/form/host-set/add-hosts/index.hbs index 7c851e376..7cb2fb625 100644 --- a/ui/admin/app/components/form/host-set/add-hosts/index.hbs +++ b/ui/admin/app/components/form/host-set/add-hosts/index.hbs @@ -55,7 +55,7 @@ - + {{t 'actions.back'}} diff --git a/ui/admin/app/components/form/role/add-principals/index.hbs b/ui/admin/app/components/form/role/add-principals/index.hbs index dc6ad4f5a..eeb567f68 100644 --- a/ui/admin/app/components/form/role/add-principals/index.hbs +++ b/ui/admin/app/components/form/role/add-principals/index.hbs @@ -58,7 +58,7 @@ {{t 'resources.role.principal.messages.none.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/components/form/target/add-credential-libraries/index.hbs b/ui/admin/app/components/form/target/add-credential-libraries/index.hbs index f7f05cf42..a99390058 100644 --- a/ui/admin/app/components/form/target/add-credential-libraries/index.hbs +++ b/ui/admin/app/components/form/target/add-credential-libraries/index.hbs @@ -55,7 +55,7 @@ {{t 'resources.target.credential-library.messages.none.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/components/form/target/add-host-sets/index.hbs b/ui/admin/app/components/form/target/add-host-sets/index.hbs index 0ad80f766..238ab3e42 100644 --- a/ui/admin/app/components/form/target/add-host-sets/index.hbs +++ b/ui/admin/app/components/form/target/add-host-sets/index.hbs @@ -59,7 +59,7 @@ {{t 'resources.target.host-set.messages.none.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/components/form/user/add-accounts/index.hbs b/ui/admin/app/components/form/user/add-accounts/index.hbs index ac93847f7..afb2c43f8 100644 --- a/ui/admin/app/components/form/user/add-accounts/index.hbs +++ b/ui/admin/app/components/form/user/add-accounts/index.hbs @@ -59,7 +59,7 @@ {{t 'resources.user.messages.no-accounts.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/templates/scopes/scope/targets/target/add-credential-libraries.hbs b/ui/admin/app/templates/scopes/scope/targets/target/add-credential-libraries.hbs index e4573894c..59a046f11 100644 --- a/ui/admin/app/templates/scopes/scope/targets/target/add-credential-libraries.hbs +++ b/ui/admin/app/templates/scopes/scope/targets/target/add-credential-libraries.hbs @@ -19,7 +19,7 @@ {{t 'resources.target.credential-library.messages.none.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/templates/scopes/scope/targets/target/add-host-sets.hbs b/ui/admin/app/templates/scopes/scope/targets/target/add-host-sets.hbs index ddf08b109..d49f9f75e 100644 --- a/ui/admin/app/templates/scopes/scope/targets/target/add-host-sets.hbs +++ b/ui/admin/app/templates/scopes/scope/targets/target/add-host-sets.hbs @@ -20,7 +20,7 @@ {{t 'resources.target.host-set.messages.none.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/templates/scopes/scope/users/user/add-accounts.hbs b/ui/admin/app/templates/scopes/scope/users/user/add-accounts.hbs index 5d79b28c8..418f49822 100644 --- a/ui/admin/app/templates/scopes/scope/users/user/add-accounts.hbs +++ b/ui/admin/app/templates/scopes/scope/users/user/add-accounts.hbs @@ -20,7 +20,7 @@ {{t 'resources.user.messages.no-accounts.description'}} - + {{t 'actions.back'}} From 0232570831ef6c2596542f58c2326a80460cffd3 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Fri, 20 Aug 2021 14:58:43 -0400 Subject: [PATCH 14/60] feature(capabilities): preliminary user create/list abilities --- addons/api/addon/models/base.js | 5 +++ addons/api/mirage/factories/scope.js | 13 +++++++ ui/admin/app/routes/scopes/scope/users.js | 8 +++-- .../app/routes/scopes/scope/users/index.js | 12 ++++++- ui/admin/app/templates/scopes/scope.hbs | 12 ++++--- .../templates/scopes/scope/users/index.hbs | 35 ++++++++++++++----- 6 files changed, 68 insertions(+), 17 deletions(-) diff --git a/addons/api/addon/models/base.js b/addons/api/addon/models/base.js index f99e0351a..7fd41ec64 100644 --- a/addons/api/addon/models/base.js +++ b/addons/api/addon/models/base.js @@ -42,6 +42,11 @@ export default class BaseModel extends Model { }) authorized_actions; + @attr({ + readOnly: true, + }) + authorized_collection_actions; + set scopeModel(model) { if (model) { const json = model.serialize(); diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index fe41f3866..4ac77e576 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -4,6 +4,19 @@ import { trait } from 'ember-cli-mirage'; export default factory.extend({ type: 'global', + authorized_collection_actions: () => { + return { + users: ['create', ''], + // groups: ['create', 'list'], + // roles: ['create', 'list'], + // 'auth-methods': ['create', 'list'], + // sessopms: ['list'], + // targets: ['create', 'list'], + // 'host-catalogs': ['create', 'list'], + // 'credential-stores': ['create', 'list'], + }; + }, + /** * Generates realistic-ish IDs while still being deterministic. */ diff --git a/ui/admin/app/routes/scopes/scope/users.js b/ui/admin/app/routes/scopes/scope/users.js index 42f9c8832..aa3dde96a 100644 --- a/ui/admin/app/routes/scopes/scope/users.js +++ b/ui/admin/app/routes/scopes/scope/users.js @@ -11,6 +11,7 @@ export default class ScopesScopeUsersRoute extends Route { @service intl; @service notify; @service session; + @service can; // =methods @@ -26,8 +27,11 @@ export default class ScopesScopeUsersRoute extends Route { * @return {Promise{[UserModel]}} */ async model() { - const { id: scope_id } = this.modelFor('scopes.scope'); - return this.store.query('user', { scope_id }); + const scope = this.modelFor('scopes.scope'); + const { id: scope_id } = scope; + if (this.can.can('list collection', scope, { collection: 'users' })) { + return this.store.query('user', { scope_id }); + } } // =actions diff --git a/ui/admin/app/routes/scopes/scope/users/index.js b/ui/admin/app/routes/scopes/scope/users/index.js index f59170106..8d3bc89c6 100644 --- a/ui/admin/app/routes/scopes/scope/users/index.js +++ b/ui/admin/app/routes/scopes/scope/users/index.js @@ -1,3 +1,13 @@ import Route from '@ember/routing/route'; -export default class ScopesScopeUsersIndexRoute extends Route {} +export default class ScopesScopeUsersIndexRoute extends Route { + + // =methods + + setupController(controller) { + const scope = this.modelFor('scopes.scope'); + super.setupController(...arguments); + controller.setProperties({ scope }); + } + +} diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index 65e456c51..825be5d14 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -94,10 +94,12 @@ {{#unless @model.isProject}} - - - {{t 'resources.user.title_plural'}} - + {{#if (can 'navigate collection' @model collection='users')}} + + + {{t 'resources.user.title_plural'}} + + {{/if}} {{t 'resources.group.title_plural'}} @@ -140,4 +142,4 @@ - \ No newline at end of file + diff --git a/ui/admin/app/templates/scopes/scope/users/index.hbs b/ui/admin/app/templates/scopes/scope/users/index.hbs index ab31bc1cf..61d80197b 100644 --- a/ui/admin/app/templates/scopes/scope/users/index.hbs +++ b/ui/admin/app/templates/scopes/scope/users/index.hbs @@ -15,10 +15,12 @@ - {{#if @model}} - {{t - 'titles.new' - }} + {{#if (can 'create collection' this.scope collection='users')}} + {{#if @model}} + {{t + 'titles.new' + }} + {{/if}} {{/if}} @@ -69,11 +71,26 @@ > {{t 'resources.user.description'}} + {{#if (can 'create collection' this.scope collection='users')}} + {{#unless (can 'list collection' this.scope collection='users')}} +
+
+ + Oh noes! Resources you create won't appear here because you + have create permission, but not list. + + {{/unless}} + {{/if}}
- - - {{t 'titles.new'}} - + {{#if (can 'create collection' this.scope collection='users')}} + + + {{t 'titles.new'}} + + {{/if}} @@ -81,4 +98,4 @@ - \ No newline at end of file + From f510d2f4fe43e84f6091f9ce9e7288d4dfe5784f Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 24 Aug 2021 14:46:21 -0400 Subject: [PATCH 15/60] chore: add create and list to mock user --- addons/api/mirage/factories/scope.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index 4ac77e576..e9c5ac09f 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -6,7 +6,7 @@ export default factory.extend({ authorized_collection_actions: () => { return { - users: ['create', ''], + users: ['create', 'list'], // groups: ['create', 'list'], // roles: ['create', 'list'], // 'auth-methods': ['create', 'list'], From 03e06a22a4c895eb9f55338aacbdba479297f234 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 24 Aug 2021 16:47:33 -0400 Subject: [PATCH 16/60] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20messages=20f?= =?UTF-8?q?or=20insufficient=20permissions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/addon/abilities/collection.js | 3 +- addons/core/translations/en-us.yaml | 2 ++ .../app/routes/scopes/scope/users/index.js | 2 -- ui/admin/app/templates/scopes/scope.hbs | 2 +- .../templates/scopes/scope/users/index.hbs | 30 ++++++++++--------- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/addons/api/addon/abilities/collection.js b/addons/api/addon/abilities/collection.js index ad52afd18..92f0e4342 100644 --- a/addons/api/addon/abilities/collection.js +++ b/addons/api/addon/abilities/collection.js @@ -29,7 +29,8 @@ export default class CollectionAbility extends Ability { * @return {boolean} */ hasAuthorizedCollectionAction(action) { - const { authorized_collection_actions } = this.model; + const authorized_collection_actions = + (this.model || {}).authorized_collection_actions || {}; const collection = this.collection || {}; return authorized_collection_actions[collection]?.includes(action); } diff --git a/addons/core/translations/en-us.yaml b/addons/core/translations/en-us.yaml index 5370c7e75..8f98f633c 100644 --- a/addons/core/translations/en-us.yaml +++ b/addons/core/translations/en-us.yaml @@ -32,6 +32,8 @@ titles: descriptions: empty-set: There are no items to display yet. You may be able to add items or try back later. origin-initialization: To get started, please enter your origin URL + create-but-not-list: You do not have permission to list {resource}, but you can create new instances. + neither-list-nor-create: You do not have permission to list or create {resource}. questions: delete-confirm: Are you sure you want to delete this resource? remove-confirm: Are you sure you want to remove this association? diff --git a/ui/admin/app/routes/scopes/scope/users/index.js b/ui/admin/app/routes/scopes/scope/users/index.js index 8d3bc89c6..2e92b693d 100644 --- a/ui/admin/app/routes/scopes/scope/users/index.js +++ b/ui/admin/app/routes/scopes/scope/users/index.js @@ -1,7 +1,6 @@ import Route from '@ember/routing/route'; export default class ScopesScopeUsersIndexRoute extends Route { - // =methods setupController(controller) { @@ -9,5 +8,4 @@ export default class ScopesScopeUsersIndexRoute extends Route { super.setupController(...arguments); controller.setProperties({ scope }); } - } diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index 825be5d14..fd20ca2a2 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -142,4 +142,4 @@ - + \ No newline at end of file diff --git a/ui/admin/app/templates/scopes/scope/users/index.hbs b/ui/admin/app/templates/scopes/scope/users/index.hbs index 61d80197b..ef9ef91b3 100644 --- a/ui/admin/app/templates/scopes/scope/users/index.hbs +++ b/ui/admin/app/templates/scopes/scope/users/index.hbs @@ -70,19 +70,21 @@ as |message| > - {{t 'resources.user.description'}} - {{#if (can 'create collection' this.scope collection='users')}} - {{#unless (can 'list collection' this.scope collection='users')}} -
-
- - Oh noes! Resources you create won't appear here because you - have create permission, but not list. - - {{/unless}} + {{#if (can 'list collection' this.scope collection='users')}} + {{! can list (at least): show default welcome message}} + {{t 'resources.user.description'}} + {{else if (can 'create collection' this.scope collection='users')}} + {{! can create (only): show create-but-not-list welcome message}} + {{t + 'descriptions.create-but-not-list' + resource=(t 'resources.user.title_plural') + }} + {{else}} + {{! can neither list nor create }} + {{t + 'descriptions.neither-list-nor-create' + resource=(t 'resources.user.title_plural') + }} {{/if}}
{{#if (can 'create collection' this.scope collection='users')}} @@ -98,4 +100,4 @@ - + \ No newline at end of file From 1165d21ef66ea7b8dbe701e0d04d539d41f10c95 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 25 Aug 2021 10:52:20 -0400 Subject: [PATCH 17/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20consume=20flight?= =?UTF-8?q?=20icons=20from=20npm=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/addon/components/doc-link/index.hbs | 2 +- .../addon/components/error/message/index.js | 4 +-- addons/core/index.js | 2 -- .../components/rose/badge/index.stories.mdx | 8 ++--- .../components/rose/button/index.stories.mdx | 20 +++++------ .../rose/card/link/index.stories.mdx | 6 ++-- .../components/rose/cards/index.stories.mdx | 14 ++++---- .../addon/components/rose/dialog/index.hbs | 4 +-- .../components/rose/dialog/index.stories.mdx | 8 ++--- .../rose/dropdown/index.stories.mdx | 6 ++-- .../rose/form/errors/message/index.hbs | 2 +- .../rose/form/radio/group/index.stories.mdx | 6 ++-- .../rose/form/radio/radio/index.stories.mdx | 8 ++--- .../components/rose/header/index.stories.mdx | 10 +++--- .../components/rose/icon/index.stories.mdx | 6 ++-- .../rose/link-button/index.stories.mdx | 22 ++++++------- .../rose/list/key-value/index.stories.mdx | 4 +-- .../components/rose/message/index.stories.mdx | 12 +++---- .../components/rose/notification/index.hbs | 2 +- .../components/rose/notification/index.js | 8 ++--- .../components/rose/table/index.stories.mdx | 2 +- addons/rose/index.js | 21 ++++++++++++ addons/rose/package.json | 1 + addons/rose/public/flight/alert-circle-16.svg | 7 ---- .../rose/public/flight/alert-triangle-16.svg | 7 ---- .../public/flight/arrow-right-circle-16.svg | 6 ---- addons/rose/public/flight/check-circle-16.svg | 6 ---- addons/rose/public/flight/chevron-left-16.svg | 5 --- .../public/flight/clipboard-checked-16.svg | 5 --- .../rose/public/flight/clipboard-copy-16.svg | 9 ----- addons/rose/public/flight/collections-16.svg | 7 ---- addons/rose/public/flight/crosshair-16.svg | 5 --- addons/rose/public/flight/eye-16.svg | 6 ---- addons/rose/public/flight/eye-off-16.svg | 6 ---- addons/rose/public/flight/folder-users-16.svg | 9 ----- addons/rose/public/flight/globe-16.svg | 5 --- addons/rose/public/flight/grid-16.svg | 8 ----- addons/rose/public/flight/help-16.svg | 7 ---- .../rose/public/flight/identity-user-16.svg | 7 ---- addons/rose/public/flight/info-16.svg | 7 ---- addons/rose/public/flight/key-16.svg | 6 ---- addons/rose/public/flight/lock-16.svg | 6 ---- .../rose/public/flight/more-horizontal-16.svg | 7 ---- addons/rose/public/flight/org-16.svg | 12 ------- addons/rose/public/flight/plus-circle-16.svg | 6 ---- addons/rose/public/flight/trash-16.svg | 7 ---- addons/rose/public/flight/user-circle-16.svg | 6 ---- addons/rose/public/flight/users-16.svg | 8 ----- addons/rose/public/flight/x-16.svg | 5 --- addons/rose/public/flight/x-circle-16.svg | 6 ---- addons/rose/public/flight/x-square-16.svg | 6 ---- .../tests/dummy/app/templates/playground.hbs | 4 +-- .../integration/components/rose/badge-test.js | 4 ++- .../components/rose/button-test.js | 12 +++++-- .../components/rose/card/link-test.js | 2 +- .../components/rose/dropdown-test.js | 2 +- .../components/rose/dropdown/button-test.js | 2 +- .../components/rose/form/radio/radio-test.js | 2 +- .../integration/components/rose/icon-test.js | 6 ++-- .../components/rose/link-button-test.js | 6 ++-- ui/admin/app/components/copyable/index.js | 4 +-- .../form/auth-method/oidc/index.hbs | 10 +++--- .../form/group/add-members/index.hbs | 2 +- .../form/host-set/add-hosts/index.hbs | 2 +- .../form/role/add-principals/index.hbs | 2 +- .../app/components/form/role/grants/index.hbs | 2 +- ui/admin/app/components/form/role/index.hbs | 8 +++-- .../target/add-credential-libraries/index.hbs | 2 +- .../form/target/add-host-sets/index.hbs | 2 +- .../form/user/add-accounts/index.hbs | 2 +- ui/admin/app/templates/application.hbs | 6 ++-- ui/admin/app/templates/scopes/index.hbs | 2 +- ui/admin/app/templates/scopes/scope.hbs | 33 ++++++++++--------- .../templates/scopes/scope/-header-nav.hbs | 6 ++-- .../app/templates/scopes/scope/-sidebar.hbs | 8 ++--- .../auth-methods/auth-method/-actions.hbs | 6 ++-- .../auth-method/accounts/index.hbs | 2 +- .../scopes/scope/auth-methods/index.hbs | 4 +-- .../templates/scopes/scope/authenticate.hbs | 4 +-- .../scopes/scope/authenticate/index.hbs | 2 +- .../credential-libraries/index.hbs | 2 +- .../scopes/scope/credential-stores/index.hbs | 2 +- .../scopes/scope/groups/group/members.hbs | 4 +-- .../templates/scopes/scope/groups/index.hbs | 2 +- .../host-catalog/host-sets/host-set/hosts.hbs | 4 +-- .../host-catalog/host-sets/index.hbs | 2 +- .../host-catalog/hosts/index.hbs | 2 +- .../scopes/scope/host-catalogs/index.hbs | 2 +- .../templates/scopes/scope/roles/index.hbs | 2 +- .../scopes/scope/roles/role/principals.hbs | 4 +-- .../templates/scopes/scope/scopes/index.hbs | 10 ++++-- .../templates/scopes/scope/sessions/index.hbs | 2 +- .../templates/scopes/scope/targets/index.hbs | 2 +- .../target/add-credential-libraries.hbs | 2 +- .../scope/targets/target/add-host-sets.hbs | 2 +- .../targets/target/credential-libraries.hbs | 4 +-- .../scopes/scope/targets/target/host-sets.hbs | 4 +-- .../templates/scopes/scope/users/index.hbs | 2 +- .../scopes/scope/users/user/accounts.hbs | 4 +-- .../scopes/scope/users/user/add-accounts.hbs | 2 +- ui/admin/ember-cli-build.js | 2 +- ui/desktop/app/components/copyable/index.js | 4 +-- .../app/components/hidden-secret/index.hbs | 6 +++- ui/desktop/app/templates/application.hbs | 8 ++--- .../templates/scopes/scope/-header-nav.hbs | 4 +-- .../templates/scopes/scope/authenticate.hbs | 4 +-- .../scopes/scope/authenticate/index.hbs | 2 +- .../app/templates/scopes/scope/projects.hbs | 4 +-- .../scopes/scope/projects/sessions/index.hbs | 2 +- .../scopes/scope/projects/targets.hbs | 2 +- .../projects/targets/target/sessions.hbs | 2 +- ui/desktop/ember-cli-build.js | 2 +- .../tests/integration/components/card-test.js | 2 +- yarn.lock | 5 +++ 114 files changed, 244 insertions(+), 379 deletions(-) delete mode 100644 addons/rose/public/flight/alert-circle-16.svg delete mode 100644 addons/rose/public/flight/alert-triangle-16.svg delete mode 100644 addons/rose/public/flight/arrow-right-circle-16.svg delete mode 100644 addons/rose/public/flight/check-circle-16.svg delete mode 100644 addons/rose/public/flight/chevron-left-16.svg delete mode 100644 addons/rose/public/flight/clipboard-checked-16.svg delete mode 100644 addons/rose/public/flight/clipboard-copy-16.svg delete mode 100644 addons/rose/public/flight/collections-16.svg delete mode 100644 addons/rose/public/flight/crosshair-16.svg delete mode 100644 addons/rose/public/flight/eye-16.svg delete mode 100644 addons/rose/public/flight/eye-off-16.svg delete mode 100644 addons/rose/public/flight/folder-users-16.svg delete mode 100644 addons/rose/public/flight/globe-16.svg delete mode 100644 addons/rose/public/flight/grid-16.svg delete mode 100644 addons/rose/public/flight/help-16.svg delete mode 100644 addons/rose/public/flight/identity-user-16.svg delete mode 100644 addons/rose/public/flight/info-16.svg delete mode 100644 addons/rose/public/flight/key-16.svg delete mode 100644 addons/rose/public/flight/lock-16.svg delete mode 100644 addons/rose/public/flight/more-horizontal-16.svg delete mode 100644 addons/rose/public/flight/org-16.svg delete mode 100644 addons/rose/public/flight/plus-circle-16.svg delete mode 100644 addons/rose/public/flight/trash-16.svg delete mode 100644 addons/rose/public/flight/user-circle-16.svg delete mode 100644 addons/rose/public/flight/users-16.svg delete mode 100644 addons/rose/public/flight/x-16.svg delete mode 100644 addons/rose/public/flight/x-circle-16.svg delete mode 100644 addons/rose/public/flight/x-square-16.svg diff --git a/addons/core/addon/components/doc-link/index.hbs b/addons/core/addon/components/doc-link/index.hbs index c7b7e1a8e..67a788936 100644 --- a/addons/core/addon/components/doc-link/index.hbs +++ b/addons/core/addon/components/doc-link/index.hbs @@ -4,5 +4,5 @@ target="_blank" rel="noreferrer noopener" title={{t "actions.get-topic-help"}}> - + diff --git a/addons/core/addon/components/error/message/index.js b/addons/core/addon/components/error/message/index.js index f121d7d7b..9d9e435db 100644 --- a/addons/core/addon/components/error/message/index.js +++ b/addons/core/addon/components/error/message/index.js @@ -28,11 +28,11 @@ export default class ErrorMessageComponent extends MessageComponent { get icon() { switch (this.args.status) { case '404': - return 'flight/help-16'; + return 'flight-icons/help-16'; case '401': case '403': default: - return 'flight/alert-circle-16'; + return 'flight-icons/alert-circle-16'; } } diff --git a/addons/core/index.js b/addons/core/index.js index f1a668631..3646d4641 100644 --- a/addons/core/index.js +++ b/addons/core/index.js @@ -16,14 +16,12 @@ module.exports = { */ includePublic(app) { const publicPath = path.resolve('public'); - const rosePublicPath = path.resolve('../rose/public'); const dummyPublicPath = path.resolve('tests/dummy/public'); app.options.svg = app.options.svg || {}; app.options.svg.paths = app.options.svg.paths || []; app.options.svg.paths.push(publicPath); - app.options.svg.paths.push(rosePublicPath); if (this.isDevelopingAddon()) app.options.svg.paths.push(dummyPublicPath); this.addons.forEach((addon) => { diff --git a/addons/rose/addon/components/rose/badge/index.stories.mdx b/addons/rose/addon/components/rose/badge/index.stories.mdx index 1d65b3d0a..d109810c6 100644 --- a/addons/rose/addon/components/rose/badge/index.stories.mdx +++ b/addons/rose/addon/components/rose/badge/index.stories.mdx @@ -13,7 +13,7 @@ When style definition isn't supplied, a default style will be supplied. Styles: outline, dark, informational, informational-outline, success, success-outline, error, error-outline, warning, warning-outline, alert, alert-outline ```html -Badge +Badge ``` @@ -43,9 +43,9 @@ Styles: outline, dark, informational, informational-outline, success, success-ou 'none' ), icon: select('icon', { - 'flight/org-16': 'flight/org-16', + 'flight-icons/org-16': 'flight-icons/org-16', }, - 'flight/org-16' + 'flight-icons/org-16' ), } }} @@ -56,7 +56,7 @@ Styles: outline, dark, informational, informational-outline, success, success-ou template: hbs` default style outline - default style with icon + default style with icon dark informational informational-outline diff --git a/addons/rose/addon/components/rose/button/index.stories.mdx b/addons/rose/addon/components/rose/button/index.stories.mdx index 76010a51c..3b2841c8a 100644 --- a/addons/rose/addon/components/rose/button/index.stories.mdx +++ b/addons/rose/addon/components/rose/button/index.stories.mdx @@ -12,7 +12,7 @@ to trigger actions or to submit forms. Avoid using buttons as simple links to other routes. For accessibility, use links instead. ```htmlbars - + Action ``` @@ -49,18 +49,18 @@ other routes. For accessibility, use links instead. iconLeft: select( 'iconLeft', { - 'flight/check-circle-16': 'flight/check-circle-16', - 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', + 'flight-icons/check-circle-16': 'flight-icons/check-circle-16', + 'flight-icons/clipboard-copy-16': 'flight-icons/clipboard-copy-16', }, - 'flight/check-circle-16' + 'flight-icons/check-circle-16' ), iconRight: select( 'iconRight', { - 'flight/check-circle-16': 'flight/check-circle-16', - 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', + 'flight-icons/check-circle-16': 'flight-icons/check-circle-16', + 'flight-icons/clipboard-copy-16': 'flight-icons/clipboard-copy-16', }, - 'flight/clipboard-copy-16' + 'flight-icons/clipboard-copy-16' ), onClick: action('clicked'), }, @@ -81,10 +81,10 @@ button in this case for accessibility. iconOnly: select( 'iconOnly', { - 'flight/check-circle-16': 'flight/check-circle-16', - 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', + 'flight-icons/check-circle-16': 'flight-icons/check-circle-16', + 'flight-icons/clipboard-copy-16': 'flight-icons/clipboard-copy-16', }, - 'flight/check-circle-16' + 'flight-icons/check-circle-16' ), }, }} diff --git a/addons/rose/addon/components/rose/card/link/index.stories.mdx b/addons/rose/addon/components/rose/card/link/index.stories.mdx index 8aaf7e693..eaaa20293 100644 --- a/addons/rose/addon/components/rose/card/link/index.stories.mdx +++ b/addons/rose/addon/components/rose/card/link/index.stories.mdx @@ -13,7 +13,7 @@ Card link component wraps content with `LinkTo` component. Supports title and de @title='Card title' @description='Card description' @id='resource_id_1234' - @icon='flight/org-16' + @icon='flight-icons/org-16' @route='about'/> ``` @@ -32,9 +32,9 @@ Card link component wraps content with `LinkTo` component. Supports title and de description: text('description', 'Card description'), id: text('id', 'resource_id_1234'), icon: select('icon', { - 'flight/org-16': 'flight/org-16', + 'flight-icons/org-16': 'flight-icons/org-16', }, - 'flight/org-16' + 'flight-icons/org-16' ), }, }} diff --git a/addons/rose/addon/components/rose/cards/index.stories.mdx b/addons/rose/addon/components/rose/cards/index.stories.mdx index 72c503e85..bb2471b84 100644 --- a/addons/rose/addon/components/rose/cards/index.stories.mdx +++ b/addons/rose/addon/components/rose/cards/index.stories.mdx @@ -18,35 +18,35 @@ A set of cards arranged side-by-side. @title="Card Title" @description="Description" @id="resource_id_1234" - @icon="flight/org-16" + @icon="flight-icons/org-16" /> `, @@ -62,14 +62,14 @@ A set of cards arranged side-by-side. @title="Card Title" @description="Description" @id="resource_id_1234" - @icon="flight/org-16" + @icon="flight-icons/org-16" /> ``` diff --git a/addons/rose/addon/components/rose/dialog/index.hbs b/addons/rose/addon/components/rose/dialog/index.hbs index 7876f5349..4f762c6bc 100644 --- a/addons/rose/addon/components/rose/dialog/index.hbs +++ b/addons/rose/addon/components/rose/dialog/index.hbs @@ -27,7 +27,7 @@ title={{@dismissButtonText}} {{on "click" (fn this.dismiss @dismiss)}} > - + @@ -62,7 +62,7 @@ title={{@dismissButtonText}} {{on "click" (fn this.dismiss @dismiss)}} > - + diff --git a/addons/rose/addon/components/rose/dialog/index.stories.mdx b/addons/rose/addon/components/rose/dialog/index.stories.mdx index 0315a3c87..d5d05be52 100644 --- a/addons/rose/addon/components/rose/dialog/index.stories.mdx +++ b/addons/rose/addon/components/rose/dialog/index.stories.mdx @@ -36,10 +36,10 @@ A dialog component with optional modal capabilities. icon: select( 'icon', { - 'flight/check-circle-16': 'flight/check-circle-16', - 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', + 'flight-icons/check-circle-16': 'flight-icons/check-circle-16', + 'flight-icons/clipboard-copy-16': 'flight-icons/clipboard-copy-16', }, - 'flight/check-circle-16' + 'flight-icons/check-circle-16' ), style: select( 'style', @@ -58,7 +58,7 @@ A dialog component with optional modal capabilities. diff --git a/addons/rose/addon/components/rose/dropdown/index.stories.mdx b/addons/rose/addon/components/rose/dropdown/index.stories.mdx index 8ac807a63..fae413044 100644 --- a/addons/rose/addon/components/rose/dropdown/index.stories.mdx +++ b/addons/rose/addon/components/rose/dropdown/index.stories.mdx @@ -11,7 +11,7 @@ A simple dropdown component with support for links and buttons. {{ template: hbs` - + Menu item Menu item @@ -31,7 +31,7 @@ A simple dropdown component with support for links and buttons. {{ template: hbs` - + Menu item Menu item @@ -117,7 +117,7 @@ Dropdown supports `danger` styling through `style` attribute. Dropdown indicator can be hidden using `showCaret` attribute. ```html - + Menu item Button menu item diff --git a/addons/rose/addon/components/rose/form/errors/message/index.hbs b/addons/rose/addon/components/rose/form/errors/message/index.hbs index 443829171..eb2246b04 100644 --- a/addons/rose/addon/components/rose/form/errors/message/index.hbs +++ b/addons/rose/addon/components/rose/form/errors/message/index.hbs @@ -1,4 +1,4 @@

- + {{yield}}

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 be4aa2b3f..026b9526c 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 @@ -68,10 +68,10 @@ Renders a form radiofield group. firstFieldIcon: select( 'first icon', { - 'flight/org-16': 'flight/org-16', - 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', + 'flight-icons/org-16': 'flight-icons/org-16', + 'flight-icons/clipboard-copy-16': 'flight-icons/clipboard-copy-16', }, - 'flight/org-16' + 'flight-icons/org-16' ), secondFieldLabel: text('second label', 'Maybe'), secondFieldValue: text('second value', 'maybe'), 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 e2f15d63a..a5540499b 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 @@ -44,8 +44,8 @@ Renders a form radiofield. 'icon', { 'none': null, - 'flight/org-16': 'flight/org-16', - 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', + 'flight-icons/org-16': 'flight-icons/org-16', + 'flight-icons/clipboard-copy-16': 'flight-icons/clipboard-copy-16', }, null ), @@ -109,8 +109,8 @@ Renders a form radiofield. 'icon', { 'none': null, - 'flight/org-16': 'flight/org-16', - 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', + 'flight-icons/org-16': 'flight-icons/org-16', + 'flight-icons/clipboard-copy-16': 'flight-icons/clipboard-copy-16', }, null ), diff --git a/addons/rose/addon/components/rose/header/index.stories.mdx b/addons/rose/addon/components/rose/header/index.stories.mdx index be894c503..e1990b552 100644 --- a/addons/rose/addon/components/rose/header/index.stories.mdx +++ b/addons/rose/addon/components/rose/header/index.stories.mdx @@ -27,7 +27,7 @@ A header component that allows three distinct sections to be configured: brand, Menu item Menu item @@ -69,11 +69,11 @@ A header component that allows three distinct sections to be configured: brand, dropdownIcon: select( 'dropdownIcon', { - 'flight/user-circle-16': 'flight/user-circle-16', - 'flight/check-circle-16': 'flight/check-circle-16', - 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', + 'flight-icons/user-circle-16': 'flight-icons/user-circle-16', + 'flight-icons/check-circle-16': 'flight-icons/check-circle-16', + 'flight-icons/clipboard-copy-16': 'flight-icons/clipboard-copy-16', }, - 'flight/user-circle-16' + 'flight-icons/user-circle-16' ), }, }}
diff --git a/addons/rose/addon/components/rose/icon/index.stories.mdx b/addons/rose/addon/components/rose/icon/index.stories.mdx index d22b1bcac..946b7d1cf 100644 --- a/addons/rose/addon/components/rose/icon/index.stories.mdx +++ b/addons/rose/addon/components/rose/icon/index.stories.mdx @@ -22,10 +22,10 @@ Renders a simple icon. name: select( 'name', { - 'flight/check-circle-16': 'flight/check-circle-16', - 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', + 'flight-icons/check-circle-16': 'flight-icons/check-circle-16', + 'flight-icons/clipboard-copy-16': 'flight-icons/clipboard-copy-16', }, - 'flight/check-circle-16' + 'flight-icons/check-circle-16' ), } }}
diff --git a/addons/rose/addon/components/rose/link-button/index.stories.mdx b/addons/rose/addon/components/rose/link-button/index.stories.mdx index 9f8831694..a5cc19106 100644 --- a/addons/rose/addon/components/rose/link-button/index.stories.mdx +++ b/addons/rose/addon/components/rose/link-button/index.stories.mdx @@ -12,7 +12,7 @@ Styles supported: primary, secondary, warning, and ghost. Disabling link button is not supported as it is an action on form components only. ```html - + Content ``` @@ -45,18 +45,18 @@ Disabling link button is not supported as it is an action on form components onl iconLeft: select( 'iconLeft', { - 'flight/check-circle-16': 'flight/check-circle-16', - 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', + 'flight-icons/check-circle-16': 'flight-icons/check-circle-16', + 'flight-icons/clipboard-copy-16': 'flight-icons/clipboard-copy-16', }, - 'flight/clipboard-copy-16' + 'flight-icons/clipboard-copy-16' ), iconRight: select( 'iconRight', { - 'flight/check-circle-16': 'flight/check-circle-16', - 'flight/clipboard-copy-16': 'flight/clipboard-copy-16', + 'flight-icons/check-circle-16': 'flight-icons/check-circle-16', + 'flight-icons/clipboard-copy-16': 'flight-icons/clipboard-copy-16', }, - 'flight/clipboard-copy-16' + 'flight-icons/clipboard-copy-16' ), }, }} @@ -65,7 +65,7 @@ Disabling link button is not supported as it is an action on form components onl Similar to `Rose::Button`, icon only link button is supported. ```html - + ``` @@ -88,10 +88,10 @@ Similar to `Rose::Button`, icon only link button is supported. iconOnly: select( 'iconOnly', { - 'flight/check-circle-16': 'flight/check-circle-16', - 'flight/help-16': 'flight/help-16', + 'flight-icons/check-circle-16': 'flight-icons/check-circle-16', + 'flight-icons/help-16': 'flight-icons/help-16', }, - 'flight/help-16' + 'flight-icons/help-16' ), }, }} diff --git a/addons/rose/addon/components/rose/list/key-value/index.stories.mdx b/addons/rose/addon/components/rose/list/key-value/index.stories.mdx index cded0db99..74d65375f 100644 --- a/addons/rose/addon/components/rose/list/key-value/index.stories.mdx +++ b/addons/rose/addon/components/rose/list/key-value/index.stories.mdx @@ -46,7 +46,7 @@ A simple key/value list with support for embedded form fields and buttons. - Remove + Remove @@ -94,7 +94,7 @@ A simple key/value list with support for embedded form fields and buttons. - Remove + Remove diff --git a/addons/rose/addon/components/rose/message/index.stories.mdx b/addons/rose/addon/components/rose/message/index.stories.mdx index 60fa1b9f0..aeb5e042b 100644 --- a/addons/rose/addon/components/rose/message/index.stories.mdx +++ b/addons/rose/addon/components/rose/message/index.stories.mdx @@ -18,7 +18,7 @@ Title can be configured with optional icon and subtitle. {{description}} - + Go back @@ -33,23 +33,23 @@ Title can be configured with optional icon and subtitle. icon: select( 'icon', { - 'flight/alert-circle-16': 'flight/alert-circle-16', - 'flight/help-16': 'flight/help-16', + 'flight-icons/alert-circle-16': 'flight-icons/alert-circle-16', + 'flight-icons/help-16': 'flight-icons/help-16', }, - 'flight/help-16' + 'flight-icons/help-16' ), }, }} ```html - + You must be granted permissions to view this data. Ask your administrator if you think you should have access. - + Go back Need help? diff --git a/addons/rose/addon/components/rose/notification/index.hbs b/addons/rose/addon/components/rose/notification/index.hbs index 3d9290695..fc0acf33f 100644 --- a/addons/rose/addon/components/rose/notification/index.hbs +++ b/addons/rose/addon/components/rose/notification/index.hbs @@ -26,7 +26,7 @@ {{on "click" @dismiss}} > {{@dismissText}} diff --git a/addons/rose/addon/components/rose/notification/index.js b/addons/rose/addon/components/rose/notification/index.js index c3c23b44b..b036bec5d 100644 --- a/addons/rose/addon/components/rose/notification/index.js +++ b/addons/rose/addon/components/rose/notification/index.js @@ -8,17 +8,17 @@ export default class RoseNotificationComponent extends Component { */ @computed('style') get icon() { - let icon = 'flight/info-16'; + let icon = 'flight-icons/info-16'; switch (this.style) { case 'error': - icon = 'flight/x-square-16'; + icon = 'flight-icons/x-square-16'; break; case 'success': - icon = 'flight/check-circle-16'; + icon = 'flight-icons/check-circle-16'; break; case 'warning': - icon = 'flight/alert-triangle-16'; + icon = 'flight-icons/alert-triangle-16'; break; } diff --git a/addons/rose/addon/components/rose/table/index.stories.mdx b/addons/rose/addon/components/rose/table/index.stories.mdx index 0b786556a..2b56d4242 100644 --- a/addons/rose/addon/components/rose/table/index.stories.mdx +++ b/addons/rose/addon/components/rose/table/index.stories.mdx @@ -122,7 +122,7 @@ Cell shrink should be applied to all the cells in a row. Otherwise the bigger ce - Remove + Remove diff --git a/addons/rose/index.js b/addons/rose/index.js index 4da13fee7..ebc5a2673 100644 --- a/addons/rose/index.js +++ b/addons/rose/index.js @@ -10,6 +10,7 @@ module.exports = { this._super.included.apply(this, arguments); this.includeStyles(app); + this.includeFlightIcons(app); this.includePublic(app); this.setupSVGO(app); }, @@ -40,6 +41,26 @@ module.exports = { app.options.sassOptions.includePaths.push(styleTree); }, + /** + * Finds the structure-icons folder and includes it into the + * ember-inline-svg addon. + */ + includeFlightIcons(app) { + const iconPackagePath = path.resolve( + '../../node_modules/@hashicorp/flight-icons' + ); + const iconsPath = path.resolve(iconPackagePath, '..'); + + app.options.svg = app.options.svg || {}; + app.options.svg.paths = app.options.svg.paths || []; + + app.options.svg.paths.push(iconsPath); + + this.addons.forEach((addon) => { + if (addon.name === 'ember-inline-svg') addon.included(app); + }); + }, + /** * Finds the public folder and includes it into the ember-inline-svg addon. */ diff --git a/addons/rose/package.json b/addons/rose/package.json index 88718fbbd..cffa4b44b 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -43,6 +43,7 @@ "@ember/test-helpers": "^2.2.8", "@glimmer/component": "^1.0.3", "@glimmer/tracking": "^1.0.3", + "@hashicorp/flight-icons": "^0.0.3-beta", "@storybook/addon-actions": "^6.3.1", "@storybook/addon-docs": "^6.3.1", "@storybook/addon-knobs": "^6.3.0", diff --git a/addons/rose/public/flight/alert-circle-16.svg b/addons/rose/public/flight/alert-circle-16.svg deleted file mode 100644 index 55d000d4c..000000000 --- a/addons/rose/public/flight/alert-circle-16.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/addons/rose/public/flight/alert-triangle-16.svg b/addons/rose/public/flight/alert-triangle-16.svg deleted file mode 100644 index 9367dbd4c..000000000 --- a/addons/rose/public/flight/alert-triangle-16.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/arrow-right-circle-16.svg b/addons/rose/public/flight/arrow-right-circle-16.svg deleted file mode 100644 index 24003e7de..000000000 --- a/addons/rose/public/flight/arrow-right-circle-16.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/check-circle-16.svg b/addons/rose/public/flight/check-circle-16.svg deleted file mode 100644 index 4d296da62..000000000 --- a/addons/rose/public/flight/check-circle-16.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/chevron-left-16.svg b/addons/rose/public/flight/chevron-left-16.svg deleted file mode 100644 index eeb214c72..000000000 --- a/addons/rose/public/flight/chevron-left-16.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/clipboard-checked-16.svg b/addons/rose/public/flight/clipboard-checked-16.svg deleted file mode 100644 index 04db58a2c..000000000 --- a/addons/rose/public/flight/clipboard-checked-16.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/clipboard-copy-16.svg b/addons/rose/public/flight/clipboard-copy-16.svg deleted file mode 100644 index 865e5d45d..000000000 --- a/addons/rose/public/flight/clipboard-copy-16.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/collections-16.svg b/addons/rose/public/flight/collections-16.svg deleted file mode 100644 index cb96ffef0..000000000 --- a/addons/rose/public/flight/collections-16.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/crosshair-16.svg b/addons/rose/public/flight/crosshair-16.svg deleted file mode 100644 index facad35a7..000000000 --- a/addons/rose/public/flight/crosshair-16.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/eye-16.svg b/addons/rose/public/flight/eye-16.svg deleted file mode 100644 index 8eb2e59a7..000000000 --- a/addons/rose/public/flight/eye-16.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/eye-off-16.svg b/addons/rose/public/flight/eye-off-16.svg deleted file mode 100644 index 105f1d3e3..000000000 --- a/addons/rose/public/flight/eye-off-16.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/folder-users-16.svg b/addons/rose/public/flight/folder-users-16.svg deleted file mode 100644 index bb81c2b6c..000000000 --- a/addons/rose/public/flight/folder-users-16.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/globe-16.svg b/addons/rose/public/flight/globe-16.svg deleted file mode 100644 index 0c5298171..000000000 --- a/addons/rose/public/flight/globe-16.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/grid-16.svg b/addons/rose/public/flight/grid-16.svg deleted file mode 100644 index b65333af2..000000000 --- a/addons/rose/public/flight/grid-16.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/help-16.svg b/addons/rose/public/flight/help-16.svg deleted file mode 100644 index acaf4b376..000000000 --- a/addons/rose/public/flight/help-16.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/addons/rose/public/flight/identity-user-16.svg b/addons/rose/public/flight/identity-user-16.svg deleted file mode 100644 index 47cb2ba13..000000000 --- a/addons/rose/public/flight/identity-user-16.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/info-16.svg b/addons/rose/public/flight/info-16.svg deleted file mode 100644 index 1c7f58c50..000000000 --- a/addons/rose/public/flight/info-16.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/key-16.svg b/addons/rose/public/flight/key-16.svg deleted file mode 100644 index e3ec42abd..000000000 --- a/addons/rose/public/flight/key-16.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/lock-16.svg b/addons/rose/public/flight/lock-16.svg deleted file mode 100644 index 5b5dba1c1..000000000 --- a/addons/rose/public/flight/lock-16.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/more-horizontal-16.svg b/addons/rose/public/flight/more-horizontal-16.svg deleted file mode 100644 index 79143ccd4..000000000 --- a/addons/rose/public/flight/more-horizontal-16.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/org-16.svg b/addons/rose/public/flight/org-16.svg deleted file mode 100644 index 213323766..000000000 --- a/addons/rose/public/flight/org-16.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/plus-circle-16.svg b/addons/rose/public/flight/plus-circle-16.svg deleted file mode 100644 index 6cef57c52..000000000 --- a/addons/rose/public/flight/plus-circle-16.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/trash-16.svg b/addons/rose/public/flight/trash-16.svg deleted file mode 100644 index 9686f6d23..000000000 --- a/addons/rose/public/flight/trash-16.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/user-circle-16.svg b/addons/rose/public/flight/user-circle-16.svg deleted file mode 100644 index b74c95d07..000000000 --- a/addons/rose/public/flight/user-circle-16.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/users-16.svg b/addons/rose/public/flight/users-16.svg deleted file mode 100644 index 0648faa9f..000000000 --- a/addons/rose/public/flight/users-16.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/x-16.svg b/addons/rose/public/flight/x-16.svg deleted file mode 100644 index f41d39dd5..000000000 --- a/addons/rose/public/flight/x-16.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/x-circle-16.svg b/addons/rose/public/flight/x-circle-16.svg deleted file mode 100644 index 5b0aa3f78..000000000 --- a/addons/rose/public/flight/x-circle-16.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/addons/rose/public/flight/x-square-16.svg b/addons/rose/public/flight/x-square-16.svg deleted file mode 100644 index 9bf270d7e..000000000 --- a/addons/rose/public/flight/x-square-16.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/addons/rose/tests/dummy/app/templates/playground.hbs b/addons/rose/tests/dummy/app/templates/playground.hbs index dc477136d..33694bdca 100644 --- a/addons/rose/tests/dummy/app/templates/playground.hbs +++ b/addons/rose/tests/dummy/app/templates/playground.hbs @@ -19,7 +19,7 @@ Menu item Menu item @@ -82,7 +82,7 @@ - Remove + Remove diff --git a/addons/rose/tests/integration/components/rose/badge-test.js b/addons/rose/tests/integration/components/rose/badge-test.js index 7b5a62abe..65f6f6b45 100644 --- a/addons/rose/tests/integration/components/rose/badge-test.js +++ b/addons/rose/tests/integration/components/rose/badge-test.js @@ -17,7 +17,9 @@ module('Integration | Component | rose/badge', function (hooks) { }); test('it renders an icon using @icon', async function (assert) { - await render(hbs``); + await render( + hbs`` + ); assert.ok(find('.rose-icon')); }); diff --git a/addons/rose/tests/integration/components/rose/button-test.js b/addons/rose/tests/integration/components/rose/button-test.js index f41d8b686..cebdc50c3 100644 --- a/addons/rose/tests/integration/components/rose/button-test.js +++ b/addons/rose/tests/integration/components/rose/button-test.js @@ -34,14 +34,20 @@ module('Integration | Component | rose/button', function (hooks) { }); test('it supports left and right icons', async function (assert) { - await render(hbs``); + await render( + hbs`` + ); assert.ok(find('.has-icon-left .rose-icon')); - await render(hbs``); + await render( + hbs`` + ); assert.ok(find('.has-icon-right .rose-icon')); }); test('it supports an icon-only type', async function (assert) { - await render(hbs``); + await render( + hbs`` + ); assert.ok(find('.has-icon-only .rose-icon')); }); }); diff --git a/addons/rose/tests/integration/components/rose/card/link-test.js b/addons/rose/tests/integration/components/rose/card/link-test.js index f4eb10074..fdbfb31ac 100644 --- a/addons/rose/tests/integration/components/rose/card/link-test.js +++ b/addons/rose/tests/integration/components/rose/card/link-test.js @@ -42,7 +42,7 @@ module('Integration | Component | rose/card/link', function (hooks) { test('it renders with @icon', async function (assert) { await render( - hbs`` + hbs`` ); assert.ok(find('.rose-icon')); }); diff --git a/addons/rose/tests/integration/components/rose/dropdown-test.js b/addons/rose/tests/integration/components/rose/dropdown-test.js index a80d5d365..e94b1f09d 100644 --- a/addons/rose/tests/integration/components/rose/dropdown-test.js +++ b/addons/rose/tests/integration/components/rose/dropdown-test.js @@ -24,7 +24,7 @@ module('Integration | Component | rose/dropdown', function (hooks) { }); test('it supports an icon', async function (assert) { - await render(hbs``); + await render(hbs``); assert.ok(find('svg')); }); diff --git a/addons/rose/tests/integration/components/rose/dropdown/button-test.js b/addons/rose/tests/integration/components/rose/dropdown/button-test.js index 11ef9ed53..3b1bc1193 100644 --- a/addons/rose/tests/integration/components/rose/dropdown/button-test.js +++ b/addons/rose/tests/integration/components/rose/dropdown/button-test.js @@ -33,7 +33,7 @@ module('Integration | Component | rose/dropdown/button', function (hooks) { test('it supports an icon-only type', async function (assert) { await render( - hbs`` + hbs`` ); assert.ok(find('.has-icon-only .rose-icon')); }); diff --git a/addons/rose/tests/integration/components/rose/form/radio/radio-test.js b/addons/rose/tests/integration/components/rose/form/radio/radio-test.js index 15547dab8..c7117a1e7 100644 --- a/addons/rose/tests/integration/components/rose/form/radio/radio-test.js +++ b/addons/rose/tests/integration/components/rose/form/radio/radio-test.js @@ -19,7 +19,7 @@ module('Integration | Component | rose/form/radio/radio', function (hooks) { test('it supports an icon', async function (assert) { await render( - hbs`` + hbs`` ); assert.ok(find('svg')); }); diff --git a/addons/rose/tests/integration/components/rose/icon-test.js b/addons/rose/tests/integration/components/rose/icon-test.js index 2caad0943..c51b16587 100644 --- a/addons/rose/tests/integration/components/rose/icon-test.js +++ b/addons/rose/tests/integration/components/rose/icon-test.js @@ -7,12 +7,14 @@ module('Integration | Component | rose/icon', function (hooks) { setupRenderingTest(hooks); test('it renders', async function (assert) { - await render(hbs``); + await render(hbs``); assert.ok(find('svg')); }); test('it supports optional @size', async function (assert) { - await render(hbs``); + await render( + hbs`` + ); assert.ok(find('.small')); }); }); diff --git a/addons/rose/tests/integration/components/rose/link-button-test.js b/addons/rose/tests/integration/components/rose/link-button-test.js index 49ba9d843..c49c66d20 100644 --- a/addons/rose/tests/integration/components/rose/link-button-test.js +++ b/addons/rose/tests/integration/components/rose/link-button-test.js @@ -35,7 +35,7 @@ module('Integration | Component | rose/link-button', function (hooks) { test('it supports left icon with @iconLeft', async function (assert) { await render( - hbs`` + hbs`` ); assert.ok(find('.rose-icon')); assert.ok(find('.has-icon-left')); @@ -43,7 +43,7 @@ module('Integration | Component | rose/link-button', function (hooks) { test('it supports left icon with @iconRight', async function (assert) { await render( - hbs`` + hbs`` ); assert.ok(find('.rose-icon')); assert.ok(find('.has-icon-right')); @@ -51,7 +51,7 @@ module('Integration | Component | rose/link-button', function (hooks) { test('it supports only icon with @iconOnly', async function (assert) { await render( - hbs`` + hbs`` ); assert.ok(find('.rose-icon')); assert.ok(find('.has-icon-only')); diff --git a/ui/admin/app/components/copyable/index.js b/ui/admin/app/components/copyable/index.js index 6f13e6ce7..0957798fe 100644 --- a/ui/admin/app/components/copyable/index.js +++ b/ui/admin/app/components/copyable/index.js @@ -12,8 +12,8 @@ export default class CopyableComponent extends Component { id = generateComponentID(); copyableButtonId = `copyable-button-${this.id}`; - actionIcon = 'flight/clipboard-copy-16'; - successIcon = 'flight/clipboard-checked-16'; + actionIcon = 'flight-icons/clipboard-copy-16'; + successIcon = 'flight-icons/clipboard-checked-16'; actionText = this.args.buttonText; successText = this.args.acknowledgeText; diff --git a/ui/admin/app/components/form/auth-method/oidc/index.hbs b/ui/admin/app/components/form/auth-method/oidc/index.hbs index 33e29d67e..d311a6887 100644 --- a/ui/admin/app/components/form/auth-method/oidc/index.hbs +++ b/ui/admin/app/components/form/auth-method/oidc/index.hbs @@ -178,7 +178,7 @@ - + {{t 'actions.back'}} diff --git a/ui/admin/app/components/form/host-set/add-hosts/index.hbs b/ui/admin/app/components/form/host-set/add-hosts/index.hbs index 7cb2fb625..72adf0902 100644 --- a/ui/admin/app/components/form/host-set/add-hosts/index.hbs +++ b/ui/admin/app/components/form/host-set/add-hosts/index.hbs @@ -55,7 +55,7 @@ - + {{t 'actions.back'}} diff --git a/ui/admin/app/components/form/role/add-principals/index.hbs b/ui/admin/app/components/form/role/add-principals/index.hbs index eeb567f68..1c60623be 100644 --- a/ui/admin/app/components/form/role/add-principals/index.hbs +++ b/ui/admin/app/components/form/role/add-principals/index.hbs @@ -58,7 +58,7 @@ {{t 'resources.role.principal.messages.none.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/components/form/role/grants/index.hbs b/ui/admin/app/components/form/role/grants/index.hbs index 86c994d25..f3a9e2f1e 100644 --- a/ui/admin/app/components/form/role/grants/index.hbs +++ b/ui/admin/app/components/form/role/grants/index.hbs @@ -74,7 +74,7 @@ diff --git a/ui/admin/app/components/form/role/index.hbs b/ui/admin/app/components/form/role/index.hbs index dde4c73d5..b5a9d6888 100644 --- a/ui/admin/app/components/form/role/index.hbs +++ b/ui/admin/app/components/form/role/index.hbs @@ -69,8 +69,12 @@ @text={{this.selectedGrantScope.displayName}} @icon={{if this.selectedGrantScope.isProject - 'flight/grid-16' - (if this.selectedGrantScope.isOrg 'flight/org-16' 'flight/globe-16') + 'flight-icons/grid-16' + (if + this.selectedGrantScope.isOrg + 'flight-icons/org-16' + 'flight-icons/globe-16' + ) }} as |dropdown| > diff --git a/ui/admin/app/components/form/target/add-credential-libraries/index.hbs b/ui/admin/app/components/form/target/add-credential-libraries/index.hbs index a99390058..628bed983 100644 --- a/ui/admin/app/components/form/target/add-credential-libraries/index.hbs +++ b/ui/admin/app/components/form/target/add-credential-libraries/index.hbs @@ -55,7 +55,7 @@ {{t 'resources.target.credential-library.messages.none.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/components/form/target/add-host-sets/index.hbs b/ui/admin/app/components/form/target/add-host-sets/index.hbs index 238ab3e42..ade5297a6 100644 --- a/ui/admin/app/components/form/target/add-host-sets/index.hbs +++ b/ui/admin/app/components/form/target/add-host-sets/index.hbs @@ -59,7 +59,7 @@ {{t 'resources.target.host-set.messages.none.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/components/form/user/add-accounts/index.hbs b/ui/admin/app/components/form/user/add-accounts/index.hbs index afb2c43f8..778fa7993 100644 --- a/ui/admin/app/components/form/user/add-accounts/index.hbs +++ b/ui/admin/app/components/form/user/add-accounts/index.hbs @@ -59,7 +59,7 @@ {{t 'resources.user.messages.no-accounts.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/templates/application.hbs b/ui/admin/app/templates/application.hbs index 7413d948e..daa6f8737 100644 --- a/ui/admin/app/templates/application.hbs +++ b/ui/admin/app/templates/application.hbs @@ -16,7 +16,7 @@ @@ -100,7 +100,7 @@ diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index f896df85a..d3abb701c 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -18,7 +18,7 @@ {{#if @model.isGlobal}} - + {{t 'resources.org.title_plural'}} @@ -28,12 +28,12 @@ {{#if this.session.data.authenticated.isGlobal}} - + {{t 'resources.org.title_plural'}} {{/if}} - + {{t 'resources.project.title_plural'}} @@ -43,12 +43,12 @@ {{#if this.session.data.authenticated.isGlobal}} - + {{t 'resources.org.title_plural'}} {{/if}} - + {{t 'resources.project.title_plural'}} @@ -58,13 +58,13 @@ {{t "resources.group.title_plural"}} {{t "resources.role.title_plural"}} @@ -72,20 +72,23 @@ --}} - + {{t 'resources.session.title_plural'}} - + {{t 'resources.target.title_plural'}} - + {{t 'resources.host-catalog.title_plural'}} {{#if (feature-flag 'credential-store')}} - + {{t 'resources.credential-store.title_plural'}} {{/if}} @@ -95,19 +98,19 @@ {{#unless @model.isProject}} - + {{t 'resources.user.title_plural'}} - + {{t 'resources.group.title_plural'}} - + {{t 'resources.role.title_plural'}} - + {{t 'resources.auth-method.title_plural'}} diff --git a/ui/admin/app/templates/scopes/scope/-header-nav.hbs b/ui/admin/app/templates/scopes/scope/-header-nav.hbs index 0a0f9c3b9..cd84e45cc 100644 --- a/ui/admin/app/templates/scopes/scope/-header-nav.hbs +++ b/ui/admin/app/templates/scopes/scope/-header-nav.hbs @@ -2,8 +2,8 @@ @text={{this.scopes.selectedOrg.displayName}} @icon={{if this.scopes.selectedOrg.isGlobal - 'flight/globe-16' - 'flight/org-16' + 'flight-icons/globe-16' + 'flight-icons/org-16' }} as |dropdown| > @@ -23,7 +23,7 @@ {{#if this.scopes.selectedProject}} {{#each this.scopes.projects as |scope|}} diff --git a/ui/admin/app/templates/scopes/scope/-sidebar.hbs b/ui/admin/app/templates/scopes/scope/-sidebar.hbs index f592804ce..08d4b6b46 100644 --- a/ui/admin/app/templates/scopes/scope/-sidebar.hbs +++ b/ui/admin/app/templates/scopes/scope/-sidebar.hbs @@ -1,18 +1,18 @@ - + {{t 'resources.user.title_plural'}} - + {{t 'resources.group.title_plural'}} - + {{t 'resources.role.title_plural'}} - + {{t 'resources.auth-method.title_plural'}} \ No newline at end of file diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-actions.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-actions.hbs index 200cc9912..9099abe02 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-actions.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-actions.hbs @@ -3,8 +3,10 @@ @text={{t (concat 'states.' @model.attributes.state)}} @icon={{if @model.isInactive - 'flight/x-circle-16' - (if @model.isPrivate 'flight/lock-16' 'flight/check-circle-16') + 'flight-icons/x-circle-16' + (if + @model.isPrivate 'flight-icons/lock-16' 'flight-icons/check-circle-16' + ) }} @dropdownRight={{true}} as |dropdown| diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/accounts/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/accounts/index.hbs index ee9b1091d..2006e7f52 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/accounts/index.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/accounts/index.hbs @@ -115,7 +115,7 @@ {{t 'resources.account.messages.welcome.description'}} - + {{t 'resources.account.actions.create'}} diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs index 0a4fbd8d8..2b078d971 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs @@ -123,7 +123,7 @@ @dropdownRight={{true}} @iconOnly={{true}} @showCaret={{false}} - @icon='flight/more-horizontal-16' + @icon='flight-icons/more-horizontal-16' as |dropdown| > {{#unless authMethod.isPrimary}} @@ -165,7 +165,7 @@ @route='scopes.scope.auth-methods.new' @query={{hash type='password'}} > - + {{t 'titles.new'}}
diff --git a/ui/admin/app/templates/scopes/scope/authenticate.hbs b/ui/admin/app/templates/scopes/scope/authenticate.hbs index 755b72578..bf7f33f0a 100644 --- a/ui/admin/app/templates/scopes/scope/authenticate.hbs +++ b/ui/admin/app/templates/scopes/scope/authenticate.hbs @@ -16,7 +16,7 @@ }}

@@ -79,7 +79,7 @@ diff --git a/ui/admin/app/templates/scopes/scope/authenticate/index.hbs b/ui/admin/app/templates/scopes/scope/authenticate/index.hbs index 014f21a9a..fa5633bb1 100644 --- a/ui/admin/app/templates/scopes/scope/authenticate/index.hbs +++ b/ui/admin/app/templates/scopes/scope/authenticate/index.hbs @@ -2,7 +2,7 @@ diff --git a/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs b/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs index 60d720c91..56d73cdcb 100644 --- a/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs +++ b/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs @@ -58,7 +58,7 @@ - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs b/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs index cf059f762..1727d0347 100644 --- a/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs +++ b/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs @@ -78,7 +78,7 @@ {{t 'resources.credential-store.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/groups/group/members.hbs b/ui/admin/app/templates/scopes/scope/groups/group/members.hbs index 07503d0d3..3979e762a 100644 --- a/ui/admin/app/templates/scopes/scope/groups/group/members.hbs +++ b/ui/admin/app/templates/scopes/scope/groups/group/members.hbs @@ -27,7 +27,7 @@ - + {{t 'resources.group.actions.add-members'}} diff --git a/ui/admin/app/templates/scopes/scope/groups/index.hbs b/ui/admin/app/templates/scopes/scope/groups/index.hbs index c290f9948..7c25937c0 100644 --- a/ui/admin/app/templates/scopes/scope/groups/index.hbs +++ b/ui/admin/app/templates/scopes/scope/groups/index.hbs @@ -72,7 +72,7 @@ {{t 'resources.group.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs index 1b1f21949..351fb19d7 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs @@ -37,7 +37,7 @@ {{!-- - + {{t "resources.host-set.actions.create-and-add-host"}} --}} 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 defdee52e..57542b1d8 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 @@ -52,7 +52,7 @@ - + {{t 'titles.new'}} 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 3079c54c2..a29293dd8 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 @@ -54,7 +54,7 @@ {{t 'resources.host.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs index 6affad96b..0ee13bee1 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs @@ -81,7 +81,7 @@ {{t 'resources.host-catalog.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/roles/index.hbs b/ui/admin/app/templates/scopes/scope/roles/index.hbs index 30cc00e38..2b975a0f3 100644 --- a/ui/admin/app/templates/scopes/scope/roles/index.hbs +++ b/ui/admin/app/templates/scopes/scope/roles/index.hbs @@ -67,7 +67,7 @@ {{t 'resources.role.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs b/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs index b67e32aa7..5086502f0 100644 --- a/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs +++ b/ui/admin/app/templates/scopes/scope/roles/role/principals.hbs @@ -31,7 +31,7 @@ - + {{t 'resources.role.principal.actions.add-principals'}} diff --git a/ui/admin/app/templates/scopes/scope/scopes/index.hbs b/ui/admin/app/templates/scopes/scope/scopes/index.hbs index 542404b4e..19a4168d5 100644 --- a/ui/admin/app/templates/scopes/scope/scopes/index.hbs +++ b/ui/admin/app/templates/scopes/scope/scopes/index.hbs @@ -43,7 +43,11 @@ @title={{scope.name}} @description={{scope.description}} @id={{scope.id}} - @icon={{if scope.isOrg 'flight/org-16' 'flight/grid-16'}} + @icon={{if + scope.isOrg + 'flight-icons/org-16' + 'flight-icons/grid-16' + }} @route='scopes.scope' @model={{scope.id}} /> @@ -62,7 +66,7 @@ {{t 'resources.org.description'}} - + {{t 'titles.new'}} @@ -79,7 +83,7 @@ {{t 'resources.project.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/sessions/index.hbs b/ui/admin/app/templates/scopes/scope/sessions/index.hbs index e1844e23b..552c50c88 100644 --- a/ui/admin/app/templates/scopes/scope/sessions/index.hbs +++ b/ui/admin/app/templates/scopes/scope/sessions/index.hbs @@ -36,7 +36,7 @@ 'session-status-' sessionAggregate.session.status }} - @name='flight/arrow-right-circle-16' + @name='flight-icons/arrow-right-circle-16' @size='medium' /> - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/targets/target/add-credential-libraries.hbs b/ui/admin/app/templates/scopes/scope/targets/target/add-credential-libraries.hbs index 59a046f11..a4188a78e 100644 --- a/ui/admin/app/templates/scopes/scope/targets/target/add-credential-libraries.hbs +++ b/ui/admin/app/templates/scopes/scope/targets/target/add-credential-libraries.hbs @@ -19,7 +19,7 @@ {{t 'resources.target.credential-library.messages.none.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/templates/scopes/scope/targets/target/add-host-sets.hbs b/ui/admin/app/templates/scopes/scope/targets/target/add-host-sets.hbs index d49f9f75e..af5d5921a 100644 --- a/ui/admin/app/templates/scopes/scope/targets/target/add-host-sets.hbs +++ b/ui/admin/app/templates/scopes/scope/targets/target/add-host-sets.hbs @@ -20,7 +20,7 @@ {{t 'resources.target.host-set.messages.none.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/app/templates/scopes/scope/targets/target/credential-libraries.hbs b/ui/admin/app/templates/scopes/scope/targets/target/credential-libraries.hbs index b62c5d4d2..87284cafe 100644 --- a/ui/admin/app/templates/scopes/scope/targets/target/credential-libraries.hbs +++ b/ui/admin/app/templates/scopes/scope/targets/target/credential-libraries.hbs @@ -44,7 +44,7 @@ - + {{t 'resources.target.actions.add-credential-libraries'}} diff --git a/ui/admin/app/templates/scopes/scope/targets/target/host-sets.hbs b/ui/admin/app/templates/scopes/scope/targets/target/host-sets.hbs index 5f0f96421..b123d74d3 100644 --- a/ui/admin/app/templates/scopes/scope/targets/target/host-sets.hbs +++ b/ui/admin/app/templates/scopes/scope/targets/target/host-sets.hbs @@ -34,7 +34,7 @@ - + {{t 'resources.target.actions.add-host-sets'}} diff --git a/ui/admin/app/templates/scopes/scope/users/index.hbs b/ui/admin/app/templates/scopes/scope/users/index.hbs index b282a6993..b0cf3e83b 100644 --- a/ui/admin/app/templates/scopes/scope/users/index.hbs +++ b/ui/admin/app/templates/scopes/scope/users/index.hbs @@ -71,7 +71,7 @@ {{t 'resources.user.description'}} - + {{t 'titles.new'}} diff --git a/ui/admin/app/templates/scopes/scope/users/user/accounts.hbs b/ui/admin/app/templates/scopes/scope/users/user/accounts.hbs index ec8d3704e..369e3c08b 100644 --- a/ui/admin/app/templates/scopes/scope/users/user/accounts.hbs +++ b/ui/admin/app/templates/scopes/scope/users/user/accounts.hbs @@ -34,7 +34,7 @@ - + {{t 'resources.user.actions.add-accounts'}} diff --git a/ui/admin/app/templates/scopes/scope/users/user/add-accounts.hbs b/ui/admin/app/templates/scopes/scope/users/user/add-accounts.hbs index 418f49822..3ded8d49b 100644 --- a/ui/admin/app/templates/scopes/scope/users/user/add-accounts.hbs +++ b/ui/admin/app/templates/scopes/scope/users/user/add-accounts.hbs @@ -20,7 +20,7 @@ {{t 'resources.user.messages.no-accounts.description'}} - + {{t 'actions.back'}} diff --git a/ui/admin/ember-cli-build.js b/ui/admin/ember-cli-build.js index ab3b6e0f1..a7b391110 100644 --- a/ui/admin/ember-cli-build.js +++ b/ui/admin/ember-cli-build.js @@ -23,7 +23,7 @@ module.exports = function (defaults) { importCss: false, }, svg: { - paths: ['../../addons/core/public', '../../addons/rose/public'], + paths: ['../../addons/core/public'], }, }); diff --git a/ui/desktop/app/components/copyable/index.js b/ui/desktop/app/components/copyable/index.js index 8af16d028..6168b8c97 100644 --- a/ui/desktop/app/components/copyable/index.js +++ b/ui/desktop/app/components/copyable/index.js @@ -13,8 +13,8 @@ export default class CopyableComponent extends Component { id = generateComponentID(); copyableButtonId = `copyable-button-${this.id}`; - actionIcon = 'flight/clipboard-copy-16'; - successIcon = 'flight/clipboard-checked-16'; + actionIcon = 'flight-icons/clipboard-copy-16'; + successIcon = 'flight-icons/clipboard-checked-16'; actionText = this.args.buttonText; successText = this.args.acknowledgeText; diff --git a/ui/desktop/app/components/hidden-secret/index.hbs b/ui/desktop/app/components/hidden-secret/index.hbs index afca5e4d3..a3181b9a6 100644 --- a/ui/desktop/app/components/hidden-secret/index.hbs +++ b/ui/desktop/app/components/hidden-secret/index.hbs @@ -1,7 +1,11 @@
{{t 'actions.toggle-secret'}} diff --git a/ui/desktop/app/templates/application.hbs b/ui/desktop/app/templates/application.hbs index caab00131..0099725ed 100644 --- a/ui/desktop/app/templates/application.hbs +++ b/ui/desktop/app/templates/application.hbs @@ -21,7 +21,7 @@ {{#if this.isWindowsOS}} @@ -107,7 +107,7 @@ diff --git a/ui/desktop/app/templates/scopes/scope/authenticate.hbs b/ui/desktop/app/templates/scopes/scope/authenticate.hbs index da49bb798..2c48baf83 100644 --- a/ui/desktop/app/templates/scopes/scope/authenticate.hbs +++ b/ui/desktop/app/templates/scopes/scope/authenticate.hbs @@ -11,7 +11,7 @@ @@ -67,7 +67,7 @@ diff --git a/ui/desktop/app/templates/scopes/scope/authenticate/index.hbs b/ui/desktop/app/templates/scopes/scope/authenticate/index.hbs index 014f21a9a..fa5633bb1 100644 --- a/ui/desktop/app/templates/scopes/scope/authenticate/index.hbs +++ b/ui/desktop/app/templates/scopes/scope/authenticate/index.hbs @@ -2,7 +2,7 @@ diff --git a/ui/desktop/app/templates/scopes/scope/projects.hbs b/ui/desktop/app/templates/scopes/scope/projects.hbs index f3bde26b8..ab28a0a16 100644 --- a/ui/desktop/app/templates/scopes/scope/projects.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects.hbs @@ -2,12 +2,12 @@ - + {{t 'resources.target.title_plural'}} - + {{t 'resources.session.title_plural'}} diff --git a/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs b/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs index 5aeffbf98..126557d3f 100644 --- a/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs @@ -29,7 +29,7 @@ <:header> + @icon='flight-icons/key-16'> <:header> <:body> <:footer> diff --git a/yarn.lock b/yarn.lock index d35304465..9a1ba9bf4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2066,6 +2066,11 @@ resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-1.1.0.tgz#d6dbc7574774b238114582410e8fee0dc3532bdf" integrity sha512-rR7tJoSwJ2eooOpYGxGGW95sLq6GXUaS1UtWvN7pei6n2/okYvCGld9vsUTvkl2migxbkszsycwtMf/GEc1k1A== +"@hashicorp/flight-icons@^0.0.3-beta": + version "0.0.3-beta" + resolved "https://registry.yarnpkg.com/@hashicorp/flight/-/flight-icons-0.0.3-beta.tgz#26b6b22e4c709559ed4c9ab0e87a0874c919b909" + integrity sha512-K+rS0p3YKPqNDHYP9Mz+7vmU5wsvm8wjI3h8rs/y6f84agC9LyhkmZQBy/RRAMXeyYsa3sq8cJc6jcj/nuR23g== + "@humanwhocodes/config-array@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" From 4a0f1d04f252ff2f7d8cfce098e2b34ad81b282a Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 25 Aug 2021 10:57:47 -0400 Subject: [PATCH 18/60] fix: fix broken lockfile link --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 9a1ba9bf4..4309fdf56 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2068,7 +2068,7 @@ "@hashicorp/flight-icons@^0.0.3-beta": version "0.0.3-beta" - resolved "https://registry.yarnpkg.com/@hashicorp/flight/-/flight-icons-0.0.3-beta.tgz#26b6b22e4c709559ed4c9ab0e87a0874c919b909" + resolved "https://registry.yarnpkg.com/@hashicorp/flight-icons/-/flight-icons-0.0.3-beta.tgz#26b6b22e4c709559ed4c9ab0e87a0874c919b909" integrity sha512-K+rS0p3YKPqNDHYP9Mz+7vmU5wsvm8wjI3h8rs/y6f84agC9LyhkmZQBy/RRAMXeyYsa3sq8cJc6jcj/nuR23g== "@humanwhocodes/config-array@^0.5.0": From 59934559a5ef50f3a74a6c6a928bfefff1a9c301 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 25 Aug 2021 15:13:24 -0400 Subject: [PATCH 19/60] chore: bump flight-icons to 0.0.4-beta --- addons/rose/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/rose/package.json b/addons/rose/package.json index cffa4b44b..e35727834 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -43,7 +43,7 @@ "@ember/test-helpers": "^2.2.8", "@glimmer/component": "^1.0.3", "@glimmer/tracking": "^1.0.3", - "@hashicorp/flight-icons": "^0.0.3-beta", + "@hashicorp/flight-icons": "^0.0.4-beta", "@storybook/addon-actions": "^6.3.1", "@storybook/addon-docs": "^6.3.1", "@storybook/addon-knobs": "^6.3.0", diff --git a/yarn.lock b/yarn.lock index 4309fdf56..a172e38a5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2066,10 +2066,10 @@ resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-1.1.0.tgz#d6dbc7574774b238114582410e8fee0dc3532bdf" integrity sha512-rR7tJoSwJ2eooOpYGxGGW95sLq6GXUaS1UtWvN7pei6n2/okYvCGld9vsUTvkl2migxbkszsycwtMf/GEc1k1A== -"@hashicorp/flight-icons@^0.0.3-beta": - version "0.0.3-beta" - resolved "https://registry.yarnpkg.com/@hashicorp/flight-icons/-/flight-icons-0.0.3-beta.tgz#26b6b22e4c709559ed4c9ab0e87a0874c919b909" - integrity sha512-K+rS0p3YKPqNDHYP9Mz+7vmU5wsvm8wjI3h8rs/y6f84agC9LyhkmZQBy/RRAMXeyYsa3sq8cJc6jcj/nuR23g== +"@hashicorp/flight-icons@^0.0.4-beta": + version "0.0.4-beta" + resolved "https://registry.yarnpkg.com/@hashicorp/flight-icons/-/flight-icons-0.0.4-beta.tgz#b89cb3be3d226411c7bc2df34f732fb99e0f2e85" + integrity sha512-iMO7uycGzVP/Pp6m4KNlZB1fS0alrY6jx+p1HWM+EV63YjEbzmS/M6/1KMZ4hfoQRZCpui8EydqXclI5TL05nw== "@humanwhocodes/config-array@^0.5.0": version "0.5.0" From a54ae21858d99dbe199e6f5f4b69a54eeeedc950 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 25 Aug 2021 15:23:52 -0400 Subject: [PATCH 20/60] chore: revert to flight-icons 0.0.3-beta due to breaking change --- addons/rose/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/rose/package.json b/addons/rose/package.json index e35727834..cffa4b44b 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -43,7 +43,7 @@ "@ember/test-helpers": "^2.2.8", "@glimmer/component": "^1.0.3", "@glimmer/tracking": "^1.0.3", - "@hashicorp/flight-icons": "^0.0.4-beta", + "@hashicorp/flight-icons": "^0.0.3-beta", "@storybook/addon-actions": "^6.3.1", "@storybook/addon-docs": "^6.3.1", "@storybook/addon-knobs": "^6.3.0", diff --git a/yarn.lock b/yarn.lock index d2affa035..eef18daed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2066,10 +2066,10 @@ resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-1.1.0.tgz#d6dbc7574774b238114582410e8fee0dc3532bdf" integrity sha512-rR7tJoSwJ2eooOpYGxGGW95sLq6GXUaS1UtWvN7pei6n2/okYvCGld9vsUTvkl2migxbkszsycwtMf/GEc1k1A== -"@hashicorp/flight-icons@^0.0.4-beta": - version "0.0.4-beta" - resolved "https://registry.yarnpkg.com/@hashicorp/flight-icons/-/flight-icons-0.0.4-beta.tgz#b89cb3be3d226411c7bc2df34f732fb99e0f2e85" - integrity sha512-iMO7uycGzVP/Pp6m4KNlZB1fS0alrY6jx+p1HWM+EV63YjEbzmS/M6/1KMZ4hfoQRZCpui8EydqXclI5TL05nw== +"@hashicorp/flight-icons@^0.0.3-beta": + version "0.0.3-beta" + resolved "https://registry.yarnpkg.com/@hashicorp/flight-icons/-/flight-icons-0.0.3-beta.tgz#26b6b22e4c709559ed4c9ab0e87a0874c919b909" + integrity sha512-K+rS0p3YKPqNDHYP9Mz+7vmU5wsvm8wjI3h8rs/y6f84agC9LyhkmZQBy/RRAMXeyYsa3sq8cJc6jcj/nuR23g== "@humanwhocodes/config-array@^0.5.0": version "0.5.0" From b0326e0c994c294a715701b1a6d17329a4f1813f Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 25 Aug 2021 16:24:26 -0400 Subject: [PATCH 21/60] test: add user create test and stubbed list test --- .../{users-test.js => users/create-test.js} | 22 ++++++- ui/admin/tests/acceptance/users/list-test.js | 57 +++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) rename ui/admin/tests/acceptance/{users-test.js => users/create-test.js} (74%) create mode 100644 ui/admin/tests/acceptance/users/list-test.js diff --git a/ui/admin/tests/acceptance/users-test.js b/ui/admin/tests/acceptance/users/create-test.js similarity index 74% rename from ui/admin/tests/acceptance/users-test.js rename to ui/admin/tests/acceptance/users/create-test.js index b047a0d2a..069ca0102 100644 --- a/ui/admin/tests/acceptance/users-test.js +++ b/ui/admin/tests/acceptance/users/create-test.js @@ -10,23 +10,28 @@ import { //invalidateSession, } from 'ember-simple-auth/test-support'; -module('Acceptance | users', function (hooks) { +module('Acceptance | users | create', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); + let globalScope; let orgScope; + let orgURL; let usersURL; let newUserURL; hooks.beforeEach(function () { + globalScope = this.server.create('scope', { id: 'global' }); orgScope = this.server.create( 'scope', { type: 'org', + scope: { id: 'global', type: 'global' }, }, 'withChildren' ); + orgURL = `/scopes/${orgScope.id}`; usersURL = `/scopes/${orgScope.id}/users`; newUserURL = `${usersURL}/new`; @@ -42,6 +47,21 @@ module('Acceptance | users', function (hooks) { assert.equal(this.server.db.users.length, usersCount + 1); }); + test('can navigate to new users route with proper authorization', async function (assert) { + assert.expect(2); + await visit(orgURL); + assert.ok(orgScope.authorized_collection_actions.users.includes('create')); + assert.ok(find(`[href="${orgURL}/users"]`)); + }); + + test('cannot navigate to new users route without proper authorization', async function (assert) { + assert.expect(2); + orgScope.authorized_collection_actions.users = []; + await visit(orgURL); + assert.notOk(orgScope.authorized_collection_actions.users.includes('create')); + assert.notOk(find(`[href="${orgURL}/users"]`)); + }); + test('can cancel creation of a new user', async function (assert) { assert.expect(2); const usersCount = this.server.db.users.length; diff --git a/ui/admin/tests/acceptance/users/list-test.js b/ui/admin/tests/acceptance/users/list-test.js new file mode 100644 index 000000000..bf768b334 --- /dev/null +++ b/ui/admin/tests/acceptance/users/list-test.js @@ -0,0 +1,57 @@ +import { module, test } from 'qunit'; +import { visit, currentURL, find } 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, + // These are left here intentionally for future reference. + //currentSession, + //invalidateSession, +} from 'ember-simple-auth/test-support'; + +module('Acceptance | users | list', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + + let usersURL; + + const instances = { + scopes: { + global: null, + org: null, + } + }; + + const urls = { + scopes: { + org: null + }, + users: null + }; + + hooks.beforeEach(function () { + instances.scopes.global = this.server.create('scope', { id: 'global' }); + instances.org = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + instances.user = this.server.create('user', { + scope: instances.org, + }); + urls.users = `/scopes/${instances.org.id}/users`; + authenticateSession({}); + }); + + test('can navigate to users with proper authorization', async function (assert) { + // TODO + }); + + test('cannot navigate to users with proper authorization', async function (assert) { + // TODO + }); +}); From 1017295a8567d4bc51887249e6e409d4136b1ad4 Mon Sep 17 00:00:00 2001 From: Amy Lam Date: Wed, 25 Aug 2021 19:29:54 -0700 Subject: [PATCH 22/60] Update package --- addons/rose/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/rose/package.json b/addons/rose/package.json index cffa4b44b..6a62cb90f 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -43,7 +43,7 @@ "@ember/test-helpers": "^2.2.8", "@glimmer/component": "^1.0.3", "@glimmer/tracking": "^1.0.3", - "@hashicorp/flight-icons": "^0.0.3-beta", + "@hashicorp/flight-icons": "^0.0.6-beta", "@storybook/addon-actions": "^6.3.1", "@storybook/addon-docs": "^6.3.1", "@storybook/addon-knobs": "^6.3.0", diff --git a/yarn.lock b/yarn.lock index eef18daed..d354d0c09 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2066,10 +2066,10 @@ resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-1.1.0.tgz#d6dbc7574774b238114582410e8fee0dc3532bdf" integrity sha512-rR7tJoSwJ2eooOpYGxGGW95sLq6GXUaS1UtWvN7pei6n2/okYvCGld9vsUTvkl2migxbkszsycwtMf/GEc1k1A== -"@hashicorp/flight-icons@^0.0.3-beta": - version "0.0.3-beta" - resolved "https://registry.yarnpkg.com/@hashicorp/flight-icons/-/flight-icons-0.0.3-beta.tgz#26b6b22e4c709559ed4c9ab0e87a0874c919b909" - integrity sha512-K+rS0p3YKPqNDHYP9Mz+7vmU5wsvm8wjI3h8rs/y6f84agC9LyhkmZQBy/RRAMXeyYsa3sq8cJc6jcj/nuR23g== +"@hashicorp/flight-icons@^0.0.6-beta": + version "0.0.6-beta" + resolved "https://registry.yarnpkg.com/@hashicorp/flight-icons/-/flight-icons-0.0.6-beta.tgz#49da48d4966c13ef0636a9853dc208fccc8d5c88" + integrity sha512-GJHFPig7n26mMyMDPuUiD2Szp8wEskkcLKxWGAx0wyCGASYotLgAYHAGfa4uLlUOsIkibxKjc/7Y/0ttQeN9hQ== "@humanwhocodes/config-array@^0.5.0": version "0.5.0" From b4d36438a458f80387a6589d0c95ee66bcca8a2c Mon Sep 17 00:00:00 2001 From: Amy Lam Date: Wed, 25 Aug 2021 19:53:16 -0700 Subject: [PATCH 23/60] Update icon to 24 In the dev tools the viewBox should be 24. @hashicorp/flight-icons now uses 16 as default. --- addons/core/addon/components/doc-link/index.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/core/addon/components/doc-link/index.hbs b/addons/core/addon/components/doc-link/index.hbs index 67a788936..664e9d215 100644 --- a/addons/core/addon/components/doc-link/index.hbs +++ b/addons/core/addon/components/doc-link/index.hbs @@ -4,5 +4,5 @@ target="_blank" rel="noreferrer noopener" title={{t "actions.get-topic-help"}}> - + From b2f11f712bd3dbad681576bdd64756dc17192ff5 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 25 Aug 2021 23:43:07 -0700 Subject: [PATCH 24/60] grp --- addons/api/addon/abilities/collection.js | 3 +- addons/api/addon/models/base.js | 5 ++ addons/api/mirage/factories/scope.js | 5 ++ addons/core/translations/en-us.yaml | 2 + ui/admin/app/routes/scopes/scope/groups.js | 9 ++- .../app/routes/scopes/scope/groups/index.js | 9 ++- .../templates/scopes/scope/groups/index.hbs | 36 +++++++-- .../{groups-test.js => groups/create-test.js} | 20 ++++- .../tests/acceptance/groups/delete-test.js | 2 +- ui/admin/tests/acceptance/groups/list-test.js | 80 +++++++++++++++++++ 10 files changed, 154 insertions(+), 17 deletions(-) rename ui/admin/tests/acceptance/{groups-test.js => groups/create-test.js} (84%) create mode 100644 ui/admin/tests/acceptance/groups/list-test.js diff --git a/addons/api/addon/abilities/collection.js b/addons/api/addon/abilities/collection.js index ad52afd18..92f0e4342 100644 --- a/addons/api/addon/abilities/collection.js +++ b/addons/api/addon/abilities/collection.js @@ -29,7 +29,8 @@ export default class CollectionAbility extends Ability { * @return {boolean} */ hasAuthorizedCollectionAction(action) { - const { authorized_collection_actions } = this.model; + const authorized_collection_actions = + (this.model || {}).authorized_collection_actions || {}; const collection = this.collection || {}; return authorized_collection_actions[collection]?.includes(action); } diff --git a/addons/api/addon/models/base.js b/addons/api/addon/models/base.js index f99e0351a..7fd41ec64 100644 --- a/addons/api/addon/models/base.js +++ b/addons/api/addon/models/base.js @@ -42,6 +42,11 @@ export default class BaseModel extends Model { }) authorized_actions; + @attr({ + readOnly: true, + }) + authorized_collection_actions; + set scopeModel(model) { if (model) { const json = model.serialize(); diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index fe41f3866..e6a1071f5 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -4,6 +4,11 @@ import { trait } from 'ember-cli-mirage'; export default factory.extend({ type: 'global', + authorized_collection_actions: () => { + return { + groups: ['create', 'list'], + }; + }, /** * Generates realistic-ish IDs while still being deterministic. */ diff --git a/addons/core/translations/en-us.yaml b/addons/core/translations/en-us.yaml index 5370c7e75..8f98f633c 100644 --- a/addons/core/translations/en-us.yaml +++ b/addons/core/translations/en-us.yaml @@ -32,6 +32,8 @@ titles: descriptions: empty-set: There are no items to display yet. You may be able to add items or try back later. origin-initialization: To get started, please enter your origin URL + create-but-not-list: You do not have permission to list {resource}, but you can create new instances. + neither-list-nor-create: You do not have permission to list or create {resource}. questions: delete-confirm: Are you sure you want to delete this resource? remove-confirm: Are you sure you want to remove this association? diff --git a/ui/admin/app/routes/scopes/scope/groups.js b/ui/admin/app/routes/scopes/scope/groups.js index 7fa556182..1784799cc 100644 --- a/ui/admin/app/routes/scopes/scope/groups.js +++ b/ui/admin/app/routes/scopes/scope/groups.js @@ -11,7 +11,7 @@ export default class ScopesScopeGroupsRoute extends Route { @service intl; @service notify; @service session; - + @service can; // =methods /** @@ -26,8 +26,11 @@ export default class ScopesScopeGroupsRoute extends Route { * @return {Promise[GroupModel]} */ async model() { - const { id: scope_id } = this.modelFor('scopes.scope'); - return this.store.query('group', { scope_id }); + const scope = this.modelFor('scopes.scope'); + const { id: scope_id } = scope; + if (this.can.can('list collection', scope, { collection: 'groups' })) { + return this.store.query('group', { scope_id }); + } } // =actions diff --git a/ui/admin/app/routes/scopes/scope/groups/index.js b/ui/admin/app/routes/scopes/scope/groups/index.js index 7d2a20fb0..22e3d3593 100644 --- a/ui/admin/app/routes/scopes/scope/groups/index.js +++ b/ui/admin/app/routes/scopes/scope/groups/index.js @@ -1,3 +1,10 @@ import Route from '@ember/routing/route'; +export default class ScopesScopeGroupsIndexRoute extends Route { + // =methods -export default class ScopesScopeGroupsIndexRoute extends Route {} + setupController(controller) { + const scope = this.modelFor('scopes.scope'); + super.setupController(...arguments); + controller.setProperties({ scope }); + } +} diff --git a/ui/admin/app/templates/scopes/scope/groups/index.hbs b/ui/admin/app/templates/scopes/scope/groups/index.hbs index cb59fde2e..e1104e0c8 100644 --- a/ui/admin/app/templates/scopes/scope/groups/index.hbs +++ b/ui/admin/app/templates/scopes/scope/groups/index.hbs @@ -13,10 +13,12 @@ - {{#if @model}} - {{t - 'titles.new' - }} + {{#if (can 'create collection' this.scope collection='groups')}} + {{#if @model}} + {{t + 'titles.new' + }} + {{/if}} {{/if}} @@ -70,11 +72,29 @@ > {{t 'resources.group.description'}} + {{#if (can 'list collection' this.scope collection='groups')}} + {{! can list (at least): show default welcome message}} + {{t 'resources.group.description'}} + {{else if (can 'create collection' this.scope collection='groups')}} + {{! can create (only): show create-but-not-list welcome message}} + {{t + 'descriptions.create-but-not-list' + resource=(t 'resources.group.title_plural') + }} + {{else}} + {{! can neither list nor create }} + {{t + 'descriptions.neither-list-nor-create' + resource=(t 'resources.group.title_plural') + }} + {{/if}} - - - {{t 'titles.new'}} - + {{#if (can 'create collection' this.scope collection='groups')}} + + + {{t 'titles.new'}} + + {{/if}} diff --git a/ui/admin/tests/acceptance/groups-test.js b/ui/admin/tests/acceptance/groups/create-test.js similarity index 84% rename from ui/admin/tests/acceptance/groups-test.js rename to ui/admin/tests/acceptance/groups/create-test.js index 38b95d60d..291222647 100644 --- a/ui/admin/tests/acceptance/groups-test.js +++ b/ui/admin/tests/acceptance/groups/create-test.js @@ -10,10 +10,10 @@ import { //invalidateSession, } from 'ember-simple-auth/test-support'; -module('Acceptance | groups', function (hooks) { +module('Acceptance | groups | create', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); - + let orgScope; const instances = { scopes: { global: null, @@ -22,7 +22,6 @@ module('Acceptance | groups', function (hooks) { group: null, }; const urls = { - orgScope: null, groups: null, group: null, newGroup: null, @@ -31,6 +30,14 @@ module('Acceptance | groups', function (hooks) { hooks.beforeEach(function () { authenticateSession({}); instances.scopes.global = this.server.create('scope', { id: 'global' }); + orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); instances.scopes.org = this.server.create('scope', { type: 'org', scope: { id: 'global', type: 'global' }, @@ -52,6 +59,13 @@ module('Acceptance | groups', function (hooks) { assert.equal(this.server.db.groups.length, groupsCount + 1); }); + test('cannot create new group without proper authorization', async function (assert) { + assert.expect(1); + orgScope.authorized_collection_actions.groups = ['list']; + await visit(urls.groups); + assert.notOk(find('.rose-layout-page-actions .rose-button-primary')); + }); + test('can cancel new group creation', async function (assert) { assert.expect(2); const groupsCount = this.server.db.groups.length; diff --git a/ui/admin/tests/acceptance/groups/delete-test.js b/ui/admin/tests/acceptance/groups/delete-test.js index c1dec7fdb..ed9838d24 100644 --- a/ui/admin/tests/acceptance/groups/delete-test.js +++ b/ui/admin/tests/acceptance/groups/delete-test.js @@ -1,4 +1,4 @@ -import { module, test } from 'qunit'; + import { module, test } from 'qunit'; import { visit, click, find } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; diff --git a/ui/admin/tests/acceptance/groups/list-test.js b/ui/admin/tests/acceptance/groups/list-test.js new file mode 100644 index 000000000..988136963 --- /dev/null +++ b/ui/admin/tests/acceptance/groups/list-test.js @@ -0,0 +1,80 @@ +import { module, test } from 'qunit'; +import { visit, find } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { + authenticateSession, + // These are left here intentionally for future reference. + //currentSession, + //invalidateSession, +} from 'ember-simple-auth/test-support'; + +module('Acceptance | groups | list', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + let orgScope; + let orgURL; + const instances = { + scopes: { + global: null, + org: null, + }, + }; + + const urls = { + scopes: { + org: null, + }, + groups: null, + orgScope: null, + }; + + hooks.beforeEach(function () { + instances.scopes.global = this.server.create('scope', { id: 'global' }); + orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + instances.org = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + instances.scopes.org = this.server.create('scope', { + type: 'org', + scope: { id: 'global', type: 'global' }, + }); + instances.group = this.server.create('group', { + scope: instances.org, + }); + urls.groups = `/scopes/${instances.scopes.org.id}/groups`; + orgURL = `/scopes/${orgScope.id}`; + + authenticateSession({}); + }); + + test('can navigate to groups with proper authorization', async function (assert) { + assert.expect(2); + orgScope.authorized_collection_actions.groups = ['list']; + await visit(orgURL); + assert.ok(orgScope.authorized_collection_actions.groups.includes('list')); + assert.ok(find(`[href="${orgURL}/groups"]`)); + }); + + test('cannot navigate to groups without proper authorization', async function (assert) { + assert.expect(1); + orgScope.authorized_collection_actions.groups = []; + await visit(orgURL); + assert.notOk( + orgScope.authorized_collection_actions.groups.includes('list') + ); + //assert.notOk(find(`[href="${orgURL}/groups"]`)); + }); +}); From b5fdb850f6a14f7077439cdb35684144eae9917d Mon Sep 17 00:00:00 2001 From: dharini Date: Thu, 26 Aug 2021 00:02:57 -0700 Subject: [PATCH 25/60] =?UTF-8?q?test:=20=F0=9F=92=8D=20add=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/acceptance/users/create-test.js | 6 ++-- ui/admin/tests/acceptance/users/list-test.js | 36 ++++++++++++++----- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/ui/admin/tests/acceptance/users/create-test.js b/ui/admin/tests/acceptance/users/create-test.js index 069ca0102..fbff7fbee 100644 --- a/ui/admin/tests/acceptance/users/create-test.js +++ b/ui/admin/tests/acceptance/users/create-test.js @@ -14,14 +14,12 @@ module('Acceptance | users | create', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); - let globalScope; let orgScope; let orgURL; let usersURL; let newUserURL; hooks.beforeEach(function () { - globalScope = this.server.create('scope', { id: 'global' }); orgScope = this.server.create( 'scope', { @@ -58,7 +56,9 @@ module('Acceptance | users | create', function (hooks) { assert.expect(2); orgScope.authorized_collection_actions.users = []; await visit(orgURL); - assert.notOk(orgScope.authorized_collection_actions.users.includes('create')); + assert.notOk( + orgScope.authorized_collection_actions.users.includes('create') + ); assert.notOk(find(`[href="${orgURL}/users"]`)); }); diff --git a/ui/admin/tests/acceptance/users/list-test.js b/ui/admin/tests/acceptance/users/list-test.js index bf768b334..8e071febc 100644 --- a/ui/admin/tests/acceptance/users/list-test.js +++ b/ui/admin/tests/acceptance/users/list-test.js @@ -1,8 +1,7 @@ import { module, test } from 'qunit'; -import { visit, currentURL, find } from '@ember/test-helpers'; +import { visit, find } 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, // These are left here intentionally for future reference. @@ -13,25 +12,33 @@ import { module('Acceptance | users | list', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); - - let usersURL; + let orgScope; + let orgURL; const instances = { scopes: { global: null, org: null, - } + }, }; const urls = { scopes: { - org: null + org: null, }, - users: null + users: null, }; hooks.beforeEach(function () { instances.scopes.global = this.server.create('scope', { id: 'global' }); + orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); instances.org = this.server.create( 'scope', { @@ -43,15 +50,26 @@ module('Acceptance | users | list', function (hooks) { instances.user = this.server.create('user', { scope: instances.org, }); + orgURL = `/scopes/${orgScope.id}`; + urls.users = `/scopes/${instances.org.id}/users`; authenticateSession({}); }); test('can navigate to users with proper authorization', async function (assert) { - // TODO + assert.expect(2); + await visit(orgURL); + assert.ok(orgScope.authorized_collection_actions.users.includes('create')); + assert.ok(find(`[href="${orgURL}/users"]`)); }); test('cannot navigate to users with proper authorization', async function (assert) { - // TODO + assert.expect(2); + orgScope.authorized_collection_actions.users = []; + await visit(orgURL); + assert.notOk( + orgScope.authorized_collection_actions.users.includes('create') + ); + assert.notOk(find(`[href="${orgURL}/users"]`)); }); }); From dae42c7288c11873e394d1f34e4a091a12210ba1 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Thu, 26 Aug 2021 10:14:14 -0400 Subject: [PATCH 26/60] chore: pin flight-icons at 0.0.6-beta --- addons/rose/package.json | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/rose/package.json b/addons/rose/package.json index 6a62cb90f..b28297c51 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -43,7 +43,7 @@ "@ember/test-helpers": "^2.2.8", "@glimmer/component": "^1.0.3", "@glimmer/tracking": "^1.0.3", - "@hashicorp/flight-icons": "^0.0.6-beta", + "@hashicorp/flight-icons": "0.0.6-beta", "@storybook/addon-actions": "^6.3.1", "@storybook/addon-docs": "^6.3.1", "@storybook/addon-knobs": "^6.3.0", diff --git a/yarn.lock b/yarn.lock index d354d0c09..9255174ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2066,7 +2066,7 @@ resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-1.1.0.tgz#d6dbc7574774b238114582410e8fee0dc3532bdf" integrity sha512-rR7tJoSwJ2eooOpYGxGGW95sLq6GXUaS1UtWvN7pei6n2/okYvCGld9vsUTvkl2migxbkszsycwtMf/GEc1k1A== -"@hashicorp/flight-icons@^0.0.6-beta": +"@hashicorp/flight-icons@0.0.6-beta": version "0.0.6-beta" resolved "https://registry.yarnpkg.com/@hashicorp/flight-icons/-/flight-icons-0.0.6-beta.tgz#49da48d4966c13ef0636a9853dc208fccc8d5c88" integrity sha512-GJHFPig7n26mMyMDPuUiD2Szp8wEskkcLKxWGAx0wyCGASYotLgAYHAGfa4uLlUOsIkibxKjc/7Y/0ttQeN9hQ== From a400892790c4ee88787a54ed80ecfa18989e0ecc Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Thu, 26 Aug 2021 10:48:15 -0400 Subject: [PATCH 27/60] chore: tweak doc icon size; switch sessions icon --- addons/core/addon/components/doc-link/index.hbs | 2 +- .../rose/addon/components/rose/button/index.stories.mdx | 2 +- .../addon/components/rose/link-button/index.stories.mdx | 2 +- .../rose/tests/integration/components/rose/badge-test.js | 4 +--- .../tests/integration/components/rose/link-button-test.js | 2 +- ui/admin/app/styles/app.scss | 8 -------- ui/admin/app/templates/scopes/scope.hbs | 5 +---- ui/admin/app/templates/scopes/scope/sessions/index.hbs | 2 +- ui/desktop/app/styles/app.scss | 8 -------- ui/desktop/app/templates/scopes/scope/projects.hbs | 2 +- .../templates/scopes/scope/projects/sessions/index.hbs | 2 +- .../scopes/scope/projects/targets/target/sessions.hbs | 2 +- 12 files changed, 10 insertions(+), 31 deletions(-) diff --git a/addons/core/addon/components/doc-link/index.hbs b/addons/core/addon/components/doc-link/index.hbs index 664e9d215..67a788936 100644 --- a/addons/core/addon/components/doc-link/index.hbs +++ b/addons/core/addon/components/doc-link/index.hbs @@ -4,5 +4,5 @@ target="_blank" rel="noreferrer noopener" title={{t "actions.get-topic-help"}}> - + diff --git a/addons/rose/addon/components/rose/button/index.stories.mdx b/addons/rose/addon/components/rose/button/index.stories.mdx index 3b2841c8a..18235d3ce 100644 --- a/addons/rose/addon/components/rose/button/index.stories.mdx +++ b/addons/rose/addon/components/rose/button/index.stories.mdx @@ -12,7 +12,7 @@ to trigger actions or to submit forms. Avoid using buttons as simple links to other routes. For accessibility, use links instead. ```htmlbars - + Action ``` diff --git a/addons/rose/addon/components/rose/link-button/index.stories.mdx b/addons/rose/addon/components/rose/link-button/index.stories.mdx index a5cc19106..9b952f6b9 100644 --- a/addons/rose/addon/components/rose/link-button/index.stories.mdx +++ b/addons/rose/addon/components/rose/link-button/index.stories.mdx @@ -12,7 +12,7 @@ Styles supported: primary, secondary, warning, and ghost. Disabling link button is not supported as it is an action on form components only. ```html - + Content ``` diff --git a/addons/rose/tests/integration/components/rose/badge-test.js b/addons/rose/tests/integration/components/rose/badge-test.js index 65f6f6b45..f52964bba 100644 --- a/addons/rose/tests/integration/components/rose/badge-test.js +++ b/addons/rose/tests/integration/components/rose/badge-test.js @@ -17,9 +17,7 @@ module('Integration | Component | rose/badge', function (hooks) { }); test('it renders an icon using @icon', async function (assert) { - await render( - hbs`` - ); + await render(hbs``); assert.ok(find('.rose-icon')); }); diff --git a/addons/rose/tests/integration/components/rose/link-button-test.js b/addons/rose/tests/integration/components/rose/link-button-test.js index c49c66d20..b5d3dbb2f 100644 --- a/addons/rose/tests/integration/components/rose/link-button-test.js +++ b/addons/rose/tests/integration/components/rose/link-button-test.js @@ -43,7 +43,7 @@ module('Integration | Component | rose/link-button', function (hooks) { test('it supports left icon with @iconRight', async function (assert) { await render( - hbs`` + hbs`` ); assert.ok(find('.rose-icon')); assert.ok(find('.has-icon-right')); diff --git a/ui/admin/app/styles/app.scss b/ui/admin/app/styles/app.scss index 45d9b4bdc..e8f3d4987 100644 --- a/ui/admin/app/styles/app.scss +++ b/ui/admin/app/styles/app.scss @@ -189,14 +189,6 @@ } } -.doc-link { - .large { - svg { - transform: scale(0.8); - } - } -} - [class*='session-status-'] { color: var(--ui-gray-subtler-2); } diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index d3abb701c..9396f280d 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -72,10 +72,7 @@ --}} - + {{t 'resources.session.title_plural'}} diff --git a/ui/admin/app/templates/scopes/scope/sessions/index.hbs b/ui/admin/app/templates/scopes/scope/sessions/index.hbs index 552c50c88..4e00d0eff 100644 --- a/ui/admin/app/templates/scopes/scope/sessions/index.hbs +++ b/ui/admin/app/templates/scopes/scope/sessions/index.hbs @@ -36,7 +36,7 @@ 'session-status-' sessionAggregate.session.status }} - @name='flight-icons/arrow-right-circle-16' + @name='flight-icons/entry-point-16' @size='medium' /> - + {{t 'resources.session.title_plural'}} diff --git a/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs b/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs index 126557d3f..6c1fb5636 100644 --- a/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects/sessions/index.hbs @@ -29,7 +29,7 @@ Date: Thu, 26 Aug 2021 10:49:29 -0400 Subject: [PATCH 28/60] chore: increase doc link icon size to 24 --- addons/core/addon/components/doc-link/index.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/core/addon/components/doc-link/index.hbs b/addons/core/addon/components/doc-link/index.hbs index 67a788936..664e9d215 100644 --- a/addons/core/addon/components/doc-link/index.hbs +++ b/addons/core/addon/components/doc-link/index.hbs @@ -4,5 +4,5 @@ target="_blank" rel="noreferrer noopener" title={{t "actions.get-topic-help"}}> - + From 350c4f5f70e2e4b67ee7df42506ce722557e1d56 Mon Sep 17 00:00:00 2001 From: dharini Date: Fri, 27 Aug 2021 08:06:24 -0700 Subject: [PATCH 29/60] =?UTF-8?q?fix:=20=F0=9F=90=9B=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/tests/acceptance/users/list-test.js | 30 +++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/ui/admin/tests/acceptance/users/list-test.js b/ui/admin/tests/acceptance/users/list-test.js index 8e071febc..0d8aaa60e 100644 --- a/ui/admin/tests/acceptance/users/list-test.js +++ b/ui/admin/tests/acceptance/users/list-test.js @@ -12,7 +12,6 @@ import { module('Acceptance | users | list', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); - let orgScope; let orgURL; const instances = { @@ -27,11 +26,12 @@ module('Acceptance | users | list', function (hooks) { org: null, }, users: null, + orgScope: null, }; hooks.beforeEach(function () { instances.scopes.global = this.server.create('scope', { id: 'global' }); - orgScope = this.server.create( + urls.orgScope = this.server.create( 'scope', { type: 'org', @@ -50,26 +50,36 @@ module('Acceptance | users | list', function (hooks) { instances.user = this.server.create('user', { scope: instances.org, }); - orgURL = `/scopes/${orgScope.id}`; + orgURL = `/scopes/${urls.orgScope.id}`; + //urls.orgScope = `/scopes/${instances.org.id}/scopes`; - urls.users = `/scopes/${instances.org.id}/users`; + urls.users = `/scopes/${urls.orgScope.id}/users`; authenticateSession({}); }); test('can navigate to users with proper authorization', async function (assert) { assert.expect(2); await visit(orgURL); - assert.ok(orgScope.authorized_collection_actions.users.includes('create')); - assert.ok(find(`[href="${orgURL}/users"]`)); + assert.ok( + urls.orgScope.authorized_collection_actions.users.includes('list') + ); + assert.ok(find(`[href="${urls.users}"]`)); }); - test('cannot navigate to users with proper authorization', async function (assert) { + test('User cannot navigate to index without either list or create actions', async function (assert) { assert.expect(2); - orgScope.authorized_collection_actions.users = []; + urls.orgScope.authorized_collection_actions.users = []; await visit(orgURL); assert.notOk( - orgScope.authorized_collection_actions.users.includes('create') + urls.orgScope.authorized_collection_actions.users.includes('list') ); - assert.notOk(find(`[href="${orgURL}/users"]`)); + assert.notOk(find(`[href="${urls.usersorgURL}"]`)); + }); + + test('User can navigate to index with only create action', async function (assert) { + assert.expect(1); + urls.orgScope.authorized_collection_actions.users = ['create']; + await visit(orgURL); + assert.ok(find(`[href="${urls.users}"]`)); }); }); From 40c2acd6ab476c3b5863d5cafe76c06d174c3318 Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Fri, 27 Aug 2021 10:17:34 -0700 Subject: [PATCH 30/60] Update list-test.js --- ui/admin/tests/acceptance/users/list-test.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/ui/admin/tests/acceptance/users/list-test.js b/ui/admin/tests/acceptance/users/list-test.js index 0d8aaa60e..d752d8687 100644 --- a/ui/admin/tests/acceptance/users/list-test.js +++ b/ui/admin/tests/acceptance/users/list-test.js @@ -51,8 +51,6 @@ module('Acceptance | users | list', function (hooks) { scope: instances.org, }); orgURL = `/scopes/${urls.orgScope.id}`; - //urls.orgScope = `/scopes/${instances.org.id}/scopes`; - urls.users = `/scopes/${urls.orgScope.id}/users`; authenticateSession({}); }); From 99baefaffcb66722fe5263cfe63a67441bb00710 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Fri, 27 Aug 2021 13:37:46 -0400 Subject: [PATCH 31/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20switch=20doc=20li?= =?UTF-8?q?nk=20to=2016px=20style?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/addon/components/doc-link/index.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/core/addon/components/doc-link/index.hbs b/addons/core/addon/components/doc-link/index.hbs index 664e9d215..67a788936 100644 --- a/addons/core/addon/components/doc-link/index.hbs +++ b/addons/core/addon/components/doc-link/index.hbs @@ -4,5 +4,5 @@ target="_blank" rel="noreferrer noopener" title={{t "actions.get-topic-help"}}> - + From c82269c9608da9d3b8d560dec73f33d1daabd9ec Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Fri, 27 Aug 2021 15:31:30 -0400 Subject: [PATCH 32/60] chore: switch back to 24 --- addons/core/addon/components/doc-link/index.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/core/addon/components/doc-link/index.hbs b/addons/core/addon/components/doc-link/index.hbs index 67a788936..664e9d215 100644 --- a/addons/core/addon/components/doc-link/index.hbs +++ b/addons/core/addon/components/doc-link/index.hbs @@ -4,5 +4,5 @@ target="_blank" rel="noreferrer noopener" title={{t "actions.get-topic-help"}}> - + From 3a3fdf2396d917a2aeecfaff4632ba6261d07354 Mon Sep 17 00:00:00 2001 From: dharini Date: Fri, 27 Aug 2021 13:09:00 -0700 Subject: [PATCH 33/60] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20grp=20create/list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/templates/scopes/scope.hbs | 10 +++-- .../create-test.js => group-create-test.js} | 16 -------- .../tests/acceptance/groups/delete-test.js | 2 +- ui/admin/tests/acceptance/groups/list-test.js | 37 +++++++++++-------- 4 files changed, 28 insertions(+), 37 deletions(-) rename ui/admin/tests/acceptance/{groups/create-test.js => group-create-test.js} (86%) diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index 65e456c51..fd768111d 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -98,10 +98,12 @@ {{t 'resources.user.title_plural'}} - - - {{t 'resources.group.title_plural'}} - + {{#if (can 'navigate collection' @model collection='groups')}} + + + {{t 'resources.group.title_plural'}} + + {{/if}} {{t 'resources.role.title_plural'}} diff --git a/ui/admin/tests/acceptance/groups/create-test.js b/ui/admin/tests/acceptance/group-create-test.js similarity index 86% rename from ui/admin/tests/acceptance/groups/create-test.js rename to ui/admin/tests/acceptance/group-create-test.js index 291222647..616ce66b4 100644 --- a/ui/admin/tests/acceptance/groups/create-test.js +++ b/ui/admin/tests/acceptance/group-create-test.js @@ -13,7 +13,6 @@ import { module('Acceptance | groups | create', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); - let orgScope; const instances = { scopes: { global: null, @@ -30,14 +29,6 @@ module('Acceptance | groups | create', function (hooks) { hooks.beforeEach(function () { authenticateSession({}); instances.scopes.global = this.server.create('scope', { id: 'global' }); - orgScope = this.server.create( - 'scope', - { - type: 'org', - scope: { id: 'global', type: 'global' }, - }, - 'withChildren' - ); instances.scopes.org = this.server.create('scope', { type: 'org', scope: { id: 'global', type: 'global' }, @@ -59,13 +50,6 @@ module('Acceptance | groups | create', function (hooks) { assert.equal(this.server.db.groups.length, groupsCount + 1); }); - test('cannot create new group without proper authorization', async function (assert) { - assert.expect(1); - orgScope.authorized_collection_actions.groups = ['list']; - await visit(urls.groups); - assert.notOk(find('.rose-layout-page-actions .rose-button-primary')); - }); - test('can cancel new group creation', async function (assert) { assert.expect(2); const groupsCount = this.server.db.groups.length; diff --git a/ui/admin/tests/acceptance/groups/delete-test.js b/ui/admin/tests/acceptance/groups/delete-test.js index ed9838d24..c1dec7fdb 100644 --- a/ui/admin/tests/acceptance/groups/delete-test.js +++ b/ui/admin/tests/acceptance/groups/delete-test.js @@ -1,4 +1,4 @@ - import { module, test } from 'qunit'; +import { module, test } from 'qunit'; import { visit, click, find } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; diff --git a/ui/admin/tests/acceptance/groups/list-test.js b/ui/admin/tests/acceptance/groups/list-test.js index 988136963..fd93645a7 100644 --- a/ui/admin/tests/acceptance/groups/list-test.js +++ b/ui/admin/tests/acceptance/groups/list-test.js @@ -12,8 +12,8 @@ import { module('Acceptance | groups | list', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); - let orgScope; let orgURL; + const instances = { scopes: { global: null, @@ -31,7 +31,7 @@ module('Acceptance | groups | list', function (hooks) { hooks.beforeEach(function () { instances.scopes.global = this.server.create('scope', { id: 'global' }); - orgScope = this.server.create( + urls.orgScope = this.server.create( 'scope', { type: 'org', @@ -47,34 +47,39 @@ module('Acceptance | groups | list', function (hooks) { }, 'withChildren' ); - instances.scopes.org = this.server.create('scope', { - type: 'org', - scope: { id: 'global', type: 'global' }, - }); instances.group = this.server.create('group', { scope: instances.org, }); - urls.groups = `/scopes/${instances.scopes.org.id}/groups`; - orgURL = `/scopes/${orgScope.id}`; + orgURL = `/scopes/${urls.orgScope.id}`; + //urls.orgScope = `/scopes/${instances.org.id}/scopes`; + urls.groups = `/scopes/${urls.orgScope.id}/groups`; authenticateSession({}); }); test('can navigate to groups with proper authorization', async function (assert) { assert.expect(2); - orgScope.authorized_collection_actions.groups = ['list']; await visit(orgURL); - assert.ok(orgScope.authorized_collection_actions.groups.includes('list')); - assert.ok(find(`[href="${orgURL}/groups"]`)); + assert.ok( + urls.orgScope.authorized_collection_actions.groups.includes('list') + ); + assert.ok(find(`[href="${urls.groups}"]`)); }); - test('cannot navigate to groups without proper authorization', async function (assert) { - assert.expect(1); - orgScope.authorized_collection_actions.groups = []; + test('User cannot navigate to index without either list or create actions', async function (assert) { + assert.expect(2); + urls.orgScope.authorized_collection_actions.groups = []; await visit(orgURL); assert.notOk( - orgScope.authorized_collection_actions.groups.includes('list') + urls.orgScope.authorized_collection_actions.groups.includes('list') ); - //assert.notOk(find(`[href="${orgURL}/groups"]`)); + assert.notOk(find(`[href="${urls.groups}"]`)); + }); + + test('User can navigate to index with only create action', async function (assert) { + assert.expect(1); + urls.orgScope.authorized_collection_actions.groups = ['create']; + await visit(orgURL); + assert.ok(find(`[href="${urls.groups}"]`)); }); }); From fc4dab606e46decbb240127e561f826099462449 Mon Sep 17 00:00:00 2001 From: dharini Date: Sun, 29 Aug 2021 22:57:16 -0700 Subject: [PATCH 34/60] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20roles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/addon/abilities/collection.js | 3 +- addons/api/addon/models/base.js | 5 ++ addons/api/mirage/factories/scope.js | 6 ++ addons/core/translations/en-us.yaml | 2 + ui/admin/app/routes/scopes/scope/roles.js | 8 +- .../app/routes/scopes/scope/roles/index.js | 9 +- ui/admin/app/templates/scopes/scope.hbs | 10 ++- .../templates/scopes/scope/roles/index.hbs | 37 ++++++-- .../{roles-test.js => roles/create-test.js} | 42 ++++++++-- ui/admin/tests/acceptance/roles/list-test.js | 84 +++++++++++++++++++ 10 files changed, 183 insertions(+), 23 deletions(-) rename ui/admin/tests/acceptance/{roles-test.js => roles/create-test.js} (73%) create mode 100644 ui/admin/tests/acceptance/roles/list-test.js diff --git a/addons/api/addon/abilities/collection.js b/addons/api/addon/abilities/collection.js index ad52afd18..92f0e4342 100644 --- a/addons/api/addon/abilities/collection.js +++ b/addons/api/addon/abilities/collection.js @@ -29,7 +29,8 @@ export default class CollectionAbility extends Ability { * @return {boolean} */ hasAuthorizedCollectionAction(action) { - const { authorized_collection_actions } = this.model; + const authorized_collection_actions = + (this.model || {}).authorized_collection_actions || {}; const collection = this.collection || {}; return authorized_collection_actions[collection]?.includes(action); } diff --git a/addons/api/addon/models/base.js b/addons/api/addon/models/base.js index f99e0351a..7fd41ec64 100644 --- a/addons/api/addon/models/base.js +++ b/addons/api/addon/models/base.js @@ -42,6 +42,11 @@ export default class BaseModel extends Model { }) authorized_actions; + @attr({ + readOnly: true, + }) + authorized_collection_actions; + set scopeModel(model) { if (model) { const json = model.serialize(); diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index fe41f3866..0121b9542 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -4,6 +4,12 @@ import { trait } from 'ember-cli-mirage'; export default factory.extend({ type: 'global', + authorized_collection_actions: () => { + return { + roles: ['create', 'list'], + }; + }, + /** * Generates realistic-ish IDs while still being deterministic. */ diff --git a/addons/core/translations/en-us.yaml b/addons/core/translations/en-us.yaml index 5370c7e75..8f98f633c 100644 --- a/addons/core/translations/en-us.yaml +++ b/addons/core/translations/en-us.yaml @@ -32,6 +32,8 @@ titles: descriptions: empty-set: There are no items to display yet. You may be able to add items or try back later. origin-initialization: To get started, please enter your origin URL + create-but-not-list: You do not have permission to list {resource}, but you can create new instances. + neither-list-nor-create: You do not have permission to list or create {resource}. questions: delete-confirm: Are you sure you want to delete this resource? remove-confirm: Are you sure you want to remove this association? diff --git a/ui/admin/app/routes/scopes/scope/roles.js b/ui/admin/app/routes/scopes/scope/roles.js index 88d05373b..cbc1dfcc5 100644 --- a/ui/admin/app/routes/scopes/scope/roles.js +++ b/ui/admin/app/routes/scopes/scope/roles.js @@ -11,6 +11,7 @@ export default class ScopesScopeRolesRoute extends Route { @service intl; @service notify; @service session; + @service can; // =methods @@ -26,8 +27,11 @@ export default class ScopesScopeRolesRoute extends Route { * @return {Promise{[RoleModel]}} */ async model() { - const { id: scope_id } = this.modelFor('scopes.scope'); - return this.store.query('role', { scope_id }); + const scope = this.modelFor('scopes.scope'); + const { id: scope_id } = scope; + if (this.can.can('list collection', scope, { collection: 'roles' })) { + return this.store.query('role', { scope_id }); + } } // =actions diff --git a/ui/admin/app/routes/scopes/scope/roles/index.js b/ui/admin/app/routes/scopes/scope/roles/index.js index f2a8d7af1..6020b0c6f 100644 --- a/ui/admin/app/routes/scopes/scope/roles/index.js +++ b/ui/admin/app/routes/scopes/scope/roles/index.js @@ -1,3 +1,10 @@ import Route from '@ember/routing/route'; +export default class ScopesScopeUsersIndexRoute extends Route { + // =methods -export default class ScopesScopeRolesIndexRoute extends Route {} + setupController(controller) { + const scope = this.modelFor('scopes.scope'); + super.setupController(...arguments); + controller.setProperties({ scope }); + } +} diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index 65e456c51..f2b01f11b 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -102,10 +102,12 @@ {{t 'resources.group.title_plural'}} - - - {{t 'resources.role.title_plural'}} - + {{#if (can 'navigate collection' @model collection='roles')}} + + + {{t 'resources.role.title_plural'}} + + {{/if}} {{t 'resources.auth-method.title_plural'}} diff --git a/ui/admin/app/templates/scopes/scope/roles/index.hbs b/ui/admin/app/templates/scopes/scope/roles/index.hbs index d69351c8e..ac7664ece 100644 --- a/ui/admin/app/templates/scopes/scope/roles/index.hbs +++ b/ui/admin/app/templates/scopes/scope/roles/index.hbs @@ -15,10 +15,12 @@ - {{#if @model}} - {{t - 'titles.new' - }} + {{#if (can 'create collection' this.scope collection='users')}} + {{#if @model}} + {{t + 'titles.new' + }} + {{/if}} {{/if}} @@ -68,12 +70,29 @@ as |message| > - {{t 'resources.role.description'}} + {{#if (can 'list collection' this.scope collection='roles')}} + {{! can list (at least): show default welcome message}} + {{t 'resources.roles.description'}} + {{else if (can 'create collection' this.scope collection='roles')}} + {{! can create (only): show create-but-not-list welcome message}} + {{t + 'descriptions.create-but-not-list' + resource=(t 'resources.role.title_plural') + }} + {{else}} + {{! can neither list nor create }} + {{t + 'descriptions.neither-list-nor-create' + resource=(t 'resources.role.title_plural') + }} + {{/if}} - - - {{t 'titles.new'}} - + {{#if (can 'create collection' this.scope collection='roles')}} + + + {{t 'titles.new'}} + + {{/if}} diff --git a/ui/admin/tests/acceptance/roles-test.js b/ui/admin/tests/acceptance/roles/create-test.js similarity index 73% rename from ui/admin/tests/acceptance/roles-test.js rename to ui/admin/tests/acceptance/roles/create-test.js index 77b971f46..a0364c8b0 100644 --- a/ui/admin/tests/acceptance/roles-test.js +++ b/ui/admin/tests/acceptance/roles/create-test.js @@ -11,10 +11,13 @@ import { //invalidateSession, } from 'ember-simple-auth/test-support'; -module('Acceptance | roles', function (hooks) { +module('Acceptance | roles | create', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); + let orgURL; + let orgScope; + const instances = { scopes: { global: null, @@ -27,10 +30,20 @@ module('Acceptance | roles', function (hooks) { orgScope: null, roles: null, role: null, - newRole: null, + newRoleURL: null, }; hooks.beforeEach(function () { + orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + + orgURL = `/scopes/${orgScope.id}`; authenticateSession({}); instances.scopes.global = this.server.create('scope', { id: 'global' }); instances.scopes.org = this.server.create('scope', { @@ -53,22 +66,39 @@ module('Acceptance | roles', function (hooks) { ); urls.roles = `/scopes/${instances.scopes.org.id}/roles`; urls.role = `${urls.roles}/${instances.role.id}`; - urls.newRole = `${urls.roles}/new`; + urls.newRoleURL = `${urls.roles}/new`; }); test('can create new role', async function (assert) { assert.expect(1); const rolesCount = this.server.db.roles.length; - await visit(urls.newRole); + await visit(urls.newRoleURL); await fillIn('[name="name"]', 'role name'); await click('[type="submit"]'); assert.equal(this.server.db.roles.length, rolesCount + 1); }); + test('can navigate to new roles route with proper authorization', async function (assert) { + assert.expect(2); + await visit(orgURL); + assert.ok(orgScope.authorized_collection_actions.roles.includes('create')); + assert.ok(find(`[href="${orgURL}/roles"]`)); + }); + + test('cannot navigate to new roles route without proper authorization', async function (assert) { + assert.expect(2); + orgScope.authorized_collection_actions.roles = []; + await visit(orgURL); + assert.notOk( + orgScope.authorized_collection_actions.roles.includes('create') + ); + assert.notOk(find(`[href="${orgURL}/roles"]`)); + }); + test('can cancel new role creation', async function (assert) { assert.expect(2); const rolesCount = this.server.db.roles.length; - await visit(urls.newRole); + await visit(urls.newRoleURL); await fillIn('[name="name"]', 'role name'); await click('.rose-form-actions [type="button"]'); assert.equal(currentURL(), urls.roles); @@ -96,7 +126,7 @@ module('Acceptance | roles', function (hooks) { } ); }); - await visit(urls.newRole); + await visit(urls.newRoleURL); await fillIn('[name="name"]', 'new target'); await click('form [type="submit"]'); await a11yAudit(); diff --git a/ui/admin/tests/acceptance/roles/list-test.js b/ui/admin/tests/acceptance/roles/list-test.js new file mode 100644 index 000000000..78e7d22fa --- /dev/null +++ b/ui/admin/tests/acceptance/roles/list-test.js @@ -0,0 +1,84 @@ +import { module, test } from 'qunit'; +import { visit, find } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { + authenticateSession, + // These are left here intentionally for future reference. + //currentSession, + //invalidateSession, +} from 'ember-simple-auth/test-support'; + +module('Acceptance | roles | list', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + let orgURL; + + const instances = { + scopes: { + global: null, + org: null, + }, + }; + + const urls = { + scopes: { + org: null, + }, + roles: null, + orgScope: null, + }; + + hooks.beforeEach(function () { + instances.scopes.global = this.server.create('scope', { id: 'global' }); + urls.orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + instances.org = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + instances.role = this.server.create('role', { + scope: instances.org, + }); + orgURL = `/scopes/${urls.orgScope.id}`; + + urls.roles = `/scopes/${urls.orgScope.id}/roles`; + authenticateSession({}); + }); + + test('can navigate to roles with proper authorization', async function (assert) { + assert.expect(2); + await visit(orgURL); + assert.ok( + urls.orgScope.authorized_collection_actions.roles.includes('list') + ); + assert.ok(find(`[href="${urls.roles}"]`)); + }); + + test('User cannot navigate to index without either list or create actions', async function (assert) { + assert.expect(2); + urls.orgScope.authorized_collection_actions.roles = []; + await visit(orgURL); + assert.notOk( + urls.orgScope.authorized_collection_actions.roles.includes('list') + ); + assert.notOk(find(`[href="${urls.roles}"]`)); + }); + + test('User can navigate to index with only create action', async function (assert) { + assert.expect(1); + urls.orgScope.authorized_collection_actions.roles = ['create']; + await visit(orgURL); + assert.ok(find(`[href="${urls.roles}"]`)); + }); +}); From 161cf3cd530a0f5c5cb3dd112d8d019a92995d65 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Mon, 30 Aug 2021 14:18:39 -0700 Subject: [PATCH 35/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Delete=20xmldom?= =?UTF-8?q?=20from=20resolutions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Delete xmldom from resolutions --- package.json | 1 - ui/desktop/electron-app/package.json | 1 - yarn.lock | 7 ++++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a96317204..66eff112b 100755 --- a/package.json +++ b/package.json @@ -77,7 +77,6 @@ "normalize-url": "^4.5.1", "glob-parent": "^5.1.2", "tar": "^6.1.2", - "xmldom": "github:xmldom/xmldom#0.7.0", "path-parse": "^1.0.7" }, "config": { diff --git a/ui/desktop/electron-app/package.json b/ui/desktop/electron-app/package.json index 2a1d4a2a5..c0e9b5672 100644 --- a/ui/desktop/electron-app/package.json +++ b/ui/desktop/electron-app/package.json @@ -42,7 +42,6 @@ }, "resolutions": { "highlight.js": "^10.4.1", - "xmldom": "~0.5.0", "yargs-parser": "~20.2.7", "trim-newlines": "^3.0.1", "normalize-url": "^4.5.1", diff --git a/yarn.lock b/yarn.lock index e356bc3d3..e622d6271 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21696,9 +21696,10 @@ xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -xmldom@^0.6.0, "xmldom@github:xmldom/xmldom#0.7.0": - version "0.7.0" - resolved "https://codeload.github.com/xmldom/xmldom/tar.gz/c568938641cc1f121cef5b4df80fcfda1e489b6e" +xmldom@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.6.0.tgz#43a96ecb8beece991cef382c08397d82d4d0c46f" + integrity sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg== xmlhttprequest-ssl@^1.6.2: version "1.6.3" From c971d6d2ceb1137ca3d5f1a4a6a5868e59a2e53d Mon Sep 17 00:00:00 2001 From: dharini Date: Mon, 30 Aug 2021 19:16:58 -0700 Subject: [PATCH 36/60] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20auth=20methods=20c?= =?UTF-8?q?apability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/addon/abilities/collection.js | 3 +- addons/api/addon/models/base.js | 5 + addons/api/mirage/factories/scope.js | 5 + addons/core/translations/en-us.yaml | 2 + .../app/routes/scopes/scope/auth-methods.js | 10 +- ui/admin/app/templates/scopes/scope.hbs | 10 +- .../scopes/scope/auth-methods/index.hbs | 66 ++++++++---- .../create-test.js} | 100 +++++++++--------- .../acceptance/auth-methods/list-test.js | 87 +++++++++++++++ 9 files changed, 210 insertions(+), 78 deletions(-) rename ui/admin/tests/acceptance/{auth-methods-test.js => auth-methods/create-test.js} (69%) create mode 100644 ui/admin/tests/acceptance/auth-methods/list-test.js diff --git a/addons/api/addon/abilities/collection.js b/addons/api/addon/abilities/collection.js index ad52afd18..92f0e4342 100644 --- a/addons/api/addon/abilities/collection.js +++ b/addons/api/addon/abilities/collection.js @@ -29,7 +29,8 @@ export default class CollectionAbility extends Ability { * @return {boolean} */ hasAuthorizedCollectionAction(action) { - const { authorized_collection_actions } = this.model; + const authorized_collection_actions = + (this.model || {}).authorized_collection_actions || {}; const collection = this.collection || {}; return authorized_collection_actions[collection]?.includes(action); } diff --git a/addons/api/addon/models/base.js b/addons/api/addon/models/base.js index f99e0351a..7fd41ec64 100644 --- a/addons/api/addon/models/base.js +++ b/addons/api/addon/models/base.js @@ -42,6 +42,11 @@ export default class BaseModel extends Model { }) authorized_actions; + @attr({ + readOnly: true, + }) + authorized_collection_actions; + set scopeModel(model) { if (model) { const json = model.serialize(); diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index fe41f3866..a3081887b 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -4,6 +4,11 @@ import { trait } from 'ember-cli-mirage'; export default factory.extend({ type: 'global', + authorized_collection_actions: () => { + return { + 'auth-methods': ['create', 'list'], + }; + }, /** * Generates realistic-ish IDs while still being deterministic. */ diff --git a/addons/core/translations/en-us.yaml b/addons/core/translations/en-us.yaml index 5370c7e75..8f98f633c 100644 --- a/addons/core/translations/en-us.yaml +++ b/addons/core/translations/en-us.yaml @@ -32,6 +32,8 @@ titles: descriptions: empty-set: There are no items to display yet. You may be able to add items or try back later. origin-initialization: To get started, please enter your origin URL + create-but-not-list: You do not have permission to list {resource}, but you can create new instances. + neither-list-nor-create: You do not have permission to list or create {resource}. questions: delete-confirm: Are you sure you want to delete this resource? remove-confirm: Are you sure you want to remove this association? diff --git a/ui/admin/app/routes/scopes/scope/auth-methods.js b/ui/admin/app/routes/scopes/scope/auth-methods.js index 31c0778a5..938ce6d16 100644 --- a/ui/admin/app/routes/scopes/scope/auth-methods.js +++ b/ui/admin/app/routes/scopes/scope/auth-methods.js @@ -11,6 +11,7 @@ export default class ScopesScopeAuthMethodsRoute extends Route { @service intl; @service notify; @service session; + @service can; // =methods @@ -26,8 +27,13 @@ export default class ScopesScopeAuthMethodsRoute extends Route { * @return {Promise[AuthMethodModel]} */ async model() { - const { id: scope_id } = this.modelFor('scopes.scope'); - return this.store.query('auth-method', { scope_id }); + const scope = this.modelFor('scopes.scope'); + const { id: scope_id } = scope; + if ( + this.can.can('list collection', scope, { collection: 'auth-methods' }) + ) { + return this.store.query('auth-method', { scope_id }); + } } // =actions diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index 65e456c51..30e63cc29 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -106,10 +106,12 @@ {{t 'resources.role.title_plural'}} - - - {{t 'resources.auth-method.title_plural'}} - + {{#if (can 'navigate collection' @model collection='auth-methods')}} + + + {{t 'resources.auth-method.title_plural'}} + + {{/if}} {{/unless}} diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs index 4bd1bd2a4..a795d6449 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs @@ -12,25 +12,30 @@ + {{#if @model}} - - - {{t 'resources.auth-method.types.password'}} - - - {{t 'resources.auth-method.types.oidc'}} - - + {{#if (can 'create collection' this.scope collection='auth-methods')}} + {{#if @model}} + + + {{t 'resources.auth-method.types.password'}} + + + {{t 'resources.auth-method.types.oidc'}} + + + {{/if}} + {{/if}} {{/if}} @@ -165,7 +170,24 @@ as |message| > - {{t 'resources.auth-method.messages.welcome.description'}} + {{#if (can 'list collection' this.scope collection='auth-methods')}} + {{! can list (at least): show default welcome message}} + {{t 'resources.auth-method.messages.welcome.description'}} + {{else if (can + 'create collection' this.scope collection='auth-methods' + )}} + {{! can create (only): show create-but-not-list welcome message}} + {{t + 'descriptions.create-but-not-list' + resource=(t 'resources.auth-method.title_plural') + }} + {{else}} + {{! can neither list nor create }} + {{t + 'descriptions.neither-list-nor-create' + resource=(t 'resources.auth-method.title_plural') + }} + {{/if}} {{t 'titles.new'}} + {{#if (can 'create collection' this.scope collection='auth-methods')}} + + + {{t 'titles.new'}} + + {{/if}} diff --git a/ui/admin/tests/acceptance/auth-methods-test.js b/ui/admin/tests/acceptance/auth-methods/create-test.js similarity index 69% rename from ui/admin/tests/acceptance/auth-methods-test.js rename to ui/admin/tests/acceptance/auth-methods/create-test.js index 61d8071a3..55a76243b 100644 --- a/ui/admin/tests/acceptance/auth-methods-test.js +++ b/ui/admin/tests/acceptance/auth-methods/create-test.js @@ -2,7 +2,6 @@ import { module, test } from 'qunit'; import { visit, currentURL, click, find, 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 { Response } from 'miragejs'; import { authenticateSession, @@ -12,7 +11,7 @@ import { } from 'ember-simple-auth/test-support'; import { enableFeature } from 'ember-feature-flags/test-support'; -module('Acceptance | auth methods', function (hooks) { +module('Acceptance | auth-methods | create ', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); @@ -22,66 +21,35 @@ module('Acceptance | auth methods', function (hooks) { org: null, }, authMethod: null, + orgScope: null, }; + const urls = { orgScope: null, authMethods: null, newAuthMethod: null, authMethod: null, + orgURL: null, }; hooks.beforeEach(function () { - // Setup Mirage mock resources for this test authenticateSession({}); - instances.scopes.global = this.server.create('scope', { id: 'global' }); - instances.scopes.org = this.server.create('scope', { + instances.orgScope = this.server.create('scope', { type: 'org', scope: { id: 'global', type: 'global' }, }); + instances.authMethod = this.server.create('auth-method', { - scope: instances.scopes.org, + scope: instances.orgScope, }); // Generate route URLs for resources - urls.orgScope = `/scopes/${instances.scopes.org.id}`; - urls.authMethods = `${urls.orgScope}/auth-methods`; + urls.orgURL = `/scopes/${instances.orgScope.id}`; + urls.authMethods = `${urls.orgURL}/auth-methods`; urls.newAuthMethod = `${urls.authMethods}/new?type=password`; urls.authMethod = `${urls.authMethods}/${instances.authMethod.id}`; }); - test('visiting auth methods', async function (assert) { - assert.expect(1); - await visit(urls.authMethods); - await a11yAudit(); - assert.equal(currentURL(), urls.authMethods); - }); - - test('can navigate to an auth method form', async function (assert) { - assert.expect(1); - await visit(urls.authMethods); - await click('main tbody .rose-table-header-cell:nth-child(1) a'); - await a11yAudit(); - assert.equal(currentURL(), urls.authMethod); - }); - - test('can update an auth method and save changes', async function (assert) { - assert.expect(1); - await visit(urls.authMethod); - await click('form [type="button"]', 'Activate edit mode'); - await fillIn('[name="name"]', 'update name'); - await click('form [type="submit"]:not(:disabled)'); - assert.equal(this.server.db.authMethods[0].name, 'update name'); - }); - - test('can update an auth method and cancel changes', async function (assert) { - assert.expect(1); - await visit(urls.authMethod); - await click('form [type="button"]', 'Activate edit mode'); - await fillIn('[name="name"]', 'update name'); - await click('form button:not([type="submit"])'); - assert.notEqual(this.server.db.authMethods[0].name, 'update name'); - }); - test('can create new auth method', async function (assert) { assert.expect(1); const authMethodsCount = this.server.db.authMethods.length; @@ -92,6 +60,34 @@ module('Acceptance | auth methods', function (hooks) { assert.equal(this.server.db.authMethods.length, authMethodsCount + 1); }); + test('can navigate to new auth-methods route with proper authorization', async function (assert) { + assert.expect(2); + instances.orgScope.authorized_collection_actions['auth-methods'] = [ + 'create', + 'list', + ]; + await visit(urls.orgURL); + assert.ok( + instances.orgScope.authorized_collection_actions['auth-methods'].includes( + 'create' + ) + ); + console.log(urls.orgURL); + assert.ok(find(`[href="${urls.authMethods}"]`)); + }); + + test('cannot navigate to new auth-methods route without proper authorization', async function (assert) { + assert.expect(2); + instances.orgScope.authorized_collection_actions['auth-methods'] = []; + await visit(urls.orgURL); + assert.notOk( + instances.orgScope.authorized_collection_actions['auth-methods'].includes( + 'create' + ) + ); + assert.notOk(find(`[href="${urls.authMethods}"]`)); + }); + test('can cancel new auth method creation', async function (assert) { assert.expect(2); const authMethodsCount = this.server.db.authMethods.length; @@ -106,7 +102,7 @@ module('Acceptance | auth methods', function (hooks) { test('user can make primary an auth method', async function (assert) { assert.expect(2); assert.notOk( - instances.scopes.org.primaryAuthMethodId, + instances.orgScope.primaryAuthMethodId, 'Primary auth method is not yet set.' ); enableFeature('primary-auth-method'); @@ -114,7 +110,7 @@ module('Acceptance | auth methods', function (hooks) { await click( '.rose-layout-page-actions .rose-dropdown-content [type="button"]:first-child' ); - const scope = this.server.schema.scopes.find(instances.scopes.org.id); + const scope = this.server.schema.scopes.find(instances.orgScope.id); assert.equal( scope.primaryAuthMethodId, instances.authMethod.id, @@ -136,7 +132,7 @@ module('Acceptance | auth methods', function (hooks) { ); }); assert.notOk( - instances.scopes.org.primaryAuthMethodId, + instances.orgScope.primaryAuthMethodId, 'Primary auth method is not yet set.' ); enableFeature('primary-auth-method'); @@ -149,11 +145,11 @@ module('Acceptance | auth methods', function (hooks) { test('user can remove as primary an auth method', async function (assert) { assert.expect(2); - instances.scopes.org.update({ + instances.orgScope.update({ primaryAuthMethodId: instances.authMethod.id, }); assert.ok( - instances.scopes.org.primaryAuthMethodId, + instances.orgScope.primaryAuthMethodId, 'Primary auth method is set.' ); enableFeature('primary-auth-method'); @@ -161,7 +157,7 @@ module('Acceptance | auth methods', function (hooks) { await click( '.rose-layout-page-actions .rose-dropdown-content [type="button"]:first-child' ); - const scope = this.server.schema.scopes.find(instances.scopes.org.id); + const scope = this.server.schema.scopes.find(instances.orgScope.id); assert.notOk(scope.primaryAuthMethodId, 'Primary auth method is unset.'); }); @@ -178,11 +174,11 @@ module('Acceptance | auth methods', function (hooks) { } ); }); - instances.scopes.org.update({ + instances.orgScope.update({ primaryAuthMethodId: instances.authMethod.id, }); assert.ok( - instances.scopes.org.primaryAuthMethodId, + instances.orgScope.primaryAuthMethodId, 'Primary auth method is set.' ); enableFeature('primary-auth-method'); @@ -196,7 +192,7 @@ module('Acceptance | auth methods', function (hooks) { test('user can make and remove primary auth methods from index', async function (assert) { assert.expect(3); assert.notOk( - instances.scopes.org.primaryAuthMethodId, + instances.orgScope.primaryAuthMethodId, 'Primary auth method is not yet set.' ); enableFeature('primary-auth-method'); @@ -204,7 +200,7 @@ module('Acceptance | auth methods', function (hooks) { await click( '.rose-table-body .rose-table-row:first-child .rose-dropdown-content [type="button"]:first-child' ); - let scope = this.server.schema.scopes.find(instances.scopes.org.id); + let scope = this.server.schema.scopes.find(instances.orgScope.id); assert.equal( scope.primaryAuthMethodId, instances.authMethod.id, @@ -213,7 +209,7 @@ module('Acceptance | auth methods', function (hooks) { await click( '.rose-table-body .rose-table-row:first-child .rose-dropdown-content [type="button"]:first-child' ); - scope = this.server.schema.scopes.find(instances.scopes.org.id); + scope = this.server.schema.scopes.find(instances.orgScope.id); assert.notOk(scope.primaryAuthMethodId, 'Primary auth method is unset.'); }); }); diff --git a/ui/admin/tests/acceptance/auth-methods/list-test.js b/ui/admin/tests/acceptance/auth-methods/list-test.js new file mode 100644 index 000000000..bd9a8dfcd --- /dev/null +++ b/ui/admin/tests/acceptance/auth-methods/list-test.js @@ -0,0 +1,87 @@ +import { module, test } from 'qunit'; +import { visit, find } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { + authenticateSession, + // These are left here intentionally for future reference. + //currentSession, + //invalidateSession, +} from 'ember-simple-auth/test-support'; + +module('Acceptance | auth-methods | list', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + let orgURL; + + const instances = { + scopes: { + global: null, + org: null, + }, + orgScope: null, + }; + + const urls = { + scopes: { + org: null, + }, + authMethods: null, + }; + + hooks.beforeEach(function () { + instances.scopes.global = this.server.create('scope', { id: 'global' }); + instances.orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + instances.org = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + + orgURL = `/scopes/${instances.orgScope.id}`; + urls.authMethods = `/scopes/${instances.orgScope.id}/auth-methods`; + authenticateSession({}); + }); + + test('can navigate to users with proper authorization', async function (assert) { + assert.expect(2); + await visit(orgURL); + assert.ok( + instances.orgScope.authorized_collection_actions['auth-methods'].includes( + 'list' + ) + ); + assert.ok(find(`[href="${urls.authMethods}"]`)); + }); + + test('User cannot navigate to index without either list or create actions', async function (assert) { + assert.expect(2); + instances.orgScope.authorized_collection_actions['auth-methods'] = []; + await visit(orgURL); + assert.notOk( + instances.orgScope.authorized_collection_actions['auth-methods'].includes( + 'list' + ) + ); + assert.notOk(find(`[href="${urls.authMethods}"]`)); + }); + + test('User can navigate to index with only create action', async function (assert) { + assert.expect(1); + instances.orgScope.authorized_collection_actions['auth-methods'] = [ + 'create', + ]; + await visit(orgURL); + assert.ok(find(`[href="${urls.authMethods}"]`)); + }); +}); From ce286964d11a85d3d1305de598a6a65e28a2e04c Mon Sep 17 00:00:00 2001 From: dharini Date: Mon, 30 Aug 2021 21:49:48 -0700 Subject: [PATCH 37/60] =?UTF-8?q?fix:=20=F0=9F=90=9B=20tests=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/tests/acceptance/users/list-test.js | 28 +++++++------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/ui/admin/tests/acceptance/users/list-test.js b/ui/admin/tests/acceptance/users/list-test.js index d752d8687..72a6e35eb 100644 --- a/ui/admin/tests/acceptance/users/list-test.js +++ b/ui/admin/tests/acceptance/users/list-test.js @@ -19,6 +19,7 @@ module('Acceptance | users | list', function (hooks) { global: null, org: null, }, + orgScope: null, }; const urls = { @@ -26,20 +27,11 @@ module('Acceptance | users | list', function (hooks) { org: null, }, users: null, - orgScope: null, }; hooks.beforeEach(function () { instances.scopes.global = this.server.create('scope', { id: 'global' }); - urls.orgScope = this.server.create( - 'scope', - { - type: 'org', - scope: { id: 'global', type: 'global' }, - }, - 'withChildren' - ); - instances.org = this.server.create( + instances.orgScope = this.server.create( 'scope', { type: 'org', @@ -48,10 +40,10 @@ module('Acceptance | users | list', function (hooks) { 'withChildren' ); instances.user = this.server.create('user', { - scope: instances.org, + scope: instances.orgScope, }); - orgURL = `/scopes/${urls.orgScope.id}`; - urls.users = `/scopes/${urls.orgScope.id}/users`; + orgURL = `/scopes/${instances.orgScope.id}`; + urls.users = `/scopes/${instances.orgScope.id}/users`; authenticateSession({}); }); @@ -59,24 +51,24 @@ module('Acceptance | users | list', function (hooks) { assert.expect(2); await visit(orgURL); assert.ok( - urls.orgScope.authorized_collection_actions.users.includes('list') + instances.orgScope.authorized_collection_actions.users.includes('list') ); assert.ok(find(`[href="${urls.users}"]`)); }); test('User cannot navigate to index without either list or create actions', async function (assert) { assert.expect(2); - urls.orgScope.authorized_collection_actions.users = []; + instances.orgScope.authorized_collection_actions.users = []; await visit(orgURL); assert.notOk( - urls.orgScope.authorized_collection_actions.users.includes('list') + instances.orgScope.authorized_collection_actions.users.includes('list') ); - assert.notOk(find(`[href="${urls.usersorgURL}"]`)); + assert.notOk(find(`[href="${urls.users}"]`)); }); test('User can navigate to index with only create action', async function (assert) { assert.expect(1); - urls.orgScope.authorized_collection_actions.users = ['create']; + instances.orgScope.authorized_collection_actions.users = ['create']; await visit(orgURL); assert.ok(find(`[href="${urls.users}"]`)); }); From e291956c1bcc7fbdb0ab0246a2e6b8eec4d7d0ca Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 31 Aug 2021 07:46:52 -0700 Subject: [PATCH 38/60] =?UTF-8?q?test:=20=F0=9F=92=8D=20fix=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-test.js} | 39 +++++++++++++++---- ui/admin/tests/acceptance/groups/list-test.js | 27 +++++-------- 2 files changed, 41 insertions(+), 25 deletions(-) rename ui/admin/tests/acceptance/{group-create-test.js => groups/create-test.js} (72%) diff --git a/ui/admin/tests/acceptance/group-create-test.js b/ui/admin/tests/acceptance/groups/create-test.js similarity index 72% rename from ui/admin/tests/acceptance/group-create-test.js rename to ui/admin/tests/acceptance/groups/create-test.js index 616ce66b4..815e4a760 100644 --- a/ui/admin/tests/acceptance/group-create-test.js +++ b/ui/admin/tests/acceptance/groups/create-test.js @@ -13,12 +13,15 @@ import { module('Acceptance | groups | create', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); + let orgURL; + const instances = { scopes: { global: null, org: null, }, group: null, + orgScope: null, }; const urls = { groups: null, @@ -28,17 +31,21 @@ module('Acceptance | groups | create', function (hooks) { hooks.beforeEach(function () { authenticateSession({}); - instances.scopes.global = this.server.create('scope', { id: 'global' }); - instances.scopes.org = this.server.create('scope', { - type: 'org', - scope: { id: 'global', type: 'global' }, - }); + instances.orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); instances.group = this.server.create('group', { - scope: instances.scopes.org, + scope: instances.orgScope, }); - urls.groups = `/scopes/${instances.scopes.org.id}/groups`; + urls.groups = `/scopes/${instances.orgScope.id}/groups`; urls.group = `${urls.groups}/${instances.group.id}`; urls.newGroup = `${urls.groups}/new`; + orgURL = `/scopes/${instances.orgScope.id}`; }); test('can create new group', async function (assert) { @@ -50,6 +57,24 @@ module('Acceptance | groups | create', function (hooks) { assert.equal(this.server.db.groups.length, groupsCount + 1); }); + test('can navigate to new groups route with proper authorization', async function (assert) { + assert.expect(2); + await visit(orgURL); + assert.ok( + instances.orgScope.authorized_collection_actions.groups.includes('create') + ); + assert.ok(find(`[href="${urls.groups}"]`)); + }); + + test('cannot navigate to new groups route without proper authorization', async function (assert) { + assert.expect(2); + instances.orgScope.authorized_collection_actions.groups = []; + await visit(orgURL); + assert.notOk( + instances.orgScope.authorized_collection_actions.groups.includes('create') + ); + assert.notOk(find(`[href="${urls.groups}"]`)); + }); test('can cancel new group creation', async function (assert) { assert.expect(2); const groupsCount = this.server.db.groups.length; diff --git a/ui/admin/tests/acceptance/groups/list-test.js b/ui/admin/tests/acceptance/groups/list-test.js index fd93645a7..f9229c19d 100644 --- a/ui/admin/tests/acceptance/groups/list-test.js +++ b/ui/admin/tests/acceptance/groups/list-test.js @@ -19,6 +19,7 @@ module('Acceptance | groups | list', function (hooks) { global: null, org: null, }, + orgScope: null, }; const urls = { @@ -26,20 +27,11 @@ module('Acceptance | groups | list', function (hooks) { org: null, }, groups: null, - orgScope: null, }; hooks.beforeEach(function () { instances.scopes.global = this.server.create('scope', { id: 'global' }); - urls.orgScope = this.server.create( - 'scope', - { - type: 'org', - scope: { id: 'global', type: 'global' }, - }, - 'withChildren' - ); - instances.org = this.server.create( + instances.orgScope = this.server.create( 'scope', { type: 'org', @@ -48,12 +40,11 @@ module('Acceptance | groups | list', function (hooks) { 'withChildren' ); instances.group = this.server.create('group', { - scope: instances.org, + scope: instances.orgScope, }); - orgURL = `/scopes/${urls.orgScope.id}`; - //urls.orgScope = `/scopes/${instances.org.id}/scopes`; + orgURL = `/scopes/${instances.orgScope.id}`; - urls.groups = `/scopes/${urls.orgScope.id}/groups`; + urls.groups = `/scopes/${instances.orgScope.id}/groups`; authenticateSession({}); }); @@ -61,24 +52,24 @@ module('Acceptance | groups | list', function (hooks) { assert.expect(2); await visit(orgURL); assert.ok( - urls.orgScope.authorized_collection_actions.groups.includes('list') + instances.orgScope.authorized_collection_actions.groups.includes('list') ); assert.ok(find(`[href="${urls.groups}"]`)); }); test('User cannot navigate to index without either list or create actions', async function (assert) { assert.expect(2); - urls.orgScope.authorized_collection_actions.groups = []; + instances.orgScope.authorized_collection_actions.groups = []; await visit(orgURL); assert.notOk( - urls.orgScope.authorized_collection_actions.groups.includes('list') + instances.orgScope.authorized_collection_actions.groups.includes('list') ); assert.notOk(find(`[href="${urls.groups}"]`)); }); test('User can navigate to index with only create action', async function (assert) { assert.expect(1); - urls.orgScope.authorized_collection_actions.groups = ['create']; + instances.orgScope.authorized_collection_actions.groups = ['create']; await visit(orgURL); assert.ok(find(`[href="${urls.groups}"]`)); }); From 77b1ca477d6893513e3ad4ec51fe5a5763024356 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 31 Aug 2021 08:17:25 -0700 Subject: [PATCH 39/60] =?UTF-8?q?fix:=20=F0=9F=90=9B=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/acceptance/roles/create-test.js | 37 ++++++++++--------- ui/admin/tests/acceptance/roles/list-test.js | 27 +++++--------- 2 files changed, 28 insertions(+), 36 deletions(-) diff --git a/ui/admin/tests/acceptance/roles/create-test.js b/ui/admin/tests/acceptance/roles/create-test.js index a0364c8b0..c2a86e46c 100644 --- a/ui/admin/tests/acceptance/roles/create-test.js +++ b/ui/admin/tests/acceptance/roles/create-test.js @@ -16,7 +16,6 @@ module('Acceptance | roles | create', function (hooks) { setupMirage(hooks); let orgURL; - let orgScope; const instances = { scopes: { @@ -25,16 +24,17 @@ module('Acceptance | roles | create', function (hooks) { project: null, }, role: null, + orgScope: null, }; const urls = { - orgScope: null, roles: null, role: null, newRoleURL: null, }; hooks.beforeEach(function () { - orgScope = this.server.create( + authenticateSession({}); + instances.orgScope = this.server.create( 'scope', { type: 'org', @@ -43,30 +43,29 @@ module('Acceptance | roles | create', function (hooks) { 'withChildren' ); - orgURL = `/scopes/${orgScope.id}`; - authenticateSession({}); - instances.scopes.global = this.server.create('scope', { id: 'global' }); - instances.scopes.org = this.server.create('scope', { - type: 'org', - scope: { id: 'global', type: 'global' }, - }); + // instances.scopes.global = this.server.create('scope', { id: 'global' }); + // instances.scopes.org = this.server.create('scope', { + // type: 'org', + // scope: { id: 'global', type: 'global' }, + // }); // The project scope is not yet used for role tests (though it will be // in the future). This is created simply to test the grant scope loading // mechanism. instances.scopes.project = this.server.create('scope', { type: 'project', - scope: { id: instances.scopes.org.id, type: instances.scopes.org.type }, + scope: { id: instances.orgScope.id, type: instances.orgScope.type }, }); instances.role = this.server.create( 'role', { - scope: instances.scopes.org, + scope: instances.orgScope, }, 'withPrincipals' ); - urls.roles = `/scopes/${instances.scopes.org.id}/roles`; + urls.roles = `/scopes/${instances.orgScope.id}/roles`; urls.role = `${urls.roles}/${instances.role.id}`; urls.newRoleURL = `${urls.roles}/new`; + orgURL = `/scopes/${instances.orgScope.id}`; }); test('can create new role', async function (assert) { @@ -81,18 +80,20 @@ module('Acceptance | roles | create', function (hooks) { test('can navigate to new roles route with proper authorization', async function (assert) { assert.expect(2); await visit(orgURL); - assert.ok(orgScope.authorized_collection_actions.roles.includes('create')); - assert.ok(find(`[href="${orgURL}/roles"]`)); + assert.ok( + instances.orgScope.authorized_collection_actions.roles.includes('create') + ); + assert.ok(find(`[href="${urls.roles}"]`)); }); test('cannot navigate to new roles route without proper authorization', async function (assert) { assert.expect(2); - orgScope.authorized_collection_actions.roles = []; + instances.orgScope.authorized_collection_actions.roles = []; await visit(orgURL); assert.notOk( - orgScope.authorized_collection_actions.roles.includes('create') + instances.orgScope.authorized_collection_actions.roles.includes('create') ); - assert.notOk(find(`[href="${orgURL}/roles"]`)); + assert.notOk(find(`[href="${urls.roles}"]`)); }); test('can cancel new role creation', async function (assert) { diff --git a/ui/admin/tests/acceptance/roles/list-test.js b/ui/admin/tests/acceptance/roles/list-test.js index 78e7d22fa..e6e13cfb7 100644 --- a/ui/admin/tests/acceptance/roles/list-test.js +++ b/ui/admin/tests/acceptance/roles/list-test.js @@ -19,6 +19,7 @@ module('Acceptance | roles | list', function (hooks) { global: null, org: null, }, + orgScope: null, }; const urls = { @@ -26,20 +27,10 @@ module('Acceptance | roles | list', function (hooks) { org: null, }, roles: null, - orgScope: null, }; hooks.beforeEach(function () { - instances.scopes.global = this.server.create('scope', { id: 'global' }); - urls.orgScope = this.server.create( - 'scope', - { - type: 'org', - scope: { id: 'global', type: 'global' }, - }, - 'withChildren' - ); - instances.org = this.server.create( + instances.orgScope = this.server.create( 'scope', { type: 'org', @@ -48,11 +39,11 @@ module('Acceptance | roles | list', function (hooks) { 'withChildren' ); instances.role = this.server.create('role', { - scope: instances.org, + scope: instances.orgScope, }); - orgURL = `/scopes/${urls.orgScope.id}`; + orgURL = `/scopes/${instances.orgScope.id}`; - urls.roles = `/scopes/${urls.orgScope.id}/roles`; + urls.roles = `/scopes/${instances.orgScope.id}/roles`; authenticateSession({}); }); @@ -60,24 +51,24 @@ module('Acceptance | roles | list', function (hooks) { assert.expect(2); await visit(orgURL); assert.ok( - urls.orgScope.authorized_collection_actions.roles.includes('list') + instances.orgScope.authorized_collection_actions.roles.includes('list') ); assert.ok(find(`[href="${urls.roles}"]`)); }); test('User cannot navigate to index without either list or create actions', async function (assert) { assert.expect(2); - urls.orgScope.authorized_collection_actions.roles = []; + instances.orgScope.authorized_collection_actions.roles = []; await visit(orgURL); assert.notOk( - urls.orgScope.authorized_collection_actions.roles.includes('list') + instances.orgScope.authorized_collection_actions.roles.includes('list') ); assert.notOk(find(`[href="${urls.roles}"]`)); }); test('User can navigate to index with only create action', async function (assert) { assert.expect(1); - urls.orgScope.authorized_collection_actions.roles = ['create']; + instances.orgScope.authorized_collection_actions.roles = ['create']; await visit(orgURL); assert.ok(find(`[href="${urls.roles}"]`)); }); From 4f74f8578ec62c996d5b0a9564d762afb8a45c43 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 31 Aug 2021 08:55:36 -0700 Subject: [PATCH 40/60] =?UTF-8?q?fix:=20=F0=9F=90=9B=20resource=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/routes/scopes/scope/roles/index.js | 2 +- ui/admin/app/templates/scopes/scope/roles/index.hbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/admin/app/routes/scopes/scope/roles/index.js b/ui/admin/app/routes/scopes/scope/roles/index.js index 6020b0c6f..56c143beb 100644 --- a/ui/admin/app/routes/scopes/scope/roles/index.js +++ b/ui/admin/app/routes/scopes/scope/roles/index.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; -export default class ScopesScopeUsersIndexRoute extends Route { +export default class ScopesScopeRolesIndexRoute extends Route { // =methods setupController(controller) { diff --git a/ui/admin/app/templates/scopes/scope/roles/index.hbs b/ui/admin/app/templates/scopes/scope/roles/index.hbs index ac7664ece..9962addc5 100644 --- a/ui/admin/app/templates/scopes/scope/roles/index.hbs +++ b/ui/admin/app/templates/scopes/scope/roles/index.hbs @@ -15,7 +15,7 @@ - {{#if (can 'create collection' this.scope collection='users')}} + {{#if (can 'create collection' this.scope collection='roles')}} {{#if @model}} {{t 'titles.new' From ab1a642f6637f0e2504ba86fc323eb76c70b85d8 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 31 Aug 2021 10:56:54 -0700 Subject: [PATCH 41/60] =?UTF-8?q?fix:=20=F0=9F=90=9B=20show=20dropdown=20l?= =?UTF-8?q?ink?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routes/scopes/scope/auth-methods/index.js | 5 +++ .../scopes/scope/auth-methods/index.hbs | 40 +++++++++---------- ui/admin/jsconfig.json | 1 + .../acceptance/auth-methods/list-test.js | 2 +- 4 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 ui/admin/jsconfig.json diff --git a/ui/admin/app/routes/scopes/scope/auth-methods/index.js b/ui/admin/app/routes/scopes/scope/auth-methods/index.js index 913b4f8ff..0d727524a 100644 --- a/ui/admin/app/routes/scopes/scope/auth-methods/index.js +++ b/ui/admin/app/routes/scopes/scope/auth-methods/index.js @@ -12,4 +12,9 @@ export default class ScopesScopeAuthMethodsIndexRoute extends Route { const scopeModel = this.modelFor('scopes.scope'); controller.scopeModel = scopeModel; } + // setupController(controller) { + // const scope = this.modelFor('scopes.scope'); + // super.setupController(...arguments); + // controller.setProperties({ scope }); + // } } diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs index a795d6449..566c844e8 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs @@ -13,28 +13,26 @@ - {{#if @model}} - {{#if (can 'create collection' this.scope collection='auth-methods')}} - {{#if @model}} - + - - {{t 'resources.auth-method.types.password'}} - - - {{t 'resources.auth-method.types.oidc'}} - - - {{/if}} + {{t 'resources.auth-method.types.password'}} + + + {{t 'resources.auth-method.types.oidc'}} + + {{/if}} {{/if}} diff --git a/ui/admin/jsconfig.json b/ui/admin/jsconfig.json new file mode 100644 index 000000000..f408cac8c --- /dev/null +++ b/ui/admin/jsconfig.json @@ -0,0 +1 @@ +{"compilerOptions":{"target":"es6","experimentalDecorators":true},"exclude":["node_modules","bower_components","tmp","vendor",".git","dist"]} \ No newline at end of file diff --git a/ui/admin/tests/acceptance/auth-methods/list-test.js b/ui/admin/tests/acceptance/auth-methods/list-test.js index bd9a8dfcd..1dbe3f23f 100644 --- a/ui/admin/tests/acceptance/auth-methods/list-test.js +++ b/ui/admin/tests/acceptance/auth-methods/list-test.js @@ -53,7 +53,7 @@ module('Acceptance | auth-methods | list', function (hooks) { authenticateSession({}); }); - test('can navigate to users with proper authorization', async function (assert) { + test('can navigate to auth methods with proper authorization', async function (assert) { assert.expect(2); await visit(orgURL); assert.ok( From 3ae2423aa412c663e6aba291093a29c79b57479e Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 31 Aug 2021 11:06:16 -0700 Subject: [PATCH 42/60] =?UTF-8?q?fix:=20=F0=9F=90=9B=20remove=20unnecessar?= =?UTF-8?q?y=20change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/routes/scopes/scope/auth-methods/index.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ui/admin/app/routes/scopes/scope/auth-methods/index.js b/ui/admin/app/routes/scopes/scope/auth-methods/index.js index 0d727524a..913b4f8ff 100644 --- a/ui/admin/app/routes/scopes/scope/auth-methods/index.js +++ b/ui/admin/app/routes/scopes/scope/auth-methods/index.js @@ -12,9 +12,4 @@ export default class ScopesScopeAuthMethodsIndexRoute extends Route { const scopeModel = this.modelFor('scopes.scope'); controller.scopeModel = scopeModel; } - // setupController(controller) { - // const scope = this.modelFor('scopes.scope'); - // super.setupController(...arguments); - // controller.setProperties({ scope }); - // } } From 09d9432825a52c2bd4987ece77069970868cd4ce Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 31 Aug 2021 11:13:27 -0700 Subject: [PATCH 43/60] =?UTF-8?q?fix:=20=F0=9F=90=9B=20del=20jsconfig=20fi?= =?UTF-8?q?le?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/jsconfig.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 ui/admin/jsconfig.json diff --git a/ui/admin/jsconfig.json b/ui/admin/jsconfig.json deleted file mode 100644 index f408cac8c..000000000 --- a/ui/admin/jsconfig.json +++ /dev/null @@ -1 +0,0 @@ -{"compilerOptions":{"target":"es6","experimentalDecorators":true},"exclude":["node_modules","bower_components","tmp","vendor",".git","dist"]} \ No newline at end of file From f344d73f32d9e269e85522482141521f98a2d80d Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 31 Aug 2021 15:17:57 -0700 Subject: [PATCH 44/60] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20host=20catalogs=20?= =?UTF-8?q?create/list=20capability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/addon/abilities/collection.js | 3 +- addons/api/addon/models/base.js | 7 +- addons/api/mirage/factories/scope.js | 5 + addons/core/translations/en-us.yaml | 2 + .../app/routes/scopes/scope/host-catalogs.js | 11 ++- .../scopes/scope/host-catalogs/index.js | 8 +- ui/admin/app/templates/scopes/scope.hbs | 10 +- .../scopes/scope/host-catalogs/index.hbs | 47 ++++++--- .../create-test.js} | 41 +++++++- .../acceptance/host-catalogs/list-test.js | 98 +++++++++++++++++++ 10 files changed, 207 insertions(+), 25 deletions(-) rename ui/admin/tests/acceptance/{host-catalogs-test.js => host-catalogs/create-test.js} (74%) create mode 100644 ui/admin/tests/acceptance/host-catalogs/list-test.js diff --git a/addons/api/addon/abilities/collection.js b/addons/api/addon/abilities/collection.js index ad52afd18..92f0e4342 100644 --- a/addons/api/addon/abilities/collection.js +++ b/addons/api/addon/abilities/collection.js @@ -29,7 +29,8 @@ export default class CollectionAbility extends Ability { * @return {boolean} */ hasAuthorizedCollectionAction(action) { - const { authorized_collection_actions } = this.model; + const authorized_collection_actions = + (this.model || {}).authorized_collection_actions || {}; const collection = this.collection || {}; return authorized_collection_actions[collection]?.includes(action); } diff --git a/addons/api/addon/models/base.js b/addons/api/addon/models/base.js index f99e0351a..5ce5d3a8c 100644 --- a/addons/api/addon/models/base.js +++ b/addons/api/addon/models/base.js @@ -42,6 +42,11 @@ export default class BaseModel extends Model { }) authorized_actions; + @attr({ + readOnly: true, + }) + authorized_collection_actions; + set scopeModel(model) { if (model) { const json = model.serialize(); @@ -52,7 +57,7 @@ export default class BaseModel extends Model { /** * Convenience for getting and setting the parent scope ID. - * @type {string + * @type {string} */ @computed('scope.scope_id') get scopeID() { diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index fe41f3866..cfed04b66 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -3,6 +3,11 @@ import { trait } from 'ember-cli-mirage'; export default factory.extend({ type: 'global', + authorized_collection_actions: () => { + return { + 'host-catalogs': ['create', 'list'], + }; + }, /** * Generates realistic-ish IDs while still being deterministic. diff --git a/addons/core/translations/en-us.yaml b/addons/core/translations/en-us.yaml index 5370c7e75..8f98f633c 100644 --- a/addons/core/translations/en-us.yaml +++ b/addons/core/translations/en-us.yaml @@ -32,6 +32,8 @@ titles: descriptions: empty-set: There are no items to display yet. You may be able to add items or try back later. origin-initialization: To get started, please enter your origin URL + create-but-not-list: You do not have permission to list {resource}, but you can create new instances. + neither-list-nor-create: You do not have permission to list or create {resource}. questions: delete-confirm: Are you sure you want to delete this resource? remove-confirm: Are you sure you want to remove this association? diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs.js b/ui/admin/app/routes/scopes/scope/host-catalogs.js index 53fd92f7a..65da4edc1 100644 --- a/ui/admin/app/routes/scopes/scope/host-catalogs.js +++ b/ui/admin/app/routes/scopes/scope/host-catalogs.js @@ -11,7 +11,7 @@ export default class ScopesScopeHostCatalogsRoute extends Route { @service intl; @service notify; @service session; - + @service can; // =methods /** @@ -26,8 +26,13 @@ export default class ScopesScopeHostCatalogsRoute extends Route { * @return {Promise{[HostCatalogModel]}} */ async model() { - const { id: scope_id } = this.modelFor('scopes.scope'); - return this.store.query('host-catalog', { scope_id }); + const scope = this.modelFor('scopes.scope'); + const { id: scope_id } = scope; + if ( + this.can.can('list collection', scope, { collection: 'host-catalogs' }) + ) { + return this.store.query('host-catalog', { scope_id }); + } } // =actions diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/index.js b/ui/admin/app/routes/scopes/scope/host-catalogs/index.js index 90fba54e3..9261d003a 100644 --- a/ui/admin/app/routes/scopes/scope/host-catalogs/index.js +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/index.js @@ -1,3 +1,9 @@ import Route from '@ember/routing/route'; -export default class ScopesScopeHostCatalogsIndexRoute extends Route {} +export default class ScopesScopeHostCatalogsIndexRoute extends Route { + setupController(controller) { + const scope = this.modelFor('scopes.scope'); + super.setupController(...arguments); + controller.setProperties({ scope }); + } +} diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index 65e456c51..da31bfa24 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -79,10 +79,12 @@ {{t 'resources.target.title_plural'}} - - - {{t 'resources.host-catalog.title_plural'}} - + {{#if (can 'navigate collection' @model collection='host-catalogs')}} + + + {{t 'resources.host-catalog.title_plural'}} + + {{/if}} {{#if (feature-flag 'credential-store')}} diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs index 734825303..db06323c7 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs @@ -15,13 +15,13 @@ - {{#if @model}} - - {{t 'titles.new'}} - + {{#if (can 'create collection' this.scope collection='host-catalogs')}} + {{#if @model}} + {{t 'titles.new'}} + {{/if}} {{/if}} @@ -82,12 +82,35 @@ as |message| > - {{t 'resources.host-catalog.description'}} + {{#if + (can 'list collection' this.scope collection='host-catalogs') + }} + {{! can list (at least): show default welcome message}} + {{t 'resources.host-catalog.description'}} + {{else if (can + 'create collection' this.scope collection='host-catalogs' + )}} + {{! can create (only): show create-but-not-list welcome message}} + {{t + 'descriptions.create-but-not-list' + resource=(t 'resources.host-catalog.title_plural') + }} + {{else}} + {{! can neither list nor create }} + {{t + 'descriptions.neither-list-nor-create' + resource=(t 'resources.host-catalog.title_plural') + }} + {{/if}} - - - {{t 'titles.new'}} - + {{#if + (can 'create collection' this.scope collection='host-catalogs') + }} + + + {{t 'titles.new'}} + + {{/if}} diff --git a/ui/admin/tests/acceptance/host-catalogs-test.js b/ui/admin/tests/acceptance/host-catalogs/create-test.js similarity index 74% rename from ui/admin/tests/acceptance/host-catalogs-test.js rename to ui/admin/tests/acceptance/host-catalogs/create-test.js index fea885978..8661e1eff 100644 --- a/ui/admin/tests/acceptance/host-catalogs-test.js +++ b/ui/admin/tests/acceptance/host-catalogs/create-test.js @@ -10,7 +10,7 @@ import { //invalidateSession, } from 'ember-simple-auth/test-support'; -module('Acceptance | host-catalogs', function (hooks) { +module('Acceptance | host-catalogs | create', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); @@ -22,6 +22,7 @@ module('Acceptance | host-catalogs', function (hooks) { org: null, project: null, }, + orgScope: null, }; const urls = { globalScope: null, @@ -35,6 +36,14 @@ module('Acceptance | host-catalogs', function (hooks) { hooks.beforeEach(function () { // Generate resources instances.scopes.global = this.server.create('scope', { id: 'global' }); + instances.orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); instances.scopes.org = this.server.create('scope', { type: 'org', scope: { id: 'global', type: 'global' }, @@ -46,17 +55,19 @@ module('Acceptance | host-catalogs', function (hooks) { instances.hostCatalog = this.server.create('host-catalog', { scope: instances.scopes.project, }); + // Generate route URLs for resources urls.globalScope = `/scopes/global/scopes`; - urls.orgScope = `/scopes/${instances.scopes.org.id}/scopes`; + urls.orgScope = `/scopes/${instances.orgScope.id}/scopes`; urls.projectScope = `/scopes/${instances.scopes.project.id}`; urls.hostCatalogs = `${urls.projectScope}/host-catalogs`; + urls.hostCatalog = `${urls.hostCatalogs}/${instances.hostCatalog.id}`; - urls.unknownHostCatalog = `${urls.hostCatalogs}/foo`; urls.newHostCatalog = `${urls.hostCatalogs}/new`; // Generate resource couner gethostCatalogCount = () => this.server.schema.hostCatalogs.all().models.length; + authenticateSession({}); }); @@ -79,6 +90,30 @@ module('Acceptance | host-catalogs', function (hooks) { assert.equal(gethostCatalogCount(), count); }); + test('can navigate to new host catalogs route with proper authorization', async function (assert) { + assert.expect(2); + await visit(urls.projectScope); + assert.ok( + instances.scopes.project.authorized_collection_actions[ + 'host-catalogs' + ].includes('create') + ); + assert.ok(find(`[href="${urls.hostCatalogs}"]`)); + }); + + test('cannot navigate to new host catalogs route without proper authorization', async function (assert) { + assert.expect(2); + instances.scopes.project.authorized_collection_actions['host-catalogs'] = + []; + await visit(urls.projectScope); + assert.notOk( + instances.scopes.project.authorized_collection_actions[ + 'host-catalogs' + ].includes('create') + ); + assert.notOk(find(`[href="${urls.hostCatalogs}"]`)); + }); + test('saving a new host catalog with invalid fields displays error messages', async function (assert) { assert.expect(2); this.server.post('/host-catalogs', () => { diff --git a/ui/admin/tests/acceptance/host-catalogs/list-test.js b/ui/admin/tests/acceptance/host-catalogs/list-test.js new file mode 100644 index 000000000..127784f4a --- /dev/null +++ b/ui/admin/tests/acceptance/host-catalogs/list-test.js @@ -0,0 +1,98 @@ +import { module, test } from 'qunit'; +import { visit, find } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { + authenticateSession, + // These are left here intentionally for future reference. + //currentSession, + //invalidateSession, +} from 'ember-simple-auth/test-support'; + +module('Acceptance | host-catalogs | list', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + + const instances = { + scopes: { + global: null, + org: null, + project: null, + }, + orgScope: null, + }; + + const urls = { + scopes: { + org: null, + }, + projectScope: null, + hostCatalogs: null, + }; + + hooks.beforeEach(function () { + instances.scopes.global = this.server.create('scope', { id: 'global' }); + instances.orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + instances.scopes.org = this.server.create('scope', { + type: 'org', + scope: { id: 'global', type: 'global' }, + }); + instances.scopes.project = this.server.create('scope', { + type: 'project', + scope: { id: instances.scopes.org.id, type: 'org' }, + }); + instances.hostCatalog = this.server.create('host-catalog', { + scope: instances.scopes.project, + }); + + // orgURL = `/scopes/${instances.orgScope.id}`; + urls.hostCatalogs = `/scopes/${instances.orgScope.id}/host-catalogs`; + urls.globalScope = `/scopes/global/scopes`; + urls.orgScope = `/scopes/${instances.orgScope.id}/scopes`; + urls.projectScope = `/scopes/${instances.scopes.project.id}`; + urls.hostCatalogs = `${urls.projectScope}/host-catalogs`; + + urls.hostCatalog = `${urls.hostCatalogs}/${instances.hostCatalog.id}`; + authenticateSession({}); + }); + + test('can navigate to host catalogs with proper authorization', async function (assert) { + assert.expect(2); + await visit(urls.projectScope); + assert.ok( + instances.scopes.project.authorized_collection_actions[ + 'host-catalogs' + ].includes('list') + ); + assert.ok(find(`[href="${urls.hostCatalogs}"]`)); + }); + + test('User cannot navigate to index without either list or create actions', async function (assert) { + assert.expect(2); + instances.scopes.project.authorized_collection_actions['host-catalogs'] = + []; + await visit(urls.projectScope); + assert.notOk( + instances.scopes.project.authorized_collection_actions[ + 'host-catalogs' + ].includes('list') + ); + assert.notOk(find(`[href="${urls.hostCatalogs}"]`)); + }); + + test('User can navigate to index with only create action', async function (assert) { + assert.expect(1); + instances.scopes.project.authorized_collection_actions['host-catalogs'] = [ + 'create', + ]; + await visit(urls.projectScope); + assert.ok(find(`[href="${urls.hostCatalogs}"]`)); + }); +}); From e76bc73c118584ed5777173c2b394afb81351daf Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Tue, 31 Aug 2021 17:10:11 -0700 Subject: [PATCH 45/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Update=20ember-cl?= =?UTF-8?q?i=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update ember-cli version to the latest stable version --- 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 | 20 ++++++++++---------- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/api/package.json b/addons/api/package.json index be04185ab..5094a68e2 100644 --- a/addons/api/package.json +++ b/addons/api/package.json @@ -41,7 +41,7 @@ "broccoli-asset-rev": "^3.0.0", "doctoc": "^2.0.0", "ember-auto-import": "^1.10.1", - "ember-cli": "~3.27.0", + "ember-cli": "~3.28.0", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-sri": "^2.1.1", diff --git a/addons/auth/package.json b/addons/auth/package.json index f656717be..0418515dc 100644 --- a/addons/auth/package.json +++ b/addons/auth/package.json @@ -35,7 +35,7 @@ "core": "*", "doctoc": "^2.0.0", "ember-auto-import": "^1.10.1", - "ember-cli": "~3.27.0", + "ember-cli": "~3.28.0", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-sri": "^2.1.1", diff --git a/addons/core/package.json b/addons/core/package.json index 4ede3ce38..3b92f32c1 100644 --- a/addons/core/package.json +++ b/addons/core/package.json @@ -50,7 +50,7 @@ "broccoli-asset-rev": "^3.0.0", "doctoc": "^2.0.0", "ember-auto-import": "^1.10.1", - "ember-cli": "~3.27.0", + "ember-cli": "~3.28.0", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-sri": "^2.1.1", diff --git a/addons/rose/package.json b/addons/rose/package.json index 6e1f5fadb..8fdf4eaf3 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -53,7 +53,7 @@ "broccoli-asset-rev": "^3.0.0", "doctoc": "^2.0.0", "ember-auto-import": "^1.10.1", - "ember-cli": "~3.27.0", + "ember-cli": "~3.28.0", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-sass": "^10.0.1", diff --git a/ui/admin/package.json b/ui/admin/package.json index bc9e5b2b6..22cddb938 100644 --- a/ui/admin/package.json +++ b/ui/admin/package.json @@ -50,7 +50,7 @@ "ember-a11y-testing": "^4.0.7", "ember-auto-import": "^1.10.1", "ember-breadcrumbs": "^0.2.3", - "ember-cli": "~3.27.0", + "ember-cli": "~3.28.0", "ember-cli-app-version": "^5.0.0", "ember-cli-babel": "^7.23.0", "ember-cli-code-coverage": "^1.0.2", diff --git a/ui/desktop/package.json b/ui/desktop/package.json index 920d03e56..77482183b 100755 --- a/ui/desktop/package.json +++ b/ui/desktop/package.json @@ -65,7 +65,7 @@ "ember-a11y-testing": "^4.0.7", "ember-auto-import": "^1.10.1", "ember-autofocus-modifier": "^1.1.0", - "ember-cli": "~3.27.0", + "ember-cli": "~3.28.0", "ember-cli-app-version": "^5.0.0", "ember-cli-babel": "^7.23.0", "ember-cli-code-coverage": "^1.0.2", diff --git a/yarn.lock b/yarn.lock index e356bc3d3..7814f8021 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5604,7 +5604,7 @@ broccoli-funnel@^1.0.1: symlink-or-copy "^1.0.0" walk-sync "^0.3.1" -broccoli-funnel@^3.0.3, broccoli-funnel@^3.0.8: +broccoli-funnel@^3.0.3, broccoli-funnel@^3.0.5, broccoli-funnel@^3.0.8: version "3.0.8" resolved "https://registry.yarnpkg.com/broccoli-funnel/-/broccoli-funnel-3.0.8.tgz#f5b62e2763c3918026a15a3c833edc889971279b" integrity sha512-ng4eIhPYiXqMw6SyGoxPHR3YAwEd2lr9FgBI1CyTbspl4txZovOsmzFkMkGAlu88xyvYXJqHiM2crfLa65T1BQ== @@ -8787,10 +8787,10 @@ ember-cli-version-checker@^5.0.1, ember-cli-version-checker@^5.1.1, ember-cli-ve semver "^7.3.4" silent-error "^1.1.1" -ember-cli@~3.27.0: - version "3.27.0" - resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.27.0.tgz#8ccf9db51d7b462f86210b853d086a4543605c34" - integrity sha512-vFLPFkplXn5v005fattHdOcs5AbSp7RG4w1wpHDWHzOSYpl2Dr+5zzZtqLS7V5IVaLf3XK4l24XwhSW9HpMfsQ== +ember-cli@~3.28.0: + version "3.28.0" + resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.28.0.tgz#0a0374c9a1d08386ddf56e8098a38b71dd4453bc" + integrity sha512-CrMs5edFQ2ingO2xfT33T4nUEl8SlvBQ7q+XO9L/GFTvFU07slHxYSvGur0cwgQfOiLnkSTnIaVF1oqBnEmfPQ== dependencies: "@babel/core" "^7.13.8" "@babel/plugin-transform-modules-amd" "^7.12.1" @@ -8806,7 +8806,7 @@ ember-cli@~3.27.0: broccoli-config-loader "^1.0.1" broccoli-config-replace "^1.1.2" broccoli-debug "^0.6.5" - broccoli-funnel "^2.0.2" + broccoli-funnel "^3.0.5" broccoli-funnel-reducer "^1.0.0" broccoli-merge-trees "^3.0.2" broccoli-middleware "^2.1.1" @@ -8872,7 +8872,7 @@ ember-cli@~3.27.0: sane "^4.1.0" semver "^7.3.4" silent-error "^1.1.1" - sort-package-json "^1.48.0" + sort-package-json "^1.49.0" symlink-or-copy "^1.3.1" temp "0.9.4" testem "^3.2.0" @@ -8881,7 +8881,7 @@ ember-cli@~3.27.0: uuid "^8.3.2" walk-sync "^2.2.0" watch-detector "^1.0.0" - workerpool "^6.0.3" + workerpool "^6.1.4" yam "^1.0.0" ember-compatibility-helpers@^1.1.1, ember-compatibility-helpers@^1.1.2, ember-compatibility-helpers@^1.2.0, ember-compatibility-helpers@^1.2.1, ember-compatibility-helpers@^1.2.4: @@ -19184,7 +19184,7 @@ sort-object-keys@^1.1.3: resolved "https://registry.yarnpkg.com/sort-object-keys/-/sort-object-keys-1.1.3.tgz#bff833fe85cab147b34742e45863453c1e190b45" integrity sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg== -sort-package-json@^1.48.0: +sort-package-json@^1.49.0: version "1.50.0" resolved "https://registry.yarnpkg.com/sort-package-json/-/sort-package-json-1.50.0.tgz#19fc109fe23bd157bd03c8e572fa3251a52467d8" integrity sha512-qZpqhMU9XTntebgAgc4hv/D6Fzhh7kFnwvV6a7+q8y8J5JoaDqPYQnvXPf7BBqG95tdE8X6JVNo7/jDzcbdfUg== @@ -21580,7 +21580,7 @@ workerpool@^3.1.1: object-assign "4.1.1" rsvp "^4.8.4" -workerpool@^6.0.0, workerpool@^6.0.3, workerpool@^6.1.4: +workerpool@^6.0.0, workerpool@^6.1.4: version "6.1.5" resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== From a6b7837af163ab54dbd8d1cf5fdbcbd3d32c6ccb Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Tue, 31 Aug 2021 17:22:20 -0700 Subject: [PATCH 46/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Update=20tar=20ve?= =?UTF-8?q?rsion=20resolutions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update tar version resolutions to avoid security vulnerability --- package.json | 2 +- ui/desktop/electron-app/package.json | 3 +- ui/desktop/electron-app/yarn.lock | 57 +++------------------------- yarn.lock | 8 ++-- 4 files changed, 13 insertions(+), 57 deletions(-) diff --git a/package.json b/package.json index 66eff112b..d5070c4b8 100755 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "minimist": "^1.2.3", "normalize-url": "^4.5.1", "glob-parent": "^5.1.2", - "tar": "^6.1.2", + "tar": "^6.1.9", "path-parse": "^1.0.7" }, "config": { diff --git a/ui/desktop/electron-app/package.json b/ui/desktop/electron-app/package.json index c0e9b5672..a91471f79 100644 --- a/ui/desktop/electron-app/package.json +++ b/ui/desktop/electron-app/package.json @@ -46,6 +46,7 @@ "trim-newlines": "^3.0.1", "normalize-url": "^4.5.1", "jszip": "^3.7.0", - "path-parse": "^1.0.7" + "path-parse": "^1.0.7", + "tar": "^6.1.9" } } diff --git a/ui/desktop/electron-app/yarn.lock b/ui/desktop/electron-app/yarn.lock index ed7fb79aa..c4bd48ac9 100644 --- a/ui/desktop/electron-app/yarn.lock +++ b/ui/desktop/electron-app/yarn.lock @@ -694,11 +694,6 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - chownr@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" @@ -1503,13 +1498,6 @@ fs-extra@^9.0.0, fs-extra@^9.0.1: jsonfile "^6.0.1" universalify "^2.0.0" -fs-minipass@^1.2.5: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - fs-minipass@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -2334,14 +2322,6 @@ minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1. resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - minipass@^3.0.0: version "3.1.3" resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.3.tgz#7d42ff1f39635482e15f9cdb53184deebd5815fd" @@ -2349,13 +2329,6 @@ minipass@^3.0.0: dependencies: yallist "^4.0.0" -minizlib@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - minizlib@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" @@ -2364,7 +2337,7 @@ minizlib@^2.1.1: minipass "^3.0.0" yallist "^4.0.0" -mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.4: +mkdirp@^0.5.1, mkdirp@^0.5.4: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -3494,23 +3467,10 @@ tar-stream@^1.5.2: to-buffer "^1.1.1" xtend "^4.0.0" -tar@^4: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" - -tar@^6.0.2, tar@^6.0.5: - version "6.1.0" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.0.tgz#d1724e9bcc04b977b18d5c573b333a2207229a83" - integrity sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA== +tar@^4, tar@^6.0.2, tar@^6.0.5, tar@^6.1.9: + version "6.1.11" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" + integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" @@ -3779,7 +3739,7 @@ xmlbuilder@^9.0.7: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= -xmldom@^0.5.0, xmldom@~0.5.0: +xmldom@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.5.0.tgz#193cb96b84aa3486127ea6272c4596354cb4962e" integrity sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA== @@ -3806,11 +3766,6 @@ yaku@^0.16.6: resolved "https://registry.yarnpkg.com/yaku/-/yaku-0.16.7.tgz#1d195c78aa9b5bf8479c895b9504fd4f0847984e" integrity sha1-HRlceKqbW/hHnIlblQT9TwhHmE4= -yallist@^3.0.0, yallist@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" diff --git a/yarn.lock b/yarn.lock index e622d6271..eea247596 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20015,10 +20015,10 @@ tapable@^1.0.0, tapable@^1.1.3: resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== -tar@^4, tar@^4.4.10, tar@^4.4.12, tar@^4.4.15, tar@^5.0.5, tar@^6.0.2, tar@^6.0.5, tar@^6.1.0, tar@^6.1.2: - version "6.1.8" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.8.tgz#4fc50cfe56511c538ce15b71e05eebe66530cbd4" - integrity sha512-sb9b0cp855NbkMJcskdSYA7b11Q8JsX4qe4pyUAfHp+Y6jBjJeek2ZVlwEfWayshEIwlIzXx0Fain3QG9JPm2A== +tar@^4, tar@^4.4.10, tar@^4.4.12, tar@^4.4.15, tar@^5.0.5, tar@^6.0.2, tar@^6.0.5, tar@^6.1.0, tar@^6.1.9: + version "6.1.11" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" + integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" From 04af1a431fbffbae824e5486ec7bdf3f830e2734 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 31 Aug 2021 19:41:11 -0700 Subject: [PATCH 47/60] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20sessions=20create?= =?UTF-8?q?=20list=20capabilities?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/mirage/factories/scope.js | 2 +- ui/admin/app/templates/scopes/scope.hbs | 10 +++-- ui/admin/jsconfig.json | 1 + ui/admin/tests/acceptance/sessions-test.js | 43 +++++++++++++++++++++- 4 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 ui/admin/jsconfig.json diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index e9c5ac09f..afe31e5cd 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -10,7 +10,7 @@ export default factory.extend({ // groups: ['create', 'list'], // roles: ['create', 'list'], // 'auth-methods': ['create', 'list'], - // sessopms: ['list'], + sessions: ['list'], // targets: ['create', 'list'], // 'host-catalogs': ['create', 'list'], // 'credential-stores': ['create', 'list'], diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index fd20ca2a2..c0cb0dca7 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -71,10 +71,12 @@ --}} - - - {{t 'resources.session.title_plural'}} - + {{#if (can 'navigate collection' @model collection='sessions')}} + + + {{t 'resources.session.title_plural'}} + + {{/if}} {{t 'resources.target.title_plural'}} diff --git a/ui/admin/jsconfig.json b/ui/admin/jsconfig.json new file mode 100644 index 000000000..f408cac8c --- /dev/null +++ b/ui/admin/jsconfig.json @@ -0,0 +1 @@ +{"compilerOptions":{"target":"es6","experimentalDecorators":true},"exclude":["node_modules","bower_components","tmp","vendor",".git","dist"]} \ No newline at end of file diff --git a/ui/admin/tests/acceptance/sessions-test.js b/ui/admin/tests/acceptance/sessions-test.js index d5f68ffeb..a5dfa25ff 100644 --- a/ui/admin/tests/acceptance/sessions-test.js +++ b/ui/admin/tests/acceptance/sessions-test.js @@ -15,13 +15,13 @@ import { module('Acceptance | sessions', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); - const instances = { scopes: { global: null, org: null, }, sessions: null, + orgScope: null, }; const urls = { orgScope: null, @@ -31,6 +31,14 @@ module('Acceptance | sessions', function (hooks) { hooks.beforeEach(function () { authenticateSession({}); instances.scopes.global = this.server.create('scope', { id: 'global' }); + instances.orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); instances.scopes.org = this.server.create('scope', { type: 'org', scope: { id: 'global', type: 'global' }, @@ -66,6 +74,7 @@ module('Acceptance | sessions', function (hooks) { }, 'withAssociations' ); + urls.orgScope = `/scopes/${instances.scopes.project.id}`; urls.sessions = `/scopes/${instances.scopes.project.id}/sessions`; }); @@ -81,6 +90,38 @@ module('Acceptance | sessions', function (hooks) { await visit(urls.sessions); }); + test('Users cannot navigate to sessions without proper authorization', async function (assert) { + assert.expect(2); + instances.scopes.project.authorized_collection_actions.sessions = []; + authenticateSession({}); + later(async () => { + run.cancelTimers(); + assert.notOk( + instances.scopes.project.authorized_collection_actions.sessions.includes( + 'list' + ) + ); + assert.notOk(find(`[href="${urls.sessions}"]`)); + }, 750); + await visit(urls.orgScope); + }); + + test('Users can navigate to sessions with proper authorization', async function (assert) { + assert.expect(2); + instances.scopes.project.authorized_collection_actions.sessions = ['list']; + authenticateSession({}); + later(async () => { + run.cancelTimers(); + assert.ok( + instances.scopes.project.authorized_collection_actions.sessions.includes( + 'list' + ) + ); + assert.ok(find(`[href="${urls.sessions}"]`)); + }, 750); + await visit(urls.orgScope); + }); + test('visiting sessions without users or targets is OK', async function (assert) { assert.expect(2); instances.sessions[0].update({ From 32c69624f90bc3b1aca0e0c9b206dfd414c38e17 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 31 Aug 2021 19:49:56 -0700 Subject: [PATCH 48/60] =?UTF-8?q?fix:=20=F0=9F=90=9B=20remove=20jsconfig?= =?UTF-8?q?=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/jsconfig.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 ui/admin/jsconfig.json diff --git a/ui/admin/jsconfig.json b/ui/admin/jsconfig.json deleted file mode 100644 index f408cac8c..000000000 --- a/ui/admin/jsconfig.json +++ /dev/null @@ -1 +0,0 @@ -{"compilerOptions":{"target":"es6","experimentalDecorators":true},"exclude":["node_modules","bower_components","tmp","vendor",".git","dist"]} \ No newline at end of file From 2a8d42eabad44db188aad3b3971e6a14d5fece45 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 31 Aug 2021 23:34:32 -0700 Subject: [PATCH 49/60] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20target=20create=20?= =?UTF-8?q?list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/mirage/factories/scope.js | 2 +- ui/admin/app/routes/scopes/scope/targets.js | 8 +- .../app/routes/scopes/scope/targets/index.js | 9 +- ui/admin/app/templates/scopes/scope.hbs | 10 ++- .../templates/scopes/scope/targets/index.hbs | 43 +++++++--- .../create-test.js} | 26 +++++- .../tests/acceptance/targets/list-test.js | 84 +++++++++++++++++++ 7 files changed, 162 insertions(+), 20 deletions(-) rename ui/admin/tests/acceptance/{targets-test.js => targets/create-test.js} (80%) create mode 100644 ui/admin/tests/acceptance/targets/list-test.js diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index e9c5ac09f..3e375fb59 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -11,7 +11,7 @@ export default factory.extend({ // roles: ['create', 'list'], // 'auth-methods': ['create', 'list'], // sessopms: ['list'], - // targets: ['create', 'list'], + targets: ['create', 'list'], // 'host-catalogs': ['create', 'list'], // 'credential-stores': ['create', 'list'], }; diff --git a/ui/admin/app/routes/scopes/scope/targets.js b/ui/admin/app/routes/scopes/scope/targets.js index 40cd811bb..2adb5ca84 100644 --- a/ui/admin/app/routes/scopes/scope/targets.js +++ b/ui/admin/app/routes/scopes/scope/targets.js @@ -11,6 +11,7 @@ export default class ScopesScopeTargetsRoute extends Route { @service intl; @service notify; @service session; + @service can; // =methods @@ -26,8 +27,11 @@ export default class ScopesScopeTargetsRoute extends Route { * @return {Promise{[TargetModel]}} */ async model() { - const { id: scope_id } = this.modelFor('scopes.scope'); - return this.store.query('target', { scope_id }); + const scope = this.modelFor('scopes.scope'); + const { id: scope_id } = scope; + if (this.can.can('list collection', scope, { collection: 'targets' })) { + return this.store.query('target', { scope_id }); + } } // =actions diff --git a/ui/admin/app/routes/scopes/scope/targets/index.js b/ui/admin/app/routes/scopes/scope/targets/index.js index 2b4412f53..8e92f73d5 100644 --- a/ui/admin/app/routes/scopes/scope/targets/index.js +++ b/ui/admin/app/routes/scopes/scope/targets/index.js @@ -1,3 +1,10 @@ import Route from '@ember/routing/route'; +export default class ScopesScopeTargetsIndexRoute extends Route { + // =methods -export default class ScopesScopeTargetsIndexRoute extends Route {} + setupController(controller) { + const scope = this.modelFor('scopes.scope'); + super.setupController(...arguments); + controller.setProperties({ scope }); + } +} diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index fd20ca2a2..cf4d2e977 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -75,10 +75,12 @@ {{t 'resources.session.title_plural'}} - - - {{t 'resources.target.title_plural'}} - + {{#if (can 'navigate collection' @model collection='targets')}} + + + {{t 'resources.target.title_plural'}} + + {{/if}} {{t 'resources.host-catalog.title_plural'}} diff --git a/ui/admin/app/templates/scopes/scope/targets/index.hbs b/ui/admin/app/templates/scopes/scope/targets/index.hbs index f8dcec9b4..bfb9821d0 100644 --- a/ui/admin/app/templates/scopes/scope/targets/index.hbs +++ b/ui/admin/app/templates/scopes/scope/targets/index.hbs @@ -15,13 +15,14 @@ - {{#if @model}} - - {{t 'titles.new'}} - + {{#if (can 'create collection' this.scope collection='targets')}} + {{#if @model}} + {{t + 'titles.new' + }} + {{/if}} {{/if}} - {{#if @model}} @@ -79,12 +80,34 @@ as |message| > - {{t 'resources.target.description'}} + + {{#if (can 'list collection' this.scope collection='targets')}} + {{! can list (at least): show default welcome message}} + {{t 'resources.target.description'}} + {{else if (can + 'create collection' this.scope collection='targets' + )}} + {{! can create (only): show create-but-not-list welcome message}} + {{t + 'descriptions.create-but-not-list' + resource=(t 'resources.target.title_plural') + }} + {{else}} + {{! can neither list nor create }} + {{t + 'descriptions.neither-list-nor-create' + resource=(t 'resources.target.title_plural') + }} + + {{/if}} - - - {{t 'titles.new'}} - + + {{#if (can 'create collection' this.scope collection='targets')}} + + + {{t 'titles.new'}} + + {{/if}} diff --git a/ui/admin/tests/acceptance/targets-test.js b/ui/admin/tests/acceptance/targets/create-test.js similarity index 80% rename from ui/admin/tests/acceptance/targets-test.js rename to ui/admin/tests/acceptance/targets/create-test.js index cf202c049..16215cb7a 100644 --- a/ui/admin/tests/acceptance/targets-test.js +++ b/ui/admin/tests/acceptance/targets/create-test.js @@ -10,7 +10,7 @@ import { //invalidateSession, } from 'ember-simple-auth/test-support'; -module('Acceptance | targets', function (hooks) { +module('Acceptance | targets | create', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); @@ -33,7 +33,6 @@ module('Acceptance | targets', function (hooks) { }; hooks.beforeEach(function () { - // Generate resources instances.scopes.global = this.server.create('scope', { id: 'global' }); instances.scopes.org = this.server.create('scope', { type: 'org', @@ -68,6 +67,29 @@ module('Acceptance | targets', function (hooks) { assert.equal(getTargetCount(), count + 1); }); + test('can navigate to new targets route with proper authorization', async function (assert) { + assert.expect(2); + await visit(urls.projectScope); + assert.ok( + instances.scopes.project.authorized_collection_actions.targets.includes( + 'create' + ) + ); + assert.ok(find(`[href="${urls.targets}"]`)); + }); + + test('cannot navigate to new targets route without proper authorization', async function (assert) { + assert.expect(2); + instances.scopes.project.authorized_collection_actions.targets = []; + await visit(urls.projectScope); + assert.notOk( + instances.scopes.project.authorized_collection_actions.targets.includes( + 'create' + ) + ); + assert.notOk(find(`[href="${urls.targets}"]`)); + }); + test('can cancel create new targets', async function (assert) { assert.expect(2); const count = getTargetCount(); diff --git a/ui/admin/tests/acceptance/targets/list-test.js b/ui/admin/tests/acceptance/targets/list-test.js new file mode 100644 index 000000000..19bd4ee64 --- /dev/null +++ b/ui/admin/tests/acceptance/targets/list-test.js @@ -0,0 +1,84 @@ +import { module, test } from 'qunit'; +import { visit, find } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { + authenticateSession, + // These are left here intentionally for future reference. + //currentSession, + //invalidateSession, +} from 'ember-simple-auth/test-support'; + +module('Acceptance | targets | list', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + + const instances = { + scopes: { + global: null, + org: null, + }, + orgScope: null, + }; + + const urls = { + scopes: { + org: null, + project: null, + }, + targets: null, + projectScope: null, + }; + + hooks.beforeEach(function () { + instances.scopes.global = this.server.create('scope', { id: 'global' }); + instances.orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + instances.scopes.project = this.server.create('scope', { + type: 'project', + scope: { id: instances.orgScope.id, type: 'org' }, + }); + instances.target = this.server.create('target', { + scope: instances.scopes.project, + }); + urls.projectScope = `/scopes/${instances.scopes.project.id}`; + urls.targets = `${urls.projectScope}/targets`; + authenticateSession({}); + }); + + test('can navigate to targets with proper authorization', async function (assert) { + assert.expect(2); + await visit(urls.projectScope); + assert.ok( + instances.scopes.project.authorized_collection_actions.targets.includes( + 'list' + ) + ); + assert.ok(find(`[href="${urls.targets}"]`)); + }); + + test('User cannot navigate to index without either list or create actions', async function (assert) { + assert.expect(2); + instances.scopes.project.authorized_collection_actions.targets = []; + await visit(urls.projectScope); + assert.notOk( + instances.scopes.project.authorized_collection_actions.targets.includes( + 'list' + ) + ); + assert.notOk(find(`[href="${urls.targets}"]`)); + }); + + test('User can navigate to index with only create action', async function (assert) { + assert.expect(1); + instances.scopes.project.authorized_collection_actions.targets = ['create']; + await visit(urls.projectScope); + assert.ok(find(`[href="${urls.targets}"]`)); + }); +}); From b27fe14dbca2ec2acba743e9b8df52796070eda8 Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Wed, 1 Sep 2021 08:47:34 -0700 Subject: [PATCH 50/60] Update create-test.js --- ui/admin/tests/acceptance/users/create-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/admin/tests/acceptance/users/create-test.js b/ui/admin/tests/acceptance/users/create-test.js index fbff7fbee..99b715b9b 100644 --- a/ui/admin/tests/acceptance/users/create-test.js +++ b/ui/admin/tests/acceptance/users/create-test.js @@ -45,14 +45,14 @@ module('Acceptance | users | create', function (hooks) { assert.equal(this.server.db.users.length, usersCount + 1); }); - test('can navigate to new users route with proper authorization', async function (assert) { + test('Users can navigate to new users route with proper authorization', async function (assert) { assert.expect(2); await visit(orgURL); assert.ok(orgScope.authorized_collection_actions.users.includes('create')); assert.ok(find(`[href="${orgURL}/users"]`)); }); - test('cannot navigate to new users route without proper authorization', async function (assert) { + test('Users cannot navigate to new users route without proper authorization', async function (assert) { assert.expect(2); orgScope.authorized_collection_actions.users = []; await visit(orgURL); From e7b553efda26b8b0992bb25110a0b0e65f2345d8 Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Wed, 1 Sep 2021 08:48:08 -0700 Subject: [PATCH 51/60] Update list-test.js --- ui/admin/tests/acceptance/users/list-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/admin/tests/acceptance/users/list-test.js b/ui/admin/tests/acceptance/users/list-test.js index 72a6e35eb..d453e5b04 100644 --- a/ui/admin/tests/acceptance/users/list-test.js +++ b/ui/admin/tests/acceptance/users/list-test.js @@ -47,7 +47,7 @@ module('Acceptance | users | list', function (hooks) { authenticateSession({}); }); - test('can navigate to users with proper authorization', async function (assert) { + test('Users can navigate to users with proper authorization', async function (assert) { assert.expect(2); await visit(orgURL); assert.ok( From 9f28484bd7fcf6820908f9751c0b7181b209fdd9 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 1 Sep 2021 14:02:27 -0700 Subject: [PATCH 52/60] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20cred=20store=20cre?= =?UTF-8?q?ate/list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/mirage/factories/scope.js | 2 +- .../routes/scopes/scope/credential-stores.js | 14 +++- .../scopes/scope/credential-stores/index.js | 9 +- ui/admin/app/templates/scopes/scope.hbs | 15 ++-- .../scopes/scope/credential-stores/index.hbs | 50 ++++++++--- .../create-test.js} | 22 +++-- .../acceptance/credential-store/list-test.js | 84 +++++++++++++++++++ 7 files changed, 169 insertions(+), 27 deletions(-) rename ui/admin/tests/acceptance/{credential-stores-test.js => credential-store/create-test.js} (82%) create mode 100644 ui/admin/tests/acceptance/credential-store/list-test.js diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index e9c5ac09f..1d479d1b1 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -13,7 +13,7 @@ export default factory.extend({ // sessopms: ['list'], // targets: ['create', 'list'], // 'host-catalogs': ['create', 'list'], - // 'credential-stores': ['create', 'list'], + 'credential-stores': ['create', 'list'], }; }, diff --git a/ui/admin/app/routes/scopes/scope/credential-stores.js b/ui/admin/app/routes/scopes/scope/credential-stores.js index 8bfce1b1d..d49379fcf 100644 --- a/ui/admin/app/routes/scopes/scope/credential-stores.js +++ b/ui/admin/app/routes/scopes/scope/credential-stores.js @@ -1,4 +1,5 @@ import Route from '@ember/routing/route'; +import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import loading from 'ember-loading/decorator'; import { confirm } from 'core/decorators/confirm'; @@ -6,14 +7,21 @@ import { notifySuccess, notifyError } from 'core/decorators/notify'; export default class ScopesScopeCredentialStoresRoute extends Route { // =methods - + @service can; /** * Load all credential stores under current scope * @returns {Promise[CredentialStoreModel]} */ async model() { - const { id: scope_id } = this.modelFor('scopes.scope'); - return this.store.query('credential-store', { scope_id }); + const scope = this.modelFor('scopes.scope'); + const { id: scope_id } = scope; + if ( + this.can.can('list collection', scope, { + collection: 'credential-stores', + }) + ) { + return this.store.query('credential-store', { scope_id }); + } } // =actions diff --git a/ui/admin/app/routes/scopes/scope/credential-stores/index.js b/ui/admin/app/routes/scopes/scope/credential-stores/index.js index 99ced4658..57fea4b74 100644 --- a/ui/admin/app/routes/scopes/scope/credential-stores/index.js +++ b/ui/admin/app/routes/scopes/scope/credential-stores/index.js @@ -1,3 +1,10 @@ import Route from '@ember/routing/route'; +export default class ScopesScopeCredentialStoresIndexRoute extends Route { + // =methods -export default class ScopesScopeCredentialStoresIndexRoute extends Route {} + setupController(controller) { + const scope = this.modelFor('scopes.scope'); + super.setupController(...arguments); + controller.setProperties({ scope }); + } +} diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index fd20ca2a2..3a2745d60 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -83,11 +83,16 @@ {{t 'resources.host-catalog.title_plural'}} - {{#if (feature-flag 'credential-store')}} - - - {{t 'resources.credential-store.title_plural'}} - + {{#if + (can 'navigate collection' @model collection='credential-stores') + }} + {{#if (feature-flag 'credential-store')}} + + + + {{t 'resources.credential-store.title_plural'}} + + {{/if}} {{/if}} {{/if}} diff --git a/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs b/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs index faa489b0b..6dd0d281f 100644 --- a/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs +++ b/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs @@ -14,13 +14,16 @@ - {{#if @model}} - - {{t 'titles.new'}} - + + {{#if (can 'create collection' this.scope collection='credential-stores')}} + {{#if @model}} + + {{t 'titles.new'}} + + {{/if}} {{/if}} @@ -79,12 +82,35 @@ as |message| > - {{t 'resources.credential-store.description'}} + {{#if + (can 'list collection' this.scope collection='credential-stores') + }} + {{! can list (at least): show default welcome message}} + {{t 'resources.credential-store.description'}} + {{else if (can + 'create collection' this.scope collection='credential-stores' + )}} + {{! can create (only): show create-but-not-list welcome message}} + {{t + 'descriptions.create-but-not-list' + resource=(t 'resources.credential-store.title_plural') + }} + {{else}} + {{! can neither list nor create }} + {{t + 'descriptions.neither-list-nor-create' + resource=(t 'resources.user.title_plural') + }} + {{/if}} - - - {{t 'titles.new'}} - + {{#if + (can 'create collection' this.scope collection='credential-stores') + }} + + + {{t 'titles.new'}} + + {{/if}} diff --git a/ui/admin/tests/acceptance/credential-stores-test.js b/ui/admin/tests/acceptance/credential-store/create-test.js similarity index 82% rename from ui/admin/tests/acceptance/credential-stores-test.js rename to ui/admin/tests/acceptance/credential-store/create-test.js index 54764b5a3..e651a641b 100644 --- a/ui/admin/tests/acceptance/credential-stores-test.js +++ b/ui/admin/tests/acceptance/credential-store/create-test.js @@ -5,7 +5,7 @@ import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import { authenticateSession } from 'ember-simple-auth/test-support'; import { Response } from 'miragejs'; -module('Acceptance | credential-stores', function (hooks) { +module('Acceptance | credential-stores | create', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); @@ -21,7 +21,6 @@ module('Acceptance | credential-stores', function (hooks) { const urls = { globalScope: null, - orgScope: null, projectScope: null, credentialStores: null, credentialStore: null, @@ -45,7 +44,6 @@ module('Acceptance | credential-stores', function (hooks) { }); // 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}`; @@ -58,7 +56,7 @@ module('Acceptance | credential-stores', function (hooks) { authenticateSession({}); }); - test('can create a new credential stores', async function (assert) { + test('Users can create a new credential stores', async function (assert) { assert.expect(1); const count = getCredentialStoresCount(); await visit(urls.newCredentialStore); @@ -67,7 +65,7 @@ module('Acceptance | credential-stores', function (hooks) { assert.equal(getCredentialStoresCount(), count + 1); }); - test('can cancel create new credential stores', async function (assert) { + test('Users can cancel create new credential stores', async function (assert) { assert.expect(2); const count = getCredentialStoresCount(); await visit(urls.newCredentialStore); @@ -77,6 +75,20 @@ module('Acceptance | credential-stores', function (hooks) { assert.equal(getCredentialStoresCount(), count); }); + test('Users cannot navigate to new credential stores route without proper authorization', async function (assert) { + assert.expect(2); + instances.scopes.project.authorized_collection_actions[ + 'credential-stores' + ] = []; + await visit(urls.projectScope); + assert.notOk( + instances.scopes.project.authorized_collection_actions[ + 'credential-stores' + ].includes('create') + ); + assert.notOk(find(`[href="${urls.credentialStores}"]`)); + }); + test('saving a new credential store with invalid fields displays error messages', async function (assert) { assert.expect(2); this.server.post('/credential-stores', () => { diff --git a/ui/admin/tests/acceptance/credential-store/list-test.js b/ui/admin/tests/acceptance/credential-store/list-test.js new file mode 100644 index 000000000..e4d6cda15 --- /dev/null +++ b/ui/admin/tests/acceptance/credential-store/list-test.js @@ -0,0 +1,84 @@ +import { module, test } from 'qunit'; +import { visit, find } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { + authenticateSession, + // These are left here intentionally for future reference. + //currentSession, + //invalidateSession, +} from 'ember-simple-auth/test-support'; + +module('Acceptance | credential-stores | list', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + + const instances = { + scopes: { + global: null, + org: null, + project: null, + }, + }; + + const urls = { + scopes: { + org: null, + }, + projectScope: null, + credentialStores: null, + credentialStore: null, + }; + + hooks.beforeEach(function () { + instances.scopes.global = this.server.create('scope', { id: 'global' }); + instances.scopes.org = this.server.create('scope', { + type: 'org', + scope: { id: 'global', type: 'global' }, + }); + instances.scopes.project = this.server.create('scope', { + type: 'project', + scope: { id: instances.scopes.org.id, type: 'org' }, + }); + instances.credentialStore = this.server.create('credential-store', { + scope: instances.scopes.project, + }); + urls.projectScope = `/scopes/${instances.scopes.project.id}`; + urls.credentialStores = `${urls.projectScope}/credential-stores`; + authenticateSession({}); + }); + + test('Users can navigate to credential-stores with proper authorization', async function (assert) { + assert.expect(2); + await visit(urls.projectScope); + assert.ok( + instances.scopes.project.authorized_collection_actions[ + 'credential-stores' + ].includes('list') + ); + assert.ok(find(`[href="${urls.credentialStores}"]`)); + }); + + test('Users cannot navigate to index without either list or create actions', async function (assert) { + assert.expect(2); + instances.scopes.project.authorized_collection_actions[ + 'credential-stores' + ] = []; + await visit(urls.projectScope); + assert.notOk( + instances.scopes.project.authorized_collection_actions[ + 'credential-stores' + ].includes('list') + ); + assert.notOk(find(`[href="${urls.credentialStores}"]`)); + }); + + test('Users can navigate to index with only create action', async function (assert) { + assert.expect(1); + instances.scopes.project.authorized_collection_actions[ + 'credential-stores' + ] = ['create']; + await visit(urls.projectScope); + assert.ok(find(`[href="${urls.credentialStores}"]`)); + }); +}); From 0ab5ff837074bcfff61e5f1134815e73bfee4117 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 1 Sep 2021 14:17:00 -0700 Subject: [PATCH 53/60] =?UTF-8?q?fix:=20=F0=9F=90=9B=20add=20org=20to=20ur?= =?UTF-8?q?ls,=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/acceptance/roles/create-test.js | 24 +++++++------------ ui/admin/tests/acceptance/roles/list-test.js | 10 ++++---- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/ui/admin/tests/acceptance/roles/create-test.js b/ui/admin/tests/acceptance/roles/create-test.js index c2a86e46c..f9d5e7778 100644 --- a/ui/admin/tests/acceptance/roles/create-test.js +++ b/ui/admin/tests/acceptance/roles/create-test.js @@ -15,8 +15,6 @@ module('Acceptance | roles | create', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); - let orgURL; - const instances = { scopes: { global: null, @@ -29,7 +27,8 @@ module('Acceptance | roles | create', function (hooks) { const urls = { roles: null, role: null, - newRoleURL: null, + newRole: null, + orgScope: null, }; hooks.beforeEach(function () { @@ -43,11 +42,6 @@ module('Acceptance | roles | create', function (hooks) { 'withChildren' ); - // instances.scopes.global = this.server.create('scope', { id: 'global' }); - // instances.scopes.org = this.server.create('scope', { - // type: 'org', - // scope: { id: 'global', type: 'global' }, - // }); // The project scope is not yet used for role tests (though it will be // in the future). This is created simply to test the grant scope loading // mechanism. @@ -64,14 +58,14 @@ module('Acceptance | roles | create', function (hooks) { ); urls.roles = `/scopes/${instances.orgScope.id}/roles`; urls.role = `${urls.roles}/${instances.role.id}`; - urls.newRoleURL = `${urls.roles}/new`; - orgURL = `/scopes/${instances.orgScope.id}`; + urls.newRole = `${urls.roles}/new`; + urls.orgScope = `/scopes/${instances.orgScope.id}`; }); test('can create new role', async function (assert) { assert.expect(1); const rolesCount = this.server.db.roles.length; - await visit(urls.newRoleURL); + await visit(urls.newRole); await fillIn('[name="name"]', 'role name'); await click('[type="submit"]'); assert.equal(this.server.db.roles.length, rolesCount + 1); @@ -79,7 +73,7 @@ module('Acceptance | roles | create', function (hooks) { test('can navigate to new roles route with proper authorization', async function (assert) { assert.expect(2); - await visit(orgURL); + await visit(urls.orgScope); assert.ok( instances.orgScope.authorized_collection_actions.roles.includes('create') ); @@ -89,7 +83,7 @@ module('Acceptance | roles | create', function (hooks) { test('cannot navigate to new roles route without proper authorization', async function (assert) { assert.expect(2); instances.orgScope.authorized_collection_actions.roles = []; - await visit(orgURL); + await visit(urls.orgScope); assert.notOk( instances.orgScope.authorized_collection_actions.roles.includes('create') ); @@ -99,7 +93,7 @@ module('Acceptance | roles | create', function (hooks) { test('can cancel new role creation', async function (assert) { assert.expect(2); const rolesCount = this.server.db.roles.length; - await visit(urls.newRoleURL); + await visit(urls.newRole); await fillIn('[name="name"]', 'role name'); await click('.rose-form-actions [type="button"]'); assert.equal(currentURL(), urls.roles); @@ -127,7 +121,7 @@ module('Acceptance | roles | create', function (hooks) { } ); }); - await visit(urls.newRoleURL); + await visit(urls.newRole); await fillIn('[name="name"]', 'new target'); await click('form [type="submit"]'); await a11yAudit(); diff --git a/ui/admin/tests/acceptance/roles/list-test.js b/ui/admin/tests/acceptance/roles/list-test.js index e6e13cfb7..c1b1ed8a5 100644 --- a/ui/admin/tests/acceptance/roles/list-test.js +++ b/ui/admin/tests/acceptance/roles/list-test.js @@ -12,7 +12,6 @@ import { module('Acceptance | roles | list', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); - let orgURL; const instances = { scopes: { @@ -27,6 +26,7 @@ module('Acceptance | roles | list', function (hooks) { org: null, }, roles: null, + orgScope: null, }; hooks.beforeEach(function () { @@ -41,7 +41,7 @@ module('Acceptance | roles | list', function (hooks) { instances.role = this.server.create('role', { scope: instances.orgScope, }); - orgURL = `/scopes/${instances.orgScope.id}`; + urls.orgScope = `/scopes/${instances.orgScope.id}`; urls.roles = `/scopes/${instances.orgScope.id}/roles`; authenticateSession({}); @@ -49,7 +49,7 @@ module('Acceptance | roles | list', function (hooks) { test('can navigate to roles with proper authorization', async function (assert) { assert.expect(2); - await visit(orgURL); + await visit(urls.orgScope); assert.ok( instances.orgScope.authorized_collection_actions.roles.includes('list') ); @@ -59,7 +59,7 @@ module('Acceptance | roles | list', function (hooks) { test('User cannot navigate to index without either list or create actions', async function (assert) { assert.expect(2); instances.orgScope.authorized_collection_actions.roles = []; - await visit(orgURL); + await visit(urls.orgScope); assert.notOk( instances.orgScope.authorized_collection_actions.roles.includes('list') ); @@ -69,7 +69,7 @@ module('Acceptance | roles | list', function (hooks) { test('User can navigate to index with only create action', async function (assert) { assert.expect(1); instances.orgScope.authorized_collection_actions.roles = ['create']; - await visit(orgURL); + await visit(urls.orgScope); assert.ok(find(`[href="${urls.roles}"]`)); }); }); From 13794c7bf8c3fda081aff18445b6370ac5f7204e Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 1 Sep 2021 14:26:25 -0700 Subject: [PATCH 54/60] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/tests/acceptance/roles/create-test.js | 4 ++-- ui/admin/tests/acceptance/roles/list-test.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/admin/tests/acceptance/roles/create-test.js b/ui/admin/tests/acceptance/roles/create-test.js index f9d5e7778..a0564f67d 100644 --- a/ui/admin/tests/acceptance/roles/create-test.js +++ b/ui/admin/tests/acceptance/roles/create-test.js @@ -71,7 +71,7 @@ module('Acceptance | roles | create', function (hooks) { assert.equal(this.server.db.roles.length, rolesCount + 1); }); - test('can navigate to new roles route with proper authorization', async function (assert) { + test('Users can navigate to new roles route with proper authorization', async function (assert) { assert.expect(2); await visit(urls.orgScope); assert.ok( @@ -80,7 +80,7 @@ module('Acceptance | roles | create', function (hooks) { assert.ok(find(`[href="${urls.roles}"]`)); }); - test('cannot navigate to new roles route without proper authorization', async function (assert) { + test('Users cannot navigate to new roles route without proper authorization', async function (assert) { assert.expect(2); instances.orgScope.authorized_collection_actions.roles = []; await visit(urls.orgScope); diff --git a/ui/admin/tests/acceptance/roles/list-test.js b/ui/admin/tests/acceptance/roles/list-test.js index c1b1ed8a5..ff170aeb7 100644 --- a/ui/admin/tests/acceptance/roles/list-test.js +++ b/ui/admin/tests/acceptance/roles/list-test.js @@ -47,7 +47,7 @@ module('Acceptance | roles | list', function (hooks) { authenticateSession({}); }); - test('can navigate to roles with proper authorization', async function (assert) { + test('Users can navigate to roles with proper authorization', async function (assert) { assert.expect(2); await visit(urls.orgScope); assert.ok( @@ -56,7 +56,7 @@ module('Acceptance | roles | list', function (hooks) { assert.ok(find(`[href="${urls.roles}"]`)); }); - test('User cannot navigate to index without either list or create actions', async function (assert) { + test('Users cannot navigate to index without either list or create actions', async function (assert) { assert.expect(2); instances.orgScope.authorized_collection_actions.roles = []; await visit(urls.orgScope); @@ -66,7 +66,7 @@ module('Acceptance | roles | list', function (hooks) { assert.notOk(find(`[href="${urls.roles}"]`)); }); - test('User can navigate to index with only create action', async function (assert) { + test('Users can navigate to index with only create action', async function (assert) { assert.expect(1); instances.orgScope.authorized_collection_actions.roles = ['create']; await visit(urls.orgScope); From 166b35860ace66e79233ab62b8dbebfab4b0686e Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 1 Sep 2021 15:29:09 -0700 Subject: [PATCH 55/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20merge=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/templates/scopes/scope/host-catalogs/index.hbs | 4 +++- ui/admin/tests/acceptance/host-catalogs/create-test.js | 8 ++++---- ui/admin/tests/acceptance/host-catalogs/list-test.js | 3 +-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs index db06323c7..d5c7ab53a 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/index.hbs @@ -20,7 +20,9 @@ {{t 'titles.new'}} + > + {{t 'titles.new'}} + {{/if}} {{/if}} diff --git a/ui/admin/tests/acceptance/host-catalogs/create-test.js b/ui/admin/tests/acceptance/host-catalogs/create-test.js index 8661e1eff..e95ecbde0 100644 --- a/ui/admin/tests/acceptance/host-catalogs/create-test.js +++ b/ui/admin/tests/acceptance/host-catalogs/create-test.js @@ -71,7 +71,7 @@ module('Acceptance | host-catalogs | create', function (hooks) { authenticateSession({}); }); - test('can create new host catalogs', async function (assert) { + test('Users can create new host catalogs', async function (assert) { assert.expect(1); const count = gethostCatalogCount(); await visit(urls.newHostCatalog); @@ -80,7 +80,7 @@ module('Acceptance | host-catalogs | create', function (hooks) { assert.equal(gethostCatalogCount(), count + 1); }); - test('can cancel create new host catalogs', async function (assert) { + test('Users can cancel create new host catalogs', async function (assert) { assert.expect(2); const count = gethostCatalogCount(); await visit(urls.newHostCatalog); @@ -90,7 +90,7 @@ module('Acceptance | host-catalogs | create', function (hooks) { assert.equal(gethostCatalogCount(), count); }); - test('can navigate to new host catalogs route with proper authorization', async function (assert) { + test('Users can navigate to new host catalogs route with proper authorization', async function (assert) { assert.expect(2); await visit(urls.projectScope); assert.ok( @@ -101,7 +101,7 @@ module('Acceptance | host-catalogs | create', function (hooks) { assert.ok(find(`[href="${urls.hostCatalogs}"]`)); }); - test('cannot navigate to new host catalogs route without proper authorization', async function (assert) { + test('Users cannot navigate to new host catalogs route without proper authorization', async function (assert) { assert.expect(2); instances.scopes.project.authorized_collection_actions['host-catalogs'] = []; diff --git a/ui/admin/tests/acceptance/host-catalogs/list-test.js b/ui/admin/tests/acceptance/host-catalogs/list-test.js index 127784f4a..6cf508e20 100644 --- a/ui/admin/tests/acceptance/host-catalogs/list-test.js +++ b/ui/admin/tests/acceptance/host-catalogs/list-test.js @@ -52,7 +52,6 @@ module('Acceptance | host-catalogs | list', function (hooks) { scope: instances.scopes.project, }); - // orgURL = `/scopes/${instances.orgScope.id}`; urls.hostCatalogs = `/scopes/${instances.orgScope.id}/host-catalogs`; urls.globalScope = `/scopes/global/scopes`; urls.orgScope = `/scopes/${instances.orgScope.id}/scopes`; @@ -63,7 +62,7 @@ module('Acceptance | host-catalogs | list', function (hooks) { authenticateSession({}); }); - test('can navigate to host catalogs with proper authorization', async function (assert) { + test('Users can navigate to host catalogs with proper authorization', async function (assert) { assert.expect(2); await visit(urls.projectScope); assert.ok( From 7c0366c790cb27d35fccca27212f71150587687d Mon Sep 17 00:00:00 2001 From: dharini Date: Thu, 2 Sep 2021 08:12:10 -0700 Subject: [PATCH 56/60] =?UTF-8?q?fix:=20=F0=9F=90=9B=20update=20to=20orgur?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/tests/acceptance/auth-methods/create-test.js | 1 - ui/admin/tests/acceptance/auth-methods/list-test.js | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ui/admin/tests/acceptance/auth-methods/create-test.js b/ui/admin/tests/acceptance/auth-methods/create-test.js index 55a76243b..a9c9dea2d 100644 --- a/ui/admin/tests/acceptance/auth-methods/create-test.js +++ b/ui/admin/tests/acceptance/auth-methods/create-test.js @@ -72,7 +72,6 @@ module('Acceptance | auth-methods | create ', function (hooks) { 'create' ) ); - console.log(urls.orgURL); assert.ok(find(`[href="${urls.authMethods}"]`)); }); diff --git a/ui/admin/tests/acceptance/auth-methods/list-test.js b/ui/admin/tests/acceptance/auth-methods/list-test.js index 1dbe3f23f..3ca7925f7 100644 --- a/ui/admin/tests/acceptance/auth-methods/list-test.js +++ b/ui/admin/tests/acceptance/auth-methods/list-test.js @@ -12,7 +12,6 @@ import { module('Acceptance | auth-methods | list', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); - let orgURL; const instances = { scopes: { @@ -27,6 +26,7 @@ module('Acceptance | auth-methods | list', function (hooks) { org: null, }, authMethods: null, + orgScope: null, }; hooks.beforeEach(function () { @@ -48,14 +48,14 @@ module('Acceptance | auth-methods | list', function (hooks) { 'withChildren' ); - orgURL = `/scopes/${instances.orgScope.id}`; + urls.orgScope = `/scopes/${instances.orgScope.id}`; urls.authMethods = `/scopes/${instances.orgScope.id}/auth-methods`; authenticateSession({}); }); test('can navigate to auth methods with proper authorization', async function (assert) { assert.expect(2); - await visit(orgURL); + await visit(urls.orgScope); assert.ok( instances.orgScope.authorized_collection_actions['auth-methods'].includes( 'list' @@ -67,7 +67,7 @@ module('Acceptance | auth-methods | list', function (hooks) { test('User cannot navigate to index without either list or create actions', async function (assert) { assert.expect(2); instances.orgScope.authorized_collection_actions['auth-methods'] = []; - await visit(orgURL); + await visit(urls.orgScope); assert.notOk( instances.orgScope.authorized_collection_actions['auth-methods'].includes( 'list' @@ -81,7 +81,7 @@ module('Acceptance | auth-methods | list', function (hooks) { instances.orgScope.authorized_collection_actions['auth-methods'] = [ 'create', ]; - await visit(orgURL); + await visit(urls.orgScope); assert.ok(find(`[href="${urls.authMethods}"]`)); }); }); From 42283596b26f39707282efb1d21c1a20a92b0c12 Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Thu, 2 Sep 2021 08:13:47 -0700 Subject: [PATCH 57/60] Update list-test.js --- ui/admin/tests/acceptance/auth-methods/list-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/admin/tests/acceptance/auth-methods/list-test.js b/ui/admin/tests/acceptance/auth-methods/list-test.js index 3ca7925f7..c943c01e8 100644 --- a/ui/admin/tests/acceptance/auth-methods/list-test.js +++ b/ui/admin/tests/acceptance/auth-methods/list-test.js @@ -53,7 +53,7 @@ module('Acceptance | auth-methods | list', function (hooks) { authenticateSession({}); }); - test('can navigate to auth methods with proper authorization', async function (assert) { + test('Users can navigate to auth methods with proper authorization', async function (assert) { assert.expect(2); await visit(urls.orgScope); assert.ok( @@ -64,7 +64,7 @@ module('Acceptance | auth-methods | list', function (hooks) { assert.ok(find(`[href="${urls.authMethods}"]`)); }); - test('User cannot navigate to index without either list or create actions', async function (assert) { + test('Users cannot navigate to index without either list or create actions', async function (assert) { assert.expect(2); instances.orgScope.authorized_collection_actions['auth-methods'] = []; await visit(urls.orgScope); From 66b40e531848883804872745e2b8c4832db57a9d Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Thu, 2 Sep 2021 08:15:04 -0700 Subject: [PATCH 58/60] Update create-test.js --- ui/admin/tests/acceptance/auth-methods/create-test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/admin/tests/acceptance/auth-methods/create-test.js b/ui/admin/tests/acceptance/auth-methods/create-test.js index a9c9dea2d..8554157e1 100644 --- a/ui/admin/tests/acceptance/auth-methods/create-test.js +++ b/ui/admin/tests/acceptance/auth-methods/create-test.js @@ -50,7 +50,7 @@ module('Acceptance | auth-methods | create ', function (hooks) { urls.authMethod = `${urls.authMethods}/${instances.authMethod.id}`; }); - test('can create new auth method', async function (assert) { + test('Users can create new auth method', async function (assert) { assert.expect(1); const authMethodsCount = this.server.db.authMethods.length; await visit(urls.newAuthMethod); @@ -60,7 +60,7 @@ module('Acceptance | auth-methods | create ', function (hooks) { assert.equal(this.server.db.authMethods.length, authMethodsCount + 1); }); - test('can navigate to new auth-methods route with proper authorization', async function (assert) { + test('Users can navigate to new auth-methods route with proper authorization', async function (assert) { assert.expect(2); instances.orgScope.authorized_collection_actions['auth-methods'] = [ 'create', @@ -75,7 +75,7 @@ module('Acceptance | auth-methods | create ', function (hooks) { assert.ok(find(`[href="${urls.authMethods}"]`)); }); - test('cannot navigate to new auth-methods route without proper authorization', async function (assert) { + test('Users cannot navigate to new auth-methods route without proper authorization', async function (assert) { assert.expect(2); instances.orgScope.authorized_collection_actions['auth-methods'] = []; await visit(urls.orgURL); From 5e6a3e9d9a4ce98d8cbd00980d837823b46bb6ad Mon Sep 17 00:00:00 2001 From: dharini Date: Thu, 2 Sep 2021 09:48:28 -0700 Subject: [PATCH 59/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20merge=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/mirage/factories/scope.js | 2 +- ui/admin/app/routes/scopes/scope/roles.js | 8 +- .../app/routes/scopes/scope/roles/index.js | 9 ++- ui/admin/app/templates/scopes/scope.hbs | 13 +++- .../templates/scopes/scope/roles/index.hbs | 37 ++++++--- .../acceptance/auth-methods/create-test.js | 25 +++++-- .../acceptance/auth-methods/list-test.js | 8 -- .../{roles-test.js => roles/create-test.js} | 45 ++++++++--- ui/admin/tests/acceptance/roles/list-test.js | 75 +++++++++++++++++++ 9 files changed, 179 insertions(+), 43 deletions(-) rename ui/admin/tests/acceptance/{roles-test.js => roles/create-test.js} (70%) create mode 100644 ui/admin/tests/acceptance/roles/list-test.js diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index c98b1fa23..0e7056957 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -8,7 +8,7 @@ export default factory.extend({ return { users: ['create', 'list'], groups: ['create', 'list'], - // roles: ['create', 'list'], + roles: ['create', 'list'], 'auth-methods': ['create', 'list'], // sessopms: ['list'], // targets: ['create', 'list'], diff --git a/ui/admin/app/routes/scopes/scope/roles.js b/ui/admin/app/routes/scopes/scope/roles.js index 88d05373b..cbc1dfcc5 100644 --- a/ui/admin/app/routes/scopes/scope/roles.js +++ b/ui/admin/app/routes/scopes/scope/roles.js @@ -11,6 +11,7 @@ export default class ScopesScopeRolesRoute extends Route { @service intl; @service notify; @service session; + @service can; // =methods @@ -26,8 +27,11 @@ export default class ScopesScopeRolesRoute extends Route { * @return {Promise{[RoleModel]}} */ async model() { - const { id: scope_id } = this.modelFor('scopes.scope'); - return this.store.query('role', { scope_id }); + const scope = this.modelFor('scopes.scope'); + const { id: scope_id } = scope; + if (this.can.can('list collection', scope, { collection: 'roles' })) { + return this.store.query('role', { scope_id }); + } } // =actions diff --git a/ui/admin/app/routes/scopes/scope/roles/index.js b/ui/admin/app/routes/scopes/scope/roles/index.js index f2a8d7af1..56c143beb 100644 --- a/ui/admin/app/routes/scopes/scope/roles/index.js +++ b/ui/admin/app/routes/scopes/scope/roles/index.js @@ -1,3 +1,10 @@ import Route from '@ember/routing/route'; +export default class ScopesScopeRolesIndexRoute extends Route { + // =methods -export default class ScopesScopeRolesIndexRoute extends Route {} + setupController(controller) { + const scope = this.modelFor('scopes.scope'); + super.setupController(...arguments); + controller.setProperties({ scope }); + } +} diff --git a/ui/admin/app/templates/scopes/scope.hbs b/ui/admin/app/templates/scopes/scope.hbs index cabac1f4a..d8704d9c8 100644 --- a/ui/admin/app/templates/scopes/scope.hbs +++ b/ui/admin/app/templates/scopes/scope.hbs @@ -106,10 +106,15 @@ {{t 'resources.group.title_plural'}} {{/if}} - - - {{t 'resources.role.title_plural'}} - + {{#if (can 'navigate collection' @model collection='roles')}} + + + {{t 'resources.role.title_plural'}} + + {{/if}} {{#if (can 'navigate collection' @model collection='auth-methods')}} diff --git a/ui/admin/app/templates/scopes/scope/roles/index.hbs b/ui/admin/app/templates/scopes/scope/roles/index.hbs index ae8157f05..241093ea4 100644 --- a/ui/admin/app/templates/scopes/scope/roles/index.hbs +++ b/ui/admin/app/templates/scopes/scope/roles/index.hbs @@ -15,10 +15,12 @@ - {{#if @model}} - {{t - 'titles.new' - }} + {{#if (can 'create collection' this.scope collection='roles')}} + {{#if @model}} + {{t + 'titles.new' + }} + {{/if}} {{/if}} @@ -68,12 +70,29 @@ as |message| > - {{t 'resources.role.description'}} + {{#if (can 'list collection' this.scope collection='roles')}} + {{! can list (at least): show default welcome message}} + {{t 'resources.roles.description'}} + {{else if (can 'create collection' this.scope collection='roles')}} + {{! can create (only): show create-but-not-list welcome message}} + {{t + 'descriptions.create-but-not-list' + resource=(t 'resources.role.title_plural') + }} + {{else}} + {{! can neither list nor create }} + {{t + 'descriptions.neither-list-nor-create' + resource=(t 'resources.role.title_plural') + }} + {{/if}} - - - {{t 'titles.new'}} - + {{#if (can 'create collection' this.scope collection='roles')}} + + + {{t 'titles.new'}} + + {{/if}} diff --git a/ui/admin/tests/acceptance/auth-methods/create-test.js b/ui/admin/tests/acceptance/auth-methods/create-test.js index 8554157e1..684984999 100644 --- a/ui/admin/tests/acceptance/auth-methods/create-test.js +++ b/ui/admin/tests/acceptance/auth-methods/create-test.js @@ -19,6 +19,7 @@ module('Acceptance | auth-methods | create ', function (hooks) { scopes: { global: null, org: null, + project: null, }, authMethod: null, orgScope: null, @@ -29,14 +30,22 @@ module('Acceptance | auth-methods | create ', function (hooks) { authMethods: null, newAuthMethod: null, authMethod: null, - orgURL: null, }; hooks.beforeEach(function () { authenticateSession({}); - instances.orgScope = this.server.create('scope', { - type: 'org', - scope: { id: 'global', type: 'global' }, + instances.orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + + instances.scopes.project = this.server.create('scope', { + type: 'project', + scope: { id: instances.orgScope.id, type: instances.orgScope.type }, }); instances.authMethod = this.server.create('auth-method', { @@ -44,8 +53,8 @@ module('Acceptance | auth-methods | create ', function (hooks) { }); // Generate route URLs for resources - urls.orgURL = `/scopes/${instances.orgScope.id}`; - urls.authMethods = `${urls.orgURL}/auth-methods`; + urls.orgScope = `/scopes/${instances.orgScope.id}`; + urls.authMethods = `${urls.orgScope}/auth-methods`; urls.newAuthMethod = `${urls.authMethods}/new?type=password`; urls.authMethod = `${urls.authMethods}/${instances.authMethod.id}`; }); @@ -66,7 +75,7 @@ module('Acceptance | auth-methods | create ', function (hooks) { 'create', 'list', ]; - await visit(urls.orgURL); + await visit(urls.orgScope); assert.ok( instances.orgScope.authorized_collection_actions['auth-methods'].includes( 'create' @@ -78,7 +87,7 @@ module('Acceptance | auth-methods | create ', function (hooks) { test('Users cannot navigate to new auth-methods route without proper authorization', async function (assert) { assert.expect(2); instances.orgScope.authorized_collection_actions['auth-methods'] = []; - await visit(urls.orgURL); + await visit(urls.orgScope); assert.notOk( instances.orgScope.authorized_collection_actions['auth-methods'].includes( 'create' diff --git a/ui/admin/tests/acceptance/auth-methods/list-test.js b/ui/admin/tests/acceptance/auth-methods/list-test.js index c943c01e8..385c8cb1a 100644 --- a/ui/admin/tests/acceptance/auth-methods/list-test.js +++ b/ui/admin/tests/acceptance/auth-methods/list-test.js @@ -39,14 +39,6 @@ module('Acceptance | auth-methods | list', function (hooks) { }, 'withChildren' ); - instances.org = this.server.create( - 'scope', - { - type: 'org', - scope: { id: 'global', type: 'global' }, - }, - 'withChildren' - ); urls.orgScope = `/scopes/${instances.orgScope.id}`; urls.authMethods = `/scopes/${instances.orgScope.id}/auth-methods`; diff --git a/ui/admin/tests/acceptance/roles-test.js b/ui/admin/tests/acceptance/roles/create-test.js similarity index 70% rename from ui/admin/tests/acceptance/roles-test.js rename to ui/admin/tests/acceptance/roles/create-test.js index 77b971f46..a0564f67d 100644 --- a/ui/admin/tests/acceptance/roles-test.js +++ b/ui/admin/tests/acceptance/roles/create-test.js @@ -11,7 +11,7 @@ import { //invalidateSession, } from 'ember-simple-auth/test-support'; -module('Acceptance | roles', function (hooks) { +module('Acceptance | roles | create', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); @@ -22,38 +22,44 @@ module('Acceptance | roles', function (hooks) { project: null, }, role: null, + orgScope: null, }; const urls = { - orgScope: null, roles: null, role: null, newRole: null, + orgScope: null, }; hooks.beforeEach(function () { authenticateSession({}); - instances.scopes.global = this.server.create('scope', { id: 'global' }); - instances.scopes.org = this.server.create('scope', { - type: 'org', - scope: { id: 'global', type: 'global' }, - }); + instances.orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + // The project scope is not yet used for role tests (though it will be // in the future). This is created simply to test the grant scope loading // mechanism. instances.scopes.project = this.server.create('scope', { type: 'project', - scope: { id: instances.scopes.org.id, type: instances.scopes.org.type }, + scope: { id: instances.orgScope.id, type: instances.orgScope.type }, }); instances.role = this.server.create( 'role', { - scope: instances.scopes.org, + scope: instances.orgScope, }, 'withPrincipals' ); - urls.roles = `/scopes/${instances.scopes.org.id}/roles`; + urls.roles = `/scopes/${instances.orgScope.id}/roles`; urls.role = `${urls.roles}/${instances.role.id}`; urls.newRole = `${urls.roles}/new`; + urls.orgScope = `/scopes/${instances.orgScope.id}`; }); test('can create new role', async function (assert) { @@ -65,6 +71,25 @@ module('Acceptance | roles', function (hooks) { assert.equal(this.server.db.roles.length, rolesCount + 1); }); + test('Users can navigate to new roles route with proper authorization', async function (assert) { + assert.expect(2); + await visit(urls.orgScope); + assert.ok( + instances.orgScope.authorized_collection_actions.roles.includes('create') + ); + assert.ok(find(`[href="${urls.roles}"]`)); + }); + + test('Users cannot navigate to new roles route without proper authorization', async function (assert) { + assert.expect(2); + instances.orgScope.authorized_collection_actions.roles = []; + await visit(urls.orgScope); + assert.notOk( + instances.orgScope.authorized_collection_actions.roles.includes('create') + ); + assert.notOk(find(`[href="${urls.roles}"]`)); + }); + test('can cancel new role creation', async function (assert) { assert.expect(2); const rolesCount = this.server.db.roles.length; diff --git a/ui/admin/tests/acceptance/roles/list-test.js b/ui/admin/tests/acceptance/roles/list-test.js new file mode 100644 index 000000000..ff170aeb7 --- /dev/null +++ b/ui/admin/tests/acceptance/roles/list-test.js @@ -0,0 +1,75 @@ +import { module, test } from 'qunit'; +import { visit, find } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { + authenticateSession, + // These are left here intentionally for future reference. + //currentSession, + //invalidateSession, +} from 'ember-simple-auth/test-support'; + +module('Acceptance | roles | list', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + + const instances = { + scopes: { + global: null, + org: null, + }, + orgScope: null, + }; + + const urls = { + scopes: { + org: null, + }, + roles: null, + orgScope: null, + }; + + hooks.beforeEach(function () { + instances.orgScope = this.server.create( + 'scope', + { + type: 'org', + scope: { id: 'global', type: 'global' }, + }, + 'withChildren' + ); + instances.role = this.server.create('role', { + scope: instances.orgScope, + }); + urls.orgScope = `/scopes/${instances.orgScope.id}`; + + urls.roles = `/scopes/${instances.orgScope.id}/roles`; + authenticateSession({}); + }); + + test('Users can navigate to roles with proper authorization', async function (assert) { + assert.expect(2); + await visit(urls.orgScope); + assert.ok( + instances.orgScope.authorized_collection_actions.roles.includes('list') + ); + assert.ok(find(`[href="${urls.roles}"]`)); + }); + + test('Users cannot navigate to index without either list or create actions', async function (assert) { + assert.expect(2); + instances.orgScope.authorized_collection_actions.roles = []; + await visit(urls.orgScope); + assert.notOk( + instances.orgScope.authorized_collection_actions.roles.includes('list') + ); + assert.notOk(find(`[href="${urls.roles}"]`)); + }); + + test('Users can navigate to index with only create action', async function (assert) { + assert.expect(1); + instances.orgScope.authorized_collection_actions.roles = ['create']; + await visit(urls.orgScope); + assert.ok(find(`[href="${urls.roles}"]`)); + }); +}); From 0ed506a111e5abfc5cf1d95d23eb9af701b88874 Mon Sep 17 00:00:00 2001 From: dharini Date: Thu, 2 Sep 2021 10:22:47 -0700 Subject: [PATCH 60/60] =?UTF-8?q?chore:=20=F0=9F=A4=96=20merge=20main=20+?= =?UTF-8?q?=20resolve=20conflicts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/mirage/factories/scope.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index 523693a4e..f4c7073f7 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -3,11 +3,6 @@ import { trait } from 'ember-cli-mirage'; export default factory.extend({ type: 'global', - authorized_collection_actions: () => { - return { - 'host-catalogs': ['create', 'list'], - }; - }, authorized_collection_actions: () => { return { @@ -17,7 +12,7 @@ export default factory.extend({ // 'auth-methods': ['create', 'list'], // sessopms: ['list'], // targets: ['create', 'list'], - // 'host-catalogs': ['create', 'list'], + 'host-catalogs': ['create', 'list'], // 'credential-stores': ['create', 'list'], }; },