diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index ce5787c46bd..996bdcdae79 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -4246,6 +4246,26 @@ "commonImportFormats": { "message": "Common formats", "description": "Label indicating the most common import formats" + }, + "uriMatchDefaultStrategyHint": { + "message": "URI match detection is how Bitwarden identifies autofill suggestions.", + "description": "Explains to the user that URI match detection determines how Bitwarden suggests autofill options, and clarifies that this default strategy applies when no specific match detection is set for a login item." + }, + "regExAdvancedOptionWarning": { + "message": "\"Regular expression\" is an advanced option with increased risk of exposing credentials.", + "description": "Content for dialog which warns a user when selecting 'regular expression' matching strategy as a cipher match strategy" + }, + "startsWithAdvancedOptionWarning": { + "message": "\"Starts with\" is an advanced option with increased risk of exposing credentials.", + "description": "Content for dialog which warns a user when selecting 'starts with' matching strategy as a cipher match strategy" + }, + "uriMatchWarningDialogLink": { + "message": "More about match detection", + "description": "Link to match detection docs on warning dialog for advance match strategy" + }, + "uriAdvancedOption":{ + "message": "Advanced options", + "description": "Advanced option placeholder for uri option component" }, "confirmContinueToBrowserSettingsTitle": { "message": "Continue to browser settings?", diff --git a/apps/desktop/src/locales/en/messages.json b/apps/desktop/src/locales/en/messages.json index ac9307c482c..991d07fb9df 100644 --- a/apps/desktop/src/locales/en/messages.json +++ b/apps/desktop/src/locales/en/messages.json @@ -3534,6 +3534,22 @@ "commonImportFormats": { "message": "Common formats", "description": "Label indicating the most common import formats" + }, + "uriMatchDefaultStrategyHint": { + "message": "URI match detection is how Bitwarden identifies autofill suggestions.", + "description": "Explains to the user that URI match detection determines how Bitwarden suggests autofill options, and clarifies that this default strategy applies when no specific match detection is set for a login item." + }, + "regExAdvancedOptionWarning": { + "message": "\"Regular expression\" is an advanced option with increased risk of exposing credentials.", + "description": "Content for dialog which warns a user when selecting 'regular expression' matching strategy as a cipher match strategy" + }, + "startsWithAdvancedOptionWarning": { + "message": "\"Starts with\" is an advanced option with increased risk of exposing credentials.", + "description": "Content for dialog which warns a user when selecting 'starts with' matching strategy as a cipher match strategy" + }, + "uriMatchWarningDialogLink": { + "message": "More about match detection", + "description": "Link to match detection docs on warning dialog for advance match strategy" }, "success": { "message": "Success" diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index 6ed8ffe9bb3..ce35f2abd33 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -8907,6 +8907,22 @@ "commonImportFormats": { "message": "Common formats", "description": "Label indicating the most common import formats" + }, + "uriMatchDefaultStrategyHint": { + "message": "URI match detection is how Bitwarden identifies autofill suggestions.", + "description": "Explains to the user that URI match detection determines how Bitwarden suggests autofill options, and clarifies that this default strategy applies when no specific match detection is set for a login item." + }, + "regExAdvancedOptionWarning": { + "message": "\"Regular expression\" is an advanced option with increased risk of exposing credentials.", + "description": "Content for dialog which warns a user when selecting 'regular expression' matching strategy as a cipher match strategy" + }, + "startsWithAdvancedOptionWarning": { + "message": "\"Starts with\" is an advanced option with increased risk of exposing credentials.", + "description": "Content for dialog which warns a user when selecting 'starts with' matching strategy as a cipher match strategy" + }, + "uriMatchWarningDialogLink": { + "message": "More about match detection", + "description": "Link to match detection docs on warning dialog for advance match strategy" }, "maintainYourSubscription": { "message": "To maintain your subscription for $ORG$, ", diff --git a/libs/vault/src/cipher-form/components/autofill-options/advanced-uri-option-dialog.component.html b/libs/vault/src/cipher-form/components/autofill-options/advanced-uri-option-dialog.component.html new file mode 100644 index 00000000000..627989a3397 --- /dev/null +++ b/libs/vault/src/cipher-form/components/autofill-options/advanced-uri-option-dialog.component.html @@ -0,0 +1,27 @@ + + + + {{ "warningCapitalized" | i18n }} + +
+

+ {{ contentKey | i18n }} +
+ +

+
+ + + + +
diff --git a/libs/vault/src/cipher-form/components/autofill-options/advanced-uri-option-dialog.component.ts b/libs/vault/src/cipher-form/components/autofill-options/advanced-uri-option-dialog.component.ts new file mode 100644 index 00000000000..e63aa224149 --- /dev/null +++ b/libs/vault/src/cipher-form/components/autofill-options/advanced-uri-option-dialog.component.ts @@ -0,0 +1,58 @@ +import { Component, inject } from "@angular/core"; + +import { JslibModule } from "@bitwarden/angular/jslib.module"; +import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; +import { + ButtonLinkDirective, + ButtonModule, + DialogModule, + DialogService, + DIALOG_DATA, + DialogRef, +} from "@bitwarden/components"; + +export type AdvancedUriOptionDialogParams = { + contentKey: string; + onCancel: () => void; + onContinue: () => void; +}; + +@Component({ + templateUrl: "advanced-uri-option-dialog.component.html", + imports: [ButtonLinkDirective, ButtonModule, DialogModule, JslibModule], +}) +export class AdvancedUriOptionDialogComponent { + constructor(private dialogRef: DialogRef) {} + + protected platformUtilsService = inject(PlatformUtilsService); + protected params = inject(DIALOG_DATA); + + get contentKey(): string { + return this.params.contentKey; + } + + onCancel() { + this.params.onCancel?.(); + this.dialogRef.close(false); + } + + onContinue() { + this.params.onContinue?.(); + this.dialogRef.close(true); + } + + openLink(event: Event) { + event.preventDefault(); + this.platformUtilsService.launchUri("https://bitwarden.com/help/uri-match-detection/"); + } + + static open( + dialogService: DialogService, + params: AdvancedUriOptionDialogParams, + ): DialogRef { + return dialogService.open(AdvancedUriOptionDialogComponent, { + data: params, + disableClose: true, + }); + } +} diff --git a/libs/vault/src/cipher-form/components/autofill-options/uri-option.component.html b/libs/vault/src/cipher-form/components/autofill-options/uri-option.component.html index 84b43edfbac..2e88a68a0d4 100644 --- a/libs/vault/src/cipher-form/components/autofill-options/uri-option.component.html +++ b/libs/vault/src/cipher-form/components/autofill-options/uri-option.component.html @@ -6,7 +6,7 @@