url display fixed #91
@@ -112,15 +112,9 @@ const GeneralTab = memo(({
|
||||
<>
|
||||
{isCustom === true ?
|
||||
<>
|
||||
{(tabKey === 'template_tab') && <SiteTemplateSelector name={name} data={sortedData}
|
||||
isCustom={isCustom}
|
||||
productData={productData}/>}
|
||||
{(tabKey === 'url_config_tab') && <URLConfiguration name={name} data={sortedData}
|
||||
isCustom={isCustom}
|
||||
productData={productData}/>}
|
||||
{(tabKey === 'color_scheme_tab') && <ColorStyleConfigure name={name} data={sortedData}
|
||||
isCustom={isCustom}
|
||||
productData={productData}/>}
|
||||
{(tabKey === 'template_tab') && <SiteTemplateSelector name={name} data={sortedData} isCustom={isCustom} productData={productData}/>}
|
||||
{(tabKey === 'url_config_tab') && <URLConfiguration name={name} data={sortedData} isCustom={isCustom} productData={productData}/>}
|
||||
{(tabKey === 'color_scheme_tab') && <ColorStyleConfigure name={name} data={sortedData} isCustom={isCustom} productData={productData}/>}
|
||||
</>
|
||||
:
|
||||
<div className="page-account-form">
|
||||
|
||||
@@ -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 <>
|
||||
{/*<div className="card card-statistics">*/}
|
||||
{/* <div className="card-header">*/}
|
||||
{/* <div className="card-heading">*/}
|
||||
{/* <h4 className="card-title">URL Configuration</h4>*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* <div className="card-body button-list">*/}
|
||||
{/* <div className="row">*/}
|
||||
{/* <div className="col-12 mb-2">*/}
|
||||
{/* <div className="alert alert-primary" role="alert" style={{borderRadius: '10px'}}>*/}
|
||||
{/* <h3 className="text-white">Default URL</h3>*/}
|
||||
{/* <p className="text-white">*/}
|
||||
{/* https://127476.devprov.mermsemr.com*/}
|
||||
{/* </p>*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/*</div>*/}
|
||||
|
||||
<div className="card card-statistics">
|
||||
<div className="card-header">
|
||||
<div className="card-heading">
|
||||
@@ -31,27 +46,39 @@ const URLConfiguration = () => {
|
||||
<div className="form-group">
|
||||
{/*<label htmlFor="exampleInputEmail1">Email address</label>*/}
|
||||
<input type="email" className="form-control"
|
||||
aria-describedby="defaultUrlHelp" value="https://451712a2.devprov.mermsemr.com" readOnly={true} />
|
||||
aria-describedby="defaultUrlHelp" value={defaultUrl} readOnly={true} />
|
||||
</div>
|
||||
{/*<button type="submit" className="btn btn-primary">Submit</button>*/}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="card card-statistics" style={{backgroundColor:'#7affd92b'}}>
|
||||
<div className="card-header">
|
||||
<div className="card-heading">
|
||||
<h4 className="card-title" style={{textTransform: 'none'}}>Set your own URL</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div className="card-body">
|
||||
<div className="form-group">
|
||||
<label htmlFor="exampleInputEmail1">Enter your full URL</label>
|
||||
<input type="email" className="form-control" id="exampleInputEmail1"
|
||||
aria-describedby="emailHelp" placeholder="https://example.mysite.com"/>
|
||||
</div>
|
||||
<button type="submit" className="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
<Formik
|
||||
initialValues={initialValues}
|
||||
validationSchema={validationSchema}
|
||||
onSubmit={handleSubmit}
|
||||
>
|
||||
{(props) => {
|
||||
return (
|
||||
<Form className='w-full'>
|
||||
<div className="card card-statistics" style={{backgroundColor:'#7affd92b'}}>
|
||||
<div className="card-header">
|
||||
<div className="card-heading">
|
||||
<h4 className="card-title" style={{textTransform: 'none'}}>Set your own URL</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div className="card-body">
|
||||
<div className="form-group">
|
||||
<label htmlFor="exampleInputEmail1">Enter your full URL <span className={`${(props.errors.url && props.touched.url) && 'text-danger'}`}>{props.errors.url}</span></label>
|
||||
<input value={props.values.url} onChange={props.handleChange} type="text" className="form-control" id="url" aria-describedby="url" placeholder="https://example.mysite.com"/>
|
||||
</div>
|
||||
<button type="submit" className="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
);
|
||||
}}
|
||||
</Formik>
|
||||
|
||||
</>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user