add master password strength text
This commit is contained in:
parent
fceabbb4bf
commit
8502ff8fa4
2
jslib
2
jslib
|
@ -1 +1 @@
|
||||||
Subproject commit be080f4f17b782fdb22c77560bd235e81346fb21
|
Subproject commit da47faca5c9a41f732136448461a06fc6e6fe023
|
|
@ -1113,6 +1113,18 @@
|
||||||
"whoOwnsThisItem": {
|
"whoOwnsThisItem": {
|
||||||
"message": "Who owns this item?"
|
"message": "Who owns this item?"
|
||||||
},
|
},
|
||||||
|
"strong": {
|
||||||
|
"message": "Strong",
|
||||||
|
"description": "ex. A strong password. Scale: Weak -> Good -> Strong"
|
||||||
|
},
|
||||||
|
"good": {
|
||||||
|
"message": "Good",
|
||||||
|
"description": "ex. A good password. Scale: Weak -> Good -> Strong"
|
||||||
|
},
|
||||||
|
"weak": {
|
||||||
|
"message": "Weak",
|
||||||
|
"description": "ex. A weak password. Scale: Weak -> Good -> Strong"
|
||||||
|
},
|
||||||
"weakMasterPassword": {
|
"weakMasterPassword": {
|
||||||
"message": "Weak Master Password"
|
"message": "Weak Master Password"
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,10 +24,16 @@
|
||||||
<div class="box-content-row" appBoxRow>
|
<div class="box-content-row" appBoxRow>
|
||||||
<div class="box-content-row-flex">
|
<div class="box-content-row-flex">
|
||||||
<div class="row-main">
|
<div class="row-main">
|
||||||
<label for="masterPassword">{{'masterPass' | i18n}}</label>
|
<label for="masterPassword">
|
||||||
|
{{'masterPass' | i18n}}
|
||||||
|
<strong class="sub-label text-{{masterPasswordScoreColor}}"
|
||||||
|
*ngIf="masterPasswordScoreText">
|
||||||
|
{{masterPasswordScoreText}}
|
||||||
|
</strong>
|
||||||
|
</label>
|
||||||
<input id="masterPassword" type="{{showPassword ? 'text' : 'password'}}"
|
<input id="masterPassword" type="{{showPassword ? 'text' : 'password'}}"
|
||||||
name="MasterPassword" class="monospaced" [(ngModel)]="masterPassword" required
|
name="MasterPassword" class="monospaced" [(ngModel)]="masterPassword" required
|
||||||
[appAutofocus]="email !== ''" appInputVerbatim (input)="updatePasswordStrength()">
|
[appAutofocus]="email !== ''" appInputVerbatim (input)="updatePasswordStrength()">
|
||||||
</div>
|
</div>
|
||||||
<div class="action-buttons">
|
<div class="action-buttons">
|
||||||
<a class="row-btn" href="#" appStopClick appBlurClick
|
<a class="row-btn" href="#" appStopClick appBlurClick
|
||||||
|
@ -38,7 +44,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
<div class="progress-bar {{masterPasswordScoreColor}}" role="progressbar" aria-valuenow="0"
|
<div class="progress-bar bg-{{masterPasswordScoreColor}}" role="progressbar" aria-valuenow="0"
|
||||||
aria-valuemin="0" aria-valuemax="100" [ngStyle]="{width: (masterPasswordScoreWidth + '%')}"
|
aria-valuemin="0" aria-valuemax="100" [ngStyle]="{width: (masterPasswordScoreWidth + '%')}"
|
||||||
attr.aria-valuenow="{{masterPasswordScoreWidth}}"></div>
|
attr.aria-valuenow="{{masterPasswordScoreWidth}}"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,21 +23,4 @@ export class RegisterComponent extends BaseRegisterComponent {
|
||||||
super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService,
|
super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService,
|
||||||
passwordGenerationService);
|
passwordGenerationService);
|
||||||
}
|
}
|
||||||
|
|
||||||
get masterPasswordScoreWidth() {
|
|
||||||
return this.masterPasswordScore == null ? 0 : (this.masterPasswordScore + 1) * 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
get masterPasswordScoreColor() {
|
|
||||||
switch (this.masterPasswordScore) {
|
|
||||||
case 4:
|
|
||||||
return 'bg-success';
|
|
||||||
case 3:
|
|
||||||
return 'bg-primary';
|
|
||||||
case 2:
|
|
||||||
return 'bg-warning';
|
|
||||||
default:
|
|
||||||
return 'bg-danger';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,10 @@
|
||||||
@include themify($themes) {
|
@include themify($themes) {
|
||||||
color: themed('mutedColor');
|
color: themed('mutedColor');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sub-label {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.text, .detail {
|
.text, .detail {
|
||||||
|
@ -376,23 +380,17 @@
|
||||||
.progress {
|
.progress {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 5px;
|
height: 5px;
|
||||||
overflow: hidden; // force rounded corners by cropping it
|
overflow: hidden;
|
||||||
font-size: $font-size-small;
|
margin: 5px -15px -10px;
|
||||||
margin: 10px -15px -10px;
|
|
||||||
|
|
||||||
@include themify($themes) {
|
.progress-bar {
|
||||||
background-color: themed('borderColor');
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
background-color: $brand-primary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-bar {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
text-align: center;
|
|
||||||
white-space: nowrap;
|
|
||||||
background-color: $brand-primary;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.condensed .box-content-row, .box-content-row.condensed {
|
&.condensed .box-content-row, .box-content-row.condensed {
|
||||||
|
|
Loading…
Reference in New Issue