1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-11-30 12:54:31 +01:00

Bump jslib and add compatability with username generation (#1450)

Co-authored-by: Hinton <oscar@oscarhinton.com>
This commit is contained in:
Kyle Spearrin 2022-03-25 05:56:34 -04:00 committed by GitHub
parent ad6308eb48
commit 21167301f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 39 deletions

2
jslib

@ -1 +1 @@
Subproject commit 5070a783a7730bcf7a0e4bf726c2e41d1b41cf2d
Subproject commit fa73c13b8c9ed35cbb9909e342b143fa8a57f1a0

View File

@ -7,7 +7,7 @@
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-body">
<app-callout type="info" *ngIf="enforcedPolicyOptions?.inEffect()">
<app-callout type="info" *ngIf="enforcedPasswordPolicyOptions?.inEffect()">
{{ "passwordGeneratorPolicyInEffect" | i18n }}
</app-callout>
<div class="password-block">
@ -48,12 +48,12 @@
<input
type="radio"
class="radio"
[(ngModel)]="options.type"
[(ngModel)]="passwordOptions.type"
name="Type_{{ o.value }}"
id="type_{{ o.value }}"
[value]="o.value"
(change)="saveOptions()"
[checked]="options.type === o.value"
(change)="savePasswordOptions()"
[checked]="passwordOptions.type === o.value"
/>
<label class="unstyled" for="type_{{ o.value }}">
{{ o.name }}
@ -62,7 +62,7 @@
</div>
</div>
</div>
<div class="box" [hidden]="!showOptions" *ngIf="options.type === 'passphrase'">
<div class="box" [hidden]="!showOptions" *ngIf="passwordOptions.type === 'passphrase'">
<div class="box-content condensed">
<div class="box-content-row box-content-row-input" appBoxRow>
<label for="num-words">{{ "numWords" | i18n }}</label>
@ -71,8 +71,8 @@
type="number"
min="3"
max="20"
(blur)="saveOptions()"
[(ngModel)]="options.numWords"
(blur)="savePasswordOptions()"
[(ngModel)]="passwordOptions.numWords"
/>
</div>
<div class="box-content-row box-content-row-input" appBoxRow>
@ -81,8 +81,8 @@
id="word-separator"
type="text"
maxlength="1"
(input)="saveOptions()"
[(ngModel)]="options.wordSeparator"
(input)="savePasswordOptions()"
[(ngModel)]="passwordOptions.wordSeparator"
/>
</div>
<div class="box-content-row box-content-row-checkbox" appBoxRow>
@ -90,9 +90,9 @@
<input
id="capitalize"
type="checkbox"
(change)="saveOptions()"
[(ngModel)]="options.capitalize"
[disabled]="enforcedPolicyOptions?.capitalize"
(change)="savePasswordOptions()"
[(ngModel)]="passwordOptions.capitalize"
[disabled]="enforcedPasswordPolicyOptions?.capitalize"
/>
</div>
<div class="box-content-row box-content-row-checkbox" appBoxRow>
@ -100,14 +100,14 @@
<input
id="include-number"
type="checkbox"
(change)="saveOptions()"
[(ngModel)]="options.includeNumber"
[disabled]="enforcedPolicyOptions?.includeNumber"
(change)="savePasswordOptions()"
[(ngModel)]="passwordOptions.includeNumber"
[disabled]="enforcedPasswordPolicyOptions?.includeNumber"
/>
</div>
</div>
</div>
<ng-container *ngIf="options.type === 'password'">
<ng-container *ngIf="passwordOptions.type === 'password'">
<div class="box" [hidden]="!showOptions">
<div class="box-content condensed">
<div class="box-content-row box-content-row-slider" appBoxRow>
@ -117,8 +117,8 @@
type="number"
min="5"
max="128"
[(ngModel)]="options.length"
(blur)="saveOptions()"
[(ngModel)]="passwordOptions.length"
(blur)="savePasswordOptions()"
/>
<input
id="lengthRange"
@ -126,7 +126,7 @@
min="5"
max="128"
step="1"
[(ngModel)]="options.length"
[(ngModel)]="passwordOptions.length"
(change)="sliderChanged()"
(input)="sliderInput()"
/>
@ -136,9 +136,9 @@
<input
id="uppercase"
type="checkbox"
(change)="saveOptions()"
[disabled]="enforcedPolicyOptions?.useUppercase"
[(ngModel)]="options.uppercase"
(change)="savePasswordOptions()"
[disabled]="enforcedPasswordPolicyOptions?.useUppercase"
[(ngModel)]="passwordOptions.uppercase"
/>
</div>
<div class="box-content-row box-content-row-checkbox" appBoxRow>
@ -146,9 +146,9 @@
<input
id="lowercase"
type="checkbox"
(change)="saveOptions()"
[disabled]="enforcedPolicyOptions?.useLowercase"
[(ngModel)]="options.lowercase"
(change)="savePasswordOptions()"
[disabled]="enforcedPasswordPolicyOptions?.useLowercase"
[(ngModel)]="passwordOptions.lowercase"
/>
</div>
<div class="box-content-row box-content-row-checkbox" appBoxRow>
@ -156,9 +156,9 @@
<input
id="numbers"
type="checkbox"
(change)="saveOptions()"
[disabled]="enforcedPolicyOptions?.useNumbers"
[(ngModel)]="options.number"
(change)="savePasswordOptions()"
[disabled]="enforcedPasswordPolicyOptions?.useNumbers"
[(ngModel)]="passwordOptions.number"
/>
</div>
<div class="box-content-row box-content-row-checkbox" appBoxRow>
@ -166,9 +166,9 @@
<input
id="special"
type="checkbox"
(change)="saveOptions()"
[disabled]="enforcedPolicyOptions?.useSpecial"
[(ngModel)]="options.special"
(change)="savePasswordOptions()"
[disabled]="enforcedPasswordPolicyOptions?.useSpecial"
[(ngModel)]="passwordOptions.special"
/>
</div>
</div>
@ -182,8 +182,8 @@
type="number"
min="0"
max="9"
(blur)="saveOptions()"
[(ngModel)]="options.minNumber"
(blur)="savePasswordOptions()"
[(ngModel)]="passwordOptions.minNumber"
/>
</div>
<div class="box-content-row box-content-row-input" appBoxRow>
@ -193,8 +193,8 @@
type="number"
min="0"
max="9"
(blur)="saveOptions()"
[(ngModel)]="options.minSpecial"
(blur)="savePasswordOptions()"
[(ngModel)]="passwordOptions.minSpecial"
/>
</div>
<div class="box-content-row box-content-row-checkbox" appBoxRow>
@ -202,7 +202,7 @@
<input
id="ambiguous"
type="checkbox"
(change)="saveOptions()"
(change)="savePasswordOptions()"
[(ngModel)]="avoidAmbiguous"
/>
</div>

View File

@ -1,9 +1,12 @@
import { Component } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { PasswordGeneratorComponent as BasePasswordGeneratorComponent } from "jslib-angular/components/password-generator.component";
import { I18nService } from "jslib-common/abstractions/i18n.service";
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
import { StateService } from "jslib-common/abstractions/state.service";
import { UsernameGenerationService } from "jslib-common/abstractions/usernameGeneration.service";
@Component({
selector: "app-password-generator",
@ -12,9 +15,20 @@ import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.se
export class PasswordGeneratorComponent extends BasePasswordGeneratorComponent {
constructor(
passwordGenerationService: PasswordGenerationService,
usernameGenerationService: UsernameGenerationService,
stateService: StateService,
platformUtilsService: PlatformUtilsService,
i18nService: I18nService
i18nService: I18nService,
route: ActivatedRoute
) {
super(passwordGenerationService, platformUtilsService, i18nService, window);
super(
passwordGenerationService,
usernameGenerationService,
platformUtilsService,
stateService,
i18nService,
route,
window
);
}
}