event logging on view page

This commit is contained in:
Kyle Spearrin 2019-07-09 13:56:13 -04:00
parent ebdc84ea3f
commit 1fece3079f
4 changed files with 14 additions and 4 deletions

2
jslib

@ -1 +1 @@
Subproject commit 2830121471fb7c6dca6de934c5f28520294fbffb
Subproject commit 7bdca0dcb4bbe8983157d555740db5ed229d5948

View File

@ -19,6 +19,7 @@ import {
TotpService,
UserService,
} from 'jslib/services';
import { EventService } from 'jslib/services/event.service';
import { ExportService } from 'jslib/services/export.service';
import { NotificationsService } from 'jslib/services/notifications.service';
import { SearchService } from 'jslib/services/search.service';
@ -46,6 +47,7 @@ import {
TotpService as TotpServiceAbstraction,
UserService as UserServiceAbstraction,
} from 'jslib/abstractions';
import { EventService as EventServiceAbstraction } from 'jslib/abstractions/event.service';
import { ExportService as ExportServiceAbstraction } from 'jslib/abstractions/export.service';
import { NotificationsService as NotificationsServiceAbstraction } from 'jslib/abstractions/notifications.service';
import { SearchService as SearchServiceAbstraction } from 'jslib/abstractions/search.service';
@ -100,6 +102,7 @@ export default class MainBackground {
searchService: SearchServiceAbstraction;
notificationsService: NotificationsServiceAbstraction;
systemService: SystemServiceAbstraction;
eventService: EventServiceAbstraction;
analytics: Analytics;
onUpdatedRan: boolean;
@ -177,6 +180,8 @@ export default class MainBackground {
this.notificationsService);
this.analytics = new Analytics(window, () => BrowserApi.gaFilter(), this.platformUtilsService,
this.storageService, this.appIdService);
this.eventService = new EventService(this.storageService, this.apiService, this.userService,
this.cipherService);
this.systemService = new SystemService(this.storageService, this.lockService,
this.messagingService, this.platformUtilsService, () => {
const forceWindowReload = this.platformUtilsService.isSafari() ||
@ -214,6 +219,7 @@ export default class MainBackground {
await (this.lockService as LockService).init(true);
await (this.i18nService as I18nService).init();
await (this.eventService as EventService).init(true);
await this.runtimeBackground.init();
await this.tabsBackground.init();
await this.commandsBackground.init();
@ -281,9 +287,11 @@ export default class MainBackground {
}
async logout(expired: boolean) {
await this.eventService.uploadEvents();
const userId = await this.userService.getUserId();
await Promise.all([
this.eventService.clearEvents(),
this.syncService.setLastSync(new Date(0)),
this.tokenService.clearToken(),
this.cryptoService.clearKeys(),

View File

@ -229,7 +229,7 @@
</a>
<a class="row-btn" href="#" appStopClick title="{{'copyValue' | i18n}}"
*ngIf="field.value && field.type !== fieldType.Boolean"
(click)="copy(field.value, 'value', 'Field')">
(click)="copy(field.value, 'value', field.type === fieldType.Hidden ? 'H_Field' : 'Field')">
<i class="fa fa-lg fa-clipboard"></i>
</a>
</div>

View File

@ -12,6 +12,7 @@ import {
import { AuditService } from 'jslib/abstractions/audit.service';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { CryptoService } from 'jslib/abstractions/crypto.service';
import { EventService } from 'jslib/abstractions/event.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { TokenService } from 'jslib/abstractions/token.service';
@ -35,9 +36,10 @@ export class ViewComponent extends BaseViewComponent {
auditService: AuditService, private route: ActivatedRoute,
private router: Router, private location: Location,
broadcasterService: BroadcasterService, ngZone: NgZone,
changeDetectorRef: ChangeDetectorRef, userService: UserService) {
changeDetectorRef: ChangeDetectorRef, userService: UserService,
eventService: EventService) {
super(cipherService, totpService, tokenService, i18nService, cryptoService, platformUtilsService,
auditService, window, broadcasterService, ngZone, changeDetectorRef, userService);
auditService, window, broadcasterService, ngZone, changeDetectorRef, userService, eventService);
}
ngOnInit() {