diff --git a/jslib b/jslib index 7b4d0a71de..f855a8272c 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 7b4d0a71de640ce14c3c446bfd2e8ce36635db3f +Subproject commit f855a8272c7dc3c3099643cf34e49d3089e6575e diff --git a/src/popup2/accounts/environment.component.html b/src/popup2/accounts/environment.component.html new file mode 100644 index 0000000000..648b4a53a3 --- /dev/null +++ b/src/popup2/accounts/environment.component.html @@ -0,0 +1,59 @@ + diff --git a/src/popup2/accounts/environment.component.ts b/src/popup2/accounts/environment.component.ts new file mode 100644 index 0000000000..225ccb1492 --- /dev/null +++ b/src/popup2/accounts/environment.component.ts @@ -0,0 +1,29 @@ +import * as template from './environment.component.html'; + +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; + +import { ToasterService } from 'angular2-toaster'; +import { Angulartics2 } from 'angulartics2'; + +import { EnvironmentService } from 'jslib/abstractions/environment.service'; +import { I18nService } from 'jslib/abstractions/i18n.service'; + +import { EnvironmentComponent as BaseEnvironmentComponent } from 'jslib/angular/components/environment.component'; + +@Component({ + selector: 'app-environment', + template: template, +}) +export class EnvironmentComponent extends BaseEnvironmentComponent { + constructor(analytics: Angulartics2, toasterService: ToasterService, + environmentService: EnvironmentService, i18nService: I18nService, + private router: Router) { + super(analytics, toasterService, environmentService, i18nService); + } + + saved() { + super.saved(); + this.router.navigate(['login']); + } +} diff --git a/src/popup2/accounts/hint.component.html b/src/popup2/accounts/hint.component.html new file mode 100644 index 0000000000..fa1c0c47f0 --- /dev/null +++ b/src/popup2/accounts/hint.component.html @@ -0,0 +1,23 @@ +
+
+

{{'passwordHint' | i18n}}

