From a6cdb489b2f14a519562aa8865acfc74bd54e5af Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Mon, 7 Mar 2022 15:40:39 +0100 Subject: [PATCH] Removed file preview panel from keys provider (#2197) --- src/realm-settings/keys/key-providers/KeyProviderForm.tsx | 2 ++ src/realm-settings/keys/key-providers/rsa/View.tsx | 7 +++++-- src/realm-settings/routes/KeyProvider.ts | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/realm-settings/keys/key-providers/KeyProviderForm.tsx b/src/realm-settings/keys/key-providers/KeyProviderForm.tsx index 1921a49ce6..5fedc0e3d2 100644 --- a/src/realm-settings/keys/key-providers/KeyProviderForm.tsx +++ b/src/realm-settings/keys/key-providers/KeyProviderForm.tsx @@ -46,6 +46,8 @@ const SubView = ({ providerType }: { providerType: ProviderType }) => { return ; case "rsa": return ; + case "rsa-enc": + return ; case "rsa-enc-generated": return ; case "rsa-generated": diff --git a/src/realm-settings/keys/key-providers/rsa/View.tsx b/src/realm-settings/keys/key-providers/rsa/View.tsx index f1f4876da7..d2b352d3cd 100644 --- a/src/realm-settings/keys/key-providers/rsa/View.tsx +++ b/src/realm-settings/keys/key-providers/rsa/View.tsx @@ -14,7 +14,7 @@ import { HelpItem } from "../../../../components/help-enabler/HelpItem"; import { KEY_PROVIDER_TYPE } from "../../../../util"; import useToggle from "../../../../utils/useToggle"; -export default function View() { +export default function View({ isEnc = false }: { isEnc?: boolean }) { const { t } = useTranslation("realm-settings"); const { control } = useFormContext(); const [isRSAalgDropdownOpen, toggleDropdown] = useToggle(); @@ -25,7 +25,8 @@ export default function View() { const allComponentTypes = serverInfo.componentTypes?.[KEY_PROVIDER_TYPE] ?? []; - const rsaAlgOptions = allComponentTypes[4].properties[3].options ?? []; + const rsaAlgOptions = + allComponentTypes[isEnc ? 5 : 4].properties[isEnc ? 5 : 3].options ?? []; return ( <> @@ -84,6 +85,7 @@ export default function View() { type="text" value={value.value} filename={privateKey} + hideDefaultPreview onChange={(value, filename) => { onChange(value); setPrivateKey(filename); @@ -113,6 +115,7 @@ export default function View() { type="text" value={value} filename={certificate} + hideDefaultPreview onChange={(value, filename) => { onChange(value); setCertificate(filename); diff --git a/src/realm-settings/routes/KeyProvider.ts b/src/realm-settings/routes/KeyProvider.ts index e150731b74..962fdb69e3 100644 --- a/src/realm-settings/routes/KeyProvider.ts +++ b/src/realm-settings/routes/KeyProvider.ts @@ -9,6 +9,7 @@ export type ProviderType = | "hmac-generated" | "java-keystore" | "rsa" + | "rsa-enc" | "rsa-enc-generated" | "rsa-generated";