From f443942e03e270e05d1de1d7ea9f6ebe0a0d434b Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 27 Aug 2018 22:10:15 +0200 Subject: [PATCH] Authorize onboarding (#1603) * Tweak onboarding + authorize * Authorize/Onboarding pimp * More tweaks * Comments --- gulp/tasks/translations.js | 3 + package.json | 1 + src/auth/ha-auth-flow.js | 191 ++++++++++++------ src/auth/ha-authorize.js | 126 +++++++----- src/auth/ha-pick-auth-provider.js | 47 +---- src/components/ha-form.js | 2 +- src/entrypoints/app.js | 6 +- src/entrypoints/authorize.js | 3 +- src/html/_header.html.template | 15 ++ ....html.template => authorize.html.template} | 41 ++-- src/html/index.html.template | 24 +-- src/html/onboarding.html.template | 57 ++++++ src/mixins/localize-lite-mixin.js | 52 +++++ src/onboarding/ha-onboarding.js | 111 +++++----- src/translations/en.json | 69 +++++++ webpack.config.js | 3 +- yarn.lock | 4 + 17 files changed, 514 insertions(+), 241 deletions(-) create mode 100644 src/html/_header.html.template rename src/html/{extra_page.html.template => authorize.html.template} (51%) create mode 100644 src/html/onboarding.html.template create mode 100644 src/mixins/localize-lite-mixin.js diff --git a/gulp/tasks/translations.js b/gulp/tasks/translations.js index 8399cacb71..108adeb38c 100755 --- a/gulp/tasks/translations.js +++ b/gulp/tasks/translations.js @@ -22,7 +22,10 @@ const TRANSLATION_FRAGMENTS = [ 'history', 'logbook', 'mailbox', + 'profile', 'shopping-list', + 'page-authorize', + 'page-onboarding', ]; const tasks = []; diff --git a/package.json b/package.json index ad37eaa480..7a37ff543f 100644 --- a/package.json +++ b/package.json @@ -117,6 +117,7 @@ "polymer-analyzer": "^3.0.1", "polymer-bundler": "^4.0.1", "polymer-cli": "^1.7.4", + "raw-loader": "^0.5.1", "reify": "^0.16.2", "require-dir": "^1.0.0", "sinon": "^6.0.0", diff --git a/src/auth/ha-auth-flow.js b/src/auth/ha-auth-flow.js index 1a6455eb3a..19c89a392d 100644 --- a/src/auth/ha-auth-flow.js +++ b/src/auth/ha-auth-flow.js @@ -2,46 +2,64 @@ import { PolymerElement } from '@polymer/polymer/polymer-element.js'; import '@polymer/paper-button/paper-button.js'; import { html } from '@polymer/polymer/lib/utils/html-tag.js'; import '../components/ha-form.js'; -import EventsMixin from '../mixins/events-mixin.js'; +import LocalizeLiteMixin from '../mixins/localize-lite-mixin.js'; -/* - * @appliesMixin EventsMixin - */ -class HaAuthFlow extends EventsMixin(PolymerElement) { +class HaAuthFlow extends LocalizeLiteMixin(PolymerElement) { static get template() { return html` - - -