From 28d69b631f1efe1f5700c3f68ad16889ed360943 Mon Sep 17 00:00:00 2001 From: Paul Watts Date: Wed, 19 Aug 2020 15:15:11 -0700 Subject: [PATCH] Begin updating syntax I know we can update to angle bracket components. Can we also update to the {{fn}} helper? --- tests/dummy/app/controllers/application.js | 40 +++++++++--------- tests/dummy/app/templates/application.hbs | 8 ++-- .../dummy/app/templates/attribute-verify.hbs | 7 ++-- tests/dummy/app/templates/attribute.hbs | 9 ++-- tests/dummy/app/templates/change-password.hbs | 5 ++- .../templates/components/attribute-route.hbs | 24 +++++------ .../components/attribute-verify-route.hbs | 12 +++--- .../components/change-password-route.hbs | 26 ++++++------ .../components/delete-user-route.hbs | 14 +++---- .../forgot-password-confirm-route.hbs | 34 +++++++-------- .../forgot-password-index-route.hbs | 12 +++--- .../app/templates/components/index-auth.hbs | 24 +++++------ .../app/templates/components/index-unauth.hbs | 4 +- .../components/login-index-route.hbs | 26 ++++++------ .../components/login-new-password-route.hbs | 12 +++--- .../components/register-confirm-route.hbs | 24 +++++------ .../components/register-index-route.hbs | 42 ++++++++++--------- .../components/register-resend-route.hbs | 12 +++--- tests/dummy/app/templates/delete-user.hbs | 5 ++- .../app/templates/forgot-password/confirm.hbs | 5 ++- .../app/templates/forgot-password/index.hbs | 5 ++- tests/dummy/app/templates/index.hbs | 4 +- tests/dummy/app/templates/login/index.hbs | 5 ++- .../app/templates/login/new-password.hbs | 2 +- .../dummy/app/templates/register/confirm.hbs | 5 ++- tests/dummy/app/templates/register/index.hbs | 8 ++-- tests/dummy/app/templates/register/resend.hbs | 5 ++- 27 files changed, 195 insertions(+), 184 deletions(-) diff --git a/tests/dummy/app/controllers/application.js b/tests/dummy/app/controllers/application.js index 4085948..c981f29 100644 --- a/tests/dummy/app/controllers/application.js +++ b/tests/dummy/app/controllers/application.js @@ -1,17 +1,17 @@ import Controller from '@ember/controller'; import { inject as service } from '@ember/service'; -import { set } from '@ember/object'; +import { action, set } from '@ember/object'; import { alias } from '@ember/object/computed'; -export default Controller.extend({ - cognito: service(), - currentUser: service(), - session: service(), - poolId: alias('cognito.poolId'), - clientId: alias('cognito.clientId'), +export default class ApplicationController extends Controller { + @service cognito; + @service currentUser; + @service session; + @alias('cognito.poolId') poolId; + @alias('cognito.clientId') clientId; - init() { - this._super(...arguments); + constructor() { + super(...arguments); let poolId = localStorage.getItem('ember-cognito/dummy/poolId'); let clientId = localStorage.getItem('ember-cognito/dummy/clientId'); // Ignore the defaults, which are used to test the configuration in unit tests @@ -22,17 +22,17 @@ export default Controller.extend({ } set(this, 'poolId', poolId); set(this, 'clientId', clientId); - }, + } - actions: { - saveIds(e) { - e.preventDefault(); - localStorage.setItem('ember-cognito/dummy/poolId', this.poolId); - localStorage.setItem('ember-cognito/dummy/clientId', this.clientId); - }, + @action + saveIds(e) { + e.preventDefault(); + localStorage.setItem('ember-cognito/dummy/poolId', this.poolId); + localStorage.setItem('ember-cognito/dummy/clientId', this.clientId); + } - logout() { - this.session.invalidate(); - } + @action + logout() { + this.session.invalidate(); } -}); +} diff --git a/tests/dummy/app/templates/application.hbs b/tests/dummy/app/templates/application.hbs index 9876147..c1997cf 100644 --- a/tests/dummy/app/templates/application.hbs +++ b/tests/dummy/app/templates/application.hbs @@ -1,8 +1,8 @@