diff --git a/apps/browser/src/autofill/popup/settings/autofill.component.html b/apps/browser/src/autofill/popup/settings/autofill.component.html index 264b04b039b..aa9c8648885 100644 --- a/apps/browser/src/autofill/popup/settings/autofill.component.html +++ b/apps/browser/src/autofill/popup/settings/autofill.component.html @@ -65,7 +65,10 @@ {{ "showInlineMenuIdentitiesLabel" | i18n }} - + - + = + this.restrictedItemTypesService.restricted$.pipe( + map((restrictedTypes) => restrictedTypes.some((type) => type.cipherType === CipherType.Card)), + shareReplay({ bufferSize: 1, refCount: true }), + ); protected autofillOnPageLoadForm = new FormGroup({ autofillOnPageLoad: new FormControl(), @@ -156,6 +163,7 @@ export class AutofillComponent implements OnInit { private nudgesService: NudgesService, private accountService: AccountService, private autofillBrowserSettingsService: AutofillBrowserSettingsService, + private restrictedItemTypesService: RestrictedItemTypesService, ) { this.autofillOnPageLoadOptions = [ { name: this.i18nService.t("autoFillOnPageLoadYes"), value: true }, diff --git a/apps/browser/src/vault/popup/components/vault-v2/new-item-dropdown/new-item-dropdown-v2.component.html b/apps/browser/src/vault/popup/components/vault-v2/new-item-dropdown/new-item-dropdown-v2.component.html index 6b6e8728f19..7dd0a5a3bc7 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/new-item-dropdown/new-item-dropdown-v2.component.html +++ b/apps/browser/src/vault/popup/components/vault-v2/new-item-dropdown/new-item-dropdown-v2.component.html @@ -3,34 +3,12 @@ {{ "new" | i18n }} - - - {{ "typeLogin" | i18n }} - - - - {{ "typeCard" | i18n }} - - - - {{ "typeIdentity" | i18n }} - - - - {{ "note" | i18n }} - - - - {{ "typeSshKey" | i18n }} - + @for (menuItem of cipherMenuItems$ | async; track menuItem.type) { + + + {{ menuItem.labelKey | i18n }} + + } - - diff --git a/libs/common/src/vault/types/cipher-menu-items.ts b/libs/common/src/vault/types/cipher-menu-items.ts new file mode 100644 index 00000000000..e88c0457081 --- /dev/null +++ b/libs/common/src/vault/types/cipher-menu-items.ts @@ -0,0 +1,24 @@ +import { CipherType } from "../enums"; + +/** + * Represents a menu item for creating a new cipher of a specific type + */ +export type CipherMenuItem = { + /** The cipher type this menu item represents */ + type: CipherType; + /** The icon class name (e.g., "bwi-globe") */ + icon: string; + /** The i18n key for the label text */ + labelKey: string; +}; + +/** + * All available cipher menu items with their associated icons and labels + */ +export const CIPHER_MENU_ITEMS = Object.freeze([ + { type: CipherType.Login, icon: "bwi-globe", labelKey: "typeLogin" }, + { type: CipherType.Card, icon: "bwi-credit-card", labelKey: "typeCard" }, + { type: CipherType.Identity, icon: "bwi-id-card", labelKey: "typeIdentity" }, + { type: CipherType.SecureNote, icon: "bwi-sticky-note", labelKey: "note" }, + { type: CipherType.SshKey, icon: "bwi-key", labelKey: "typeSshKey" }, +] as const) satisfies readonly CipherMenuItem[];