[PM-14002] Fix username generator from vault item (#11714)

* Fix "Forwarded email alias" not showing in drop-down

* Fixed username and forwarder options not showing
Options were being translated twice

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith 2024-10-25 18:15:48 +02:00 committed by GitHub
parent ab98bef28f
commit 10a662cc35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ export class UsernameGeneratorComponent implements OnInit, OnDestroy {
map((algorithms) => { map((algorithms) => {
const usernames = algorithms.filter((a) => !isForwarderIntegration(a.id)); const usernames = algorithms.filter((a) => !isForwarderIntegration(a.id));
const usernameOptions = this.toOptions(usernames); const usernameOptions = this.toOptions(usernames);
usernameOptions.push({ value: FORWARDER, label: this.i18nService.t("forwarder") }); usernameOptions.push({ value: FORWARDER, label: this.i18nService.t("forwardedEmail") });
const forwarders = algorithms.filter((a) => isForwarderIntegration(a.id)); const forwarders = algorithms.filter((a) => isForwarderIntegration(a.id));
const forwarderOptions = this.toOptions(forwarders); const forwarderOptions = this.toOptions(forwarders);
@ -413,7 +413,7 @@ export class UsernameGeneratorComponent implements OnInit, OnDestroy {
private toOptions(algorithms: AlgorithmInfo[]) { private toOptions(algorithms: AlgorithmInfo[]) {
const options: Option<string>[] = algorithms.map((algorithm) => ({ const options: Option<string>[] = algorithms.map((algorithm) => ({
value: JSON.stringify(algorithm.id), value: JSON.stringify(algorithm.id),
label: this.i18nService.t(algorithm.name), label: algorithm.name,
})); }));
return options; return options;