mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
use valueLabel with appCopyClick directive (#11718)
* add `valueLabel` to `appCopyClick` directives * move generated value description to the configuration
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
showToast
|
||||
[appA11yTitle]="credentialTypeCopyLabel$ | async"
|
||||
[appCopyClick]="value$ | async"
|
||||
[valueLabel]="credentialTypeLabel$ | async"
|
||||
></button>
|
||||
</div>
|
||||
</bit-card>
|
||||
|
||||
@@ -468,6 +468,14 @@ export class CredentialGeneratorComponent implements OnInit, OnDestroy {
|
||||
map(({ generate }) => generate),
|
||||
);
|
||||
|
||||
/**
|
||||
* Emits the copy credential toast respective of the selected credential type
|
||||
*/
|
||||
protected credentialTypeLabel$ = this.algorithm$.pipe(
|
||||
filter((algorithm) => !!algorithm),
|
||||
map(({ generatedValue }) => generatedValue),
|
||||
);
|
||||
|
||||
/** Emits hint key for the currently selected credential type */
|
||||
protected credentialTypeHint$ = new ReplaySubject<string>(1);
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
showToast
|
||||
[appA11yTitle]="credentialTypeCopyLabel$ | async"
|
||||
[appCopyClick]="value$ | async"
|
||||
[valueLabel]="credentialTypeLabel$ | async"
|
||||
></button>
|
||||
</div>
|
||||
</bit-card>
|
||||
|
||||
@@ -233,6 +233,14 @@ export class PasswordGeneratorComponent implements OnInit, OnDestroy {
|
||||
map(({ generate }) => generate),
|
||||
);
|
||||
|
||||
/**
|
||||
* Emits the copy credential toast respective of the selected credential type
|
||||
*/
|
||||
protected credentialTypeLabel$ = this.algorithm$.pipe(
|
||||
filter((algorithm) => !!algorithm),
|
||||
map(({ generatedValue }) => generatedValue),
|
||||
);
|
||||
|
||||
private toOptions(algorithms: AlgorithmInfo[]) {
|
||||
const options: Option<CredentialAlgorithm>[] = algorithms.map((algorithm) => ({
|
||||
value: algorithm.id,
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
showToast
|
||||
[appA11yTitle]="credentialTypeCopyLabel$ | async"
|
||||
[appCopyClick]="value$ | async"
|
||||
[valueLabel]="credentialTypeLabel$ | async"
|
||||
>
|
||||
{{ credentialTypeCopyLabel$ | async }}
|
||||
</button>
|
||||
|
||||
@@ -390,6 +390,14 @@ export class UsernameGeneratorComponent implements OnInit, OnDestroy {
|
||||
map(({ generate }) => generate),
|
||||
);
|
||||
|
||||
/**
|
||||
* Emits the copy credential toast respective of the selected credential type
|
||||
*/
|
||||
protected credentialTypeLabel$ = this.algorithm$.pipe(
|
||||
filter((algorithm) => !!algorithm),
|
||||
map(({ generatedValue }) => generatedValue),
|
||||
);
|
||||
|
||||
/** Emits hint key for the currently selected credential type */
|
||||
protected credentialTypeHint$ = new ReplaySubject<string>(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user