+
+
+
+ + +
+
+ +
+
+ + {{'cancel' | i18n}} +
+
+
diff --git a/src/popup2/accounts/hint.component.ts b/src/popup2/accounts/hint.component.ts new file mode 100644 index 0000000000..8f542845ca --- /dev/null +++ b/src/popup2/accounts/hint.component.ts @@ -0,0 +1,24 @@ +import * as template from './hint.component.html'; + +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; + +import { ToasterService } from 'angular2-toaster'; +import { Angulartics2 } from 'angulartics2'; + +import { ApiService } from 'jslib/abstractions/api.service'; +import { I18nService } from 'jslib/abstractions/i18n.service'; + +import { HintComponent as BaseHintComponent } from 'jslib/angular/components/hint.component'; + +@Component({ + selector: 'app-hint', + template: template, +}) +export class HintComponent extends BaseHintComponent { + constructor(router: Router, analytics: Angulartics2, + toasterService: ToasterService, i18nService: I18nService, + apiService: ApiService) { + super(router, analytics, toasterService, i18nService, apiService); + } +} diff --git a/src/popup2/accounts/login.component.ts b/src/popup2/accounts/login.component.ts index c96b5d73c2..6441e2eee8 100644 --- a/src/popup2/accounts/login.component.ts +++ b/src/popup2/accounts/login.component.ts @@ -24,6 +24,6 @@ export class LoginComponent extends BaseLoginComponent { } settings() { - // TODO: navigate to settings + this.router.navigate(['environment']); } } diff --git a/src/popup2/accounts/register.component.html b/src/popup2/accounts/register.component.html new file mode 100644 index 0000000000..055eabc16c --- /dev/null +++ b/src/popup2/accounts/register.component.html @@ -0,0 +1,64 @@ +
+
+

{{'createAccount' | i18n}}

+
+
+
+ + +
+
+
+ + +
+
+ + + +
+
+
+ +
+
+
+
+
+ + +
+
+ + + +
+
+
+ + +
+
+ +
+
+ + {{'cancel' | i18n}} +
+
+
diff --git a/src/popup2/accounts/register.component.ts b/src/popup2/accounts/register.component.ts new file mode 100644 index 0000000000..a2f2e7fa42 --- /dev/null +++ b/src/popup2/accounts/register.component.ts @@ -0,0 +1,27 @@ +import * as template from './register.component.html'; + +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; + +import { ToasterService } from 'angular2-toaster'; +import { Angulartics2 } from 'angulartics2'; + +import { ApiService } from 'jslib/abstractions/api.service'; +import { AuthService } from 'jslib/abstractions/auth.service'; +import { CryptoService } from 'jslib/abstractions/crypto.service'; +import { I18nService } from 'jslib/abstractions/i18n.service'; + +import { RegisterComponent as BaseRegisterComponent } from 'jslib/angular/components/register.component'; + +@Component({ + selector: 'app-register', + template: template, +}) +export class RegisterComponent extends BaseRegisterComponent { + constructor(authService: AuthService, router: Router, + analytics: Angulartics2, toasterService: ToasterService, + i18nService: I18nService, cryptoService: CryptoService, + apiService: ApiService) { + super(authService, router, analytics, toasterService, i18nService, cryptoService, apiService); + } +} diff --git a/src/popup2/accounts/two-factor-options.component.html b/src/popup2/accounts/two-factor-options.component.html new file mode 100644 index 0000000000..740365d1ea --- /dev/null +++ b/src/popup2/accounts/two-factor-options.component.html @@ -0,0 +1,28 @@ + diff --git a/src/popup2/accounts/two-factor-options.component.ts b/src/popup2/accounts/two-factor-options.component.ts new file mode 100644 index 0000000000..6115898431 --- /dev/null +++ b/src/popup2/accounts/two-factor-options.component.ts @@ -0,0 +1,27 @@ +import * as template from './two-factor-options.component.html'; + +import { Component, } from '@angular/core'; +import { Router } from '@angular/router'; + +import { ToasterService } from 'angular2-toaster'; +import { Angulartics2 } from 'angulartics2'; + +import { AuthService } from 'jslib/abstractions/auth.service'; +import { I18nService } from 'jslib/abstractions/i18n.service'; +import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; + +import { + TwoFactorOptionsComponent as BaseTwoFactorOptionsComponent +} from 'jslib/angular/components/two-factor-options.component'; + +@Component({ + selector: 'app-two-factor-options', + template: template, +}) +export class TwoFactorOptionsComponent extends BaseTwoFactorOptionsComponent { + constructor(authService: AuthService, router: Router, + analytics: Angulartics2, toasterService: ToasterService, + i18nService: I18nService, platformUtilsService: PlatformUtilsService) { + super(authService, router, analytics, toasterService, i18nService, platformUtilsService); + } +} diff --git a/src/popup2/accounts/two-factor.component.html b/src/popup2/accounts/two-factor.component.html new file mode 100644 index 0000000000..697a5f3c83 --- /dev/null +++ b/src/popup2/accounts/two-factor.component.html @@ -0,0 +1,74 @@ +
+
+

{{title}}

+

{{'enterVerificationCodeApp' | i18n}}

+

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

+
+
+
+ + +
+
+ + +
+
+
+ +

{{'insertYubiKey' | i18n}}

+
+
+
+ + +
+
+ + +
+
+
+
+ +
+
+
+
+ + +
+
+
+
+
+
+
+

{{'noTwoStepProviders' | i18n}}

+

{{'noTwoStepProviders2' | i18n}}

+
+
+
+
+ + {{'cancel' | i18n}} +
+ +
+
+ diff --git a/src/popup2/accounts/two-factor.component.ts b/src/popup2/accounts/two-factor.component.ts new file mode 100644 index 0000000000..4cbbfe9b93 --- /dev/null +++ b/src/popup2/accounts/two-factor.component.ts @@ -0,0 +1,34 @@ +import * as template from './two-factor.component.html'; + +import { Component } from '@angular/core'; + +import { Router } from '@angular/router'; + +import { ToasterService } from 'angular2-toaster'; +import { Angulartics2 } from 'angulartics2'; + +import { ApiService } from 'jslib/abstractions/api.service'; +import { AuthService } from 'jslib/abstractions/auth.service'; +import { I18nService } from 'jslib/abstractions/i18n.service'; +import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; +import { SyncService } from 'jslib/abstractions/sync.service'; + +import { TwoFactorComponent as BaseTwoFactorComponent } from 'jslib/angular/components/two-factor.component'; + +@Component({ + selector: 'app-two-factor', + template: template, +}) +export class TwoFactorComponent extends BaseTwoFactorComponent { + constructor(authService: AuthService, router: Router, + analytics: Angulartics2, toasterService: ToasterService, + i18nService: I18nService, apiService: ApiService, + platformUtilsService: PlatformUtilsService, syncService: SyncService) { + super(authService, router, analytics, toasterService, i18nService, apiService, + platformUtilsService, syncService); + } + + anotherMethod() { + this.router.navigate(['2fa-options']); + } +} diff --git a/src/popup2/app-routing.module.ts b/src/popup2/app-routing.module.ts index 812caa6311..79cc2dd0e6 100644 --- a/src/popup2/app-routing.module.ts +++ b/src/popup2/app-routing.module.ts @@ -4,11 +4,21 @@ import { Routes, } from '@angular/router'; +import { EnvironmentComponent } from './accounts/environment.component'; +import { HintComponent } from './accounts/hint.component'; import { LoginComponent } from './accounts/login.component'; +import { RegisterComponent } from './accounts/register.component'; +import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component'; +import { TwoFactorComponent } from './accounts/two-factor.component'; const routes: Routes = [ { path: '', redirectTo: '/login', pathMatch: 'full' }, { path: 'login', component: LoginComponent }, + { path: '2fa', component: TwoFactorComponent }, + { path: '2fa-options', component: TwoFactorOptionsComponent }, + { path: 'register', component: RegisterComponent }, + { path: 'hint', component: HintComponent }, + { path: 'environment', component: EnvironmentComponent }, ]; @NgModule({ diff --git a/src/popup2/app.module.ts b/src/popup2/app.module.ts index bcedb15a9a..fdec16ac60 100644 --- a/src/popup2/app.module.ts +++ b/src/popup2/app.module.ts @@ -15,7 +15,12 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppComponent } from './app.component'; +import { EnvironmentComponent } from './accounts/environment.component'; +import { HintComponent } from './accounts/hint.component'; import { LoginComponent } from './accounts/login.component'; +import { RegisterComponent } from './accounts/register.component'; +import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component'; +import { TwoFactorComponent } from './accounts/two-factor.component'; import { ApiActionDirective } from 'jslib/angular/directives/api-action.directive'; import { AutofocusDirective } from 'jslib/angular/directives/autofocus.directive'; @@ -45,11 +50,16 @@ import { I18nPipe } from 'jslib/angular/pipes/i18n.pipe'; AppComponent, AutofocusDirective, BlurClickDirective, + EnvironmentComponent, FallbackSrcDirective, + HintComponent, I18nPipe, LoginComponent, + RegisterComponent, StopClickDirective, - StopPropDirective + StopPropDirective, + TwoFactorOptionsComponent, + TwoFactorComponent ], entryComponents: [