1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-23 19:53:43 +00:00

platform utils for toasting

This commit is contained in:
Kyle Spearrin
2018-10-02 23:33:56 -04:00
parent adba3f8d67
commit 89a448b12f
21 changed files with 91 additions and 86 deletions

View File

@@ -1,11 +1,11 @@
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 { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { EnvironmentComponent as BaseEnvironmentComponent } from 'jslib/angular/components/environment.component';
@@ -14,10 +14,10 @@ import { EnvironmentComponent as BaseEnvironmentComponent } from 'jslib/angular/
templateUrl: 'environment.component.html',
})
export class EnvironmentComponent extends BaseEnvironmentComponent {
constructor(analytics: Angulartics2, toasterService: ToasterService,
constructor(analytics: Angulartics2, platformUtilsService: PlatformUtilsService,
environmentService: EnvironmentService, i18nService: I18nService,
private router: Router) {
super(analytics, toasterService, environmentService, i18nService);
super(analytics, platformUtilsService, environmentService, i18nService);
this.showCustom = true;
}

View File

@@ -1,11 +1,11 @@
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 { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { HintComponent as BaseHintComponent } from 'jslib/angular/components/hint.component';
@@ -15,8 +15,8 @@ import { HintComponent as BaseHintComponent } from 'jslib/angular/components/hin
})
export class HintComponent extends BaseHintComponent {
constructor(router: Router, analytics: Angulartics2,
toasterService: ToasterService, i18nService: I18nService,
platformUtilsService: PlatformUtilsService, i18nService: I18nService,
apiService: ApiService) {
super(router, analytics, toasterService, i18nService, apiService);
super(router, analytics, i18nService, apiService, platformUtilsService);
}
}

View File

@@ -1,16 +1,7 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import { I18nService } from 'jslib/abstractions/i18n.service';
@Component({
selector: 'app-home',
templateUrl: 'home.component.html',
})
export class HomeComponent {
constructor(private router: Router, i18nService: I18nService,
analytics: Angulartics2, toasterService: ToasterService) { }
}
export class HomeComponent { }

View File

@@ -4,7 +4,6 @@ import {
} from '@angular/core';
import { Router } from '@angular/router';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import { CryptoService } from 'jslib/abstractions/crypto.service';
@@ -21,11 +20,10 @@ import { LockComponent as BaseLockComponent } from 'jslib/angular/components/loc
})
export class LockComponent extends BaseLockComponent implements OnInit {
constructor(router: Router, analytics: Angulartics2,
toasterService: ToasterService, i18nService: I18nService,
i18nService: I18nService,
platformUtilsService: PlatformUtilsService, messagingService: MessagingService,
userService: UserService, cryptoService: CryptoService) {
super(router, analytics, toasterService, i18nService, platformUtilsService,
messagingService, userService, cryptoService);
super(router, analytics, i18nService, platformUtilsService, messagingService, userService, cryptoService);
this.successRoute = '/tabs/current';
}

View File

@@ -1,11 +1,11 @@
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 { StorageService } from 'jslib/abstractions/storage.service';
import { SyncService } from 'jslib/abstractions/sync.service';
@@ -17,9 +17,9 @@ import { LoginComponent as BaseLoginComponent } from 'jslib/angular/components/l
})
export class LoginComponent extends BaseLoginComponent {
constructor(authService: AuthService, router: Router,
analytics: Angulartics2, toasterService: ToasterService,
i18nService: I18nService, private syncService: SyncService, storageService: StorageService) {
super(authService, router, analytics, toasterService, i18nService, storageService);
analytics: Angulartics2, platformUtilsService: PlatformUtilsService,
i18nService: I18nService, syncService: SyncService, storageService: StorageService) {
super(authService, router, analytics, platformUtilsService, i18nService, storageService);
super.onSuccessfulLogin = () => {
return syncService.fullSync(true);
};

View File

@@ -1,7 +1,6 @@
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';
@@ -19,11 +18,11 @@ import { RegisterComponent as BaseRegisterComponent } from 'jslib/angular/compon
})
export class RegisterComponent extends BaseRegisterComponent {
constructor(authService: AuthService, router: Router,
analytics: Angulartics2, toasterService: ToasterService,
analytics: Angulartics2,
i18nService: I18nService, cryptoService: CryptoService,
apiService: ApiService, stateService: StateService,
platformUtilsService: PlatformUtilsService) {
super(authService, router, analytics, toasterService, i18nService, cryptoService, apiService, stateService,
super(authService, router, analytics, i18nService, cryptoService, apiService, stateService,
platformUtilsService);
}
}

View File

@@ -1,7 +1,6 @@
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';
@@ -18,9 +17,9 @@ import {
})
export class TwoFactorOptionsComponent extends BaseTwoFactorOptionsComponent {
constructor(authService: AuthService, router: Router,
analytics: Angulartics2, toasterService: ToasterService,
analytics: Angulartics2,
i18nService: I18nService, platformUtilsService: PlatformUtilsService) {
super(authService, router, analytics, toasterService, i18nService, platformUtilsService, window);
super(authService, router, analytics, i18nService, platformUtilsService, window);
}
choose(p: any) {

View File

@@ -2,13 +2,10 @@ import {
ChangeDetectorRef,
Component,
NgZone,
OnDestroy,
OnInit,
} from '@angular/core';
import { Router } from '@angular/router';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import { BrowserApi } from '../../browser/browserApi';
@@ -36,13 +33,13 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
showNewWindowMessage = false;
constructor(authService: AuthService, router: Router,
analytics: Angulartics2, toasterService: ToasterService,
analytics: Angulartics2,
i18nService: I18nService, apiService: ApiService,
platformUtilsService: PlatformUtilsService, syncService: SyncService,
environmentService: EnvironmentService, private ngZone: NgZone,
private broadcasterService: BroadcasterService, private changeDetectorRef: ChangeDetectorRef) {
super(authService, router, analytics, toasterService, i18nService, apiService,
platformUtilsService, window, environmentService);
super(authService, router, analytics, i18nService, apiService, platformUtilsService, window,
environmentService);
super.onSuccessfulLogin = () => {
return syncService.fullSync(true);
};