diff --git a/src/component/product/settingsTab/GeneralTab.jsx b/src/component/product/settingsTab/GeneralTab.jsx index 9133e98..1a1b8f2 100644 --- a/src/component/product/settingsTab/GeneralTab.jsx +++ b/src/component/product/settingsTab/GeneralTab.jsx @@ -112,15 +112,9 @@ const GeneralTab = memo(({ <> {isCustom === true ? <> - {(tabKey === 'template_tab') && } - {(tabKey === 'url_config_tab') && } - {(tabKey === 'color_scheme_tab') && } + {(tabKey === 'template_tab') && } + {(tabKey === 'url_config_tab') && } + {(tabKey === 'color_scheme_tab') && } :
diff --git a/src/component/product/settingsTab/URLConfiguration.jsx b/src/component/product/settingsTab/URLConfiguration.jsx index cb49244..1c2922d 100644 --- a/src/component/product/settingsTab/URLConfiguration.jsx +++ b/src/component/product/settingsTab/URLConfiguration.jsx @@ -1,26 +1,41 @@ -const URLConfiguration = () => { +import { Form, Formik } from "formik"; +import * as Yup from "yup"; +import { useMutation } from '@tanstack/react-query'; +import { completePWDReset } from '../../../services/services'; + +const validationSchema = Yup.object().shape({ + url: Yup.string().required("URL is required").matches(/^https?:\/\/[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-]+\.[a-zA-Z]+/, 'Must be like: https://example.mysite.com'), + }) + + const initialValues = { + url: '', + }; + +const URLConfiguration = ({productData}) => { + + let defaultUrl= 'https://'+productData?.internal_url + + // API to set url + const setURL = useMutation({ + mutationFn: (fields) => { + return completePWDReset(fields) + }, + // onSuccess: (res) => { + // }, + // onError: (err) => { + // console.log('err', err) + // } + }) + + const handleSubmit = (values) => { + let reqData = { + url: values.url + } + console.log('URL', values.url) + // setURL.mutate(reqData) + } return <> - {/*
*/} - {/*
*/} - {/*
*/} - {/*

URL Configuration

*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/*

Default URL

*/} - {/*

*/} - {/* https://127476.devprov.mermsemr.com*/} - {/*

*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/*
*/} -
@@ -31,27 +46,39 @@ const URLConfiguration = () => {
{/**/} + aria-describedby="defaultUrlHelp" value={defaultUrl} readOnly={true} />
{/**/}
-
-
-
-

Set your own URL

-
-
-
-
- - -
- -
-
+ + {(props) => { + return ( +
+
+
+
+

Set your own URL

+
+
+
+
+ + +
+ +
+
+
+ ); + }} +
+ }