From a6b87bf5019e05d103d229ef910e40b3c1703da0 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 4 Apr 2018 16:29:43 -0400 Subject: [PATCH] u2f support on 2fa page --- jslib | 2 +- src/_locales/en/messages.json | 3 ++ src/popup2/accounts/two-factor.component.html | 44 ++++++++++++++----- src/popup2/accounts/two-factor.component.ts | 6 ++- src/scss/box.scss | 4 ++ src/scss/misc.scss | 21 ++++++++- 6 files changed, 64 insertions(+), 16 deletions(-) diff --git a/jslib b/jslib index f673bd62d7a..013bf20a35c 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit f673bd62d7abb773fa5a6abfb5307b7c3feca59b +Subproject commit 013bf20a35c74383389337ac2c5ae9ac19a0bba7 diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index fba05c0e714..0cb4c619408 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -1049,5 +1049,8 @@ "organization": { "message": "Organization", "description": "An entity of multiple related people (ex. a team or business organization)." + }, + "loading": { + "message": "Loading..." } } diff --git a/src/popup2/accounts/two-factor.component.html b/src/popup2/accounts/two-factor.component.html index c744d34d683..4ce0377eebe 100644 --- a/src/popup2/accounts/two-factor.component.html +++ b/src/popup2/accounts/two-factor.component.html @@ -1,7 +1,7 @@
{{title}} @@ -17,13 +17,15 @@
-
-

{{'enterVerificationCodeApp' | i18n}}

-

+

+ + {{'enterVerificationCodeApp' | i18n}} + + {{'enterVerificationCodeEmail' | i18n : twoFactorEmail}} -

+
-
+
@@ -37,11 +39,11 @@
-
+

{{'insertYubiKey' | i18n}}

-
+
@@ -54,6 +56,23 @@
+ +
+ {{'loading' | i18n}} +
+

{{'insertU2f' | i18n}}

+ +
+
+
+
+
+ + +
+
+
+
@@ -66,18 +85,19 @@
-
+

{{'noTwoStepProviders' | i18n}}

{{'noTwoStepProviders2' | i18n}}

-
-

+

+ diff --git a/src/popup2/accounts/two-factor.component.ts b/src/popup2/accounts/two-factor.component.ts index 4cbbfe9b93b..b01047b8fce 100644 --- a/src/popup2/accounts/two-factor.component.ts +++ b/src/popup2/accounts/two-factor.component.ts @@ -9,6 +9,7 @@ import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { AuthService } from 'jslib/abstractions/auth.service'; +import { EnvironmentService } from 'jslib/abstractions/environment.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { SyncService } from 'jslib/abstractions/sync.service'; @@ -23,9 +24,10 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { constructor(authService: AuthService, router: Router, analytics: Angulartics2, toasterService: ToasterService, i18nService: I18nService, apiService: ApiService, - platformUtilsService: PlatformUtilsService, syncService: SyncService) { + platformUtilsService: PlatformUtilsService, syncService: SyncService, + environmentService: EnvironmentService) { super(authService, router, analytics, toasterService, i18nService, apiService, - platformUtilsService, syncService); + platformUtilsService, syncService, window, environmentService); } anotherMethod() { diff --git a/src/scss/box.scss b/src/scss/box.scss index d9677d0b7cc..25d35fe43ff 100644 --- a/src/scss/box.scss +++ b/src/scss/box.scss @@ -4,6 +4,10 @@ width: 100%; margin: 10px 0; + &.first { + margin-top: 0; + } + .box-header { margin: 0 10px 5px 10px; color: $gray-light; diff --git a/src/scss/misc.scss b/src/scss/misc.scss index dc95c6336c4..d09c3ab2e1b 100644 --- a/src/scss/misc.scss +++ b/src/scss/misc.scss @@ -32,6 +32,16 @@ small { margin: 0 !important; } +.no-vmargin { + margin-top: 0 !important; + margin-bottom: 0 !important; +} + +.no-vpad { + padding-top: 0 !important; + padding-bottom: 0 !important; +} + [hidden] { display: none !important; } @@ -62,7 +72,16 @@ small { } #duo-frame { - // TODO + background: url('../popup2/images/loading.svg') 0 0 no-repeat; + width: 100%; + height: 470px; + margin-bottom: -10px; + + iframe { + width: 100%; + height: 100%; + border: none; + } } app-root > #loading {