bitwarden-estensione-browser/src/app/vault/view.component.ts

52 lines
2.0 KiB
TypeScript
Raw Normal View History

2018-01-24 04:21:14 +01:00
import {
2018-08-20 23:01:25 +02:00
ChangeDetectorRef,
2018-01-24 04:21:14 +01:00
Component,
2018-07-30 17:00:06 +02:00
EventEmitter,
2018-08-20 23:01:25 +02:00
NgZone,
2018-01-24 04:21:14 +01:00
OnChanges,
2018-07-30 17:00:06 +02:00
Output,
2018-01-24 04:21:14 +01:00
} from '@angular/core';
import { AuditService } from 'jslib/abstractions/audit.service';
2018-01-24 06:06:05 +01:00
import { CipherService } from 'jslib/abstractions/cipher.service';
2018-01-25 20:25:44 +01:00
import { CryptoService } from 'jslib/abstractions/crypto.service';
2019-07-09 19:11:10 +02:00
import { EventService } from 'jslib/abstractions/event.service';
2018-01-25 20:25:44 +01:00
import { I18nService } from 'jslib/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
2018-01-25 05:26:40 +01:00
import { TokenService } from 'jslib/abstractions/token.service';
import { TotpService } from 'jslib/abstractions/totp.service';
2018-08-29 05:17:34 +02:00
import { UserService } from 'jslib/abstractions/user.service';
2018-01-24 06:06:05 +01:00
2018-08-20 23:01:25 +02:00
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
2018-04-06 05:50:06 +02:00
import { ViewComponent as BaseViewComponent } from 'jslib/angular/components/view.component';
2018-01-24 18:20:01 +01:00
2018-07-30 17:00:06 +02:00
import { CipherView } from 'jslib/models/view/cipherView';
2018-01-24 04:21:14 +01:00
@Component({
selector: 'app-vault-view',
templateUrl: 'view.component.html',
2018-01-24 04:21:14 +01:00
})
2018-04-06 05:50:06 +02:00
export class ViewComponent extends BaseViewComponent implements OnChanges {
2018-07-30 17:00:06 +02:00
@Output() onViewCipherPasswordHistory = new EventEmitter<CipherView>();
2018-04-06 05:50:06 +02:00
constructor(cipherService: CipherService, totpService: TotpService,
tokenService: TokenService, i18nService: I18nService,
2018-04-06 05:50:06 +02:00
cryptoService: CryptoService, platformUtilsService: PlatformUtilsService,
2018-08-20 23:01:25 +02:00
auditService: AuditService, broadcasterService: BroadcasterService,
2018-08-29 05:17:34 +02:00
ngZone: NgZone, changeDetectorRef: ChangeDetectorRef,
2019-07-09 19:11:10 +02:00
userService: UserService, eventService: EventService) {
super(cipherService, totpService, tokenService, i18nService, cryptoService, platformUtilsService,
2019-07-09 19:11:10 +02:00
auditService, window, broadcasterService, ngZone, changeDetectorRef, userService, eventService);
2018-01-25 17:28:52 +01:00
}
2018-04-06 05:50:06 +02:00
async ngOnChanges() {
await super.load();
2018-01-25 05:26:40 +01:00
}
2018-07-30 17:00:06 +02:00
viewHistory() {
this.platformUtilsService.eventTrack('View Password History');
2018-07-30 17:00:06 +02:00
this.onViewCipherPasswordHistory.emit(this.cipher);
}
2018-01-24 04:21:14 +01:00
}