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 />;
case "rsa":
return <RsaView />;
case "rsa-enc":
return <RsaView isEnc />;
case "rsa-enc-generated":
return <RsaGeneratedView isEnc />;
case "rsa-generated":

View file

@ -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);

View file

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