From 91a6175ba4e09c425bb712c3452828563f510d6f Mon Sep 17 00:00:00 2001 From: Ash Evans Date: Wed, 6 Nov 2024 14:28:02 +0000 Subject: [PATCH] COnverting the YamlFileUpload component to an expandable form section Signed-off-by: Ash Evans --- src/components/Contribute/YamlFileUpload.tsx | 69 +++++++++++--------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/src/components/Contribute/YamlFileUpload.tsx b/src/components/Contribute/YamlFileUpload.tsx index efb5f246..9a85a1df 100644 --- a/src/components/Contribute/YamlFileUpload.tsx +++ b/src/components/Contribute/YamlFileUpload.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { FileUpload } from '@patternfly/react-core/dist/dynamic/components/FileUpload'; -import { Form } from '@patternfly/react-core/dist/dynamic/components/Form'; +import { Form, FormFieldGroupExpandable, FormFieldGroupHeader } from '@patternfly/react-core/dist/dynamic/components/Form'; import { FormGroup } from '@patternfly/react-core/dist/dynamic/components/Form'; import { FormHelperText } from '@patternfly/react-core/dist/dynamic/components/Form'; import { HelperText } from '@patternfly/react-core/dist/dynamic/components/HelperText'; @@ -79,35 +79,44 @@ const YamlFileUpload: React.FC = ({ isKnowledgeForm, onYaml }; return ( - <> -
- - setIsRejected(true) - }} - validated={isRejected ? 'error' : 'default'} - browseButtonText="Upload" - /> - - - - {isRejected ? 'Invalid YAML file for this form type' : 'Upload a YAML file'} - - - - -
- + Load a pre-exsiting yaml file

, + id: 'author-info-id' + }} + titleDescription="If you have partially completed yaml file you can upload it!" + /> + } + > + + setIsRejected(true) + }} + validated={isRejected ? 'error' : 'default'} + browseButtonText="Upload" + /> + + + + {isRejected ? 'Invalid YAML file for this form type' : 'Upload a YAML file'} + + + + +
); };