mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
misc score props moved to jslib
This commit is contained in:
@@ -32,6 +32,36 @@ export class RegisterComponent {
|
|||||||
protected platformUtilsService: PlatformUtilsService,
|
protected platformUtilsService: PlatformUtilsService,
|
||||||
protected passwordGenerationService: PasswordGenerationService) { }
|
protected passwordGenerationService: PasswordGenerationService) { }
|
||||||
|
|
||||||
|
get masterPasswordScoreWidth() {
|
||||||
|
return this.masterPasswordScore == null ? 0 : (this.masterPasswordScore + 1) * 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
get masterPasswordScoreColor() {
|
||||||
|
switch (this.masterPasswordScore) {
|
||||||
|
case 4:
|
||||||
|
return 'success';
|
||||||
|
case 3:
|
||||||
|
return 'primary';
|
||||||
|
case 2:
|
||||||
|
return 'warning';
|
||||||
|
default:
|
||||||
|
return 'danger';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get masterPasswordScoreText() {
|
||||||
|
switch (this.masterPasswordScore) {
|
||||||
|
case 4:
|
||||||
|
return this.i18nService.t('strong');
|
||||||
|
case 3:
|
||||||
|
return this.i18nService.t('good');
|
||||||
|
case 2:
|
||||||
|
return this.i18nService.t('weak');
|
||||||
|
default:
|
||||||
|
return this.masterPasswordScore != null ? this.i18nService.t('weak') : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
if (this.email == null || this.email === '') {
|
if (this.email == null || this.email === '') {
|
||||||
this.platformUtilsService.showToast('error', this.i18nService.t('errorOccurred'),
|
this.platformUtilsService.showToast('error', this.i18nService.t('errorOccurred'),
|
||||||
|
|||||||
Reference in New Issue
Block a user