mirror of
https://github.com/bitwarden/web
synced 2025-12-21 10:43:26 +00:00
Apply Prettier (#1347)
This commit is contained in:
@@ -1,44 +1,42 @@
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
OnChanges,
|
||||
} from '@angular/core';
|
||||
import { Component, Input, OnChanges } from "@angular/core";
|
||||
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-password-strength',
|
||||
templateUrl: 'password-strength.component.html',
|
||||
selector: "app-password-strength",
|
||||
templateUrl: "password-strength.component.html",
|
||||
})
|
||||
export class PasswordStrengthComponent implements OnChanges {
|
||||
@Input() score?: number;
|
||||
@Input() showText = false;
|
||||
@Input()
|
||||
score?: number;
|
||||
@Input()
|
||||
showText = false;
|
||||
|
||||
scoreWidth = 0;
|
||||
color = 'bg-danger';
|
||||
text: string;
|
||||
scoreWidth = 0;
|
||||
color = "bg-danger";
|
||||
text: string;
|
||||
|
||||
constructor(private i18nService: I18nService) { }
|
||||
constructor(private i18nService: I18nService) {}
|
||||
|
||||
ngOnChanges(): void {
|
||||
this.scoreWidth = this.score == null ? 0 : (this.score + 1) * 20;
|
||||
switch (this.score) {
|
||||
case 4:
|
||||
this.color = 'bg-success';
|
||||
this.text = this.i18nService.t('strong');
|
||||
break;
|
||||
case 3:
|
||||
this.color = 'bg-primary';
|
||||
this.text = this.i18nService.t('good');
|
||||
break;
|
||||
case 2:
|
||||
this.color = 'bg-warning';
|
||||
this.text = this.i18nService.t('weak');
|
||||
break;
|
||||
default:
|
||||
this.color = 'bg-danger';
|
||||
this.text = this.score != null ? this.i18nService.t('weak') : null;
|
||||
break;
|
||||
}
|
||||
ngOnChanges(): void {
|
||||
this.scoreWidth = this.score == null ? 0 : (this.score + 1) * 20;
|
||||
switch (this.score) {
|
||||
case 4:
|
||||
this.color = "bg-success";
|
||||
this.text = this.i18nService.t("strong");
|
||||
break;
|
||||
case 3:
|
||||
this.color = "bg-primary";
|
||||
this.text = this.i18nService.t("good");
|
||||
break;
|
||||
case 2:
|
||||
this.color = "bg-warning";
|
||||
this.text = this.i18nService.t("weak");
|
||||
break;
|
||||
default:
|
||||
this.color = "bg-danger";
|
||||
this.text = this.score != null ? this.i18nService.t("weak") : null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user