mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-27 12:36:14 +01:00
added typings to settings components
This commit is contained in:
parent
2f5a1f470a
commit
35a20c775c
@ -1,6 +1,7 @@
|
||||
import * as angular from 'angular';
|
||||
import * as template from './environment.component.html';
|
||||
|
||||
import { EnvironmentService } from 'jslib/abstractions/environment.service';
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
|
||||
export class EnvironmentController {
|
||||
@ -11,9 +12,8 @@ export class EnvironmentController {
|
||||
baseUrl: string;
|
||||
i18n: any;
|
||||
|
||||
constructor(private i18nService: any, private $analytics: any,
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
private environmentService: any, private toastr: any, private $timeout: ng.ITimeoutService) {
|
||||
constructor(private i18nService: any, private $analytics: any, private platformUtilsService: PlatformUtilsService,
|
||||
private environmentService: EnvironmentService, private toastr: any, private $timeout: ng.ITimeoutService) {
|
||||
this.i18n = i18nService;
|
||||
|
||||
$timeout(() => {
|
||||
|
@ -3,6 +3,7 @@ import * as template from './add-folder.component.html';
|
||||
|
||||
import { Folder } from 'jslib/models/domain/folder';
|
||||
|
||||
import { FolderService } from 'jslib/abstractions/folder.service';
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
|
||||
export class AddFolderController {
|
||||
@ -10,7 +11,7 @@ export class AddFolderController {
|
||||
folder: {};
|
||||
i18n: any;
|
||||
|
||||
constructor(private folderService: any, private $state: any, private toastr: any,
|
||||
constructor(private folderService: FolderService, private $state: any, private toastr: any,
|
||||
platformUtilsService: PlatformUtilsService, private $analytics: any, private i18nService: any,
|
||||
$timeout: ng.ITimeoutService) {
|
||||
$timeout(() => {
|
||||
@ -29,10 +30,9 @@ export class AddFolderController {
|
||||
return;
|
||||
}
|
||||
|
||||
this.savePromise = this.folderService.encrypt(model).then((folderModel: any) => {
|
||||
const folder = new Folder(folderModel, true);
|
||||
this.savePromise = this.folderService.encrypt(model).then((folder: Folder) => {
|
||||
return this.folderService.saveWithServer(folder);
|
||||
}).then((folder: any) => {
|
||||
}).then(() => {
|
||||
this.$analytics.eventTrack('Added Folder');
|
||||
this.toastr.success(this.i18nService.addedFolder);
|
||||
this.$state.go('^.list', { animation: 'out-slide-down' });
|
||||
|
@ -3,18 +3,19 @@ import * as template from './edit-folder.component.html';
|
||||
|
||||
import { Folder } from 'jslib/models/domain/folder';
|
||||
|
||||
import { FolderService } from 'jslib/abstractions/folder.service';
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
|
||||
export class EditFolderController {
|
||||
$transition$: any;
|
||||
folderId: any;
|
||||
savePromise: any = null;
|
||||
folderId: string;
|
||||
savePromise: Promise<any> = null;
|
||||
i18n: any;
|
||||
folder: Folder;
|
||||
|
||||
constructor($scope: any, $stateParams: any, private folderService: any, private toastr: any, private $state: any,
|
||||
private SweetAlert: any, platformUtilsService: PlatformUtilsService, private $analytics: any,
|
||||
private i18nService: any, $timeout: ng.ITimeoutService) {
|
||||
constructor($scope: any, $stateParams: any, private folderService: FolderService, private toastr: any,
|
||||
private $state: any, private SweetAlert: any, platformUtilsService: PlatformUtilsService,
|
||||
private $analytics: any, private i18nService: any, $timeout: ng.ITimeoutService) {
|
||||
this.i18n = i18nService;
|
||||
|
||||
$timeout(() => {
|
||||
@ -40,10 +41,9 @@ export class EditFolderController {
|
||||
return;
|
||||
}
|
||||
|
||||
this.savePromise = this.folderService.encrypt(model).then((folderModel: any) => {
|
||||
const folder = new Folder(folderModel, true);
|
||||
this.savePromise = this.folderService.encrypt(model).then((folder: Folder) => {
|
||||
return this.folderService.saveWithServer(folder);
|
||||
}).then((folder: any) => {
|
||||
}).then(() => {
|
||||
this.$analytics.eventTrack('Edited Folder');
|
||||
this.toastr.success(this.i18nService.editedFolder);
|
||||
this.$state.go('^.list', { animation: 'out-slide-down' });
|
||||
|
@ -2,12 +2,14 @@ import * as template from './folders.component.html';
|
||||
|
||||
import { Folder } from 'jslib/models/domain/folder';
|
||||
|
||||
import { FolderService } from 'jslib/abstractions/folder.service';
|
||||
|
||||
export class FoldersController {
|
||||
folders: Folder[] = [];
|
||||
i18n: any;
|
||||
loaded = false;
|
||||
|
||||
constructor(private folderService: any, private $state: any, i18nService: any) {
|
||||
constructor(private folderService: FolderService, private $state: any, i18nService: any) {
|
||||
this.i18n = i18nService;
|
||||
this.load();
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import * as template from './help.component.html';
|
||||
export class HelpController {
|
||||
i18n: any;
|
||||
|
||||
constructor(i18nService: any, private $analytics: any) {
|
||||
constructor(private i18nService: any, private $analytics: any) {
|
||||
this.i18n = i18nService;
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,14 @@
|
||||
import * as angular from 'angular';
|
||||
import * as template from './options.component.html';
|
||||
|
||||
import { ConstantsService } from 'jslib/services/constants.service';
|
||||
|
||||
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
import { StorageService } from 'jslib/abstractions/storage.service';
|
||||
import { TotpService } from 'jslib/abstractions/totp.service';
|
||||
|
||||
import StateService from '../services/state.service';
|
||||
import * as template from './options.component.html';
|
||||
|
||||
export class OptionsController {
|
||||
disableFavicon = false;
|
||||
@ -16,8 +19,8 @@ export class OptionsController {
|
||||
disableGa = false;
|
||||
i18n: any;
|
||||
|
||||
constructor(private i18nService: any, private $analytics: any, private constantsService: any,
|
||||
private platformUtilsService: PlatformUtilsService, private totpService: any,
|
||||
constructor(private i18nService: any, private $analytics: any, private constantsService: ConstantsService,
|
||||
private platformUtilsService: PlatformUtilsService, private totpService: TotpService,
|
||||
private stateService: StateService, private storageService: StorageService,
|
||||
public messagingService: MessagingService, private $timeout: ng.ITimeoutService) {
|
||||
this.i18n = i18nService;
|
||||
|
@ -1,12 +1,15 @@
|
||||
import * as template from './premium.component.html';
|
||||
|
||||
import { ApiService } from 'jslib/abstractions/api.service';
|
||||
import { TokenService } from 'jslib/abstractions/token.service';
|
||||
|
||||
export class PremiumController {
|
||||
isPremium: boolean;
|
||||
i18n: any;
|
||||
price = '$10';
|
||||
|
||||
constructor(private i18nService: any, private tokenService: any, private apiService: any, private toastr: any,
|
||||
private SweetAlert: any, private $analytics: any, private $timeout: ng.ITimeoutService) {
|
||||
constructor(private i18nService: any, private tokenService: TokenService, private apiService: ApiService,
|
||||
private toastr: any, private SweetAlert: any, private $analytics: any, private $timeout: ng.ITimeoutService) {
|
||||
this.i18n = i18nService;
|
||||
this.isPremium = tokenService.getPremium();
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import { DeviceType } from 'jslib/enums/deviceType';
|
||||
import { ConstantsService } from 'jslib/services/constants.service';
|
||||
|
||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||
import { LockService } from 'jslib/abstractions/lock.service';
|
||||
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
import { StorageService } from 'jslib/abstractions/storage.service';
|
||||
@ -34,9 +35,9 @@ export class SettingsController {
|
||||
constructor(private $state: any, private SweetAlert: any,
|
||||
private platformUtilsService: PlatformUtilsService, private $analytics: any,
|
||||
private i18nService: any, private constantsService: ConstantsService,
|
||||
private cryptoService: CryptoService, private lockService: any,
|
||||
private storageService: StorageService,
|
||||
public messagingService: MessagingService, private $timeout: ng.ITimeoutService) {
|
||||
private cryptoService: CryptoService, private lockService: LockService,
|
||||
private storageService: StorageService, public messagingService: MessagingService,
|
||||
private $timeout: ng.ITimeoutService) {
|
||||
this.i18n = i18nService;
|
||||
|
||||
$timeout(() => {
|
||||
|
@ -1,11 +1,14 @@
|
||||
import * as template from './sync.component.html';
|
||||
|
||||
import { SyncService } from 'jslib/abstractions/sync.service';
|
||||
|
||||
export class SyncController {
|
||||
i18n: any;
|
||||
lastSync = '--';
|
||||
loading = false;
|
||||
|
||||
constructor(private syncService: any, private toastr: any, private $analytics: any, private i18nService: any) {
|
||||
constructor(private syncService: SyncService, private toastr: any, private $analytics: any,
|
||||
private i18nService: any) {
|
||||
this.i18n = i18nService;
|
||||
this.setLastSync();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user