From e5c80523141622cad74cf7e08179bc2500f86034 Mon Sep 17 00:00:00 2001 From: Jenny <32821331+jenny-s51@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:10:54 -0400 Subject: [PATCH] Apply MUI theming to Register Model form Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> fix tests Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> add fieldset to custom components fix spacing issue with helper text Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> remove comment Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> fixes for text area Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> format Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> add model description fix Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> create reusable fieldset component --- .../screens/RegisterModel/FormFieldset.tsx | 21 ++ .../PrefilledModelRegistryField.tsx | 10 +- .../screens/RegisterModel/RegisterModel.tsx | 60 +++- .../screens/RegisterModel/RegisterVersion.tsx | 1 - .../RegisterModel/RegisteredModelSelector.tsx | 26 +- .../RegistrationCommonFormSections.tsx | 251 ++++++++------ .../RegisteredModelListView.tsx | 2 +- clients/ui/frontend/src/style/MUI-theme.scss | 322 +++++++++++++++--- 8 files changed, 518 insertions(+), 175 deletions(-) create mode 100644 clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/FormFieldset.tsx diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/FormFieldset.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/FormFieldset.tsx new file mode 100644 index 000000000..01b6fe979 --- /dev/null +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/FormFieldset.tsx @@ -0,0 +1,21 @@ +import React, { ReactNode } from 'react'; + +interface FormFieldsetProps { + component: ReactNode; + field: string; +} + +const FormFieldset: React.FC = ({ component, field }) => { + return ( +
+ {component} + +
+ ); +}; + +export default FormFieldset; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/PrefilledModelRegistryField.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/PrefilledModelRegistryField.tsx index 980da8d37..fef2b8313 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/PrefilledModelRegistryField.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/PrefilledModelRegistryField.tsx @@ -1,13 +1,19 @@ import React from 'react'; import { FormGroup, TextInput } from '@patternfly/react-core'; +import FormFieldset from "./FormFieldset"; type PrefilledModelRegistryFieldProps = { mrName?: string; }; const PrefilledModelRegistryField: React.FC = ({ mrName }) => ( - - + + + } + field="Model Registry" + /> ); diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterModel.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterModel.tsx index c6cffb9de..8641834d5 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterModel.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterModel.tsx @@ -21,8 +21,8 @@ import { useRegisterModelData, RegistrationCommonFormData } from './useRegisterM import { isRegisterModelSubmitDisabled, registerModel } from './utils'; import { useRegistrationCommonState } from './useRegistrationCommonState'; import RegistrationCommonFormSections from './RegistrationCommonFormSections'; -import PrefilledModelRegistryField from './PrefilledModelRegistryField'; import RegistrationFormFooter from './RegistrationFormFooter'; +import FormFieldset from './FormFieldset'; const RegisterModel: React.FC = () => { const { modelRegistry: mrName } = useParams(); @@ -42,6 +42,31 @@ const RegisterModel: React.FC = () => { }); const onCancel = () => navigate(modelRegistryUrl(mrName)); + const modelRegistryInput = ( + + ); + + const modelNameInput = ( + setData('modelName', value)} + /> + ); + + const modelDescriptionInput = ( +