1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-20644] [Vault] [Browser Extension] Front End Changes to Enforce "Remove card item type policy" (#15147)

* Added service to get restricted cipher and used that to hide in autofill settings

* Referenced files from the work done on web

* Fixed restrictedCardType$ observable

* Created resuseable cipher menu items type

(cherry picked from commit 34be7f7ffef135aea2449e11e45e638ebaf34ee8)

* Updated new item dropdown to filter out restricted type and also render the menu items dynamically

(cherry picked from commit 566099ba9f3dbd7f18077dbc5b8ed44f51a94bfc)

* Updated service to have cipher types as an observable

(cherry picked from commit 6848e5f75803eb45e2262c617c9805359861ad14)

* Refactored service to have use CIPHER MENU ITEMS type and filter restricted rypes and return an observable

(cherry picked from commit e25c4eb18af895deac762b9e2d7ae69cc235f224)

* Fixed type enum

* Referenced files from the work done on web

* Referenced change from the work done on web

* Remove comment

* Remove cipher type from autofill suggestion list when enabled

* revert autofillcipher$ change

* Fixed test

* Added sharereplay to restrictedCardType$ observable

* Added startwith operator

* Add organization exemptions to restricted filter
This commit is contained in:
SmithThe4th
2025-06-16 15:07:29 -04:00
committed by GitHub
parent 9ba593701a
commit fcd24a4d60
10 changed files with 184 additions and 100 deletions

View File

@@ -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[];