Removed file preview panel from keys provider (#2197)

This commit is contained in:
Erik Jan de Wit 2022-03-07 15:40:39 +01:00 committed by GitHub
parent 9d376ebcde
commit a6cdb489b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -46,6 +46,8 @@ const SubView = ({ providerType }: { providerType: ProviderType }) => {
return <JavaKeystoreView />; return <JavaKeystoreView />;
case "rsa": case "rsa":
return <RsaView />; return <RsaView />;
case "rsa-enc":
return <RsaView isEnc />;
case "rsa-enc-generated": case "rsa-enc-generated":
return <RsaGeneratedView isEnc />; return <RsaGeneratedView isEnc />;
case "rsa-generated": case "rsa-generated":

View file

@ -14,7 +14,7 @@ import { HelpItem } from "../../../../components/help-enabler/HelpItem";
import { KEY_PROVIDER_TYPE } from "../../../../util"; import { KEY_PROVIDER_TYPE } from "../../../../util";
import useToggle from "../../../../utils/useToggle"; import useToggle from "../../../../utils/useToggle";
export default function View() { export default function View({ isEnc = false }: { isEnc?: boolean }) {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const { control } = useFormContext(); const { control } = useFormContext();
const [isRSAalgDropdownOpen, toggleDropdown] = useToggle(); const [isRSAalgDropdownOpen, toggleDropdown] = useToggle();
@ -25,7 +25,8 @@ export default function View() {
const allComponentTypes = const allComponentTypes =
serverInfo.componentTypes?.[KEY_PROVIDER_TYPE] ?? []; serverInfo.componentTypes?.[KEY_PROVIDER_TYPE] ?? [];
const rsaAlgOptions = allComponentTypes[4].properties[3].options ?? []; const rsaAlgOptions =
allComponentTypes[isEnc ? 5 : 4].properties[isEnc ? 5 : 3].options ?? [];
return ( return (
<> <>
@ -84,6 +85,7 @@ export default function View() {
type="text" type="text"
value={value.value} value={value.value}
filename={privateKey} filename={privateKey}
hideDefaultPreview
onChange={(value, filename) => { onChange={(value, filename) => {
onChange(value); onChange(value);
setPrivateKey(filename); setPrivateKey(filename);
@ -113,6 +115,7 @@ export default function View() {
type="text" type="text"
value={value} value={value}
filename={certificate} filename={certificate}
hideDefaultPreview
onChange={(value, filename) => { onChange={(value, filename) => {
onChange(value); onChange(value);
setCertificate(filename); setCertificate(filename);

View file

@ -9,6 +9,7 @@ export type ProviderType =
| "hmac-generated" | "hmac-generated"
| "java-keystore" | "java-keystore"
| "rsa" | "rsa"
| "rsa-enc"
| "rsa-enc-generated" | "rsa-enc-generated"
| "rsa-generated"; | "rsa-generated";