mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +01:00
parent
53bd9a3b14
commit
a9ef011cf3
2
jslib
2
jslib
@ -1 +1 @@
|
|||||||
Subproject commit 0a0cdaa7fdfb7322c73258b270105c8fb6552b99
|
Subproject commit 92df63304029049891a46d575612222fb9b6c325
|
5
package-lock.json
generated
5
package-lock.json
generated
@ -890,11 +890,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/angular2-toaster/-/angular2-toaster-8.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/angular2-toaster/-/angular2-toaster-8.0.0.tgz",
|
||||||
"integrity": "sha512-MRDswCmhqFLBiot7C7SIq96NyU5aT9pwIVdYgmYJtXHp7N6fXk6QzuMSMhVvK12edUJntgmUft+SZfh45Oq0Wg=="
|
"integrity": "sha512-MRDswCmhqFLBiot7C7SIq96NyU5aT9pwIVdYgmYJtXHp7N6fXk6QzuMSMhVvK12edUJntgmUft+SZfh45Oq0Wg=="
|
||||||
},
|
},
|
||||||
"angulartics2": {
|
|
||||||
"version": "9.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/angulartics2/-/angulartics2-9.1.0.tgz",
|
|
||||||
"integrity": "sha512-RAfHJSHyeRe834e5qCYLtp7fdFuKnz/myFTSVEUZV6nLp4cUotvX8XQhewUEpFv6gkrzJwcuY32JZxstDlNiXQ=="
|
|
||||||
},
|
|
||||||
"ansi-colors": {
|
"ansi-colors": {
|
||||||
"version": "3.2.3",
|
"version": "3.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz",
|
||||||
|
@ -76,7 +76,6 @@
|
|||||||
"@microsoft/signalr": "3.1.13",
|
"@microsoft/signalr": "3.1.13",
|
||||||
"@microsoft/signalr-protocol-msgpack": "3.1.13",
|
"@microsoft/signalr-protocol-msgpack": "3.1.13",
|
||||||
"angular2-toaster": "8.0.0",
|
"angular2-toaster": "8.0.0",
|
||||||
"angulartics2": "9.1.0",
|
|
||||||
"big-integer": "1.6.48",
|
"big-integer": "1.6.48",
|
||||||
"bootstrap": "4.3.1",
|
"bootstrap": "4.3.1",
|
||||||
"braintree-web-drop-in": "1.13.0",
|
"braintree-web-drop-in": "1.13.0",
|
||||||
|
@ -2,7 +2,6 @@ import { Component } from '@angular/core';
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -18,8 +17,7 @@ export class RecoverDeleteComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private router: Router, private apiService: ApiService,
|
constructor(private router: Router, private apiService: ApiService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private i18nService: I18nService) {
|
||||||
private i18nService: I18nService) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
@ -28,7 +26,6 @@ export class RecoverDeleteComponent {
|
|||||||
request.email = this.email.trim().toLowerCase();
|
request.email = this.email.trim().toLowerCase();
|
||||||
this.formPromise = this.apiService.postAccountRecoverDelete(request);
|
this.formPromise = this.apiService.postAccountRecoverDelete(request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Started Delete Recovery' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('deleteRecoverEmailSent'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('deleteRecoverEmailSent'));
|
||||||
this.router.navigate(['/']);
|
this.router.navigate(['/']);
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -2,7 +2,6 @@ import { Component } from '@angular/core';
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { AuthService } from 'jslib/abstractions/auth.service';
|
import { AuthService } from 'jslib/abstractions/auth.service';
|
||||||
@ -22,9 +21,8 @@ export class RecoverTwoFactorComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private router: Router, private apiService: ApiService,
|
constructor(private router: Router, private apiService: ApiService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private i18nService: I18nService,
|
||||||
private i18nService: I18nService, private cryptoService: CryptoService,
|
private cryptoService: CryptoService, private authService: AuthService) { }
|
||||||
private authService: AuthService) { }
|
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
try {
|
try {
|
||||||
@ -35,7 +33,6 @@ export class RecoverTwoFactorComponent {
|
|||||||
request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, key);
|
request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, key);
|
||||||
this.formPromise = this.apiService.postTwoFactorRecover(request);
|
this.formPromise = this.apiService.postTwoFactorRecover(request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Recovered 2FA' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('twoStepRecoverDisabled'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('twoStepRecoverDisabled'));
|
||||||
this.router.navigate(['/']);
|
this.router.navigate(['/']);
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -8,7 +8,6 @@ import {
|
|||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -27,8 +26,8 @@ export class VerifyRecoverDeleteComponent implements OnInit {
|
|||||||
private token: string;
|
private token: string;
|
||||||
|
|
||||||
constructor(private router: Router, private apiService: ApiService,
|
constructor(private router: Router, private apiService: ApiService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private i18nService: I18nService,
|
||||||
private i18nService: I18nService, private route: ActivatedRoute) {
|
private route: ActivatedRoute) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@ -53,7 +52,6 @@ export class VerifyRecoverDeleteComponent implements OnInit {
|
|||||||
const request = new VerifyDeleteRecoverRequest(this.userId, this.token);
|
const request = new VerifyDeleteRecoverRequest(this.userId, this.token);
|
||||||
this.formPromise = this.apiService.postAccountRecoverDeleteToken(request);
|
this.formPromise = this.apiService.postAccountRecoverDeleteToken(request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Recovered Delete' });
|
|
||||||
this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'),
|
this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'),
|
||||||
this.i18nService.t('accountDeletedDesc'));
|
this.i18nService.t('accountDeletedDesc'));
|
||||||
this.router.navigate(['/']);
|
this.router.navigate(['/']);
|
||||||
|
@ -5,11 +5,8 @@ import {
|
|||||||
BodyOutputType,
|
BodyOutputType,
|
||||||
Toast,
|
Toast,
|
||||||
ToasterConfig,
|
ToasterConfig,
|
||||||
ToasterContainerComponent,
|
|
||||||
ToasterService,
|
ToasterService,
|
||||||
} from 'angular2-toaster';
|
} from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
@ -70,12 +67,12 @@ export class AppComponent implements OnDestroy, OnInit {
|
|||||||
private idleTimer: number = null;
|
private idleTimer: number = null;
|
||||||
private isIdle = false;
|
private isIdle = false;
|
||||||
|
|
||||||
constructor(private angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics,
|
constructor(
|
||||||
private broadcasterService: BroadcasterService, private userService: UserService,
|
private broadcasterService: BroadcasterService, private userService: UserService,
|
||||||
private tokenService: TokenService, private folderService: FolderService,
|
private tokenService: TokenService, private folderService: FolderService,
|
||||||
private settingsService: SettingsService, private syncService: SyncService,
|
private settingsService: SettingsService, private syncService: SyncService,
|
||||||
private passwordGenerationService: PasswordGenerationService, private cipherService: CipherService,
|
private passwordGenerationService: PasswordGenerationService, private cipherService: CipherService,
|
||||||
private authService: AuthService, private router: Router, private analytics: Angulartics2,
|
private authService: AuthService, private router: Router,
|
||||||
private toasterService: ToasterService, private i18nService: I18nService,
|
private toasterService: ToasterService, private i18nService: I18nService,
|
||||||
private platformUtilsService: PlatformUtilsService, private ngZone: NgZone,
|
private platformUtilsService: PlatformUtilsService, private ngZone: NgZone,
|
||||||
private vaultTimeoutService: VaultTimeoutService, private storageService: StorageService,
|
private vaultTimeoutService: VaultTimeoutService, private storageService: StorageService,
|
||||||
@ -151,12 +148,6 @@ export class AppComponent implements OnDestroy, OnInit {
|
|||||||
case 'showToast':
|
case 'showToast':
|
||||||
this.showToast(message);
|
this.showToast(message);
|
||||||
break;
|
break;
|
||||||
case 'analyticsEventTrack':
|
|
||||||
this.analytics.eventTrack.next({
|
|
||||||
action: message.action,
|
|
||||||
properties: { label: message.label },
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'setFullWidth':
|
case 'setFullWidth':
|
||||||
this.setFullWidth();
|
this.setFullWidth();
|
||||||
break;
|
break;
|
||||||
@ -207,7 +198,6 @@ export class AppComponent implements OnDestroy, OnInit {
|
|||||||
|
|
||||||
this.searchService.clearIndex();
|
this.searchService.clearIndex();
|
||||||
this.authService.logOut(async () => {
|
this.authService.logOut(async () => {
|
||||||
this.analytics.eventTrack.next({ action: 'Logged Out' });
|
|
||||||
if (expired) {
|
if (expired) {
|
||||||
this.toasterService.popAsync('warning', this.i18nService.t('loggedOut'),
|
this.toasterService.popAsync('warning', this.i18nService.t('loggedOut'),
|
||||||
this.i18nService.t('loginExpired'));
|
this.i18nService.t('loginExpired'));
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import 'core-js';
|
import 'core-js';
|
||||||
|
|
||||||
import { ToasterModule } from 'angular2-toaster';
|
import { ToasterModule } from 'angular2-toaster';
|
||||||
import { Angulartics2Module } from 'angulartics2';
|
|
||||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
|
||||||
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
||||||
|
|
||||||
import { AppRoutingModule } from './app-routing.module';
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
@ -256,11 +254,6 @@ registerLocaleData(localeZhTw, 'zh-TW');
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
ServicesModule,
|
ServicesModule,
|
||||||
Angulartics2Module.forRoot({
|
|
||||||
pageTracking: {
|
|
||||||
clearQueryParams: true,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
ToasterModule.forRoot(),
|
ToasterModule.forRoot(),
|
||||||
InfiniteScrollModule,
|
InfiniteScrollModule,
|
||||||
DragDropModule,
|
DragDropModule,
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
@ -46,9 +45,8 @@ export class CollectionAddEditComponent implements OnInit {
|
|||||||
private orgKey: SymmetricCryptoKey;
|
private orgKey: SymmetricCryptoKey;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService,
|
||||||
private platformUtilsService: PlatformUtilsService, private cryptoService: CryptoService,
|
private cryptoService: CryptoService, private userService: UserService) { }
|
||||||
private userService: UserService) { }
|
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
const organization = await this.userService.getOrganization(this.organizationId);
|
const organization = await this.userService.getOrganization(this.organizationId);
|
||||||
@ -124,7 +122,6 @@ export class CollectionAddEditComponent implements OnInit {
|
|||||||
this.formPromise = this.apiService.postCollection(this.organizationId, request);
|
this.formPromise = this.apiService.postCollection(this.organizationId, request);
|
||||||
}
|
}
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Collection' : 'Created Collection' });
|
|
||||||
this.toasterService.popAsync('success', null,
|
this.toasterService.popAsync('success', null,
|
||||||
this.i18nService.t(this.editMode ? 'editedCollectionId' : 'createdCollectionId', this.name));
|
this.i18nService.t(this.editMode ? 'editedCollectionId' : 'createdCollectionId', this.name));
|
||||||
this.onSavedCollection.emit();
|
this.onSavedCollection.emit();
|
||||||
@ -146,7 +143,6 @@ export class CollectionAddEditComponent implements OnInit {
|
|||||||
try {
|
try {
|
||||||
this.deletePromise = this.apiService.deleteCollection(this.organizationId, this.collectionId);
|
this.deletePromise = this.apiService.deleteCollection(this.organizationId, this.collectionId);
|
||||||
await this.deletePromise;
|
await this.deletePromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Deleted Collection' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', this.name));
|
this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', this.name));
|
||||||
this.onDeletedCollection.emit();
|
this.onDeletedCollection.emit();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -8,7 +8,6 @@ import {
|
|||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CollectionService } from 'jslib/abstractions/collection.service';
|
import { CollectionService } from 'jslib/abstractions/collection.service';
|
||||||
@ -52,9 +51,9 @@ export class CollectionsComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(private apiService: ApiService, private route: ActivatedRoute,
|
constructor(private apiService: ApiService, private route: ActivatedRoute,
|
||||||
private collectionService: CollectionService, private componentFactoryResolver: ComponentFactoryResolver,
|
private collectionService: CollectionService, private componentFactoryResolver: ComponentFactoryResolver,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private i18nService: I18nService,
|
||||||
private i18nService: I18nService, private platformUtilsService: PlatformUtilsService,
|
private platformUtilsService: PlatformUtilsService, private userService: UserService,
|
||||||
private userService: UserService, private searchService: SearchService) { }
|
private searchService: SearchService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.route.parent.parent.params.subscribe(async params => {
|
this.route.parent.parent.params.subscribe(async params => {
|
||||||
@ -141,7 +140,6 @@ export class CollectionsComponent implements OnInit {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await this.apiService.deleteCollection(this.organizationId, collection.id);
|
await this.apiService.deleteCollection(this.organizationId, collection.id);
|
||||||
this.analytics.eventTrack.next({ action: 'Deleted Collection' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', collection.name));
|
this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', collection.name));
|
||||||
this.removeCollection(collection);
|
this.removeCollection(collection);
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -42,7 +41,7 @@ export class EntityUsersComponent implements OnInit {
|
|||||||
private allUsers: OrganizationUserUserDetailsResponse[] = [];
|
private allUsers: OrganizationUserUserDetailsResponse[] = [];
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService) { }
|
private toasterService: ToasterService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
await this.loadUsers();
|
await this.loadUsers();
|
||||||
@ -129,9 +128,6 @@ export class EntityUsersComponent implements OnInit {
|
|||||||
this.formPromise = this.apiService.putCollectionUsers(this.organizationId, this.entityId, selections);
|
this.formPromise = this.apiService.putCollectionUsers(this.organizationId, this.entityId, selections);
|
||||||
}
|
}
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({
|
|
||||||
action: this.entity === 'group' ? 'Edited Group Users' : 'Edited Collection Users',
|
|
||||||
});
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('updatedUsers'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('updatedUsers'));
|
||||||
this.onEditedUsers.emit();
|
this.onEditedUsers.emit();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CollectionService } from 'jslib/abstractions/collection.service';
|
import { CollectionService } from 'jslib/abstractions/collection.service';
|
||||||
@ -42,8 +41,8 @@ export class GroupAddEditComponent implements OnInit {
|
|||||||
deletePromise: Promise<any>;
|
deletePromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private collectionService: CollectionService,
|
||||||
private collectionService: CollectionService, private platformUtilsService: PlatformUtilsService) { }
|
private platformUtilsService: PlatformUtilsService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.editMode = this.loading = this.groupId != null;
|
this.editMode = this.loading = this.groupId != null;
|
||||||
@ -110,7 +109,6 @@ export class GroupAddEditComponent implements OnInit {
|
|||||||
this.formPromise = this.apiService.postGroup(this.organizationId, request);
|
this.formPromise = this.apiService.postGroup(this.organizationId, request);
|
||||||
}
|
}
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Group' : 'Created Group' });
|
|
||||||
this.toasterService.popAsync('success', null,
|
this.toasterService.popAsync('success', null,
|
||||||
this.i18nService.t(this.editMode ? 'editedGroupId' : 'createdGroupId', this.name));
|
this.i18nService.t(this.editMode ? 'editedGroupId' : 'createdGroupId', this.name));
|
||||||
this.onSavedGroup.emit();
|
this.onSavedGroup.emit();
|
||||||
@ -132,7 +130,6 @@ export class GroupAddEditComponent implements OnInit {
|
|||||||
try {
|
try {
|
||||||
this.deletePromise = this.apiService.deleteGroup(this.organizationId, this.groupId);
|
this.deletePromise = this.apiService.deleteGroup(this.organizationId, this.groupId);
|
||||||
await this.deletePromise;
|
await this.deletePromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Deleted Group' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', this.name));
|
this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', this.name));
|
||||||
this.onDeletedGroup.emit();
|
this.onDeletedGroup.emit();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -11,7 +11,6 @@ import {
|
|||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -49,9 +48,9 @@ export class GroupsComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(private apiService: ApiService, private route: ActivatedRoute,
|
constructor(private apiService: ApiService, private route: ActivatedRoute,
|
||||||
private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
|
private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService,
|
||||||
private platformUtilsService: PlatformUtilsService, private userService: UserService,
|
private userService: UserService, private router: Router,
|
||||||
private router: Router, private searchService: SearchService) { }
|
private searchService: SearchService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.route.parent.parent.params.subscribe(async params => {
|
this.route.parent.parent.params.subscribe(async params => {
|
||||||
@ -136,7 +135,6 @@ export class GroupsComponent implements OnInit {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await this.apiService.deleteGroup(this.organizationId, group.id);
|
await this.apiService.deleteGroup(this.organizationId, group.id);
|
||||||
this.analytics.eventTrack.next({ action: 'Deleted Group' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', group.name));
|
this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', group.name));
|
||||||
this.removeGroup(group);
|
this.removeGroup(group);
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -11,7 +11,6 @@ import {
|
|||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ValidationService } from 'jslib/angular/services/validation.service';
|
import { ValidationService } from 'jslib/angular/services/validation.service';
|
||||||
import { ConstantsService } from 'jslib/services/constants.service';
|
import { ConstantsService } from 'jslib/services/constants.service';
|
||||||
@ -71,9 +70,8 @@ export class PeopleComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(private apiService: ApiService, private route: ActivatedRoute,
|
constructor(private apiService: ApiService, private route: ActivatedRoute,
|
||||||
private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
|
private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
|
||||||
private platformUtilsService: PlatformUtilsService, private analytics: Angulartics2,
|
private platformUtilsService: PlatformUtilsService, private toasterService: ToasterService,
|
||||||
private toasterService: ToasterService, private cryptoService: CryptoService,
|
private cryptoService: CryptoService, private userService: UserService, private router: Router,
|
||||||
private userService: UserService, private router: Router,
|
|
||||||
private storageService: StorageService, private searchService: SearchService,
|
private storageService: StorageService, private searchService: SearchService,
|
||||||
private validationService: ValidationService) { }
|
private validationService: ValidationService) { }
|
||||||
|
|
||||||
@ -233,7 +231,6 @@ export class PeopleComponent implements OnInit {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await this.apiService.deleteOrganizationUser(this.organizationId, user.id);
|
await this.apiService.deleteOrganizationUser(this.organizationId, user.id);
|
||||||
this.analytics.eventTrack.next({ action: 'Deleted User' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', user.name || user.email));
|
this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', user.name || user.email));
|
||||||
this.removeUser(user);
|
this.removeUser(user);
|
||||||
} catch { }
|
} catch { }
|
||||||
@ -245,7 +242,6 @@ export class PeopleComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
this.actionPromise = this.apiService.postOrganizationUserReinvite(this.organizationId, user.id);
|
this.actionPromise = this.apiService.postOrganizationUserReinvite(this.organizationId, user.id);
|
||||||
await this.actionPromise;
|
await this.actionPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Reinvited User' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenReinvited', user.name || user.email));
|
this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenReinvited', user.name || user.email));
|
||||||
this.actionPromise = null;
|
this.actionPromise = null;
|
||||||
}
|
}
|
||||||
@ -265,7 +261,6 @@ export class PeopleComponent implements OnInit {
|
|||||||
this.actionPromise = this.doConfirmation(user, publicKey);
|
this.actionPromise = this.doConfirmation(user, publicKey);
|
||||||
await this.actionPromise;
|
await this.actionPromise;
|
||||||
updateUser(this);
|
updateUser(this);
|
||||||
this.analytics.eventTrack.next({ action: 'Confirmed User' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenConfirmed', user.name || user.email));
|
this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenConfirmed', user.name || user.email));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.validationService.showError(e);
|
this.validationService.showError(e);
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -64,7 +63,7 @@ export class PolicyEditComponent implements OnInit {
|
|||||||
private policy: PolicyResponse;
|
private policy: PolicyResponse;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService) {
|
private toasterService: ToasterService) {
|
||||||
this.passwordScores = [
|
this.passwordScores = [
|
||||||
{ name: '-- ' + i18nService.t('select') + ' --', value: null },
|
{ name: '-- ' + i18nService.t('select') + ' --', value: null },
|
||||||
{ name: i18nService.t('weak') + ' (0)', value: 0 },
|
{ name: i18nService.t('weak') + ' (0)', value: 0 },
|
||||||
@ -174,7 +173,6 @@ export class PolicyEditComponent implements OnInit {
|
|||||||
try {
|
try {
|
||||||
this.formPromise = this.apiService.putPolicy(this.organizationId, this.type, request);
|
this.formPromise = this.apiService.putPolicy(this.organizationId, this.type, request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Edited Policy' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('editedPolicyId', this.name));
|
this.toasterService.popAsync('success', null, this.i18nService.t('editedPolicyId', this.name));
|
||||||
this.onSavedPolicy.emit();
|
this.onSavedPolicy.emit();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CollectionService } from 'jslib/abstractions/collection.service';
|
import { CollectionService } from 'jslib/abstractions/collection.service';
|
||||||
@ -54,8 +53,8 @@ export class UserAddEditComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private collectionService: CollectionService,
|
||||||
private collectionService: CollectionService, private platformUtilsService: PlatformUtilsService) { }
|
private platformUtilsService: PlatformUtilsService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.editMode = this.loading = this.organizationUserId != null;
|
this.editMode = this.loading = this.organizationUserId != null;
|
||||||
@ -170,7 +169,6 @@ export class UserAddEditComponent implements OnInit {
|
|||||||
this.formPromise = this.apiService.postOrganizationUserInvite(this.organizationId, request);
|
this.formPromise = this.apiService.postOrganizationUserInvite(this.organizationId, request);
|
||||||
}
|
}
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: this.editMode ? 'Edited User' : 'Invited User' });
|
|
||||||
this.toasterService.popAsync('success', null,
|
this.toasterService.popAsync('success', null,
|
||||||
this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name));
|
this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name));
|
||||||
this.onSavedUser.emit();
|
this.onSavedUser.emit();
|
||||||
@ -192,7 +190,6 @@ export class UserAddEditComponent implements OnInit {
|
|||||||
try {
|
try {
|
||||||
this.deletePromise = this.apiService.deleteOrganizationUser(this.organizationId, this.organizationUserId);
|
this.deletePromise = this.apiService.deleteOrganizationUser(this.organizationId, this.organizationUserId);
|
||||||
await this.deletePromise;
|
await this.deletePromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Deleted User' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name));
|
this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name));
|
||||||
this.onDeletedUser.emit();
|
this.onDeletedUser.emit();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -32,7 +31,7 @@ export class UserGroupsComponent implements OnInit {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService) { }
|
private toasterService: ToasterService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
const groupsResponse = await this.apiService.getGroups(this.organizationId);
|
const groupsResponse = await this.apiService.getGroups(this.organizationId);
|
||||||
@ -75,7 +74,6 @@ export class UserGroupsComponent implements OnInit {
|
|||||||
this.formPromise = this.apiService.putOrganizationUserGroups(this.organizationId, this.organizationUserId,
|
this.formPromise = this.apiService.putOrganizationUserGroups(this.organizationId, this.organizationUserId,
|
||||||
request);
|
request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Edited User Groups' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('editedGroupsForUser', this.name));
|
this.toasterService.popAsync('success', null, this.i18nService.t('editedGroupsForUser', this.name));
|
||||||
this.onSavedUser.emit();
|
this.onSavedUser.emit();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -46,9 +45,8 @@ export class AccountComponent {
|
|||||||
|
|
||||||
constructor(private componentFactoryResolver: ComponentFactoryResolver,
|
constructor(private componentFactoryResolver: ComponentFactoryResolver,
|
||||||
private apiService: ApiService, private i18nService: I18nService,
|
private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private route: ActivatedRoute,
|
||||||
private route: ActivatedRoute, private syncService: SyncService,
|
private syncService: SyncService, private platformUtilsService: PlatformUtilsService) { }
|
||||||
private platformUtilsService: PlatformUtilsService) { }
|
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.selfHosted = this.platformUtilsService.isSelfHost();
|
this.selfHosted = this.platformUtilsService.isSelfHost();
|
||||||
@ -73,7 +71,6 @@ export class AccountComponent {
|
|||||||
return this.syncService.fullSync(true);
|
return this.syncService.fullSync(true);
|
||||||
});
|
});
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Updated Organization Settings' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('organizationUpdated'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('organizationUpdated'));
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
@ -81,7 +78,6 @@ export class AccountComponent {
|
|||||||
async submitTaxInfo() {
|
async submitTaxInfo() {
|
||||||
this.taxFormPromise = this.taxInfo.submitTaxInfo();
|
this.taxFormPromise = this.taxInfo.submitTaxInfo();
|
||||||
await this.taxFormPromise;
|
await this.taxFormPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Updated Organization Tax Info' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('taxInfoUpdated'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('taxInfoUpdated'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ import {
|
|||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -39,8 +38,8 @@ export class AdjustSeatsComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private router: Router,
|
||||||
private router: Router, private activatedRoute: ActivatedRoute) { }
|
private activatedRoute: ActivatedRoute) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
try {
|
try {
|
||||||
@ -63,7 +62,6 @@ export class AdjustSeatsComponent {
|
|||||||
};
|
};
|
||||||
this.formPromise = action();
|
this.formPromise = action();
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: this.add ? 'Added Seats' : 'Removed Seats' });
|
|
||||||
this.onAdjusted.emit(this.seatAdjustment);
|
this.onAdjusted.emit(this.seatAdjustment);
|
||||||
if (paymentFailed) {
|
if (paymentFailed) {
|
||||||
this.toasterService.popAsync({
|
this.toasterService.popAsync({
|
||||||
|
@ -28,7 +28,6 @@ export class ChangePlanComponent {
|
|||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
try {
|
try {
|
||||||
this.platformUtilsService.eventTrack('Changed Plan');
|
|
||||||
this.onChanged.emit();
|
this.onChanged.emit();
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ import { Component } from '@angular/core';
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
@ -21,8 +20,8 @@ export class DeleteOrganizationComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private cryptoService: CryptoService,
|
||||||
private cryptoService: CryptoService, private router: Router) { }
|
private router: Router) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
if (this.masterPassword == null || this.masterPassword === '') {
|
if (this.masterPassword == null || this.masterPassword === '') {
|
||||||
@ -36,7 +35,6 @@ export class DeleteOrganizationComponent {
|
|||||||
try {
|
try {
|
||||||
this.formPromise = this.apiService.deleteOrganization(this.organizationId, request);
|
this.formPromise = this.apiService.deleteOrganization(this.organizationId, request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Deleted Organization' });
|
|
||||||
this.toasterService.popAsync('success', this.i18nService.t('organizationDeleted'),
|
this.toasterService.popAsync('success', this.i18nService.t('organizationDeleted'),
|
||||||
this.i18nService.t('organizationDeletedDesc'));
|
this.i18nService.t('organizationDeletedDesc'));
|
||||||
this.router.navigate(['/']);
|
this.router.navigate(['/']);
|
||||||
|
@ -32,7 +32,6 @@ export class DownloadLicenseComponent {
|
|||||||
const license = await this.formPromise;
|
const license = await this.formPromise;
|
||||||
const licenseString = JSON.stringify(license, null, 2);
|
const licenseString = JSON.stringify(license, null, 2);
|
||||||
this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_organization_license.json');
|
this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_organization_license.json');
|
||||||
this.platformUtilsService.eventTrack('Downloaded License');
|
|
||||||
this.onDownloaded.emit();
|
this.onDownloaded.emit();
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -18,10 +17,9 @@ import { UserBillingComponent } from '../../settings/user-billing.component';
|
|||||||
templateUrl: '../../settings/user-billing.component.html',
|
templateUrl: '../../settings/user-billing.component.html',
|
||||||
})
|
})
|
||||||
export class OrganizationBillingComponent extends UserBillingComponent implements OnInit {
|
export class OrganizationBillingComponent extends UserBillingComponent implements OnInit {
|
||||||
constructor(apiService: ApiService, i18nService: I18nService,
|
constructor(apiService: ApiService, i18nService: I18nService, toasterService: ToasterService,
|
||||||
analytics: Angulartics2, toasterService: ToasterService,
|
|
||||||
private route: ActivatedRoute, platformUtilsService: PlatformUtilsService) {
|
private route: ActivatedRoute, platformUtilsService: PlatformUtilsService) {
|
||||||
super(apiService, i18nService, analytics, toasterService, platformUtilsService);
|
super(apiService, i18nService, toasterService, platformUtilsService);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { OrganizationSubscriptionResponse } from 'jslib/models/response/organizationSubscriptionResponse';
|
import { OrganizationSubscriptionResponse } from 'jslib/models/response/organizationSubscriptionResponse';
|
||||||
|
|
||||||
@ -38,9 +37,8 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
reinstatePromise: Promise<any>;
|
reinstatePromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService,
|
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService,
|
||||||
private i18nService: I18nService, private analytics: Angulartics2,
|
private i18nService: I18nService, private toasterService: ToasterService,
|
||||||
private toasterService: ToasterService, private messagingService: MessagingService,
|
private messagingService: MessagingService, private route: ActivatedRoute) {
|
||||||
private route: ActivatedRoute) {
|
|
||||||
this.selfHosted = platformUtilsService.isSelfHost();
|
this.selfHosted = platformUtilsService.isSelfHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +73,6 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
try {
|
try {
|
||||||
this.reinstatePromise = this.apiService.postOrganizationReinstate(this.organizationId);
|
this.reinstatePromise = this.apiService.postOrganizationReinstate(this.organizationId);
|
||||||
await this.reinstatePromise;
|
await this.reinstatePromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Reinstated Plan' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('reinstated'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('reinstated'));
|
||||||
this.load();
|
this.load();
|
||||||
} catch { }
|
} catch { }
|
||||||
@ -95,7 +92,6 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
try {
|
try {
|
||||||
this.cancelPromise = this.apiService.postOrganizationCancel(this.organizationId);
|
this.cancelPromise = this.apiService.postOrganizationCancel(this.organizationId);
|
||||||
await this.cancelPromise;
|
await this.cancelPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Canceled Plan' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription'));
|
||||||
this.load();
|
this.load();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
import { ImportService } from 'jslib/abstractions/import.service';
|
import { ImportService } from 'jslib/abstractions/import.service';
|
||||||
@ -21,12 +20,11 @@ import { ImportComponent as BaseImportComponent } from '../../tools/import.compo
|
|||||||
export class ImportComponent extends BaseImportComponent {
|
export class ImportComponent extends BaseImportComponent {
|
||||||
organizationName: string;
|
organizationName: string;
|
||||||
|
|
||||||
constructor(i18nService: I18nService, analytics: Angulartics2,
|
constructor(i18nService: I18nService, toasterService: ToasterService,
|
||||||
toasterService: ToasterService, importService: ImportService,
|
importService: ImportService, router: Router, private route: ActivatedRoute,
|
||||||
router: Router, private route: ActivatedRoute,
|
|
||||||
platformUtilsService: PlatformUtilsService,
|
platformUtilsService: PlatformUtilsService,
|
||||||
private userService: UserService) {
|
private userService: UserService) {
|
||||||
super(i18nService, analytics, toasterService, importService, router, platformUtilsService);
|
super(i18nService, toasterService, importService, router, platformUtilsService);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
@ -33,12 +32,11 @@ export class CiphersComponent extends BaseCiphersComponent {
|
|||||||
|
|
||||||
protected allCiphers: CipherView[] = [];
|
protected allCiphers: CipherView[] = [];
|
||||||
|
|
||||||
constructor(searchService: SearchService, analytics: Angulartics2,
|
constructor(searchService: SearchService, toasterService: ToasterService, i18nService: I18nService,
|
||||||
toasterService: ToasterService, i18nService: I18nService,
|
|
||||||
platformUtilsService: PlatformUtilsService, cipherService: CipherService,
|
platformUtilsService: PlatformUtilsService, cipherService: CipherService,
|
||||||
private apiService: ApiService, eventService: EventService, totpService: TotpService, userService: UserService) {
|
private apiService: ApiService, eventService: EventService, totpService: TotpService, userService: UserService) {
|
||||||
super(searchService, analytics, toasterService, i18nService, platformUtilsService,
|
super(searchService, toasterService, i18nService, platformUtilsService, cipherService,
|
||||||
cipherService, eventService, totpService, userService);
|
eventService, totpService, userService);
|
||||||
}
|
}
|
||||||
|
|
||||||
async load(filter: (cipher: CipherView) => boolean = null) {
|
async load(filter: (cipher: CipherView) => boolean = null) {
|
||||||
|
@ -8,9 +8,6 @@ import {
|
|||||||
ViewChild,
|
ViewChild,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||||
import { UserService } from 'jslib/abstractions/user.service';
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
@ -49,7 +46,6 @@ export class AddCreditComponent implements OnInit {
|
|||||||
private email: string;
|
private email: string;
|
||||||
|
|
||||||
constructor(private userService: UserService, private apiService: ApiService,
|
constructor(private userService: UserService, private apiService: ApiService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
|
||||||
private platformUtilsService: PlatformUtilsService) {
|
private platformUtilsService: PlatformUtilsService) {
|
||||||
if (platformUtilsService.isDev()) {
|
if (platformUtilsService.isDev()) {
|
||||||
this.ppButtonFormAction = WebConstants.paypal.buttonActionSandbox;
|
this.ppButtonFormAction = WebConstants.paypal.buttonActionSandbox;
|
||||||
@ -108,9 +104,6 @@ export class AddCreditComponent implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
this.analytics.eventTrack.next({
|
|
||||||
action: 'Added Credit',
|
|
||||||
});
|
|
||||||
this.onAdded.emit();
|
this.onAdded.emit();
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -36,7 +35,7 @@ export class AdjustPaymentComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService) { }
|
private toasterService: ToasterService) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
try {
|
try {
|
||||||
@ -59,9 +58,6 @@ export class AdjustPaymentComponent {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({
|
|
||||||
action: this.currentType == null ? 'Added Payment Method' : 'Changed Payment Method',
|
|
||||||
});
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('updatedPaymentMethod'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('updatedPaymentMethod'));
|
||||||
this.onAdjusted.emit();
|
this.onAdjusted.emit();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -12,7 +12,6 @@ import {
|
|||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -41,8 +40,8 @@ export class AdjustStorageComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private router: Router,
|
||||||
private router: Router, private activatedRoute: ActivatedRoute) { }
|
private activatedRoute: ActivatedRoute) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
try {
|
try {
|
||||||
@ -71,7 +70,6 @@ export class AdjustStorageComponent {
|
|||||||
};
|
};
|
||||||
this.formPromise = action();
|
this.formPromise = action();
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: this.add ? 'Added Storage' : 'Removed Storage' });
|
|
||||||
this.onAdjusted.emit(this.storageAdjustment);
|
this.onAdjusted.emit(this.storageAdjustment);
|
||||||
if (paymentFailed) {
|
if (paymentFailed) {
|
||||||
this.toasterService.popAsync({
|
this.toasterService.popAsync({
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -30,8 +29,8 @@ export class ApiKeyComponent {
|
|||||||
clientId: string;
|
clientId: string;
|
||||||
clientSecret: string;
|
clientSecret: string;
|
||||||
|
|
||||||
constructor(private i18nService: I18nService, private analytics: Angulartics2,
|
constructor(private i18nService: I18nService, private toasterService: ToasterService,
|
||||||
private toasterService: ToasterService, private cryptoService: CryptoService) { }
|
private cryptoService: CryptoService) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
if (this.masterPassword == null || this.masterPassword === '') {
|
if (this.masterPassword == null || this.masterPassword === '') {
|
||||||
@ -47,7 +46,6 @@ export class ApiKeyComponent {
|
|||||||
const response = await this.formPromise;
|
const response = await this.formPromise;
|
||||||
this.clientSecret = response.apiKey;
|
this.clientSecret = response.apiKey;
|
||||||
this.clientId = `${this.keyType}.${this.entityId}`;
|
this.clientId = `${this.keyType}.${this.entityId}`;
|
||||||
this.analytics.eventTrack.next({ action: `Viewed ${this.keyType} API Key` });
|
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
@ -27,9 +26,8 @@ export class ChangeEmailComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private cryptoService: CryptoService,
|
||||||
private cryptoService: CryptoService, private messagingService: MessagingService,
|
private messagingService: MessagingService, private userService: UserService) { }
|
||||||
private userService: UserService) { }
|
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
const hasEncKey = await this.cryptoService.hasEncKey();
|
const hasEncKey = await this.cryptoService.hasEncKey();
|
||||||
@ -63,7 +61,6 @@ export class ChangeEmailComponent {
|
|||||||
this.formPromise = this.apiService.postEmail(request);
|
this.formPromise = this.apiService.postEmail(request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.reset();
|
this.reset();
|
||||||
this.analytics.eventTrack.next({ action: 'Changed Email' });
|
|
||||||
this.toasterService.popAsync('success', this.i18nService.t('emailChanged'),
|
this.toasterService.popAsync('success', this.i18nService.t('emailChanged'),
|
||||||
this.i18nService.t('logBackIn'));
|
this.i18nService.t('logBackIn'));
|
||||||
this.messagingService.send('logout');
|
this.messagingService.send('logout');
|
||||||
|
@ -4,7 +4,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
@ -28,9 +27,8 @@ export class ChangeKdfComponent implements OnInit {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private cryptoService: CryptoService,
|
||||||
private cryptoService: CryptoService, private messagingService: MessagingService,
|
private messagingService: MessagingService, private userService: UserService) {
|
||||||
private userService: UserService) {
|
|
||||||
this.kdfOptions = [
|
this.kdfOptions = [
|
||||||
{ name: 'PBKDF2 SHA-256', value: KdfType.PBKDF2_SHA256 },
|
{ name: 'PBKDF2 SHA-256', value: KdfType.PBKDF2_SHA256 },
|
||||||
];
|
];
|
||||||
@ -60,7 +58,6 @@ export class ChangeKdfComponent implements OnInit {
|
|||||||
try {
|
try {
|
||||||
this.formPromise = this.apiService.postAccountKdf(request);
|
this.formPromise = this.apiService.postAccountKdf(request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Changed KDF' });
|
|
||||||
this.toasterService.popAsync('success', this.i18nService.t('encKeySettingsChanged'),
|
this.toasterService.popAsync('success', this.i18nService.t('encKeySettingsChanged'),
|
||||||
this.i18nService.t('logBackIn'));
|
this.i18nService.t('logBackIn'));
|
||||||
this.messagingService.send('logout');
|
this.messagingService.send('logout');
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
@ -19,8 +18,8 @@ export class DeauthorizeSessionsComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private cryptoService: CryptoService,
|
||||||
private cryptoService: CryptoService, private messagingService: MessagingService) { }
|
private messagingService: MessagingService) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
if (this.masterPassword == null || this.masterPassword === '') {
|
if (this.masterPassword == null || this.masterPassword === '') {
|
||||||
@ -34,7 +33,6 @@ export class DeauthorizeSessionsComponent {
|
|||||||
try {
|
try {
|
||||||
this.formPromise = this.apiService.postSecurityStamp(request);
|
this.formPromise = this.apiService.postSecurityStamp(request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Deauthorized Sessions' });
|
|
||||||
this.toasterService.popAsync('success', this.i18nService.t('sessionsDeauthorized'),
|
this.toasterService.popAsync('success', this.i18nService.t('sessionsDeauthorized'),
|
||||||
this.i18nService.t('logBackIn'));
|
this.i18nService.t('logBackIn'));
|
||||||
this.messagingService.send('logout');
|
this.messagingService.send('logout');
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
@ -19,8 +18,8 @@ export class DeleteAccountComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private cryptoService: CryptoService,
|
||||||
private cryptoService: CryptoService, private messagingService: MessagingService) { }
|
private messagingService: MessagingService) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
if (this.masterPassword == null || this.masterPassword === '') {
|
if (this.masterPassword == null || this.masterPassword === '') {
|
||||||
@ -34,7 +33,6 @@ export class DeleteAccountComponent {
|
|||||||
try {
|
try {
|
||||||
this.formPromise = this.apiService.deleteAccount(request);
|
this.formPromise = this.apiService.deleteAccount(request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Deleted Account' });
|
|
||||||
this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'),
|
this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'),
|
||||||
this.i18nService.t('accountDeletedDesc'));
|
this.i18nService.t('accountDeletedDesc'));
|
||||||
this.messagingService.send('logout');
|
this.messagingService.send('logout');
|
||||||
|
@ -4,7 +4,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -22,7 +21,7 @@ export class DomainRulesComponent implements OnInit {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService) { }
|
private toasterService: ToasterService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
const response = await this.apiService.getSettingsDomains();
|
const response = await this.apiService.getSettingsDomains();
|
||||||
@ -74,7 +73,6 @@ export class DomainRulesComponent implements OnInit {
|
|||||||
try {
|
try {
|
||||||
this.formPromise = this.apiService.putSettingsDomains(request);
|
this.formPromise = this.apiService.putSettingsDomains(request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Saved Equivalent Domains' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('domainsUpdated'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('domainsUpdated'));
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||||
@ -34,9 +33,9 @@ export class OptionsComponent implements OnInit {
|
|||||||
private startingLocale: string;
|
private startingLocale: string;
|
||||||
|
|
||||||
constructor(private storageService: StorageService, private stateService: StateService,
|
constructor(private storageService: StorageService, private stateService: StateService,
|
||||||
private analytics: Angulartics2, private i18nService: I18nService,
|
private i18nService: I18nService, private toasterService: ToasterService,
|
||||||
private toasterService: ToasterService, private vaultTimeoutService: VaultTimeoutService,
|
private vaultTimeoutService: VaultTimeoutService, private platformUtilsService: PlatformUtilsService,
|
||||||
private platformUtilsService: PlatformUtilsService, private messagingService: MessagingService) {
|
private messagingService: MessagingService) {
|
||||||
this.vaultTimeouts = [
|
this.vaultTimeouts = [
|
||||||
{ name: i18nService.t('oneMinute'), value: 1 },
|
{ name: i18nService.t('oneMinute'), value: 1 },
|
||||||
{ name: i18nService.t('fiveMinutes'), value: 5 },
|
{ name: i18nService.t('fiveMinutes'), value: 5 },
|
||||||
@ -82,7 +81,6 @@ export class OptionsComponent implements OnInit {
|
|||||||
await this.storageService.save('enableFullWidth', this.enableFullWidth);
|
await this.storageService.save('enableFullWidth', this.enableFullWidth);
|
||||||
this.messagingService.send('setFullWidth');
|
this.messagingService.send('setFullWidth');
|
||||||
await this.storageService.save(ConstantsService.localeKey, this.locale);
|
await this.storageService.save(ConstantsService.localeKey, this.locale);
|
||||||
this.analytics.eventTrack.next({ action: 'Saved Options' });
|
|
||||||
if (this.locale !== this.startingLocale) {
|
if (this.locale !== this.startingLocale) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
|
@ -9,7 +9,6 @@ import {
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { PaymentMethodType } from 'jslib/enums/paymentMethodType';
|
import { PaymentMethodType } from 'jslib/enums/paymentMethodType';
|
||||||
|
|
||||||
@ -66,9 +65,8 @@ export class OrganizationPlansComponent implements OnInit {
|
|||||||
plans: PlanResponse[];
|
plans: PlanResponse[];
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, platformUtilsService: PlatformUtilsService,
|
||||||
platformUtilsService: PlatformUtilsService, private cryptoService: CryptoService,
|
private cryptoService: CryptoService, private router: Router, private syncService: SyncService,
|
||||||
private router: Router, private syncService: SyncService,
|
|
||||||
private policyService: PolicyService, private userService: UserService) {
|
private policyService: PolicyService, private userService: UserService) {
|
||||||
this.selfHosted = platformUtilsService.isSelfHost();
|
this.selfHosted = platformUtilsService.isSelfHost();
|
||||||
}
|
}
|
||||||
@ -320,11 +318,9 @@ export class OrganizationPlansComponent implements OnInit {
|
|||||||
await this.apiService.refreshIdentityToken();
|
await this.apiService.refreshIdentityToken();
|
||||||
await this.syncService.fullSync(true);
|
await this.syncService.fullSync(true);
|
||||||
if (this.createOrganization) {
|
if (this.createOrganization) {
|
||||||
this.analytics.eventTrack.next({ action: 'Created Organization' });
|
|
||||||
this.toasterService.popAsync('success',
|
this.toasterService.popAsync('success',
|
||||||
this.i18nService.t('organizationCreated'), this.i18nService.t('organizationReadyToGo'));
|
this.i18nService.t('organizationCreated'), this.i18nService.t('organizationReadyToGo'));
|
||||||
} else {
|
} else {
|
||||||
this.analytics.eventTrack.next({ action: 'Upgraded Organization' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('organizationUpgraded'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('organizationUpgraded'));
|
||||||
}
|
}
|
||||||
this.router.navigate(['/organizations/' + orgId]);
|
this.router.navigate(['/organizations/' + orgId]);
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
@ -33,8 +32,8 @@ export class OrganizationsComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(private userService: UserService, private platformUtilsService: PlatformUtilsService,
|
constructor(private userService: UserService, private platformUtilsService: PlatformUtilsService,
|
||||||
private i18nService: I18nService, private apiService: ApiService,
|
private i18nService: I18nService, private apiService: ApiService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private syncService: SyncService,
|
||||||
private syncService: SyncService, private cryptoService: CryptoService) { }
|
private cryptoService: CryptoService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
if (!this.vault) {
|
if (!this.vault) {
|
||||||
@ -63,7 +62,6 @@ export class OrganizationsComponent implements OnInit {
|
|||||||
return this.syncService.fullSync(true);
|
return this.syncService.fullSync(true);
|
||||||
});
|
});
|
||||||
await this.actionPromise;
|
await this.actionPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Unlinked SSO' });
|
|
||||||
this.toasterService.popAsync('success', null, 'Unlinked SSO');
|
this.toasterService.popAsync('success', null, 'Unlinked SSO');
|
||||||
await this.load();
|
await this.load();
|
||||||
} catch { }
|
} catch { }
|
||||||
@ -82,7 +80,6 @@ export class OrganizationsComponent implements OnInit {
|
|||||||
return this.syncService.fullSync(true);
|
return this.syncService.fullSync(true);
|
||||||
});
|
});
|
||||||
await this.actionPromise;
|
await this.actionPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Left Organization' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('leftOrganization'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('leftOrganization'));
|
||||||
await this.load();
|
await this.load();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -6,7 +6,6 @@ import {
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -36,10 +35,10 @@ export class PremiumComponent implements OnInit {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, platformUtilsService: PlatformUtilsService,
|
||||||
platformUtilsService: PlatformUtilsService, private tokenService: TokenService,
|
private tokenService: TokenService, private router: Router,
|
||||||
private router: Router, private messagingService: MessagingService,
|
private messagingService: MessagingService, private syncService: SyncService,
|
||||||
private syncService: SyncService, private userService: UserService) {
|
private userService: UserService) {
|
||||||
this.selfHosted = platformUtilsService.isSelfHost();
|
this.selfHosted = platformUtilsService.isSelfHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +103,6 @@ export class PremiumComponent implements OnInit {
|
|||||||
async finalizePremium() {
|
async finalizePremium() {
|
||||||
await this.apiService.refreshIdentityToken();
|
await this.apiService.refreshIdentityToken();
|
||||||
await this.syncService.fullSync(true);
|
await this.syncService.fullSync(true);
|
||||||
this.analytics.eventTrack.next({ action: 'Signed Up Premium' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('premiumUpdated'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('premiumUpdated'));
|
||||||
this.messagingService.send('purchasedPremium');
|
this.messagingService.send('purchasedPremium');
|
||||||
this.router.navigate(['/settings/subscription']);
|
this.router.navigate(['/settings/subscription']);
|
||||||
|
@ -4,7 +4,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
@ -27,8 +26,8 @@ export class ProfileComponent implements OnInit {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private userService: UserService,
|
||||||
private userService: UserService, private cryptoService: CryptoService) { }
|
private cryptoService: CryptoService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.profile = await this.apiService.getProfile();
|
this.profile = await this.apiService.getProfile();
|
||||||
@ -44,7 +43,6 @@ export class ProfileComponent implements OnInit {
|
|||||||
const request = new UpdateProfileRequest(this.profile.name, this.profile.masterPasswordHint);
|
const request = new UpdateProfileRequest(this.profile.name, this.profile.masterPasswordHint);
|
||||||
this.formPromise = this.apiService.putProfile(request);
|
this.formPromise = this.apiService.putProfile(request);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Updated Profile' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('accountUpdated'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('accountUpdated'));
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
@ -24,8 +23,8 @@ export class PurgeVaultComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private cryptoService: CryptoService,
|
||||||
private cryptoService: CryptoService, private router: Router) { }
|
private router: Router) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
if (this.masterPassword == null || this.masterPassword === '') {
|
if (this.masterPassword == null || this.masterPassword === '') {
|
||||||
@ -39,9 +38,6 @@ export class PurgeVaultComponent {
|
|||||||
try {
|
try {
|
||||||
this.formPromise = this.apiService.postPurgeCiphers(request, this.organizationId);
|
this.formPromise = this.apiService.postPurgeCiphers(request, this.organizationId);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({
|
|
||||||
action: this.organizationId != null ? 'Purged Organization Vault' : 'Purged Vault',
|
|
||||||
});
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('vaultPurged'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('vaultPurged'));
|
||||||
if (this.organizationId != null) {
|
if (this.organizationId != null) {
|
||||||
this.router.navigate(['organizations', this.organizationId, 'vault']);
|
this.router.navigate(['organizations', this.organizationId, 'vault']);
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -32,9 +31,9 @@ export class TwoFactorAuthenticatorComponent extends TwoFactorBaseComponent impl
|
|||||||
private qrScript: HTMLScriptElement;
|
private qrScript: HTMLScriptElement;
|
||||||
|
|
||||||
constructor(apiService: ApiService, i18nService: I18nService,
|
constructor(apiService: ApiService, i18nService: I18nService,
|
||||||
analytics: Angulartics2, toasterService: ToasterService,
|
toasterService: ToasterService, private userService: UserService,
|
||||||
private userService: UserService, platformUtilsService: PlatformUtilsService) {
|
platformUtilsService: PlatformUtilsService) {
|
||||||
super(apiService, i18nService, analytics, toasterService, platformUtilsService);
|
super(apiService, i18nService, toasterService, platformUtilsService);
|
||||||
this.qrScript = window.document.createElement('script');
|
this.qrScript = window.document.createElement('script');
|
||||||
this.qrScript.src = 'scripts/qrious.min.js';
|
this.qrScript.src = 'scripts/qrious.min.js';
|
||||||
this.qrScript.async = true;
|
this.qrScript.async = true;
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -27,8 +26,7 @@ export abstract class TwoFactorBaseComponent {
|
|||||||
protected masterPasswordHash: string;
|
protected masterPasswordHash: string;
|
||||||
|
|
||||||
constructor(protected apiService: ApiService, protected i18nService: I18nService,
|
constructor(protected apiService: ApiService, protected i18nService: I18nService,
|
||||||
protected analytics: Angulartics2, protected toasterService: ToasterService,
|
protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService) { }
|
||||||
protected platformUtilsService: PlatformUtilsService) { }
|
|
||||||
|
|
||||||
protected auth(authResponse: any) {
|
protected auth(authResponse: any) {
|
||||||
this.masterPasswordHash = authResponse.masterPasswordHash;
|
this.masterPasswordHash = authResponse.masterPasswordHash;
|
||||||
@ -38,9 +36,6 @@ export abstract class TwoFactorBaseComponent {
|
|||||||
protected async enable(enableFunction: () => Promise<void>) {
|
protected async enable(enableFunction: () => Promise<void>) {
|
||||||
try {
|
try {
|
||||||
await enableFunction();
|
await enableFunction();
|
||||||
this.analytics.eventTrack.next({
|
|
||||||
action: 'Enabled Two-step ' + TwoFactorProviderType[this.type].toString(),
|
|
||||||
});
|
|
||||||
this.onUpdated.emit(true);
|
this.onUpdated.emit(true);
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
@ -63,9 +58,6 @@ export abstract class TwoFactorBaseComponent {
|
|||||||
}
|
}
|
||||||
await promise;
|
await promise;
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.analytics.eventTrack.next({
|
|
||||||
action: 'Disabled Two-step ' + TwoFactorProviderType[this.type].toString(),
|
|
||||||
});
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('twoStepDisabled'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('twoStepDisabled'));
|
||||||
this.onUpdated.emit(false);
|
this.onUpdated.emit(false);
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -25,9 +24,8 @@ export class TwoFactorDuoComponent extends TwoFactorBaseComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(apiService: ApiService, i18nService: I18nService,
|
constructor(apiService: ApiService, i18nService: I18nService,
|
||||||
analytics: Angulartics2, toasterService: ToasterService,
|
toasterService: ToasterService, platformUtilsService: PlatformUtilsService) {
|
||||||
platformUtilsService: PlatformUtilsService) {
|
super(apiService, i18nService, toasterService, platformUtilsService);
|
||||||
super(apiService, i18nService, analytics, toasterService, platformUtilsService);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auth(authResponse: any) {
|
auth(authResponse: any) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -29,9 +28,9 @@ export class TwoFactorEmailComponent extends TwoFactorBaseComponent {
|
|||||||
emailPromise: Promise<any>;
|
emailPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(apiService: ApiService, i18nService: I18nService,
|
constructor(apiService: ApiService, i18nService: I18nService,
|
||||||
analytics: Angulartics2, toasterService: ToasterService,
|
toasterService: ToasterService, platformUtilsService: PlatformUtilsService,
|
||||||
platformUtilsService: PlatformUtilsService, private userService: UserService) {
|
private userService: UserService) {
|
||||||
super(apiService, i18nService, analytics, toasterService, platformUtilsService);
|
super(apiService, i18nService, toasterService, platformUtilsService);
|
||||||
}
|
}
|
||||||
|
|
||||||
auth(authResponse: any) {
|
auth(authResponse: any) {
|
||||||
|
@ -4,7 +4,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -39,9 +38,9 @@ export class TwoFactorWebAuthnComponent extends TwoFactorBaseComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(apiService: ApiService, i18nService: I18nService,
|
constructor(apiService: ApiService, i18nService: I18nService,
|
||||||
analytics: Angulartics2, toasterService: ToasterService,
|
toasterService: ToasterService, platformUtilsService: PlatformUtilsService,
|
||||||
platformUtilsService: PlatformUtilsService, private ngZone: NgZone) {
|
private ngZone: NgZone) {
|
||||||
super(apiService, i18nService, analytics, toasterService, platformUtilsService);
|
super(apiService, i18nService, toasterService, platformUtilsService);
|
||||||
}
|
}
|
||||||
|
|
||||||
auth(authResponse: any) {
|
auth(authResponse: any) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -27,9 +26,8 @@ export class TwoFactorYubiKeyComponent extends TwoFactorBaseComponent {
|
|||||||
disablePromise: Promise<any>;
|
disablePromise: Promise<any>;
|
||||||
|
|
||||||
constructor(apiService: ApiService, i18nService: I18nService,
|
constructor(apiService: ApiService, i18nService: I18nService,
|
||||||
analytics: Angulartics2, toasterService: ToasterService,
|
toasterService: ToasterService, platformUtilsService: PlatformUtilsService) {
|
||||||
platformUtilsService: PlatformUtilsService) {
|
super(apiService, i18nService, toasterService, platformUtilsService);
|
||||||
super(apiService, i18nService, analytics, toasterService, platformUtilsService);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auth(authResponse: any) {
|
auth(authResponse: any) {
|
||||||
|
@ -4,7 +4,6 @@ import {
|
|||||||
Toast,
|
Toast,
|
||||||
ToasterService,
|
ToasterService,
|
||||||
} from 'angular2-toaster';
|
} from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
@ -29,10 +28,9 @@ export class UpdateKeyComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private cryptoService: CryptoService,
|
||||||
private cryptoService: CryptoService, private messagingService: MessagingService,
|
private messagingService: MessagingService, private syncService: SyncService,
|
||||||
private syncService: SyncService, private folderService: FolderService,
|
private folderService: FolderService, private cipherService: CipherService) { }
|
||||||
private cipherService: CipherService) { }
|
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
const hasEncKey = await this.cryptoService.hasEncKey();
|
const hasEncKey = await this.cryptoService.hasEncKey();
|
||||||
@ -51,7 +49,6 @@ export class UpdateKeyComponent {
|
|||||||
return this.apiService.postAccountKey(request);
|
return this.apiService.postAccountKey(request);
|
||||||
});
|
});
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Key Updated' });
|
|
||||||
const toast: Toast = {
|
const toast: Toast = {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
title: this.i18nService.t('keyUpdated'),
|
title: this.i18nService.t('keyUpdated'),
|
||||||
|
@ -6,7 +6,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -23,7 +22,7 @@ export class UpdateLicenseComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService) { }
|
private toasterService: ToasterService) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
const fileEl = document.getElementById('file') as HTMLInputElement;
|
const fileEl = document.getElementById('file') as HTMLInputElement;
|
||||||
@ -50,7 +49,6 @@ export class UpdateLicenseComponent {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Updated License' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('updatedLicense'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('updatedLicense'));
|
||||||
this.onUpdated.emit();
|
this.onUpdated.emit();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -4,7 +4,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { BillingResponse } from 'jslib/models/response/billingResponse';
|
import { BillingResponse } from 'jslib/models/response/billingResponse';
|
||||||
|
|
||||||
@ -35,8 +34,7 @@ export class UserBillingComponent implements OnInit {
|
|||||||
verifyBankPromise: Promise<any>;
|
verifyBankPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(protected apiService: ApiService, protected i18nService: I18nService,
|
constructor(protected apiService: ApiService, protected i18nService: I18nService,
|
||||||
protected analytics: Angulartics2, protected toasterService: ToasterService,
|
protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService) { }
|
||||||
protected platformUtilsService: PlatformUtilsService) { }
|
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
await this.load();
|
await this.load();
|
||||||
@ -67,7 +65,6 @@ export class UserBillingComponent implements OnInit {
|
|||||||
request.amount2 = this.verifyAmount2;
|
request.amount2 = this.verifyAmount2;
|
||||||
this.verifyBankPromise = this.apiService.postOrganizationVerifyBank(this.organizationId, request);
|
this.verifyBankPromise = this.apiService.postOrganizationVerifyBank(this.organizationId, request);
|
||||||
await this.verifyBankPromise;
|
await this.verifyBankPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Verified Bank Account' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('verifiedBankAccount'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('verifiedBankAccount'));
|
||||||
this.load();
|
this.load();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { SubscriptionResponse } from 'jslib/models/response/subscriptionResponse';
|
import { SubscriptionResponse } from 'jslib/models/response/subscriptionResponse';
|
||||||
|
|
||||||
@ -32,8 +31,7 @@ export class UserSubscriptionComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(private tokenService: TokenService, private apiService: ApiService,
|
constructor(private tokenService: TokenService, private apiService: ApiService,
|
||||||
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,
|
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
private toasterService: ToasterService, private router: Router) {
|
||||||
private router: Router) {
|
|
||||||
this.selfHosted = platformUtilsService.isSelfHost();
|
this.selfHosted = platformUtilsService.isSelfHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +76,6 @@ export class UserSubscriptionComponent implements OnInit {
|
|||||||
try {
|
try {
|
||||||
this.reinstatePromise = this.apiService.postReinstatePremium();
|
this.reinstatePromise = this.apiService.postReinstatePremium();
|
||||||
await this.reinstatePromise;
|
await this.reinstatePromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Reinstated Premium' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('reinstated'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('reinstated'));
|
||||||
this.load();
|
this.load();
|
||||||
} catch { }
|
} catch { }
|
||||||
@ -104,7 +101,6 @@ export class UserSubscriptionComponent implements OnInit {
|
|||||||
try {
|
try {
|
||||||
this.cancelPromise = this.apiService.postCancelPremium();
|
this.cancelPromise = this.apiService.postCancelPremium();
|
||||||
await this.cancelPromise;
|
await this.cancelPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Canceled Premium' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription'));
|
||||||
this.load();
|
this.load();
|
||||||
} catch { }
|
} catch { }
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -14,7 +13,7 @@ export class VerifyEmailComponent {
|
|||||||
actionPromise: Promise<any>;
|
actionPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService) { }
|
private toasterService: ToasterService) { }
|
||||||
|
|
||||||
async send() {
|
async send() {
|
||||||
if (this.actionPromise != null) {
|
if (this.actionPromise != null) {
|
||||||
@ -23,7 +22,6 @@ export class VerifyEmailComponent {
|
|||||||
try {
|
try {
|
||||||
this.actionPromise = this.apiService.postAccountVerifyEmail();
|
this.actionPromise = this.apiService.postAccountVerifyEmail();
|
||||||
await this.actionPromise;
|
await this.actionPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Sent Verification Email' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('checkInboxForVerification'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('checkInboxForVerification'));
|
||||||
} catch { }
|
} catch { }
|
||||||
this.actionPromise = null;
|
this.actionPromise = null;
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
import { ImportOption, ImportService } from 'jslib/abstractions/import.service';
|
import { ImportOption, ImportService } from 'jslib/abstractions/import.service';
|
||||||
@ -28,9 +27,9 @@ export class ImportComponent implements OnInit {
|
|||||||
protected organizationId: string = null;
|
protected organizationId: string = null;
|
||||||
protected successNavigate: any[] = ['vault'];
|
protected successNavigate: any[] = ['vault'];
|
||||||
|
|
||||||
constructor(protected i18nService: I18nService, protected analytics: Angulartics2,
|
constructor(protected i18nService: I18nService, protected toasterService: ToasterService,
|
||||||
protected toasterService: ToasterService, protected importService: ImportService,
|
protected importService: ImportService, protected router: Router,
|
||||||
protected router: Router, protected platformUtilsService: PlatformUtilsService) { }
|
protected platformUtilsService: PlatformUtilsService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.setImportOptions();
|
this.setImportOptions();
|
||||||
@ -95,10 +94,6 @@ export class ImportComponent implements OnInit {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.analytics.eventTrack.next({
|
|
||||||
action: 'Imported Data',
|
|
||||||
properties: { label: this.format },
|
|
||||||
});
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('importSuccess'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('importSuccess'));
|
||||||
this.router.navigate(this.successNavigate);
|
this.router.navigate(this.successNavigate);
|
||||||
} catch { }
|
} catch { }
|
||||||
@ -127,11 +122,6 @@ export class ImportComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async error(error: Error) {
|
private async error(error: Error) {
|
||||||
this.analytics.eventTrack.next({
|
|
||||||
action: 'Import Data Failed',
|
|
||||||
properties: { label: this.format },
|
|
||||||
});
|
|
||||||
|
|
||||||
await Swal.fire({
|
await Swal.fire({
|
||||||
heightAuto: false,
|
heightAuto: false,
|
||||||
buttonsStyling: false,
|
buttonsStyling: false,
|
||||||
|
@ -78,7 +78,6 @@ export class AddEditComponent extends BaseAddEditComponent {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.platformUtilsService.eventTrack('Launched Login URI');
|
|
||||||
this.platformUtilsService.launchUri(uri.launchUri);
|
this.platformUtilsService.launchUri(uri.launchUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +86,6 @@ export class AddEditComponent extends BaseAddEditComponent {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.platformUtilsService.eventTrack('Copied ' + aType);
|
|
||||||
this.platformUtilsService.copyToClipboard(value, { window: window });
|
this.platformUtilsService.copyToClipboard(value, { window: window });
|
||||||
this.platformUtilsService.showToast('info', null,
|
this.platformUtilsService.showToast('info', null,
|
||||||
this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey)));
|
this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey)));
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
Output,
|
Output,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
@ -26,9 +25,8 @@ export class BulkDeleteComponent {
|
|||||||
|
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private analytics: Angulartics2, private cipherService: CipherService,
|
constructor(private cipherService: CipherService, private toasterService: ToasterService,
|
||||||
private toasterService: ToasterService, private i18nService: I18nService,
|
private i18nService: I18nService, private apiService: ApiService) { }
|
||||||
private apiService: ApiService) { }
|
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
if (!this.organization || !this.organization.canManageAllCollections) {
|
if (!this.organization || !this.organization.canManageAllCollections) {
|
||||||
@ -40,7 +38,6 @@ export class BulkDeleteComponent {
|
|||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
|
|
||||||
this.onDeleted.emit();
|
this.onDeleted.emit();
|
||||||
this.analytics.eventTrack.next({ action: 'Bulk Deleted Items' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t(this.permanent ? 'permanentlyDeletedItems'
|
this.toasterService.popAsync('success', null, this.i18nService.t(this.permanent ? 'permanentlyDeletedItems'
|
||||||
: 'deletedItems'));
|
: 'deletedItems'));
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
import { FolderService } from 'jslib/abstractions/folder.service';
|
import { FolderService } from 'jslib/abstractions/folder.service';
|
||||||
@ -27,9 +26,8 @@ export class BulkMoveComponent implements OnInit {
|
|||||||
folders: FolderView[] = [];
|
folders: FolderView[] = [];
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private analytics: Angulartics2, private cipherService: CipherService,
|
constructor(private cipherService: CipherService, private toasterService: ToasterService,
|
||||||
private toasterService: ToasterService, private i18nService: I18nService,
|
private i18nService: I18nService, private folderService: FolderService) { }
|
||||||
private folderService: FolderService) { }
|
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.folders = await this.folderService.getAllDecrypted();
|
this.folders = await this.folderService.getAllDecrypted();
|
||||||
@ -40,7 +38,6 @@ export class BulkMoveComponent implements OnInit {
|
|||||||
this.formPromise = this.cipherService.moveManyWithServer(this.cipherIds, this.folderId);
|
this.formPromise = this.cipherService.moveManyWithServer(this.cipherIds, this.folderId);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.onMoved.emit();
|
this.onMoved.emit();
|
||||||
this.analytics.eventTrack.next({ action: 'Bulk Moved Items' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('movedItems'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('movedItems'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
@ -21,14 +20,13 @@ export class BulkRestoreComponent {
|
|||||||
|
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private analytics: Angulartics2, private cipherService: CipherService,
|
constructor(private cipherService: CipherService, private toasterService: ToasterService,
|
||||||
private toasterService: ToasterService, private i18nService: I18nService) { }
|
private i18nService: I18nService) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
this.formPromise = this.cipherService.restoreManyWithServer(this.cipherIds);
|
this.formPromise = this.cipherService.restoreManyWithServer(this.cipherIds);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.onRestored.emit();
|
this.onRestored.emit();
|
||||||
this.analytics.eventTrack.next({ action: 'Bulk Restored Items' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('restoredItems'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('restoredItems'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
import { CollectionService } from 'jslib/abstractions/collection.service';
|
import { CollectionService } from 'jslib/abstractions/collection.service';
|
||||||
@ -36,9 +35,9 @@ export class BulkShareComponent implements OnInit {
|
|||||||
|
|
||||||
private writeableCollections: CollectionView[] = [];
|
private writeableCollections: CollectionView[] = [];
|
||||||
|
|
||||||
constructor(private analytics: Angulartics2, private cipherService: CipherService,
|
constructor(private cipherService: CipherService, private toasterService: ToasterService,
|
||||||
private toasterService: ToasterService, private i18nService: I18nService,
|
private i18nService: I18nService, private collectionService: CollectionService,
|
||||||
private collectionService: CollectionService, private userService: UserService) { }
|
private userService: UserService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.shareableCiphers = this.ciphers.filter(c => !c.hasOldAttachments && c.organizationId == null);
|
this.shareableCiphers = this.ciphers.filter(c => !c.hasOldAttachments && c.organizationId == null);
|
||||||
@ -72,7 +71,6 @@ export class BulkShareComponent implements OnInit {
|
|||||||
checkedCollectionIds);
|
checkedCollectionIds);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
this.onShared.emit();
|
this.onShared.emit();
|
||||||
this.analytics.eventTrack.next({ action: 'Bulk Shared Items' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('sharedItems'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('sharedItems'));
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
import { EventService } from 'jslib/abstractions/event.service';
|
import { EventService } from 'jslib/abstractions/event.service';
|
||||||
@ -41,10 +40,10 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
|
|||||||
actionPromise: Promise<any>;
|
actionPromise: Promise<any>;
|
||||||
userHasPremiumAccess = false;
|
userHasPremiumAccess = false;
|
||||||
|
|
||||||
constructor(searchService: SearchService, protected analytics: Angulartics2,
|
constructor(searchService: SearchService, protected toasterService: ToasterService,
|
||||||
protected toasterService: ToasterService, protected i18nService: I18nService,
|
protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,
|
||||||
protected platformUtilsService: PlatformUtilsService, protected cipherService: CipherService,
|
protected cipherService: CipherService, protected eventService: EventService,
|
||||||
protected eventService: EventService, protected totpService: TotpService, protected userService: UserService) {
|
protected totpService: TotpService, protected userService: UserService) {
|
||||||
super(searchService);
|
super(searchService);
|
||||||
this.pageSize = 200;
|
this.pageSize = 200;
|
||||||
}
|
}
|
||||||
@ -58,7 +57,6 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
|
|||||||
}
|
}
|
||||||
|
|
||||||
launch(uri: string) {
|
launch(uri: string) {
|
||||||
this.platformUtilsService.eventTrack('Launched Login URI');
|
|
||||||
this.platformUtilsService.launchUri(uri);
|
this.platformUtilsService.launchUri(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +92,6 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
|
|||||||
try {
|
try {
|
||||||
this.actionPromise = this.deleteCipher(c.id, permanent);
|
this.actionPromise = this.deleteCipher(c.id, permanent);
|
||||||
await this.actionPromise;
|
await this.actionPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Deleted Cipher' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t(permanent ? 'permanentlyDeletedItem'
|
this.toasterService.popAsync('success', null, this.i18nService.t(permanent ? 'permanentlyDeletedItem'
|
||||||
: 'deletedItem'));
|
: 'deletedItem'));
|
||||||
this.refresh();
|
this.refresh();
|
||||||
@ -117,7 +114,6 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
|
|||||||
try {
|
try {
|
||||||
this.actionPromise = this.cipherService.restoreWithServer(c.id);
|
this.actionPromise = this.cipherService.restoreWithServer(c.id);
|
||||||
await this.actionPromise;
|
await this.actionPromise;
|
||||||
this.analytics.eventTrack.next({ action: 'Restored Cipher' });
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('restoredItem'));
|
this.toasterService.popAsync('success', null, this.i18nService.t('restoredItem'));
|
||||||
this.refresh();
|
this.refresh();
|
||||||
} catch { }
|
} catch { }
|
||||||
@ -131,7 +127,6 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
|
|||||||
value = await this.totpService.getCode(value);
|
value = await this.totpService.getCode(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.analytics.eventTrack.next({ action: 'Copied ' + aType.toLowerCase() + ' from listing.' });
|
|
||||||
this.platformUtilsService.copyToClipboard(value, { window: window });
|
this.platformUtilsService.copyToClipboard(value, { window: window });
|
||||||
this.toasterService.popAsync('info', null,
|
this.toasterService.popAsync('info', null,
|
||||||
this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey)));
|
this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey)));
|
||||||
|
@ -6,8 +6,6 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
|
|||||||
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||||
|
|
||||||
import { Utils } from 'jslib/misc/utils';
|
|
||||||
|
|
||||||
export class WebPlatformUtilsService implements PlatformUtilsService {
|
export class WebPlatformUtilsService implements PlatformUtilsService {
|
||||||
identityClientId: string = 'web';
|
identityClientId: string = 'web';
|
||||||
|
|
||||||
@ -78,10 +76,6 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
analyticsId(): string {
|
|
||||||
return 'UA-81915606-3';
|
|
||||||
}
|
|
||||||
|
|
||||||
isViewOpen(): Promise<boolean> {
|
isViewOpen(): Promise<boolean> {
|
||||||
return Promise.resolve(false);
|
return Promise.resolve(false);
|
||||||
}
|
}
|
||||||
@ -217,14 +211,6 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
|
|||||||
return confirmed.value;
|
return confirmed.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
eventTrack(action: string, label?: string, options?: any) {
|
|
||||||
this.messagingService.send('analyticsEventTrack', {
|
|
||||||
action: action,
|
|
||||||
label: label,
|
|
||||||
options: options,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
isDev(): boolean {
|
isDev(): boolean {
|
||||||
return process.env.ENV === 'development';
|
return process.env.ENV === 'development';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user