From a62d36af921f19e16d10438cd30b440218db2020 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Fri, 2 Apr 2021 16:06:38 -0400 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20auth=20callbac?= =?UTF-8?q?k=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/translations/en-us.yaml | 4 ++++ ui/admin/app/router.js | 3 +++ ui/admin/app/routes/authentication-complete.js | 3 +++ ui/admin/app/routes/authentication-error.js | 3 +++ ui/admin/app/styles/app.scss | 6 ++++++ ui/admin/app/templates/authentication-complete.hbs | 12 ++++++++++++ ui/admin/app/templates/authentication-error.hbs | 12 ++++++++++++ .../unit/routes/authentication-complete-test.js | 11 +++++++++++ .../tests/unit/routes/authentication-error-test.js | 11 +++++++++++ 9 files changed, 65 insertions(+) create mode 100644 ui/admin/app/routes/authentication-complete.js create mode 100644 ui/admin/app/routes/authentication-error.js create mode 100644 ui/admin/app/templates/authentication-complete.hbs create mode 100644 ui/admin/app/templates/authentication-error.hbs create mode 100644 ui/admin/tests/unit/routes/authentication-complete-test.js create mode 100644 ui/admin/tests/unit/routes/authentication-error-test.js diff --git a/addons/core/translations/en-us.yaml b/addons/core/translations/en-us.yaml index 903253cde..f12dfd65c 100644 --- a/addons/core/translations/en-us.yaml +++ b/addons/core/translations/en-us.yaml @@ -1,10 +1,14 @@ auth: titles: no-scopes: No Scopes Available + flow-success: Successful authentication + flow-error: Could not authenticate to provider descriptions: no-scopes: No scopes were found. To authenticate, ask your administrator to create an scope and grant you access. choose-org: Choose a scope to authenticate. authenticating-with-org: "You are authenticating with {name}." + flow-success: You've successfully authenticated. You may now close this window and return to the client. + flow-error: Something went wrong while authenticating with the provider. Please close this window and try again. If the problem persists, notify your administrator. origin: connected-to: Connected to titles: diff --git a/ui/admin/app/router.js b/ui/admin/app/router.js index ddfe7f488..97294b7ac 100644 --- a/ui/admin/app/router.js +++ b/ui/admin/app/router.js @@ -7,6 +7,9 @@ export default class Router extends EmberRouter { } Router.map(function () { + this.route('authentication-complete'); + this.route('authentication-error'); + this.route('scopes', function () { this.route('scope', { path: ':scope_id' }, function () { this.route('authenticate', function () { diff --git a/ui/admin/app/routes/authentication-complete.js b/ui/admin/app/routes/authentication-complete.js new file mode 100644 index 000000000..33e15de1e --- /dev/null +++ b/ui/admin/app/routes/authentication-complete.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class AuthenticationCompleteRoute extends Route {} diff --git a/ui/admin/app/routes/authentication-error.js b/ui/admin/app/routes/authentication-error.js new file mode 100644 index 000000000..e7eba2739 --- /dev/null +++ b/ui/admin/app/routes/authentication-error.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class AuthenticationErrorRoute extends Route {} diff --git a/ui/admin/app/styles/app.scss b/ui/admin/app/styles/app.scss index 134df4cd9..b41ac52d3 100644 --- a/ui/admin/app/styles/app.scss +++ b/ui/admin/app/styles/app.scss @@ -4,6 +4,12 @@ @import 'rose'; @import 'notify'; +.rose-layout-global { + .rose-layout-global-body { + justify-content: center; + } +} + .rose-layout-centered { > .rose-layout-page { width: sizing.rems(l) * 18; diff --git a/ui/admin/app/templates/authentication-complete.hbs b/ui/admin/app/templates/authentication-complete.hbs new file mode 100644 index 000000000..cb1fb8eb3 --- /dev/null +++ b/ui/admin/app/templates/authentication-complete.hbs @@ -0,0 +1,12 @@ +{{page-title (t 'auth.titles.flow-success')}} + +
+ + + {{t "auth.descriptions.flow-success"}} + + +
diff --git a/ui/admin/app/templates/authentication-error.hbs b/ui/admin/app/templates/authentication-error.hbs new file mode 100644 index 000000000..477f35d3f --- /dev/null +++ b/ui/admin/app/templates/authentication-error.hbs @@ -0,0 +1,12 @@ +{{page-title (t "auth.titles.flow-error")}} + +
+ + + {{t "auth.descriptions.flow-error"}} + + +
diff --git a/ui/admin/tests/unit/routes/authentication-complete-test.js b/ui/admin/tests/unit/routes/authentication-complete-test.js new file mode 100644 index 000000000..6005fe0b4 --- /dev/null +++ b/ui/admin/tests/unit/routes/authentication-complete-test.js @@ -0,0 +1,11 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Route | authentication-complete', function (hooks) { + setupTest(hooks); + + test('it exists', function (assert) { + let route = this.owner.lookup('route:authentication-complete'); + assert.ok(route); + }); +}); diff --git a/ui/admin/tests/unit/routes/authentication-error-test.js b/ui/admin/tests/unit/routes/authentication-error-test.js new file mode 100644 index 000000000..2cda681a6 --- /dev/null +++ b/ui/admin/tests/unit/routes/authentication-error-test.js @@ -0,0 +1,11 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Route | authentication-error', function (hooks) { + setupTest(hooks); + + test('it exists', function (assert) { + let route = this.owner.lookup('route:authentication-error'); + assert.ok(route); + }); +}); From 746f45b6da4d219a88051f3d23423610053f161f Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Fri, 2 Apr 2021 18:56:16 -0400 Subject: [PATCH 2/2] chore: remove "provider" from auth strings --- addons/core/translations/en-us.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/core/translations/en-us.yaml b/addons/core/translations/en-us.yaml index f12dfd65c..4b5017cab 100644 --- a/addons/core/translations/en-us.yaml +++ b/addons/core/translations/en-us.yaml @@ -2,13 +2,13 @@ auth: titles: no-scopes: No Scopes Available flow-success: Successful authentication - flow-error: Could not authenticate to provider + flow-error: Could not authenticate descriptions: no-scopes: No scopes were found. To authenticate, ask your administrator to create an scope and grant you access. choose-org: Choose a scope to authenticate. authenticating-with-org: "You are authenticating with {name}." flow-success: You've successfully authenticated. You may now close this window and return to the client. - flow-error: Something went wrong while authenticating with the provider. Please close this window and try again. If the problem persists, notify your administrator. + flow-error: Something went wrong while authenticating. Please close this window and try again. If the problem persists, notify your administrator. origin: connected-to: Connected to titles: