1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

move component code out to jslib

This commit is contained in:
Kyle Spearrin
2018-04-05 23:50:06 -04:00
parent d56f54832e
commit 86226990ee
8 changed files with 54 additions and 683 deletions

View File

@@ -3,40 +3,24 @@ import * as template from './password-generator-history.component.html';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import {
Component,
OnInit,
} from '@angular/core';
import { Component } from '@angular/core';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { PasswordHistory } from 'jslib/models/domain/passwordHistory';
import {
PasswordGeneratorHistoryComponent as BasePasswordGeneratorHistoryComponent
} from 'jslib/angular/components/password-generator-history.component';
@Component({
selector: 'app-password-generator-history',
template: template,
})
export class PasswordGeneratorHistoryComponent implements OnInit {
history: PasswordHistory[] = [];
constructor(private passwordGenerationService: PasswordGenerationService, private analytics: Angulartics2,
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,
private toasterService: ToasterService) { }
async ngOnInit() {
this.history = await this.passwordGenerationService.getHistory();
}
clear() {
this.history = [];
this.passwordGenerationService.clear();
}
copy(password: string) {
this.analytics.eventTrack.next({ action: 'Copied Historical Password' });
this.platformUtilsService.copyToClipboard(password);
this.toasterService.popAsync('info', null, this.i18nService.t('valueCopied', this.i18nService.t('password')));
export class PasswordGeneratorHistoryComponent extends BasePasswordGeneratorHistoryComponent {
constructor(passwordGenerationService: PasswordGenerationService, analytics: Angulartics2,
platformUtilsService: PlatformUtilsService, i18nService: I18nService,
toasterService: ToasterService) {
super(passwordGenerationService, analytics, platformUtilsService, i18nService, toasterService);
}
}