Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb4f9fbb42 | |||
| ad4a92ceed | |||
| d71fe9cc01 | |||
| aeb9f0512c | |||
| 62c3a8be82 | |||
| c7c1da919d | |||
| 669a249499 | |||
| 2cc57f0b0a | |||
| 54be47e1c8 |
@@ -1,15 +1,16 @@
|
|||||||
SKIP_PREFLIGHT_CHECK=true
|
SKIP_PREFLIGHT_CHECK=true
|
||||||
REACT_APP_NODE_ENV="development"
|
REACT_APP_NODE_ENV="development"
|
||||||
REACT_APP_SOCKET_URL="https://socket.mermsemr.com"
|
NODE_ENV="development"
|
||||||
REACT_APP_MAIN_API="https://api.mermsemr.com"
|
REACT_APP_SOCKET_URL="https://devsocket.mermsemr.com"
|
||||||
REACT_APP_MEDIA_SERVER="https://media.mermsemr.com"
|
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
||||||
REACT_APP_MAIN_SOCKET="https://dsocket.mermsemr.com"
|
REACT_APP_MEDIA_SERVER="https://qa-media.mermsemr.com"
|
||||||
|
REACT_APP_MAIN_SOCKET="https://devsocket.mermsemr.com"
|
||||||
|
|
||||||
# login footer links
|
# login footer links
|
||||||
REACT_APP_HOME_LINK='https://www.mermsemr.com/'
|
REACT_APP_HOME_LINK='https://qa-www.mermsemr.com/'
|
||||||
REACT_APP_ABOUT_LINK='https://www.mermsemr.com/about'
|
REACT_APP_ABOUT_LINK='https://qa-www.mermsemr.com/about'
|
||||||
REACT_APP_CONTACTS_LINK='https://www.mermsemr.com/contacts'
|
REACT_APP_CONTACTS_LINK='https://qa-www.mermsemr.com/contacts'
|
||||||
REACT_APP_TERMS_LINK='https://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
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
SKIP_PREFLIGHT_CHECK=true
|
SKIP_PREFLIGHT_CHECK=true
|
||||||
REACT_APP_NODE_ENV="production"
|
REACT_APP_NODE_ENV="production"
|
||||||
|
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://api.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"
|
REACT_APP_MAIN_SOCKET="https://socket.mermsemr.com"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
SKIP_PREFLIGHT_CHECK=true
|
SKIP_PREFLIGHT_CHECK=true
|
||||||
REACT_APP_NODE_ENV="development"
|
REACT_APP_NODE_ENV="development"
|
||||||
|
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://qa-media.mermsemr.com"
|
REACT_APP_MEDIA_SERVER="https://qa-media.mermsemr.com"
|
||||||
|
|||||||
+1
-2
@@ -33,8 +33,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start -e .env.development",
|
"start": "react-scripts start -e .env.development",
|
||||||
"build": "react-scripts start -e .env.development",
|
"build": "GENERATE_SOURCEMAP=false react-scripts build -e .env.production",
|
||||||
"build_real": "GENERATE_SOURCEMAP=false react-scripts build -e .env.production",
|
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,12 +4,17 @@ set -x
|
|||||||
|
|
||||||
export NODE_ENV="${NODE_ENV:-development}"
|
export NODE_ENV="${NODE_ENV:-development}"
|
||||||
|
|
||||||
if [ $NODE_ENV == "development" ]; then
|
if [ $NODE_ENV = "development" ]; then
|
||||||
# this runs webpack-dev-server with hot reloading
|
# this runs webpack-dev-server with hot reloading
|
||||||
echo "Development build"
|
echo "Development build"
|
||||||
npm install --legacy-peer-deps
|
npm install --legacy-peer-deps
|
||||||
npm start
|
npm start
|
||||||
# npm run build
|
# npm run build
|
||||||
|
elif [ $NODE_ENV = "qa" -o $NODE_ENV = "test" ]; then
|
||||||
|
echo "QA build"
|
||||||
|
export NODE_ENV="test"
|
||||||
|
npm install --legacy-peer-deps
|
||||||
|
npm start
|
||||||
else
|
else
|
||||||
# build the app and serve it via nginx
|
# build the app and serve it via nginx
|
||||||
echo "Production build"
|
echo "Production build"
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ import getImage from "../../utils/getImage";
|
|||||||
import { IoMdArrowDropdown } from "react-icons/io";
|
import { IoMdArrowDropdown } from "react-icons/io";
|
||||||
import { completeProfile, getCommonPractice } from '../../services/services';
|
import { completeProfile, getCommonPractice } from '../../services/services';
|
||||||
import siteLinks from "../../links/siteLinks";
|
import siteLinks from "../../links/siteLinks";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
|
import { updateUserDetails } from "../../store/UserDetails";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
|
||||||
|
|
||||||
// const validationSchema = Yup.object().shape({
|
// const validationSchema = Yup.object().shape({
|
||||||
@@ -26,8 +28,12 @@ import { useNavigate } from "react-router-dom";
|
|||||||
|
|
||||||
export default function ProfileCompleteCom(){
|
export default function ProfileCompleteCom(){
|
||||||
|
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
const {state:{redirectLink}} = useLocation()
|
||||||
|
|
||||||
const [practices, setPractices] = useState([])
|
const [practices, setPractices] = useState([])
|
||||||
|
|
||||||
const [initialValues, setInitialValues] = useState({
|
const [initialValues, setInitialValues] = useState({
|
||||||
@@ -61,8 +67,9 @@ export default function ProfileCompleteCom(){
|
|||||||
if(res.data.resultCode != '0'){
|
if(res.data.resultCode != '0'){
|
||||||
throw({message: res?.data?.resultDescription})
|
throw({message: res?.data?.resultDescription})
|
||||||
}
|
}
|
||||||
|
dispatch(updateUserDetails({profile_completed: res?.data?.profile_completed }));
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
navigate(siteLinks.home)
|
navigate(redirectLink)
|
||||||
},2000)
|
},2000)
|
||||||
// console.log('res', res)
|
// console.log('res', res)
|
||||||
}
|
}
|
||||||
@@ -107,7 +114,7 @@ export default function ProfileCompleteCom(){
|
|||||||
|
|
||||||
return <>
|
return <>
|
||||||
|
|
||||||
<BreadcrumbComBS title='Update Profile' paths={['Dashboard', 'Profile']} />
|
<BreadcrumbComBS title='Tell us more about your practice.' paths={['Dashboard', 'Profile']} />
|
||||||
|
|
||||||
{commonPractices?.isFetching ?
|
{commonPractices?.isFetching ?
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export default function SubcribePaymentOptions(){
|
||||||
|
|
||||||
|
return <>
|
||||||
|
|
||||||
|
|
||||||
|
<div className="card-header">
|
||||||
|
<div className="card-heading">
|
||||||
|
<h4 className="card-title">Select Payment Option</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="card-body">
|
||||||
|
|
||||||
|
<div className="form-check form-check-inline">
|
||||||
|
<input className="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1"
|
||||||
|
value="option1" />
|
||||||
|
<label className="form-check-label" htmlFor="inlineRadio1">Previous Cards</label>
|
||||||
|
</div>
|
||||||
|
<div className="form-check form-check-inline">
|
||||||
|
<input className="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2"
|
||||||
|
value="option2" />
|
||||||
|
<label className="form-check-label" htmlFor="inlineRadio2">Add New card</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/*<div className="card card-statistics"> </div>*/}
|
||||||
|
|
||||||
|
</>
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,86 +5,60 @@ import { getSubscriptions } from '../../services/services';
|
|||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import queryKeys from '../../services/queryKeys';
|
import queryKeys from '../../services/queryKeys';
|
||||||
import siteLinks from "../../links/siteLinks";
|
import siteLinks from "../../links/siteLinks";
|
||||||
import { Link, useNavigate } from 'react-router-dom'
|
import { Link, useLocation } from 'react-router-dom'
|
||||||
|
import SubscribeNewCard from "./SubscribeNewCard";
|
||||||
|
import SubscribePreviousCard from "./SubscribePreviousCard";
|
||||||
|
import SubcribePaymentOptions from "./SubcribePaymentOptions";
|
||||||
|
|
||||||
export default function Subscribe() {
|
export default function Subscribe() {
|
||||||
const navigate = useNavigate()
|
|
||||||
const pricingFields ={
|
|
||||||
starter: { name: 'Starter', price: 5.99, active: true },
|
|
||||||
basic: { name: 'Basic', price: 12.99, active: true },
|
|
||||||
premium: { name: 'Premium', price: 20.00, active: true },
|
|
||||||
}
|
|
||||||
|
|
||||||
const {data, isFetching, isError, error} = useQuery({
|
const {state:{selectedSubscription}} = useLocation()
|
||||||
queryKey: queryKeys.subscriptions,
|
|
||||||
queryFn: () => {
|
|
||||||
let reqData = {
|
|
||||||
token: localStorage.getItem('token'), // USER TOKEN
|
|
||||||
uid: localStorage.getItem('uid') // USER UID
|
|
||||||
}
|
|
||||||
return getSubscriptions(reqData)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const currentSubscription = data?.data?.current_product
|
// console.log('selectedSubscription', selectedSubscription)
|
||||||
const otherSubscriptions = data?.data?.options
|
|
||||||
console.log('urlData', data?.data)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<BreadcrumbComBS title='Subscription' paths={['Dashboard', 'Subscription']} />
|
<BreadcrumbComBS title='Activate or Update your Subscription' paths={['Dashboard', 'subscribe']} />
|
||||||
|
|
||||||
|
<div className="row">
|
||||||
|
<div className="col-12 col-lg-6 col-xl-6">
|
||||||
|
<div className="card card-statistics text-center py-3">
|
||||||
|
<div className="card-body pricing-content">
|
||||||
|
<div className="pricing-content-card">
|
||||||
|
<h5>Current Subscription(s)</h5>
|
||||||
|
{/*<h2 className="text-primary pt-3">{currentSubscription?.display_name}</h2>*/}
|
||||||
|
<SubcribePaymentOptions />
|
||||||
|
|
||||||
|
<SubscribeNewCard />
|
||||||
|
<SubscribePreviousCard />
|
||||||
|
|
||||||
{isFetching ?
|
|
||||||
<>
|
|
||||||
<div className="col-12">
|
|
||||||
<p className='text-mute'>Loading...</p>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
: isError ?
|
|
||||||
<div className="col-12">
|
|
||||||
<p className='text-danger'>{error.message}</p>
|
|
||||||
</div>
|
|
||||||
:
|
|
||||||
<div className="row">
|
|
||||||
<div className="col-12 col-lg-6 col-xl-3">
|
|
||||||
<div className="card card-statistics text-center py-3">
|
|
||||||
<div className="card-body pricing-content">
|
|
||||||
<div className="pricing-content-card">
|
|
||||||
<h5>Current Subscription(s)</h5>
|
|
||||||
<h2 className="text-primary pt-3">{currentSubscription?.display_name}</h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<>
|
|
||||||
{Object.entries(otherSubscriptions)?.map(([key, value]) => (
|
|
||||||
|
|
||||||
<div key={key} className="col-12 col-lg-6 col-xl-3">
|
|
||||||
<div className="card card-statistics text-center py-3">
|
|
||||||
<div className="card-body pricing-content">
|
|
||||||
<div className="pricing-content-card">
|
|
||||||
<h5>{value.display_name}</h5>
|
|
||||||
<h2 className="text-primary pt-3">${value.monthly}</h2>
|
|
||||||
<p className="text-primary pb-3">/ Monthly</p>
|
|
||||||
<ul className="py-2">
|
|
||||||
{value?.items?.map(item =>(
|
|
||||||
<li key={item}>{item}</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
<div className="pt-2">
|
|
||||||
<button onClick={()=>{navigate(siteLinks.subscribe)}} className="btn btn-inverse-secondary btn-round btn-sm">Go {value.display_name}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
|
|
||||||
|
<>
|
||||||
|
<div key="basic" className="col-12 col-lg-6 col-xl-6">
|
||||||
|
<div className="card card-statistics text-center py-3">
|
||||||
|
<div className="card-body pricing-content">
|
||||||
|
<div className="pricing-content-card">
|
||||||
|
<h5>{selectedSubscription.display_name}</h5>
|
||||||
|
<h2 className="text-primary pt-3">${selectedSubscription.monthly}</h2>
|
||||||
|
<p className="text-primary pb-3">/ Monthly</p>
|
||||||
|
<ul className="py-2">
|
||||||
|
{selectedSubscription?.items?.map(item =>(
|
||||||
|
<li key={item}>{item}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
{/*<div className="pt-2">*/}
|
||||||
|
{/* <button className="btn btn-inverse-secondary btn-round btn-sm">Go {subscriptionSelection.display_name}</button>*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import React from 'react'
|
||||||
|
export default function SubscribeNewCard(){
|
||||||
|
|
||||||
|
return <>Previous Card</>
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import React from 'react'
|
||||||
|
export default function SubscribePreviousCard(){
|
||||||
|
|
||||||
|
return <>Previous Card</>
|
||||||
|
|
||||||
|
}
|
||||||
@@ -28,7 +28,7 @@ export default function Subscription() {
|
|||||||
|
|
||||||
const currentSubscription = data?.data?.current_product
|
const currentSubscription = data?.data?.current_product
|
||||||
const otherSubscriptions = data?.data?.options
|
const otherSubscriptions = data?.data?.options
|
||||||
console.log('urlData', data?.data)
|
// console.log('urlData', data?.data)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -73,7 +73,7 @@ export default function Subscription() {
|
|||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
<div className="pt-2">
|
<div className="pt-2">
|
||||||
<button onClick={()=>{navigate(siteLinks.subscribe)}} className="btn btn-inverse-secondary btn-round btn-sm">Go {value.display_name}</button>
|
<button onClick={()=>{navigate(siteLinks.subscribe, {state:{selectedSubscription: value}})}} className="btn btn-inverse-secondary btn-round btn-sm">Go {value.display_name}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,18 +2,19 @@ import React, { useEffect } from 'react'
|
|||||||
import ProductFactory from '../component/product/ProductFactory'
|
import ProductFactory from '../component/product/ProductFactory'
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import siteLinks from '../links/siteLinks';
|
import siteLinks from '../links/siteLinks';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useLocation, useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
|
|
||||||
export default function ProductPage() {
|
export default function ProductPage() {
|
||||||
|
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
let {pathname} = useLocation()
|
||||||
|
|
||||||
const { userDetails: { profile_completed }} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
const { userDetails: { profile_completed }} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(!profile_completed){
|
if(!profile_completed){
|
||||||
navigate(siteLinks.profile_complete, {replace: true, state:{profile_completed: false}})
|
navigate(siteLinks.profile_complete, {replace: true, state:{redirectLink: pathname}})
|
||||||
}
|
}
|
||||||
},[])
|
},[])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user