From 330a7ceb3b1cc65759e00319a63c19b28b747be6 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Mon, 27 Jul 2020 14:34:39 -0400 Subject: [PATCH 1/7] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Update=20deauthenti?= =?UTF-8?q?cate=20params=20to=20still=20use=20org=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of session invalidation being provided: { scope: { id: scopeID } }, it gets: {authenticator: "authenticator:password", org_id: "1"}. --- ui/core/app/authenticators/password.js | 2 +- ui/core/translations/en-us.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/core/app/authenticators/password.js b/ui/core/app/authenticators/password.js index 3224130a3..bd2011911 100644 --- a/ui/core/app/authenticators/password.js +++ b/ui/core/app/authenticators/password.js @@ -38,7 +38,7 @@ export default class PasswordAuthenticator extends BasePasswordAuthenticator { * @param {string} scopeID * @return {string} */ - buildDeauthEndpointURL({ scope: { id: scopeID } }) { + buildDeauthEndpointURL({ authenticator, org_id: scopeID }) { const adapter = this.store.adapterFor('application'); const options = { adapterOptions: { method: 'deauthenticate' } }; return adapter.buildURL('scope', scopeID, options, 'findRecord'); diff --git a/ui/core/translations/en-us.yaml b/ui/core/translations/en-us.yaml index e770de25c..f01e4cf72 100644 --- a/ui/core/translations/en-us.yaml +++ b/ui/core/translations/en-us.yaml @@ -4,6 +4,7 @@ actions: dismiss: Dismiss save: Save help: Need help? + deauthenticate: Deauthenticate resources: user: User users: Users From 356c02b3658ada49984c203896f181fea55fd99b Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Mon, 27 Jul 2020 14:48:33 -0400 Subject: [PATCH 2/7] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Show=20sidebar=20on?= =?UTF-8?q?ly=20when=20authenticated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/core/app/templates/scopes/scope.hbs | 46 ++++++++++++++------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/ui/core/app/templates/scopes/scope.hbs b/ui/core/app/templates/scopes/scope.hbs index 2d1a73607..276ca4835 100644 --- a/ui/core/app/templates/scopes/scope.hbs +++ b/ui/core/app/templates/scopes/scope.hbs @@ -1,32 +1,34 @@ + {{#if this.session.isAuthenticated}} + - + + + {{t "resources.projects"}} + + - - - {{t "resources.projects"}} - - + {{outlet "sidebar"}} - {{outlet "sidebar"}} - - {{!-- - - - {{t "resources.users"}} - - - {{t "resources.groups"}} - + {{!-- + + + {{t "resources.users"}} + - - {{t "resources.roles"}} - - - --}} + + {{t "resources.groups"}} + - + + {{t "resources.roles"}} + + + --}} + + + {{/if}}
From 3f1a7f155c2f57dc7034b57e3c52f5eda0bfdc68 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Mon, 27 Jul 2020 14:49:42 -0400 Subject: [PATCH 3/7] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Port=20authenticate?= =?UTF-8?q?=20template=20from=20pre-scope=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/scopes/scope/authenticate.hbs | 6 ++++- .../scopes/scope/authenticate/index.hbs | 1 - .../scopes/scope/authenticate/method.hbs | 26 +++++++++++++++++++ ui/core/translations/en-us.yaml | 16 ++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/ui/core/app/templates/scopes/scope/authenticate.hbs b/ui/core/app/templates/scopes/scope/authenticate.hbs index e2147cab0..5471432d9 100644 --- a/ui/core/app/templates/scopes/scope/authenticate.hbs +++ b/ui/core/app/templates/scopes/scope/authenticate.hbs @@ -1 +1,5 @@ -{{outlet}} \ No newline at end of file + +
+ {{outlet}} +
+
diff --git a/ui/core/app/templates/scopes/scope/authenticate/index.hbs b/ui/core/app/templates/scopes/scope/authenticate/index.hbs index e2147cab0..e69de29bb 100644 --- a/ui/core/app/templates/scopes/scope/authenticate/index.hbs +++ b/ui/core/app/templates/scopes/scope/authenticate/index.hbs @@ -1 +0,0 @@ -{{outlet}} \ No newline at end of file diff --git a/ui/core/app/templates/scopes/scope/authenticate/method.hbs b/ui/core/app/templates/scopes/scope/authenticate/method.hbs index 60057d773..c6e4157e2 100644 --- a/ui/core/app/templates/scopes/scope/authenticate/method.hbs +++ b/ui/core/app/templates/scopes/scope/authenticate/method.hbs @@ -1,3 +1,29 @@ +{{#if @model}} +

{{t 'actions.authenticate'}}

+

{{t "auth.descriptions.choose-org"}}

+ + {{#each @model as |org|}} + + {{org.displayName}} + + {{/each}} + +{{/if}} + +{{#unless @model}} + + + {{t "auth.descriptions.no-orgs"}} + + +{{/unless}} + Date: Mon, 27 Jul 2020 16:19:08 -0400 Subject: [PATCH 4/7] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Update=20auth=20tem?= =?UTF-8?q?plates=20under=20scopes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/core/app/authenticators/password.js | 2 +- ui/core/app/router.js | 1 - ui/core/app/routes/scopes/scope.js | 1 - ui/core/app/templates/scopes/scope.hbs | 45 ++++++++-------- .../templates/scopes/scope/authenticate.hbs | 53 +++++++++++++++++-- .../scopes/scope/authenticate/index.hbs | 12 +++++ .../scopes/scope/authenticate/method.hbs | 26 --------- ui/core/app/templates/scopes/scope/index.hbs | 2 +- ui/core/mirage/scenarios/default.js | 11 ++++ 9 files changed, 96 insertions(+), 57 deletions(-) diff --git a/ui/core/app/authenticators/password.js b/ui/core/app/authenticators/password.js index bd2011911..41e75d078 100644 --- a/ui/core/app/authenticators/password.js +++ b/ui/core/app/authenticators/password.js @@ -38,7 +38,7 @@ export default class PasswordAuthenticator extends BasePasswordAuthenticator { * @param {string} scopeID * @return {string} */ - buildDeauthEndpointURL({ authenticator, org_id: scopeID }) { + buildDeauthEndpointURL({ org_id: scopeID }) { const adapter = this.store.adapterFor('application'); const options = { adapterOptions: { method: 'deauthenticate' } }; return adapter.buildURL('scope', scopeID, options, 'findRecord'); diff --git a/ui/core/app/router.js b/ui/core/app/router.js index 3c95ac355..ef3536c60 100644 --- a/ui/core/app/router.js +++ b/ui/core/app/router.js @@ -18,7 +18,6 @@ Router.map(function () { this.route('new'); }); }); - this.route('cope'); }); this.route('orgs', function () { diff --git a/ui/core/app/routes/scopes/scope.js b/ui/core/app/routes/scopes/scope.js index c9ecb358f..939ef5076 100644 --- a/ui/core/app/routes/scopes/scope.js +++ b/ui/core/app/routes/scopes/scope.js @@ -23,5 +23,4 @@ export default class ScopesScopeRoute extends Route { return maybeExistingScope || this.store.createRecord('scope', { id }); }); } - } diff --git a/ui/core/app/templates/scopes/scope.hbs b/ui/core/app/templates/scopes/scope.hbs index 276ca4835..35287c253 100644 --- a/ui/core/app/templates/scopes/scope.hbs +++ b/ui/core/app/templates/scopes/scope.hbs @@ -1,34 +1,31 @@ - {{#if this.session.isAuthenticated}} - - - - {{t "resources.projects"}} - - + + + + {{t "resources.projects"}} + + - {{outlet "sidebar"}} + {{outlet "sidebar"}} - {{!-- - - - {{t "resources.users"}} - + {{!-- + + + {{t "resources.users"}} + - - {{t "resources.groups"}} - + + {{t "resources.groups"}} + - - {{t "resources.roles"}} - - - --}} - - - {{/if}} + + {{t "resources.roles"}} + + + --}} +
diff --git a/ui/core/app/templates/scopes/scope/authenticate.hbs b/ui/core/app/templates/scopes/scope/authenticate.hbs index 5471432d9..c0e8c5485 100644 --- a/ui/core/app/templates/scopes/scope/authenticate.hbs +++ b/ui/core/app/templates/scopes/scope/authenticate.hbs @@ -1,5 +1,52 @@ -
- {{outlet}} -
+ + + +

{{t 'actions.authenticate'}}

+

{{t 'auth.descriptions.authenticating-with-org' name=@model.scope.displayName}}

+
+ + + + + {{#each @model.scopes as |scope|}} + + {{scope.displayName}} + + {{/each}} + + + + + + {{#each @model.authMethods as |authMethod|}} + + {{t (concat 'auth.method-types.' authMethod.type)}} + + {{/each}} + + + + + {{#if @model.authMethods}} + {{outlet}} + {{/if}} + {{#unless @model.authMethods}} + + + + {{t "auth.descriptions.no-methods"}} + + + + {{/unless}} + + +
diff --git a/ui/core/app/templates/scopes/scope/authenticate/index.hbs b/ui/core/app/templates/scopes/scope/authenticate/index.hbs index e69de29bb..22cc46f4e 100644 --- a/ui/core/app/templates/scopes/scope/authenticate/index.hbs +++ b/ui/core/app/templates/scopes/scope/authenticate/index.hbs @@ -0,0 +1,12 @@ +{{#unless @model}} + + + + {{t "auth.descriptions.no-methods"}} + + + +{{/unless}} diff --git a/ui/core/app/templates/scopes/scope/authenticate/method.hbs b/ui/core/app/templates/scopes/scope/authenticate/method.hbs index c6e4157e2..60057d773 100644 --- a/ui/core/app/templates/scopes/scope/authenticate/method.hbs +++ b/ui/core/app/templates/scopes/scope/authenticate/method.hbs @@ -1,29 +1,3 @@ -{{#if @model}} -

{{t 'actions.authenticate'}}

-

{{t "auth.descriptions.choose-org"}}

- - {{#each @model as |org|}} - - {{org.displayName}} - - {{/each}} - -{{/if}} - -{{#unless @model}} - - - {{t "auth.descriptions.no-orgs"}} - - -{{/unless}} - Date: Tue, 28 Jul 2020 10:31:40 -0400 Subject: [PATCH 5/7] chore: tweak input sizing and media queries --- addons/rose/addon/styles/rose/components/form/_input.scss | 1 + addons/rose/addon/styles/rose/variables/_media.scss | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/rose/addon/styles/rose/components/form/_input.scss b/addons/rose/addon/styles/rose/components/form/_input.scss index 6c0186b50..7b11a0a8e 100644 --- a/addons/rose/addon/styles/rose/components/form/_input.scss +++ b/addons/rose/addon/styles/rose/components/form/_input.scss @@ -19,6 +19,7 @@ .rose-form-input-field { @include type.type(m); + box-sizing: border-box; margin-bottom: sizing.rems(xs); padding: sizing.rems(xs); color: var(--stark); diff --git a/addons/rose/addon/styles/rose/variables/_media.scss b/addons/rose/addon/styles/rose/variables/_media.scss index 289c96ad9..95d1ab86d 100644 --- a/addons/rose/addon/styles/rose/variables/_media.scss +++ b/addons/rose/addon/styles/rose/variables/_media.scss @@ -9,7 +9,7 @@ $width-breakpoints: ( xlarge: 1200px, large: 1024px, medium: 768px, - small: 480px, + small: 540px, xsmall: 320px, ); From 0b974f122c46baec937a920578b07adba41508c5 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 28 Jul 2020 10:36:41 -0400 Subject: [PATCH 6/7] chore: hide sidebar when not authenticated --- ui/core/app/controllers/scopes/scope.js | 10 +++++ ui/core/app/templates/scopes/scope.hbs | 44 ++++++++++--------- .../unit/controllers/scopes/scope-test.js | 12 +++++ 3 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 ui/core/app/controllers/scopes/scope.js create mode 100644 ui/core/tests/unit/controllers/scopes/scope-test.js diff --git a/ui/core/app/controllers/scopes/scope.js b/ui/core/app/controllers/scopes/scope.js new file mode 100644 index 000000000..5bc636752 --- /dev/null +++ b/ui/core/app/controllers/scopes/scope.js @@ -0,0 +1,10 @@ +import Controller from '@ember/controller'; +import { inject as service } from '@ember/service'; + +export default class ScopesScopeController extends Controller { + + // =services + + @service session; + +} diff --git a/ui/core/app/templates/scopes/scope.hbs b/ui/core/app/templates/scopes/scope.hbs index 35287c253..172eefc48 100644 --- a/ui/core/app/templates/scopes/scope.hbs +++ b/ui/core/app/templates/scopes/scope.hbs @@ -1,31 +1,33 @@ - - - - {{t "resources.projects"}} - - + {{#if this.session.isAuthenticated}} + + + + {{t "resources.projects"}} + + - {{outlet "sidebar"}} + {{outlet "sidebar"}} - {{!-- - - - {{t "resources.users"}} - + {{!-- + + + {{t "resources.users"}} + - - {{t "resources.groups"}} - + + {{t "resources.groups"}} + - - {{t "resources.roles"}} - - - --}} - + + {{t "resources.roles"}} + + + --}} + + {{/if}}
diff --git a/ui/core/tests/unit/controllers/scopes/scope-test.js b/ui/core/tests/unit/controllers/scopes/scope-test.js new file mode 100644 index 000000000..ec2c389bb --- /dev/null +++ b/ui/core/tests/unit/controllers/scopes/scope-test.js @@ -0,0 +1,12 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Controller | scopes/scope', function(hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function(assert) { + let controller = this.owner.lookup('controller:scopes/scope'); + assert.ok(controller); + }); +}); From acf45fada90d904e584f7b9d32cd261b7d6bbfc6 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 28 Jul 2020 10:39:35 -0400 Subject: [PATCH 7/7] chore: add page title --- ui/core/app/templates/scopes/scope/authenticate.hbs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/core/app/templates/scopes/scope/authenticate.hbs b/ui/core/app/templates/scopes/scope/authenticate.hbs index c0e8c5485..43b329188 100644 --- a/ui/core/app/templates/scopes/scope/authenticate.hbs +++ b/ui/core/app/templates/scopes/scope/authenticate.hbs @@ -1,15 +1,17 @@ +{{title (t "actions.authenticate")}} + -

{{t 'actions.authenticate'}}

-

{{t 'auth.descriptions.authenticating-with-org' name=@model.scope.displayName}}

+

{{t "actions.authenticate"}}

+

{{t "auth.descriptions.authenticating-with-org" name=@model.scope.displayName}}

{{#each @model.scopes as |scope|}} @@ -24,7 +26,7 @@ {{#each @model.authMethods as |authMethod|}} - {{t (concat 'auth.method-types.' authMethod.type)}} + {{t (concat "auth.method-types." authMethod.type)}} {{/each}}