Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 25d4751935 | |||
| a8d78c4c3f | |||
| 9c672d4bf2 | |||
| c744eccd15 | |||
| 302a3aa3bb | |||
| 23a295866a | |||
| 487494fbff | |||
| 919594d7b2 | |||
| 7eedae8fc2 | |||
| 51a3c60590 | |||
| ab597039ba | |||
| 6fd2dcdb3d | |||
| 614910e29c | |||
| 2c832699c2 | |||
| c8fe2eadf6 | |||
| 1e174b7432 | |||
| dda8fa7d30 | |||
| d0f1d5ee34 | |||
| a0e417fc68 | |||
| 10e65fa6ff |
@@ -2,14 +2,14 @@ SKIP_PREFLIGHT_CHECK=true
|
|||||||
REACT_APP_NODE_ENV="development"
|
REACT_APP_NODE_ENV="development"
|
||||||
REACT_APP_SOCKET_URL="https://devsocket.mermsemr.com"
|
REACT_APP_SOCKET_URL="https://devsocket.mermsemr.com"
|
||||||
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
||||||
REACT_APP_MEDIA_SERVER="https://dev-media.mermsemr.com"
|
REACT_APP_MEDIA_SERVER="https://qa-media.mermsemr.com"
|
||||||
REACT_APP_MAIN_SOCKET="https://dev-socket.mermsemr.com"
|
REACT_APP_MAIN_SOCKET="https://devsocket.mermsemr.com"
|
||||||
|
|
||||||
# login footer links
|
# login footer links
|
||||||
REACT_APP_HOME_LINK='https://dev-www.mermsemr.com/'
|
REACT_APP_HOME_LINK='https://qa-www.mermsemr.com/'
|
||||||
REACT_APP_ABOUT_LINK='https://dev-www.mermsemr.com/about'
|
REACT_APP_ABOUT_LINK='https://qa-www.mermsemr.com/about'
|
||||||
REACT_APP_CONTACTS_LINK='https://dev-www.mermsemr.com/contacts'
|
REACT_APP_CONTACTS_LINK='https://qa-www.mermsemr.com/contacts'
|
||||||
REACT_APP_TERMS_LINK='https://dev-www.mermsemr.com/terms'
|
REACT_APP_TERMS_LINK='https://qa-www.mermsemr.com/terms'
|
||||||
|
|
||||||
# Inactivity timeout/logout AT 10MINS
|
# Inactivity timeout/logout AT 10MINS
|
||||||
REACT_APP_TIMEOUT=600000
|
REACT_APP_TIMEOUT=600000
|
||||||
|
|||||||
+7
-6
@@ -2,14 +2,15 @@ SKIP_PREFLIGHT_CHECK=true
|
|||||||
REACT_APP_NODE_ENV="development"
|
REACT_APP_NODE_ENV="development"
|
||||||
REACT_APP_SOCKET_URL="https://devsocket.mermsemr.com"
|
REACT_APP_SOCKET_URL="https://devsocket.mermsemr.com"
|
||||||
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
||||||
REACT_APP_MEDIA_SERVER="https://dev-media.mermsemr.com"
|
REACT_APP_MEDIA_SERVER="https://qa-media.mermsemr.com"
|
||||||
REACT_APP_MAIN_SOCKET="https://dev-socket.mermsemr.com"
|
REACT_APP_MAIN_SOCKET="https://devsocket.mermsemr.com"
|
||||||
|
|
||||||
# login footer links
|
# login footer links
|
||||||
REACT_APP_HOME_LINK='https://dev-www.mermsemr.com/'
|
REACT_APP_HOME_LINK='https://qa-www.mermsemr.com/'
|
||||||
REACT_APP_ABOUT_LINK='https://dev-www.mermsemr.com/about'
|
REACT_APP_ABOUT_LINK='https://qa-www.mermsemr.com/about'
|
||||||
REACT_APP_CONTACTS_LINK='https://dev-www.mermsemr.com/contacts'
|
REACT_APP_CONTACTS_LINK='https://qa-www.mermsemr.com/contacts'
|
||||||
REACT_APP_TERMS_LINK='https://dev-www.mermsemr.com/terms'
|
REACT_APP_TERMS_LINK='https://qa-www.mermsemr.com/terms'
|
||||||
|
|
||||||
# Inactivity timeout/logout AT 10MINS
|
# Inactivity timeout/logout AT 10MINS
|
||||||
REACT_APP_TIMEOUT=600000
|
REACT_APP_TIMEOUT=600000
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ REACT_APP_NODE_ENV="production"
|
|||||||
REACT_APP_SOCKET_URL="https://socket.mermsemr.com"
|
REACT_APP_SOCKET_URL="https://socket.mermsemr.com"
|
||||||
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
||||||
REACT_APP_MEDIA_SERVER="https://media.mermsemr.com"
|
REACT_APP_MEDIA_SERVER="https://media.mermsemr.com"
|
||||||
|
REACT_APP_MAIN_SOCKET="https://socket.mermsemr.com"
|
||||||
|
|
||||||
# login footer links
|
# login footer links
|
||||||
REACT_APP_HOME_LINK='https://www.mermsemr.com/'
|
REACT_APP_HOME_LINK='https://www.mermsemr.com/'
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
SKIP_PREFLIGHT_CHECK=true
|
||||||
|
REACT_APP_NODE_ENV="development"
|
||||||
|
REACT_APP_SOCKET_URL="https://devsocket.mermsemr.com"
|
||||||
|
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
||||||
|
REACT_APP_MEDIA_SERVER="https://qa-media.mermsemr.com"
|
||||||
|
REACT_APP_MAIN_SOCKET="https://devsocket.mermsemr.com"
|
||||||
|
|
||||||
|
# login footer links
|
||||||
|
REACT_APP_HOME_LINK='https://qa-www.mermsemr.com/'
|
||||||
|
REACT_APP_ABOUT_LINK='https://qa-www.mermsemr.com/about'
|
||||||
|
REACT_APP_CONTACTS_LINK='https://qa-www.mermsemr.com/contacts'
|
||||||
|
REACT_APP_TERMS_LINK='https://qa-www.mermsemr.com/terms'
|
||||||
|
|
||||||
|
# Inactivity timeout/logout AT 10MINS
|
||||||
|
REACT_APP_TIMEOUT=600000
|
||||||
+1
-1
@@ -20,7 +20,7 @@ services:
|
|||||||
extra_hosts:
|
extra_hosts:
|
||||||
- api.mermsemr.com:10.10.33.15
|
- api.mermsemr.com:10.10.33.15
|
||||||
- devapi.mermsemr.com:10.10.33.15
|
- devapi.mermsemr.com:10.10.33.15
|
||||||
- dev-socket.mermsemr.com:10.10.33.15
|
- devsocket.mermsemr.com:10.10.33.15
|
||||||
- socket.mermsemr.com:10.10.33.15
|
- socket.mermsemr.com:10.10.33.15
|
||||||
- dev-media.mermsemr.com:10.10.33.15
|
- dev-media.mermsemr.com:10.10.33.15
|
||||||
- media.mermsemr.com:10.10.33.15
|
- media.mermsemr.com:10.10.33.15
|
||||||
|
|||||||
@@ -39,4 +39,12 @@
|
|||||||
button{
|
button{
|
||||||
font-size: 1rem!important;
|
font-size: 1rem!important;
|
||||||
font-weight: 700!important;
|
font-weight: 700!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-600 {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accordion-button, .accordion-button:not(.collapsed) {
|
||||||
|
background-color: transparent!important;
|
||||||
}
|
}
|
||||||
+16
-11
@@ -1,23 +1,28 @@
|
|||||||
import { QueryClientProvider, QueryClient } from '@tanstack/react-query'
|
import { QueryClientProvider, QueryClient } from '@tanstack/react-query'
|
||||||
|
import { Provider } from 'react-redux';
|
||||||
|
import store from './store/store'
|
||||||
import AppRouters from './AppRouters';
|
import AppRouters from './AppRouters';
|
||||||
|
|
||||||
import './App.css';
|
import './App.css';
|
||||||
|
|
||||||
|
|
||||||
function App() {
|
const queryClient = new QueryClient({
|
||||||
const queryClient = new QueryClient({
|
defaultOptions: {
|
||||||
defaultOptions: {
|
queries: {
|
||||||
queries: {
|
refetchOnWindowFocus: false,
|
||||||
refetchOnWindowFocus: false,
|
retry: 3,
|
||||||
retry: 3,
|
// refetchOnMount: false,
|
||||||
// refetchOnMount: false,
|
staleTime: 360000 // can also be a number in millisecond
|
||||||
staleTime: Infinity // can also be a number in millisecond
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
function App() {
|
||||||
return (
|
return (
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<AppRouters />
|
<Provider store={store}>
|
||||||
|
<AppRouters />
|
||||||
|
</Provider>
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import SettingsPage from './views/SettingsPage'
|
|||||||
import ProductPage from './views/ProductPage'
|
import ProductPage from './views/ProductPage'
|
||||||
import SocketIOContextProvider from './component/context/SocketIOContext';
|
import SocketIOContextProvider from './component/context/SocketIOContext';
|
||||||
import CSignupPage from './views/CSignupPage';
|
import CSignupPage from './views/CSignupPage';
|
||||||
|
import HelpPage from './views/HelpPage';
|
||||||
|
|
||||||
function AppRouters() {
|
function AppRouters() {
|
||||||
return (
|
return (
|
||||||
@@ -45,6 +46,7 @@ function AppRouters() {
|
|||||||
<Route path={siteLinks.user} element={<UserPage />} />
|
<Route path={siteLinks.user} element={<UserPage />} />
|
||||||
<Route path={siteLinks.calendar} element={<CalendarPage />} />
|
<Route path={siteLinks.calendar} element={<CalendarPage />} />
|
||||||
<Route path={siteLinks.settings} element={<SettingsPage />} />
|
<Route path={siteLinks.settings} element={<SettingsPage />} />
|
||||||
|
<Route path={siteLinks.help} element={<HelpPage />} />
|
||||||
</Route>
|
</Route>
|
||||||
</Route>
|
</Route>
|
||||||
</Route>
|
</Route>
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { Form, Formik } from "formik";
|
import { Form, Formik } from "formik";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
|
import { useDispatch } from 'react-redux'
|
||||||
|
|
||||||
import { Link, useNavigate, useParams } from 'react-router-dom'
|
import { Link, useNavigate, useParams } from 'react-router-dom'
|
||||||
import siteLinks from '../../links/siteLinks'
|
import siteLinks from '../../links/siteLinks'
|
||||||
import { useMutation } from '@tanstack/react-query';
|
import { useMutation } from '@tanstack/react-query';
|
||||||
import { completeRegistration, verifyEmail } from '../../services/services';
|
import { completeRegistration, verifyEmail } from '../../services/services';
|
||||||
|
import { updateUserDetails } from '../../store/UserDetails'
|
||||||
|
|
||||||
import { IoMdArrowDropdown } from "react-icons/io";
|
import { IoMdArrowDropdown } from "react-icons/io";
|
||||||
|
|
||||||
@@ -28,6 +30,8 @@ const validationSchema = Yup.object().shape({
|
|||||||
export default function CSignup() {
|
export default function CSignup() {
|
||||||
|
|
||||||
const {jwt} = useParams()
|
const {jwt} = useParams()
|
||||||
|
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
@@ -51,15 +55,19 @@ export default function CSignup() {
|
|||||||
return completeRegistration(fields)
|
return completeRegistration(fields)
|
||||||
},
|
},
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
const {token, room} = res?.data?.data
|
if(res?.data?.resultCode != '0'){
|
||||||
if(token){
|
throw({message: res?.data?.resultDescription})
|
||||||
localStorage.setItem('token', token)
|
|
||||||
localStorage.setItem('room', room)
|
|
||||||
// const data = {token}
|
|
||||||
// dispatch(updateUserDetails({ ...data }));
|
|
||||||
navigate('/dash') // later add redux to dispatch state
|
|
||||||
}
|
}
|
||||||
}
|
const {token, room, uid} = res?.data
|
||||||
|
if(!token || !room){
|
||||||
|
throw({message: 'something went wrong, try again!'})
|
||||||
|
}
|
||||||
|
localStorage.setItem('token', token)
|
||||||
|
localStorage.setItem('room', room)
|
||||||
|
localStorage.setItem('uid', uid)
|
||||||
|
dispatch(updateUserDetails({ ...res?.data }));
|
||||||
|
navigate('/dash') // later add redux to dispatch state
|
||||||
|
},
|
||||||
// onError: (err) => {
|
// onError: (err) => {
|
||||||
// console.log('err', err)
|
// console.log('err', err)
|
||||||
// }
|
// }
|
||||||
@@ -70,7 +78,7 @@ export default function CSignup() {
|
|||||||
country : values.country,
|
country : values.country,
|
||||||
username: values.username,
|
username: values.username,
|
||||||
password: values.password,
|
password: values.password,
|
||||||
verify_link: user.verify_link
|
verify_link: jwt
|
||||||
}
|
}
|
||||||
cSignup.mutate(reqData)
|
cSignup.mutate(reqData)
|
||||||
}
|
}
|
||||||
@@ -196,7 +204,7 @@ export default function CSignup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div className="col-12 mt-3 text-center">
|
<div className="col-12 mt-3 text-center">
|
||||||
<Link to={siteLinks.login} className='text-primary' style={{color: '#6FCAEF'}}>Need help with logging in or signing up?</Link>
|
<Link to={siteLinks.signup} className='text-primary' style={{color: '#6FCAEF'}}>Need help with logging in or signing up?</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 mt-3 text-center">
|
<div className="col-12 mt-3 text-center">
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ export default function Signup2() {
|
|||||||
const signUp = (values) => {
|
const signUp = (values) => {
|
||||||
// helpers.resetForm()
|
// helpers.resetForm()
|
||||||
// console.log('values', values, helpers)
|
// console.log('values', values, helpers)
|
||||||
|
delete values.isChecked
|
||||||
mutation.mutate(values)
|
mutation.mutate(values)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import React from "react";
|
||||||
|
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
||||||
|
|
||||||
|
|
||||||
|
export default function HelpCom(){
|
||||||
|
|
||||||
|
return(
|
||||||
|
<>
|
||||||
|
<BreadcrumbComBS title='Frequesntly Asked Questions' paths={['Dashboard', 'Help']} />
|
||||||
|
{/*<div className="row">*/}
|
||||||
|
{/* <div className="vh-100 col-12 flex align-items-center">Coming Soon</div>*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
|
||||||
|
|
||||||
|
<div className="row account-contant">
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="card card-statistics">
|
||||||
|
<div className="card-body p-lg-15" style={{backgroundColor:"#f9f9fb"}}>
|
||||||
|
|
||||||
|
<p className="mb-4">First, a disclaimer – the entire process of writing a blog post often takes more than a couple of hours, even if you can type eighty words as per minute and your writing skills are sharp.</p>
|
||||||
|
<div className="row">
|
||||||
|
<div className="accordion" id="accordionExample">
|
||||||
|
{['a', 'b', 'c', 'd'].map((item, index)=>{
|
||||||
|
return (
|
||||||
|
<div className="accordion-item">
|
||||||
|
<h2 className="accordion-header">
|
||||||
|
<button className="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target={`#${item}`} aria-expanded="true" aria-controls="collapseOne">
|
||||||
|
{`Accordion Item ${item} 1`}
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
<div id={item} className={`accordion-collapse collapse ${index == 0 && 'show'}`} data-bs-parent="#accordionExample">
|
||||||
|
<div className="accordion-body">
|
||||||
|
<strong>This is the first item’s accordion body.</strong> It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It’s also worth noting that just about any HTML can go within the accordion-body, though the transition does limit overflow.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -64,10 +64,13 @@ export default function ProductsURL() {
|
|||||||
return (
|
return (
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
<td>{Number(item?.id)}</td>
|
<td>{Number(item?.id)}</td>
|
||||||
<td>{item?.description} - <a href={productUrl} target='_blank'>{item?.external_url}</a></td>
|
<td>
|
||||||
|
{item?.description} -
|
||||||
|
{/* <a href={productUrl} target='_blank'>{item?.external_url}</a> */}
|
||||||
|
</td>
|
||||||
|
|
||||||
<td><span className={`badge ${statusColor}`}>{item?.status}</span></td>
|
<td><span className={`badge ${statusColor}`}>{item?.status}</span></td>
|
||||||
<td><a className="mr-3" href=""><i className="fe fe-edit"></i></a></td>
|
<td><a className="mr-3" href={productUrl} target='_blank'><i className="fe fe-edit"></i></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ export default function UserHeader(){
|
|||||||
<div className="bg-gradient px-4 py-3">
|
<div className="bg-gradient px-4 py-3">
|
||||||
<div className="d-flex align-items-center justify-content-between">
|
<div className="d-flex align-items-center justify-content-between">
|
||||||
<div className="mr-1">
|
<div className="mr-1">
|
||||||
<h5 className="text-white mb-0">{userDetails?.firstname} {userDetails?.lastname}</h5>
|
<h4 className="text-white mb-0 font-600">{userDetails?.firstname} {userDetails?.lastname}</h4>
|
||||||
<small className="text-white">{userDetails.email}</small>
|
<p className="text-white font-600">{userDetails.email}</p>
|
||||||
</div>
|
</div>
|
||||||
<a href="#" onClick={logout} className="text-white font-20 tooltip-wrapper" data-toggle="tooltip"
|
<a href="#" onClick={logout} className="text-white font-20 tooltip-wrapper" data-toggle="tooltip"
|
||||||
data-placement="top" title="" data-original-title="Logout"> <i
|
data-placement="top" title="" data-original-title="Logout"> <i
|
||||||
@@ -92,8 +92,10 @@ export default function UserHeader(){
|
|||||||
<Link className="dropdown-item d-flex nav-link" to={siteLinks.settings}>
|
<Link className="dropdown-item d-flex nav-link" to={siteLinks.settings}>
|
||||||
<i className=" ti ti-settings pr-2 text-info"></i> Settings
|
<i className=" ti ti-settings pr-2 text-info"></i> Settings
|
||||||
</Link>
|
</Link>
|
||||||
<a className="dropdown-item d-flex nav-link" href="#">
|
<Link className="dropdown-item d-flex nav-link" to={siteLinks.help}>
|
||||||
<i className="fa fa-compass pr-2 text-warning"></i> Need help?</a>
|
<i className="fa fa-compass pr-2 text-warning"></i>
|
||||||
|
Need help?
|
||||||
|
</Link>
|
||||||
|
|
||||||
{/*<div className="row mt-2">*/}
|
{/*<div className="row mt-2">*/}
|
||||||
{/* <div className="col">*/}
|
{/* <div className="col">*/}
|
||||||
|
|||||||
@@ -61,21 +61,20 @@ export default function ProductFactory(){
|
|||||||
<p className='text-danger'>{getProductData?.error?.message}</p>
|
<p className='text-danger'>{getProductData?.error?.message}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<div>
|
<div>
|
||||||
{(product_status <= productConst.PRODUCT_AVAILABLE)?
|
{(product_status <= productConst.PRODUCT_AVAILABLE)?
|
||||||
<ProductStart productData={myproduct_data} />
|
<ProductStart productData={myproduct_data} />
|
||||||
:<></> }
|
:<></> }
|
||||||
|
|
||||||
{(product_status === productConst.PRODUCT_PROVISIONING)?
|
{(product_status === productConst.PRODUCT_PROVISIONING)?
|
||||||
<ProductProvision productData={myproduct_data} />
|
<ProductProvision productData={myproduct_data} />
|
||||||
:<></> }
|
:<></> }
|
||||||
|
|
||||||
{(product_status === productConst.PRODUCT_ACTIVE)?
|
{(product_status === productConst.PRODUCT_ACTIVE)?
|
||||||
<ProductActive productData={myproduct_data} />
|
<ProductActive productData={myproduct_data} />
|
||||||
:<></> }
|
:<></> }
|
||||||
|
</div>
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default function ProductProvision(props){
|
|||||||
queryFn: () => productProvision(reqData)
|
queryFn: () => productProvision(reqData)
|
||||||
})
|
})
|
||||||
|
|
||||||
const provisionData = provision?.data?.provision
|
const provisionData = provision?.data
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
joinRoom(productSubUID); // provision subscription room
|
joinRoom(productSubUID); // provision subscription room
|
||||||
@@ -60,7 +60,7 @@ export default function ProductProvision(props){
|
|||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<div className="progress">
|
<div className="progress">
|
||||||
<div className="progress-bar progress-bar-striped progress-bar-animated" role="progressbar"
|
<div className="progress-bar progress-bar-striped progress-bar-animated" role="progressbar"
|
||||||
aria-valuenow={`${provisionData.percent_completed}%`} aria-valuemin="0" aria-valuemax="100" style={{width:`${provisionData.percent_completed}%`}} ></div>
|
aria-valuenow={`${provisionData?.percent_completed}%`} aria-valuemin="0" aria-valuemax="100" style={{width:`${provisionData?.percent_completed}%`}} ></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -111,9 +111,7 @@ export default function ProductProvision(props){
|
|||||||
<h4 className="card-title" style={{padding:'10px'}}>Started creating your selection</h4>
|
<h4 className="card-title" style={{padding:'10px'}}>Started creating your selection</h4>
|
||||||
<img className="card-img-top" src={getImage('widget/working.jpg')} alt="Card image cap" />
|
<img className="card-img-top" src={getImage('widget/working.jpg')} alt="Card image cap" />
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<p>
|
<div className="" dangerouslySetInnerHTML={{__html: productDescription}}/>
|
||||||
{productDescription}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useRef, useState } from "react";
|
import React, { useRef, useState } from "react";
|
||||||
|
import {useNavigate} from 'react-router-dom'
|
||||||
import getImage from "../../utils/getImage";
|
import getImage from "../../utils/getImage";
|
||||||
// import { Modal } from "bootstrap";
|
import { Modal } from "bootstrap";
|
||||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
import { subscribe } from '../../services/services'
|
import { subscribe } from '../../services/services'
|
||||||
import queryKeys from "../../services/queryKeys";
|
import queryKeys from "../../services/queryKeys";
|
||||||
@@ -8,26 +9,27 @@ import queryKeys from "../../services/queryKeys";
|
|||||||
export default function ProductStart(props){
|
export default function ProductStart(props){
|
||||||
|
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const [requestStatus, setRequestStatus] = useState({status:false, message: ''})
|
const [requestStatus, setRequestStatus] = useState({status:false, message: ''})
|
||||||
|
|
||||||
const product_uid = props?.productData?.product_uid;
|
const product_uid = props?.productData?.product_uid;
|
||||||
const product_id = props?.productData?.product_id;
|
const product_id = props?.productData?.product_id;
|
||||||
const productBanner = "product/"+props.productData?.banner;
|
const productBanner = `product/${props.productData?.banner}`;
|
||||||
const productTitle = props.productData?.title;
|
const productTitle = props?.productData?.title;
|
||||||
const productDescription = props.productData?.description;
|
const productDescription = props?.productData?.description;
|
||||||
const promotion_text = props.productData?.promotion_text;
|
const promotion_text = props?.productData?.promotion_text;
|
||||||
const product_status = props.productData?.status;
|
const product_status = props?.productData?.status;
|
||||||
const saleText = props.productData?.sale_text;
|
const saleText = props?.productData?.sale_text;
|
||||||
|
|
||||||
const modalRef = useRef()
|
|
||||||
|
|
||||||
const refetch = () => {
|
const modalRef = useRef(null)
|
||||||
queryClient.refetchQueries({
|
|
||||||
queryKey: [...queryKeys.product],
|
const invalidate = () => {
|
||||||
// type: 'active',
|
// queryClient.refetchQueries({
|
||||||
// exact: true,
|
// queryKey: [...queryKeys.product],
|
||||||
})
|
// // type: 'active',
|
||||||
|
// // exact: true,
|
||||||
|
// })
|
||||||
|
queryClient.invalidateQueries({ queryKey: [...queryKeys.product_url] })
|
||||||
}
|
}
|
||||||
|
|
||||||
const mutation = useMutation({
|
const mutation = useMutation({
|
||||||
@@ -40,9 +42,12 @@ export default function ProductStart(props){
|
|||||||
},
|
},
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
setRequestStatus({status:true, message:'successful'})
|
setRequestStatus({status:true, message:'successful'})
|
||||||
|
navigate(`/product/${product_id}`, {replace: true}) //'/product/'+ product_id
|
||||||
|
dismissModal()
|
||||||
console.log(res)
|
console.log(res)
|
||||||
},
|
},
|
||||||
onSettled: () => {
|
onSettled: () => {
|
||||||
|
invalidate() // Invalidates selected queries
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
setRequestStatus({status:false, message:''})
|
setRequestStatus({status:false, message:''})
|
||||||
},4000)
|
},4000)
|
||||||
@@ -53,6 +58,22 @@ export default function ProductStart(props){
|
|||||||
mutation.mutate({product_id: product_id})
|
mutation.mutate({product_id: product_id})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dismissModal = () => {
|
||||||
|
const body = document.querySelector('body')
|
||||||
|
body.removeAttribute('style')
|
||||||
|
// body.classList.toggle('modal-open')
|
||||||
|
|
||||||
|
const modalBackdrop = document.querySelectorAll('.modal-backdrop')
|
||||||
|
modalBackdrop.forEach(item => {
|
||||||
|
if (item) {
|
||||||
|
item.remove();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const modal = Modal.getInstance(modalRef.current);
|
||||||
|
modal && modal.hide();
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
@@ -113,7 +134,7 @@ export default function ProductStart(props){
|
|||||||
<div className="modal-content">
|
<div className="modal-content">
|
||||||
<div className="modal-header">
|
<div className="modal-header">
|
||||||
<h5 className="modal-title" id="verticalCenterTitle">{productTitle}</h5>
|
<h5 className="modal-title" id="verticalCenterTitle">{productTitle}</h5>
|
||||||
<button onClick={refetch} type="button" className="close" data-bs-dismiss="modal" aria-label="Close">
|
<button type="button" className="close" data-bs-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -140,7 +161,7 @@ export default function ProductStart(props){
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-footer">
|
<div className="modal-footer">
|
||||||
<button onClick={refetch} type="button" className="btn btn-danger" data-bs-dismiss="modal">Close</button>
|
<button type="button" className="btn btn-danger" data-bs-dismiss="modal">Close</button>
|
||||||
<button type="button" className="btn btn-success" disabled={mutation.isSuccess} onClick={handleSubscribe}>{mutation.isPending ? 'loading...' : 'Start'}</button>
|
<button type="button" className="btn btn-success" disabled={mutation.isSuccess} onClick={handleSubscribe}>{mutation.isPending ? 'loading...' : 'Start'}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+3
-5
@@ -1,9 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom/client';
|
import ReactDOM from 'react-dom/client';
|
||||||
// import './index.css';
|
// import './index.css';
|
||||||
import { Provider } from 'react-redux';
|
// import { Provider } from 'react-redux';
|
||||||
|
// import store from './store/store'
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
import store from './store/store'
|
|
||||||
|
|
||||||
import App from './App';
|
import App from './App';
|
||||||
//import reportWebVitals from './reportWebVitals';
|
//import reportWebVitals from './reportWebVitals';
|
||||||
@@ -17,9 +17,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'));
|
|||||||
root.render(
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Provider store={store}>
|
<App />
|
||||||
<App />
|
|
||||||
</Provider>
|
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
const siteLinks = {
|
const siteLinks = {
|
||||||
error: '*',
|
error: '*',
|
||||||
|
help: '/help',
|
||||||
home: '/',
|
home: '/',
|
||||||
dash: '/dash',
|
dash: '/dash',
|
||||||
product: '/product/*',
|
product: '/product/*',
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
const queryKeys = {
|
const queryKeys = {
|
||||||
user_details: ['user_details'],
|
user_details: ['user_details'],
|
||||||
|
product_url: ['product_url'],
|
||||||
|
product: ['product-data'],
|
||||||
|
|
||||||
dashboard: ['dashboard'],
|
dashboard: ['dashboard'],
|
||||||
topBar: ['top-bar'],
|
topBar: ['top-bar'],
|
||||||
recentAction: ['recent-action'],
|
recentAction: ['recent-action'],
|
||||||
product: ['product-data'],
|
|
||||||
product_url: ['product_url'],
|
|
||||||
myproduct_provision: ['myproduct_provision'],
|
myproduct_provision: ['myproduct_provision'],
|
||||||
calendar_events: ['calendar_events'],
|
calendar_events: ['calendar_events'],
|
||||||
contacts: ['contacts']
|
contacts: ['contacts']
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import HelpCom from '../component/help/HelpCom'
|
||||||
|
|
||||||
|
export default function HelpPage() {
|
||||||
|
return (
|
||||||
|
<HelpCom />
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user