Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2123af0abe | |||
| a3c306bf89 | |||
| a61abe718a | |||
| 2b91506c61 | |||
| 253cace3fe | |||
| aa55a1a4e0 | |||
| 8b763882fa | |||
| 30540e46ba | |||
| b195b1f787 | |||
| 2ddd04a1a1 | |||
| 6ea26740a4 | |||
| f334ca49f0 | |||
| fa9d7f69e4 | |||
| a4db58ba97 | |||
| ddc747d9ca | |||
| ac337eb693 | |||
| f2c3415b1d | |||
| 37450925e1 | |||
| 3b20fcec68 | |||
| d87a083c3e | |||
| 3f8a7a6b3b | |||
| 91d82db40c | |||
| 2dc12d7d0a | |||
| 164195d4cc | |||
| 7ad1a585ea | |||
| a8c2dd84f1 | |||
| ddcc6f0cd2 | |||
| 683f81e8a6 | |||
| 8e09c30c5c | |||
| af0d4db5de | |||
| 6f3dae4116 | |||
| 13900793af | |||
| 698c89edfc | |||
| 4f5a383c99 | |||
| a5b6a11880 |
@@ -16,3 +16,6 @@ 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
|
||||||
|
|
||||||
|
# show download button
|
||||||
|
REACT_APP_SHOW_DOWNLOAD=0
|
||||||
|
|
||||||
|
|||||||
@@ -17,3 +17,6 @@ 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
|
||||||
|
|
||||||
|
# show download button
|
||||||
|
REACT_APP_SHOW_DOWNLOAD=0
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -14,4 +14,7 @@ REACT_APP_CONTACTS_LINK='https://www.mermsemr.com/contacts'
|
|||||||
REACT_APP_TERMS_LINK='https://www.mermsemr.com/terms'
|
REACT_APP_TERMS_LINK='https://www.mermsemr.com/terms'
|
||||||
|
|
||||||
# Inactivity timeout/logout AT 10MINS
|
# Inactivity timeout/logout AT 10MINS
|
||||||
REACT_APP_TIMEOUT=600000
|
REACT_APP_TIMEOUT=600000
|
||||||
|
|
||||||
|
# show download button
|
||||||
|
REACT_APP_SHOW_DOWNLOAD=0
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 78 KiB |
@@ -0,0 +1,42 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import GoogleDownload from '../../assets/img/download/andriod.jpg'
|
||||||
|
import IOSDownload from '../../assets/img/download/apple.jpg'
|
||||||
|
|
||||||
|
export default function AuthFooter() {
|
||||||
|
return (
|
||||||
|
<div className='w-100'>
|
||||||
|
{Number(process.env.REACT_APP_SHOW_DOWNLOAD) == 100 &&
|
||||||
|
<>
|
||||||
|
<div className="row" style={{margin: '5px'}}>
|
||||||
|
<hr />
|
||||||
|
</div>
|
||||||
|
<div className="row" style={{marginTop: '20px'}}>
|
||||||
|
<div className="col-6">
|
||||||
|
<div className="app-store-icons-wrap text-center">
|
||||||
|
<a className="icon google"
|
||||||
|
href='#' >
|
||||||
|
<img src={IOSDownload} className='w-80 h-auto' alt='IOS Download' />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="col-6">
|
||||||
|
<div className="app-store-icons-wrap text-center">
|
||||||
|
<a className="icon apple" href='#'>
|
||||||
|
<img src={GoogleDownload} className='w-80 h-auto' alt='IOS Download' />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
|
||||||
|
<div className="login-links">
|
||||||
|
<a href={process.env.REACT_APP_HOME_LINK}>Home</a>
|
||||||
|
<a href={process.env.REACT_APP_ABOUT_LINK}>About</a>
|
||||||
|
<a href={process.env.REACT_APP_CONTACTS_LINK}>Contact</a>
|
||||||
|
<a href={process.env.REACT_APP_TERMS_LINK}>Terms</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import siteLinks from '../../links/siteLinks'
|
|||||||
import { useMutation } from '@tanstack/react-query'
|
import { useMutation } from '@tanstack/react-query'
|
||||||
import { recoverPWD } from '../../services/services';
|
import { recoverPWD } from '../../services/services';
|
||||||
import getImage from '../../utils/getImage';
|
import getImage from '../../utils/getImage';
|
||||||
|
import AuthFooter from './AuthFooter';
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
username: Yup.string()
|
username: Yup.string()
|
||||||
@@ -49,7 +50,7 @@ export default function Forgetpwd2() {
|
|||||||
<div className="row no-gutters justify-content-center">
|
<div className="row no-gutters justify-content-center">
|
||||||
<div className="col-11 col-sm-6 col-lg-5 col-xxl-4 align-self-center order-2 order-sm-1h" style={{maxWidth: '520px'}}>
|
<div className="col-11 col-sm-6 col-lg-5 col-xxl-4 align-self-center order-2 order-sm-1h" style={{maxWidth: '520px'}}>
|
||||||
<div className="mt-5 d-flex">
|
<div className="mt-5 d-flex">
|
||||||
<div className="bg-white register p-5">
|
<div className="bg-white register px-5 pt-5 pb-3">
|
||||||
<h1 className="mb-2">{process.env.REACT_APP_PANEL_NAME}</h1>
|
<h1 className="mb-2">{process.env.REACT_APP_PANEL_NAME}</h1>
|
||||||
{!mutation.isSuccess && <p>Please enter your username.</p>}
|
{!mutation.isSuccess && <p>Please enter your username.</p>}
|
||||||
<Formik
|
<Formik
|
||||||
@@ -97,6 +98,7 @@ export default function Forgetpwd2() {
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Formik>
|
</Formik>
|
||||||
|
<AuthFooter />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ import siteLinks from '../../links/siteLinks'
|
|||||||
import { loginUser } from '../../services/services'
|
import { loginUser } from '../../services/services'
|
||||||
import { updateUserDetails } from '../../store/UserDetails'
|
import { updateUserDetails } from '../../store/UserDetails'
|
||||||
|
|
||||||
import GoogleDownload from '../../assets/img/download/andriod.jpg'
|
import AuthFooter from './AuthFooter'
|
||||||
import IOSDownload from '../../assets/img/download/apple.jpg'
|
|
||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
|
|
||||||
@@ -47,12 +46,12 @@ export default function Login() {
|
|||||||
console.log(error)
|
console.log(error)
|
||||||
},
|
},
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
if(res?.data?.error_message){
|
if(res?.data && res?.data?.error_message){
|
||||||
throw({message: res?.data?.error_message})
|
throw({message: res?.data?.error_message})
|
||||||
}
|
}
|
||||||
const {token, room, uid} = res?.data
|
const {token, room, uid} = res?.data
|
||||||
if(!token || !room){
|
if(!token || !room){
|
||||||
throw({message: 'something went wrong, try again!'})
|
throw({message: 'Unable to complete your login, Please try again!'})
|
||||||
}
|
}
|
||||||
localStorage.setItem('token', token)
|
localStorage.setItem('token', token)
|
||||||
localStorage.setItem('room', room)
|
localStorage.setItem('room', room)
|
||||||
@@ -133,35 +132,7 @@ export default function Login() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div className="row" style={{margin: '5px'}}>
|
<AuthFooter />
|
||||||
<hr />
|
|
||||||
</div>
|
|
||||||
<div className="row" style={{marginTop: '20px'}}>
|
|
||||||
<div className="col-6">
|
|
||||||
<div className="app-store-icons-wrap text-center">
|
|
||||||
<a className="icon google"
|
|
||||||
href='#' >
|
|
||||||
<img src={IOSDownload} className='w-80 h-auto' alt='IOS Download' />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="col-6">
|
|
||||||
<div className="app-store-icons-wrap text-center">
|
|
||||||
<a className="icon apple" href='#'>
|
|
||||||
<img src={GoogleDownload} className='w-80 h-auto' alt='IOS Download' />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="login-links">
|
|
||||||
<a href={process.env.REACT_APP_HOME_LINK}>Home</a>
|
|
||||||
<a href={process.env.REACT_APP_ABOUT_LINK}>About</a>
|
|
||||||
<a href={process.env.REACT_APP_CONTACTS_LINK}>Contact</a>
|
|
||||||
<a href={process.env.REACT_APP_TERMS_LINK}>Terms</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import siteLinks from '../../links/siteLinks'
|
|||||||
import {useMutation} from '@tanstack/react-query';
|
import {useMutation} from '@tanstack/react-query';
|
||||||
import {signUpUser} from '../../services/services';
|
import {signUpUser} from '../../services/services';
|
||||||
import getImage from '../../utils/getImage';
|
import getImage from '../../utils/getImage';
|
||||||
|
import AuthFooter from './AuthFooter';
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
email: Yup.string()
|
email: Yup.string()
|
||||||
@@ -64,9 +65,9 @@ export default function Signup2() {
|
|||||||
<div className="col-11 col-sm-6 col-lg-5 col-xxl-4 align-self-center order-2 order-sm-1"
|
<div className="col-11 col-sm-6 col-lg-5 col-xxl-4 align-self-center order-2 order-sm-1"
|
||||||
style={{maxWidth: '520px'}}>
|
style={{maxWidth: '520px'}}>
|
||||||
<div className="mt-5 d-flex">
|
<div className="mt-5 d-flex">
|
||||||
<div className="bg-white register p-5">
|
<div className="bg-white register px-5 pt-5 pb-3">
|
||||||
<h1 className="mb-2">{process.env.REACT_APP_PANEL_NAME}</h1>
|
<h1 className="mb-2">{process.env.REACT_APP_PANEL_NAME}</h1>
|
||||||
<p>Welcome, Please create your account.</p>
|
<p>Welcome, please create your account.</p>
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
validationSchema={validationSchema}
|
validationSchema={validationSchema}
|
||||||
@@ -173,19 +174,23 @@ export default function Signup2() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div className="col-12 mt-3">
|
<div className="col-12 mt-3">
|
||||||
<p>Already have an account ?<Link
|
<p>
|
||||||
to={siteLinks.login}>
|
<span style={{paddingLeft: '5px' , fontWeight: 'bolder'}}>Already have an account? </span>
|
||||||
<button
|
<Link
|
||||||
className="btn btn-warning text-uppercase">
|
to={siteLinks.login}>
|
||||||
Sign In
|
<button
|
||||||
</button>
|
className="btn btn-warning text-uppercase">
|
||||||
</Link></p>
|
Sign In
|
||||||
|
</button>
|
||||||
|
</Link>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Formik>
|
</Formik>
|
||||||
|
<AuthFooter />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export default function SocketIOContextProvider({children}) {
|
|||||||
socket.on(socketOnEvents.receive_message, (data) => {
|
socket.on(socketOnEvents.receive_message, (data) => {
|
||||||
// setSocketMsgReceived(data.message);
|
// setSocketMsgReceived(data.message);
|
||||||
// dispatch(tableReload({type:'CHATMESSAGELIST'})) // dispatches to update chat message sending from owner to worker and vice versa
|
// dispatch(tableReload({type:'CHATMESSAGELIST'})) // dispatches to update chat message sending from owner to worker and vice versa
|
||||||
console.log('DATA', data)
|
console.log('SOCKET RECEIVED DATA *** ', data)
|
||||||
queryClient.refetchQueries({
|
queryClient.refetchQueries({
|
||||||
queryKey: [...queryKeys.recentAction],
|
queryKey: [...queryKeys.recentAction],
|
||||||
// type: 'active',
|
// type: 'active',
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export default function DashPayments() {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{payments.length > 0 ?
|
{payments && payments?.length > 0 ?
|
||||||
payments.map((item, index) => {
|
payments.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export default function Products() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="report-details">
|
<div className="report-details">
|
||||||
<p><span style={{fontWeight: 'bolder', color: '#00557A'}}>{product?.status_text}</span></p>
|
<p><span style={{fontWeight: 'bolder', color: '#00557A'}}>{product?.status_text}</span></p>
|
||||||
<h4><span style={{paddingLeft: '10px'}}>{product?.name}</span></h4>
|
<h4><span className='text-truncate' style={{paddingLeft: '10px'}}>{product?.name}</span></h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default function ProductsURL() {
|
|||||||
{/*<a className="btn btn-xs" href="#!">Export <i className="zmdi zmdi-download pl-1"></i> </a>*/}
|
{/*<a className="btn btn-xs" href="#!">Export <i className="zmdi zmdi-download pl-1"></i> </a>*/}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-body scrollbar scroll_dark pt-0" style={{maxHeight: '350px'}}>
|
<div className="overflow-y-auto card-body scrollbar scroll_dark pt-0" style={{maxHeight: '350px'}}>
|
||||||
<div className="datatable-wrapper table-responsive">
|
<div className="datatable-wrapper table-responsive">
|
||||||
{isFetching ?
|
{isFetching ?
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export default function RecentActions() {
|
|||||||
<h4>{dataAction?.data?.completed}</h4>
|
<h4>{dataAction?.data?.completed}</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="table-responsive m-t-20">
|
<div className="overflow-y-auto table-responsive m-t-20">
|
||||||
<table id="datatable-buttons" className="table">
|
<table id="datatable-buttons" className="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -94,7 +94,7 @@ export default function RecentActions() {
|
|||||||
let text = action?.status == '5' ? 'completed' : action?.status == '3' ? 'verifying' : action?.status == '0' ? 'processing' : 'processing'
|
let text = action?.status == '5' ? 'completed' : action?.status == '3' ? 'verifying' : action?.status == '0' ? 'processing' : 'processing'
|
||||||
return (
|
return (
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
<td>{action?.id}</td>
|
<td>{(action?.id).toString().slice(-4)}</td>
|
||||||
<td>{action?.action_label}</td>
|
<td>{action?.action_label}</td>
|
||||||
<td>{new Date(action?.added).toDateString()}</td>
|
<td>{new Date(action?.added).toDateString()}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export default function UserHeader(){
|
|||||||
<span className="bg-success user-status"></span>
|
<span className="bg-success user-status"></span>
|
||||||
</a>
|
</a>
|
||||||
<div ref={nav_menu} onClick={toggleMenu} className="dropdown-menu animated fadeIn">
|
<div ref={nav_menu} onClick={toggleMenu} className="dropdown-menu animated fadeIn">
|
||||||
|
<div className="position-fixed" style={{top: '0px', left: '0px', right: '0px', bottom: '0px'}}></div>
|
||||||
<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">
|
||||||
|
|||||||
@@ -1,21 +1,26 @@
|
|||||||
import React, { useMemo, useRef, useState } from "react";
|
import React, {useEffect, useMemo, useRef, useState} from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import getImage from "../../utils/getImage";
|
import getImage from "../../utils/getImage";
|
||||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||||
import { productRefreshSite, getSettingsData } from "../../services/services";
|
import { productRefreshSite, getSettingsData } from "../../services/services";
|
||||||
import Settings from "./settingsTab/Settings";
|
import Settings from "./settingsTab/Settings";
|
||||||
import queryKeys from "../../services/queryKeys";
|
import queryKeys from "../../services/queryKeys";
|
||||||
|
import {SocketContextValues} from "../context/SocketIOContext";
|
||||||
|
|
||||||
|
|
||||||
export default function ProductActive({productData}){
|
export default function ProductActive({productData}){
|
||||||
|
const {joinRoom} = SocketContextValues() // Destructures values from socket context
|
||||||
const iframe = useRef()
|
const iframe = useRef()
|
||||||
|
|
||||||
|
const [refreshMsg, setRefreshMsg] = useState('')
|
||||||
|
|
||||||
const refresh = useMutation({
|
const refresh = useMutation({
|
||||||
mutationFn: (fields) => {
|
mutationFn: (fields) => {
|
||||||
return productRefreshSite(fields)
|
return productRefreshSite(fields)
|
||||||
},
|
},
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
|
setRefreshMsg(res?.data?.message)
|
||||||
|
setTimeout(()=>{setRefreshMsg('')},3000)
|
||||||
iframe.current.src += ''
|
iframe.current.src += ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -31,6 +36,13 @@ export default function ProductActive({productData}){
|
|||||||
}
|
}
|
||||||
let externalUrl= 'https://'+productData?.internal_url
|
let externalUrl= 'https://'+productData?.internal_url
|
||||||
|
|
||||||
|
const productSubUID = productData.subscription_uid;
|
||||||
|
useEffect(() => {
|
||||||
|
const provision_room = "PROVISION_"+productSubUID;
|
||||||
|
console.log("JOINING ROOM ON ACTIVE *** ", provision_room);
|
||||||
|
joinRoom(provision_room); // provision subscription room
|
||||||
|
}, [])
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
{/*<BreadcrumbComBS title='Active Product Name' paths={['Dashboard', 'Product']} />*/}
|
{/*<BreadcrumbComBS title='Active Product Name' paths={['Dashboard', 'Product']} />*/}
|
||||||
@@ -54,12 +66,17 @@ export default function ProductActive({productData}){
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-body">
|
<div className="card-body" style={{minHeight: '680px'}}>
|
||||||
<iframe ref={iframe} style={{borderWidth: '0px'}} src={externalUrl} width="100%" height="600" title={externalUrl}></iframe>
|
<iframe ref={iframe} style={{borderWidth: '0px'}} src={externalUrl} width="100%" height="600" title={externalUrl}></iframe>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-4 ml-auto">
|
<div className="p-4 ml-auto">
|
||||||
<button type="button" onClick={handleRefresh} className="btn btn-primary">{refresh.isPending ? 'Loading...' : 'Refresh Site'}
|
<div className="d-flex justify-end gap-3">
|
||||||
</button>
|
{refreshMsg &&
|
||||||
|
<p className="text-success text-center">{refreshMsg}</p>
|
||||||
|
}
|
||||||
|
<button type="button" onClick={handleRefresh} className="btn btn-primary">{refresh.isPending ? 'Initiating...' : 'Rebuild Site'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -70,7 +87,7 @@ export default function ProductActive({productData}){
|
|||||||
<h4 className="card-title"> Site Settings </h4>
|
<h4 className="card-title"> Site Settings </h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-body">
|
<div className="card-body" style={{minHeight: '680px'}}>
|
||||||
<Settings productData={productData} />
|
<Settings productData={productData} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,39 +1,41 @@
|
|||||||
import { useEffect } from "react";
|
import {useEffect} from "react";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import {useQuery} from "@tanstack/react-query";
|
||||||
import queryKeys from "../../services/queryKeys";
|
import queryKeys from "../../services/queryKeys";
|
||||||
import { productProvision } from "../../services/services";
|
import {productProvision} from "../../services/services";
|
||||||
import getImage from "../../utils/getImage";
|
import getImage from "../../utils/getImage";
|
||||||
import { SocketContextValues } from "../context/SocketIOContext";
|
import {SocketContextValues} from "../context/SocketIOContext";
|
||||||
|
|
||||||
|
|
||||||
export default function ProductProvision(props){
|
export default function ProductProvision(props) {
|
||||||
const {joinRoom} = SocketContextValues() // Destructures values from socket context
|
const {joinRoom} = SocketContextValues() // Destructures values from socket context
|
||||||
|
|
||||||
const productTitle = props?.productData?.title;
|
const productTitle = props?.productData?.title;
|
||||||
const productDescription = props?.productData?.description;
|
const productDescription = props?.productData?.description;
|
||||||
const productID = props?.productData?.product_id
|
const productID = props?.productData?.product_id
|
||||||
const productUID = props?.productData?.product_uid
|
const productUID = props?.productData?.product_uid
|
||||||
const productSubUID = props?.productData?.product_subscription_uid
|
const productSubUID = props?.productData?.product_subscription_uid
|
||||||
|
|
||||||
const reqData = {
|
const reqData = {
|
||||||
product_id : productID,
|
product_id: productID,
|
||||||
product_subscription_uid: productSubUID
|
product_subscription_uid: productSubUID
|
||||||
}
|
}
|
||||||
|
|
||||||
const {data:provision, isFetching, isError, error} = useQuery({
|
const {data: provision, isFetching, isError, error} = useQuery({
|
||||||
queryKey: queryKeys.myproduct_provision,
|
queryKey: queryKeys.myproduct_provision,
|
||||||
queryFn: () => productProvision(reqData)
|
queryFn: () => productProvision(reqData)
|
||||||
})
|
})
|
||||||
|
|
||||||
const provisionData = provision?.data
|
const provisionData = provision?.data
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(() => {
|
||||||
joinRoom(productSubUID); // provision subscription room
|
const provision_room = "PROVISION_" + productSubUID;
|
||||||
},[])
|
console.log("JOINING ROOM ON START *** ", provision_room);
|
||||||
|
joinRoom(provision_room); // provision subscription room
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isFetching ?
|
{isFetching ?
|
||||||
<>
|
<>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
@@ -42,82 +44,87 @@ export default function ProductProvision(props){
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
: isError ?
|
: isError ?
|
||||||
<div className="row">
|
|
||||||
<div className="col-12">
|
|
||||||
<p className='text-danger'>{error.message}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
:
|
|
||||||
<>
|
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-md-12">
|
<div className="col-12">
|
||||||
<div className="card card-statistics">
|
<p className='text-danger'>{error.message}</p>
|
||||||
<div className="card-header">
|
</div>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
<div className="row">
|
||||||
|
<div className="col-md-12">
|
||||||
|
<div className="card card-statistics">
|
||||||
|
<div className="card-header">
|
||||||
<div className="card-heading">
|
<div className="card-heading">
|
||||||
<h4 className="card-title">Creating - {productTitle} </h4>
|
<h4 className="card-title">Creating - {productTitle} </h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<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"
|
||||||
aria-valuenow={`${provisionData?.percent_completed}%`} aria-valuemin="0" aria-valuemax="100" style={{width:`${provisionData?.percent_completed}%`}} ></div>
|
role="progressbar"
|
||||||
|
aria-valuenow={`${provisionData?.percent_completed}%`}
|
||||||
|
aria-valuemin="0" aria-valuemax="100"
|
||||||
|
style={{width: `${provisionData?.percent_completed}%`}}></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="row">
|
||||||
<div className="row">
|
<div className="col-md-12">
|
||||||
<div className="col-md-12">
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="row">
|
||||||
<div className="row">
|
<div className="col-lg-6">
|
||||||
<div className="col-lg-6">
|
|
||||||
|
|
||||||
<div className="card card-statistics">
|
<div className="card card-statistics">
|
||||||
<div className="card-header">
|
<div className="card-header">
|
||||||
<div className="card-heading">
|
<div className="card-heading">
|
||||||
<h4 className="card-title">Progress Information</h4>
|
<h4 className="card-title">Progress Information</h4>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="card-body">
|
||||||
<div className="card-body">
|
<div className="table-responsive">
|
||||||
<div className="table-responsive">
|
<table className="table table-info mb-0">
|
||||||
<table className="table table-info mb-0">
|
<thead>
|
||||||
<thead>
|
<tr>
|
||||||
<tr>
|
<th scope="col" style={{width: '10px'}}>#</th>
|
||||||
<th scope="col" style={{width: '10px'}}>#</th>
|
<th scope="col">Action</th>
|
||||||
<th scope="col">Action</th>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{provisionData?.activities?.map(item => (
|
|
||||||
<tr key={item.id}>
|
|
||||||
<th scope="row">{item.id}</th>
|
|
||||||
<td>{item.action}</td>
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{provisionData?.activities?.map(item => (
|
||||||
|
<tr key={item.id}>
|
||||||
|
<th scope="row">{item.id}</th>
|
||||||
|
<td>{item.action}</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="col-lg-6">
|
<div className="col-lg-6">
|
||||||
<div className="card card-statistics ">
|
<div className="card card-statistics ">
|
||||||
<h4 className="card-title" style={{padding:'10px'}}>Started creating your selection</h4>
|
<h4 className="card-title" style={{padding: '10px'}}>Started creating your
|
||||||
<img className="card-img-top" src={getImage('widget/working.jpg')} alt="Card image cap" />
|
selection</h4>
|
||||||
{/* <div className="card-body">
|
<img className="card-img-top" src={getImage('widget/working.jpg')}
|
||||||
|
alt="Card image cap"/>
|
||||||
|
{/* <div className="card-body">
|
||||||
<div className="" dangerouslySetInnerHTML={{__html: productDescription}}/>
|
<div className="" dangerouslySetInnerHTML={{__html: productDescription}}/>
|
||||||
</div> */}
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</>
|
||||||
</>
|
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,179 @@
|
|||||||
const ColorStyleConfigure =()=>{
|
import React, {memo} from 'react'
|
||||||
|
import getImage from "../../../utils/getImage";
|
||||||
|
import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query';
|
||||||
|
import queryKeys from '../../../services/queryKeys';
|
||||||
|
import {
|
||||||
|
getProductcolorStyleCss,
|
||||||
|
activateTemplate,
|
||||||
|
getProductColorStyles,
|
||||||
|
activateColorStyle
|
||||||
|
} from '../../../services/services';
|
||||||
|
import {Link} from "react-router-dom";
|
||||||
|
import siteLinks from "../../../links/siteLinks";
|
||||||
|
|
||||||
return <>COLOR CONFIG</>
|
const ColorStyleConfigure = memo(({name = 'Full Name', data, productData}) => {
|
||||||
}
|
|
||||||
|
|
||||||
export default ColorStyleConfigure
|
const queryClient = useQueryClient()
|
||||||
|
|
||||||
|
const {data: colorStyleCss, isFetching, isError, error} = useQuery({
|
||||||
|
queryKey: queryKeys.productcolorStyleCss,
|
||||||
|
queryFn: () => {
|
||||||
|
let reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid'), // USER UID
|
||||||
|
product_id: productData?.product_id
|
||||||
|
}
|
||||||
|
return getProductColorStyles(reqData)
|
||||||
|
},
|
||||||
|
staleTime: 0
|
||||||
|
})
|
||||||
|
|
||||||
|
const templateResponse = colorStyleCss?.data
|
||||||
|
const currentColorUID = templateResponse?.current_colorstyle_uid
|
||||||
|
const color_styles = templateResponse?.color_styles
|
||||||
|
const custom_template_name = templateResponse?.custom_template_name
|
||||||
|
|
||||||
|
// console.log('data Template', templateResponse)
|
||||||
|
console.log("Page data == ", data)
|
||||||
|
|
||||||
|
const handleActivateTemplate = useMutation({
|
||||||
|
mutationFn: (fields) => {
|
||||||
|
return activateColorStyle(fields)
|
||||||
|
},
|
||||||
|
onSuccess: (res) => {
|
||||||
|
if (res?.data?.resultCode != '0') {
|
||||||
|
throw new Error(res.data.resultDescription)
|
||||||
|
}
|
||||||
|
queryClient.refetchQueries({ // refetches productProvision API call
|
||||||
|
queryKey: [...queryKeys.settingsData],
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onSettled: () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
handleActivateTemplate.reset()
|
||||||
|
}, 3000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleSubmit = (style_uid) => {
|
||||||
|
const reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid'), // USER UID
|
||||||
|
product_id: productData?.product_id,
|
||||||
|
color_style_uid: style_uid
|
||||||
|
}
|
||||||
|
// console.log(reqData)
|
||||||
|
handleActivateTemplate.mutate(reqData)
|
||||||
|
}
|
||||||
|
if (custom_template_name && custom_template_name != '') {
|
||||||
|
// This implies we have a custom template , just return here
|
||||||
|
return <>
|
||||||
|
<div className='col-12'>
|
||||||
|
<div
|
||||||
|
className="rounded-2 d-flex flex-column justify-content-between align-items-center"
|
||||||
|
style={{backgroundColor: '#F2FAF7'}}>
|
||||||
|
<h4 className='p-4 text-black'
|
||||||
|
style={{marginBottom: '20px'}}>Custom Product Template.</h4>
|
||||||
|
<img className='' style={{width: '200px'}}
|
||||||
|
src={getImage('custom-template.png')}
|
||||||
|
alt='mail-alert'/>
|
||||||
|
<h4 className='p-4 text-black'
|
||||||
|
style={{marginTop: '20px'}}>This product is using a custom template named <span
|
||||||
|
style={{color: 'darkred'}}>“{custom_template_name}”</span> .</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div className="page-account-form">
|
||||||
|
<div className="p-0">
|
||||||
|
{isFetching ?
|
||||||
|
<>
|
||||||
|
<div className="row">
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-mute'>Loading...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
: isError ?
|
||||||
|
<div className="row">
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-danger'>{error?.message}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<div className="row overflow-y-auto" style={{maxHeight: '550px'}}>
|
||||||
|
<>
|
||||||
|
{!color_styles?.length ?
|
||||||
|
<p>No data Found</p>
|
||||||
|
:
|
||||||
|
color_styles.map(color_style => (
|
||||||
|
<div key={color_style.color_style_uid} className="col-xl-6 col-sm-6">
|
||||||
|
<div className="card card-statistics">
|
||||||
|
<div className="card-body" style={{
|
||||||
|
backgroundColor: `#${color_style.color_code}`,
|
||||||
|
opacity: '0.85',
|
||||||
|
borderRadius: '10px'
|
||||||
|
}}>
|
||||||
|
<div className="text-center p-2">
|
||||||
|
{/*<div className="mb-2">*/}
|
||||||
|
{/* <img src={getImage('file-icon/svg.png')}*/}
|
||||||
|
{/* alt={template.title}/>*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
<h4 className="mb-0">{color_style.title}</h4>
|
||||||
|
{currentColorUID === color_style.color_style_uid ?
|
||||||
|
<button className="btn btn-light"
|
||||||
|
disabled={true}>Active</button>
|
||||||
|
:
|
||||||
|
<button
|
||||||
|
onClick={() => handleSubmit(color_style.color_style_uid)}
|
||||||
|
className="btn btn-primary">Select</button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
{/* {Object.entries(data)?.map(([key, value]) => (
|
||||||
|
<div key={key} className="col-xl-6 col-sm-6">
|
||||||
|
<div className="card card-statistics">
|
||||||
|
<div className="card-body">
|
||||||
|
<div className="text-center p-2">
|
||||||
|
<div className="mb-2">
|
||||||
|
<img src={getImage(value.banner)} alt={value.title} />
|
||||||
|
</div>
|
||||||
|
<h4 className="mb-0">{value.title}</h4>
|
||||||
|
<a href="javascript:void(0)" className="btn btn-light">Activate</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))} */}
|
||||||
|
</>
|
||||||
|
|
||||||
|
<div className="col-12">
|
||||||
|
<>
|
||||||
|
{handleActivateTemplate.isPending ?
|
||||||
|
<p className={'text-center '}>loading...</p>
|
||||||
|
:
|
||||||
|
handleActivateTemplate.isError ?
|
||||||
|
<p className={'text-center text-danger'}>{handleActivateTemplate.error.message}</p>
|
||||||
|
:
|
||||||
|
handleActivateTemplate.isSuccess ?
|
||||||
|
<p className={'text-center text-success'}>Templated activated
|
||||||
|
successfully</p>
|
||||||
|
:
|
||||||
|
null
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
export default ColorStyleConfigure
|
||||||
@@ -112,9 +112,15 @@ const GeneralTab = memo(({
|
|||||||
<>
|
<>
|
||||||
{isCustom === true ?
|
{isCustom === true ?
|
||||||
<>
|
<>
|
||||||
{(tabKey === 'template_tab') && <SiteTemplateSelector name={name} data={sortedData} isCustom={isCustom} productData={productData}/>}
|
{(tabKey === 'template_tab') &&
|
||||||
{(tabKey === 'url_config_tab') && <URLConfiguration name={name} data={sortedData} isCustom={isCustom} productData={productData}/>}
|
<SiteTemplateSelector name={name} data={sortedData} isCustom={isCustom}
|
||||||
{(tabKey === 'color_scheme_tab') && <ColorStyleConfigure name={name} data={sortedData} isCustom={isCustom} productData={productData}/>}
|
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">
|
<div className="page-account-form">
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import getImage from "../../../utils/getImage";
|
|||||||
import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query';
|
import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query';
|
||||||
import queryKeys from '../../../services/queryKeys';
|
import queryKeys from '../../../services/queryKeys';
|
||||||
import {getProductTemplateData, activateTemplate} from '../../../services/services';
|
import {getProductTemplateData, activateTemplate} from '../../../services/services';
|
||||||
|
import {Link} from "react-router-dom";
|
||||||
|
import siteLinks from "../../../links/siteLinks";
|
||||||
|
|
||||||
const SiteTemplateSelector = memo(({name = 'Full Name', data, productData}) => {
|
const SiteTemplateSelector = memo(({name = 'Full Name', data, productData}) => {
|
||||||
|
|
||||||
@@ -60,7 +62,23 @@ const SiteTemplateSelector = memo(({name = 'Full Name', data, productData}) => {
|
|||||||
}
|
}
|
||||||
if (custom_template_name && custom_template_name != '') {
|
if (custom_template_name && custom_template_name != '') {
|
||||||
// This implies we have a custom template , just return here
|
// This implies we have a custom template , just return here
|
||||||
return <>This product is using a custom template named {custom_template_name} </>
|
return <>
|
||||||
|
<div className='col-12'>
|
||||||
|
<div
|
||||||
|
className="rounded-2 d-flex flex-column justify-content-between align-items-center"
|
||||||
|
style={{backgroundColor: '#F2FAF7'}}>
|
||||||
|
<h4 className='p-4 text-black'
|
||||||
|
style={{marginBottom: '20px'}}>Custom Product Template.</h4>
|
||||||
|
<img className='' style={{width: '200px'}}
|
||||||
|
src={getImage('custom-template.png')}
|
||||||
|
alt='mail-alert'/>
|
||||||
|
<h4 className='p-4 text-black'
|
||||||
|
style={{marginTop: '20px'}}>This product is using a custom template named <span
|
||||||
|
style={{color: 'darkred'}}>“{custom_template_name}”</span> .</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="page-account-form">
|
<div className="page-account-form">
|
||||||
@@ -80,7 +98,7 @@ const SiteTemplateSelector = memo(({name = 'Full Name', data, productData}) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<div className="row">
|
<div className="row overflow-y-auto" style={{maxHeight: '550px'}}>
|
||||||
<>
|
<>
|
||||||
{!templates?.length ?
|
{!templates?.length ?
|
||||||
<p>No data Found</p>
|
<p>No data Found</p>
|
||||||
|
|||||||
@@ -1,19 +1,35 @@
|
|||||||
import { Form, Formik } from "formik";
|
import {Form, Formik} from "formik";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
import { useMutation } from '@tanstack/react-query';
|
import {useMutation} from '@tanstack/react-query';
|
||||||
import { setExternalURL } from '../../../services/services';
|
import {setExternalURL} from '../../../services/services';
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
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'),
|
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 = {
|
// const initialValues = {
|
||||||
url: '',
|
// url: '',
|
||||||
};
|
// };
|
||||||
|
|
||||||
const URLConfiguration = ({productData}) => {
|
const URLConfiguration = ({productData}) => {
|
||||||
|
|
||||||
let defaultUrl= 'https://'+productData?.internal_url
|
const [externalURLChanged, setExternalURLChanged] = useState(true)
|
||||||
|
|
||||||
|
const initialValues = {
|
||||||
|
url: productData?.external_url || '',
|
||||||
|
};
|
||||||
|
|
||||||
|
let defaultUrl = 'https://' + productData?.internal_url
|
||||||
|
let externalUrl = productData?.external_url
|
||||||
|
|
||||||
|
const handleExternalURLChanged = (e) => {
|
||||||
|
if(e.target.value == externalUrl){
|
||||||
|
setExternalURLChanged(true)
|
||||||
|
}else{
|
||||||
|
setExternalURLChanged(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// API to set url
|
// API to set url
|
||||||
const setURL = useMutation({
|
const setURL = useMutation({
|
||||||
@@ -21,13 +37,13 @@ const URLConfiguration = ({productData}) => {
|
|||||||
return setExternalURL(fields)
|
return setExternalURL(fields)
|
||||||
},
|
},
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
if(res.data.resultCode != '0'){
|
if (res.data.resultCode != '0') {
|
||||||
// throw({message: res?.data?.resultDescription})
|
// throw({message: res?.data?.resultDescription})
|
||||||
throw({message: 'Something went wrong!'})
|
throw({message: 'Something went wrong!'})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSettled: () => {
|
onSettled: () => {
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
setURL.reset()
|
setURL.reset()
|
||||||
}, 3000)
|
}, 3000)
|
||||||
}
|
}
|
||||||
@@ -50,17 +66,16 @@ const URLConfiguration = ({productData}) => {
|
|||||||
<div className="card card-statistics">
|
<div className="card card-statistics">
|
||||||
<div className="card-header">
|
<div className="card-header">
|
||||||
<div className="card-heading">
|
<div className="card-heading">
|
||||||
<h4 className="card-title">Default URL</h4>
|
<h4 className="card-title" style={{textTransform: 'none'}}>{defaultUrl}</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-body">
|
{/*<div className="card-body">*/}
|
||||||
<div className="form-group">
|
{/* <div className="form-group">*/}
|
||||||
{/*<label htmlFor="exampleInputEmail1">Email address</label>*/}
|
{/* /!*<label htmlFor="exampleInputEmail1">Email address</label>*!/*/}
|
||||||
<input type="email" className="form-control"
|
{/* <input type="email" className="form-control"*/}
|
||||||
aria-describedby="defaultUrlHelp" value={defaultUrl} readOnly={true} />
|
{/* aria-describedby="defaultUrlHelp" value={defaultUrl} readOnly={true} />*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
{/*<button type="submit" className="btn btn-primary">Submit</button>*/}
|
{/*</div>*/}
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Formik
|
<Formik
|
||||||
@@ -69,36 +84,54 @@ const URLConfiguration = ({productData}) => {
|
|||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
>
|
>
|
||||||
{(props) => {
|
{(props) => {
|
||||||
return (
|
return (
|
||||||
<Form className='w-full'>
|
<Form className='w-full'>
|
||||||
<div className="card card-statistics" style={{backgroundColor:'#7affd92b'}}>
|
<div className="card card-statistics" style={{backgroundColor: '#b6e5ef'}}>
|
||||||
<div className="card-header">
|
<div className="card-header">
|
||||||
<div className="card-heading">
|
<div className="card-heading">
|
||||||
<h4 className="card-title" style={{textTransform: 'none'}}>Set your own URL</h4>
|
<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={(e)=>{props.handleChange(e); handleExternalURLChanged(e)}} type="text"
|
||||||
|
className="form-control" id="url" aria-describedby="url"
|
||||||
|
placeholder="https://example.mysite.com"/>
|
||||||
|
</div>
|
||||||
|
<div style={{width: '100%', textAlign: 'right'}}>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={setURL.isPending || externalURLChanged}
|
||||||
|
className="btn btn-primary"
|
||||||
|
>
|
||||||
|
{setURL.isPending ? 'Loading...' : 'Submit'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{setURL.error &&
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-danger'>{setURL.error.message}</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
{setURL.isSuccess &&
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-success'>{'Completed successfully'}</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
<div style={{backgroundColor: '#94b8c0', borderRadius: '10px', padding: '10px'}}>
|
||||||
|
Final steps to configure your URL:<br/>
|
||||||
|
DNS:<br/>
|
||||||
|
DNS:<br/>
|
||||||
|
DNS:<br/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-body">
|
</Form>
|
||||||
<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" disabled={setURL.isPending} className="btn btn-primary">{setURL.isPending ? 'Loading...' : 'Submit'}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{setURL.error &&
|
|
||||||
<div className="col-12">
|
|
||||||
<p className='text-danger'>{setURL.error.message}</p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
{setURL.isSuccess &&
|
|
||||||
<div className="col-12">
|
|
||||||
<p className='text-success'>{'Completed successfully'}</p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</Form>
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
</Formik>
|
</Formik>
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ const postAuxEnd = (path, postData, media=false) => {
|
|||||||
return axios.post(`${basePath}${path}`, postData).then(res => {
|
return axios.post(`${basePath}${path}`, postData).then(res => {
|
||||||
return res
|
return res
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
// console.log('res', err.response.data)
|
// throw new Error(err.response.data.error_message);
|
||||||
throw new Error(err.response.data.error_message);
|
throw new Error(err);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +214,12 @@ export const getProductTemplateData = (reqData) => {
|
|||||||
return postAuxEnd(`/panel/account/products/templates`, postData, false)
|
return postAuxEnd(`/panel/account/products/templates`, postData, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getProductColorStyles = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/account/products/color-styles`, postData, false)
|
||||||
|
}
|
||||||
// FUNCTION TO ACTIVATE TEMPLATE
|
// FUNCTION TO ACTIVATE TEMPLATE
|
||||||
export const activateTemplate = (reqData) => {
|
export const activateTemplate = (reqData) => {
|
||||||
let postData = {
|
let postData = {
|
||||||
@@ -222,6 +228,14 @@ export const activateTemplate = (reqData) => {
|
|||||||
return postAuxEnd(`/panel/account/template/activate`, postData, false)
|
return postAuxEnd(`/panel/account/template/activate`, postData, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const activateColorStyle = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/account/colorstyle/activate`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// FUNCTION TO GET PRODUCT SUBSCRIPTIONS
|
// FUNCTION TO GET PRODUCT SUBSCRIPTIONS
|
||||||
export const completeProfile = (reqData) => {
|
export const completeProfile = (reqData) => {
|
||||||
let postData = {
|
let postData = {
|
||||||
|
|||||||
Reference in New Issue
Block a user