diff --git a/ui/src/App.tsx b/ui/src/App.tsx index a8e4d256d..6e841111b 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -12,9 +12,7 @@ import './scss/App.scss'; function App() { return ( - - {/* }> */} - + }> diff --git a/ui/src/components/Common/AddStack/addStack.tsx b/ui/src/components/Common/AddStack/addStack.tsx index 2f3b9a15e..d53755f05 100644 --- a/ui/src/components/Common/AddStack/addStack.tsx +++ b/ui/src/components/Common/AddStack/addStack.tsx @@ -42,9 +42,9 @@ const AddStack = (props: any): JSX.Element => { const onSubmit = async (formData: any) => { setIsProcessing(true); const resp = await props.onSubmit({ - name: formData?.name || props.defaultValues.name, - description: formData?.description || props.defaultValues.description, - locale: formData?.locale?.value || props.defaultValues.locale + name: formData?.name || props?.defaultValues?.name, + description: formData?.description || props?.defaultValues?.description, + locale: formData?.locale?.value || props?.defaultValues?.locale }); if (resp) { @@ -61,7 +61,7 @@ const AddStack = (props: any): JSX.Element => { useEffect(() => { //check if offline CMS data field is set to true, if then read data from cms data file. - getCMSDataFromFile(CS_ENTRIES.ADD_STACK) + getCMSDataFromFile(CS_ENTRIES?.ADD_STACK) .then((data: AddStackCMSData) => { //Check for null if (!data) { @@ -80,172 +80,182 @@ const AddStack = (props: any): JSX.Element => { }, []); return ( - { - const errors: any = {}; - if (!values.name || values.name.trim().lenght < 1) { - errors.name = 'Stack name required'; - } - if (!values.locale || values.locale === '') { - errors.locale = 'Required'; - } - return errors; - }} - initialValues={{ - locale: { label: 'English - United States', value: 'en-us' } - }} - render={({ handleSubmit }): JSX.Element => { - return ( - <> -
-
- - - - - {({ input, meta }): JSX.Element => { - return ( - <> - - {addStackCMSData.stack_name} - - { - input.onChange(event); - }} - name="name" - autoComplete="off" - type="text" - placeholder={addStackCMSData.stack_name_placeholder} - error={(meta.error || meta.submitError) && meta.touched} - /> - {meta.error && meta.touched && ( - - {meta.error} - - )} - - ); - }} - - - - - {({ input }): any => { - return ( -
- - - {addStackCMSData.stack_description} - -