diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index e72057b5495..b6a8d1834b4 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -2487,6 +2487,12 @@ "personalOwnershipPolicyInEffectImports": { "message": "An organization policy has blocked importing items into your individual vault." }, + "restrictCardTypeImport": { + "message": "Cannot import card item types" + }, + "restrictCardTypeImportDesc": { + "message": "A policy set by 1 or more organizations prevents you from importing cards to your vaults." + }, "domainsTitle": { "message": "Domains", "description": "A category title describing the concept of web domains" diff --git a/apps/desktop/src/locales/en/messages.json b/apps/desktop/src/locales/en/messages.json index 1431ab72020..f67de2d51d7 100644 --- a/apps/desktop/src/locales/en/messages.json +++ b/apps/desktop/src/locales/en/messages.json @@ -1716,6 +1716,12 @@ "accountRestricted": { "message": "Account restricted" }, + "restrictCardTypeImport": { + "message": "Cannot import card item types" + }, + "restrictCardTypeImportDesc": { + "message": "A policy set by 1 or more organizations prevents you from importing cards to your vaults." + }, "filePasswordAndConfirmFilePasswordDoNotMatch": { "message": "“File password” and “Confirm file password“ do not match." }, diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index 7ca482755a7..3c3395179fa 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -2160,6 +2160,12 @@ "restrictedItemTypesPolicyDesc": { "message": "Do not allow members to create card item types." }, + "restrictCardTypeImport": { + "message": "Cannot import card item types" + }, + "restrictCardTypeImportDesc": { + "message": "A policy set by 1 or more organizations prevents you from importing cards to your vaults." + }, "yourSingleUseRecoveryCode": { "message": "Your single-use recovery code can be used to turn off two-step login in the event that you lose access to your two-step login provider. Bitwarden recommends you write down the recovery code and keep it in a safe place." }, diff --git a/libs/importer/src/components/import.component.html b/libs/importer/src/components/import.component.html index 2182e8532ac..59ab6739c06 100644 --- a/libs/importer/src/components/import.component.html +++ b/libs/importer/src/components/import.component.html @@ -1,6 +1,13 @@ {{ "personalOwnershipPolicyInEffectImports" | i18n }} + + {{ "restrictCardTypeImportDesc" | i18n }} +
diff --git a/libs/importer/src/components/import.component.ts b/libs/importer/src/components/import.component.ts index 28137906147..34212b8e773 100644 --- a/libs/importer/src/components/import.component.ts +++ b/libs/importer/src/components/import.component.ts @@ -45,6 +45,7 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; +import { RestrictedItemTypesService } from "@bitwarden/common/vault/services/restricted-item-types.service"; import { AsyncActionsModule, BitSubmitDirective, @@ -161,6 +162,9 @@ export class ImportComponent implements OnInit, OnDestroy, AfterViewInit { protected organization: Organization; protected destroy$ = new Subject(); + protected readonly isCardTypeRestricted$: Observable = + this.restrictedItemTypesService.restricted$.pipe(map((items) => items.length > 0)); + private _importBlockedByPolicy = false; protected isFromAC = false; @@ -220,6 +224,7 @@ export class ImportComponent implements OnInit, OnDestroy, AfterViewInit { protected importCollectionService: ImportCollectionServiceAbstraction, protected toastService: ToastService, protected accountService: AccountService, + private restrictedItemTypesService: RestrictedItemTypesService, ) {} protected get importBlockedByPolicy(): boolean {