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

generic event log component for user/ciphers

This commit is contained in:
Kyle Spearrin
2018-07-11 15:22:55 -04:00
parent 6d225beb46
commit 98d3b42728
8 changed files with 89 additions and 16 deletions

View File

@@ -1,4 +1,8 @@
import { Component } from '@angular/core';
import {
Component,
EventEmitter,
Output,
} from '@angular/core';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
@@ -20,7 +24,10 @@ import { CiphersComponent as BaseCiphersComponent } from '../../vault/ciphers.co
templateUrl: '../../vault/ciphers.component.html',
})
export class CiphersComponent extends BaseCiphersComponent {
@Output() onEventsClicked = new EventEmitter<CipherView>();
organization: Organization;
accessEvents = false;
constructor(cipherService: CipherService, analytics: Angulartics2,
toasterService: ToasterService, i18nService: I18nService,
@@ -33,6 +40,7 @@ export class CiphersComponent extends BaseCiphersComponent {
await super.load();
return;
}
this.accessEvents = this.organization.useEvents;
const ciphers = await this.apiService.getCiphersOrganization(this.organization.id);
if (ciphers != null && ciphers.data != null && ciphers.data.length) {
const decCiphers: CipherView[] = [];
@@ -64,4 +72,8 @@ export class CiphersComponent extends BaseCiphersComponent {
checkCipher(c: CipherView) {
// do nothing
}
events(c: CipherView) {
this.onEventsClicked.emit(c);
}
}