Compare commits

...

6 Commits

Author SHA1 Message Date
victorAnumudu f3ebb0a925 updated profile layout 2025-08-13 11:08:30 +01:00
CHIEFSOFT\ameye 6421eb5b3e Page layout 2025-08-12 19:01:41 -04:00
ameye 971624a358 Merge branch 'profile-complete' of MERMS/MermsPanelReactJS into master 2025-08-12 21:07:37 +00:00
victorAnumudu 21463ed501 added page for profile complete 2025-08-12 19:51:13 +01:00
CHIEFSOFT\ameye f450d0e868 fic env for live 2025-08-12 05:23:01 -04:00
ameye c880cccb5a Merge branch 'subscription-endpoint' of MERMS/MermsPanelReactJS into master 2025-08-11 20:58:28 +00:00
15 changed files with 216 additions and 18 deletions
+8 -8
View File
@@ -1,15 +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"
REACT_APP_SOCKET_URL="https://socket.mermsemr.com"
REACT_APP_MAIN_API="https://api.mermsemr.com"
REACT_APP_MEDIA_SERVER="https://media.mermsemr.com"
REACT_APP_MAIN_SOCKET="https://dsocket.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'
REACT_APP_HOME_LINK='https://www.mermsemr.com/'
REACT_APP_ABOUT_LINK='https://www.mermsemr.com/about'
REACT_APP_CONTACTS_LINK='https://www.mermsemr.com/contacts'
REACT_APP_TERMS_LINK='https://www.mermsemr.com/terms'
# Inactivity timeout/logout AT 10MINS
REACT_APP_TIMEOUT=600000
+2
View File
@@ -22,6 +22,7 @@ import HelpPage from './views/HelpPage';
import SubscriptionPage from './views/SubscriptionPage';
import OnboardPage from "./views/OnboardPage";
import AccPWDResetPage from './views/AccPWDResetPage';
import ProfileCompletePage from './views/ProfileCompletePage';
function AppRouters() {
@@ -44,6 +45,7 @@ function AppRouters() {
<Route element={<SocketIOContextProvider />}>
<Route element={<UserExist />}>
<Route path={siteLinks.dash} element={<HomePage />} />
<Route path={siteLinks.profile_complete} element={<ProfileCompletePage />} />
<Route path={siteLinks.product} element={<ProductPage />} />
<Route path={siteLinks.reports} element={<ReportsPage />} />
<Route path={siteLinks.comments} element={<CommentsPage />} />
Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

+17 -1
View File
@@ -1,16 +1,31 @@
import React from 'react'
import { Outlet, useLocation } from 'react-router-dom';
import UserMenu from "./layoutcom/UserMenu";
import UserHeader from "./layoutcom/UserHeader";
import UserFooter from "./layoutcom/UserFooter";
import { Outlet } from 'react-router-dom';
import siteLinks from '../../links/siteLinks';
export default function Layout() {
const {pathname} = useLocation()
const isProfileComplete = pathname == siteLinks.profile_complete
return (
<div className="app">
{isProfileComplete ?
<div className="app-wrap">
<UserHeader />
<div className="container-fluid">
<Outlet />
</div>
<UserFooter isProfileComplete={isProfileComplete} />
</div>
:
<div className="app-wrap">
<UserHeader />
<div className="app-container">
<aside className="app-navbar">
<UserMenu />
</aside>
@@ -22,6 +37,7 @@ export default function Layout() {
</div>
<UserFooter />
</div>
}
</div>
)
}
@@ -1,11 +1,11 @@
import React from "react";
export default function UserFooter(){
export default function UserFooter({isProfileComplete=false}){
const year = new Date().getFullYear()
return <>
<footer className="footer">
<footer className={`${isProfileComplete && 'w-100'} footer`}>
<div className="row">
<div className="col-12 col-sm-6 text-center text-sm-left">
<p>&copy; Copyright {year}. All rights reserved.</p>
@@ -73,7 +73,7 @@ export default function UserHeader(){
<ul className="navbar-nav nav-right ml-auto">
<li className="nav-item user-profile">
<a onClick={toggleMenu} href="#" className="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdow">
<a onClick={toggleMenu} className="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdow">
<img src={getImage('profile-pic-circle.png')} alt="avtar-img" />
<span className="bg-success user-status"></span>
</a>
@@ -3,6 +3,7 @@ import { useMutation } from "@tanstack/react-query";
import { pageSettings } from "../../../services/services";
import SiteTemplateSelector from './SiteTemplateSelector';
import NoYesBooleanDropdown from './NoYesBooleanDropdown';
import { IoMdArrowDropdown } from 'react-icons/io';
const GeneralTab = memo(({name='Full Name', data, isCustom, productData, backendValues, setFieldsChanged}) =>{
@@ -83,11 +84,14 @@ const GeneralTab = memo(({name='Full Name', data, isCustom, productData, backend
<textarea name={fieldName} rows={5} style={{resize: 'none'}} type="text" className="form-control" id={key} value={fieldValue} onChange={handleChange} />
: value.controls == 'SELECT_NO_YES' ?
// <NoYesBooleanDropdown name={fieldName} value={fieldValue} onChange={handleChange} />
<select onChange={handleChange} name={fieldName} value={fieldValue} className="form-control">
<option value=''>Select</option>
<option value='0'>No</option>
<option value='1'>Yes</option>
</select>
<div className='position-relative'>
<select onChange={handleChange} name={fieldName} value={fieldValue} className="form-control">
<option value=''>Select</option>
<option value='0'>No</option>
<option value='1'>Yes</option>
</select>
<IoMdArrowDropdown className='position-absolute w-auto' style={{top: '50%', right: '2px', transform: 'translateY(-50%)'}} />
</div>
:
null
}
@@ -0,0 +1,146 @@
import React, { useEffect } from "react";
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
import { useLocation } from "react-router-dom";
import { Form, Formik } from "formik";
import * as Yup from "yup";
import { useMutation } from "@tanstack/react-query";
import getImage from "../../utils/getImage";
import { IoMdArrowDropdown } from "react-icons/io";
import { completeProfile } from '../../services/services';
const validationSchema = Yup.object().shape({
practice: Yup.string().required("Required"),
specialization: Yup.string().required("Required"),
information: Yup.string().min(1, "Minimum 10 characters").max(50, "Maximum 50 characters").required("Required"),
})
const initialValues = {
practice: '',
specialization: '',
information: '',
};
export default function ProfileCompleteCom(){
const {state:{profile_completed}} = useLocation()
const mutation = useMutation({
mutationFn: (fields) => {
return completeProfile(fields)
},
onSuccess: (res) => {
console.log('res', res)
}
})
const handleCompleteProfile = (values, helpers) => {
// helpers.resetForm()
let reqData = {
token: localStorage.getItem('token'), // USER TOKEN
uid: localStorage.getItem('uid'), // USER UID
// ...values
}
console.log('values', values, helpers)
// mutation.mutate(reqData)
}
return <>
<div style={{marginTop: '90px'}}>
<BreadcrumbComBS title='Update Profile' paths={['Dashboard', 'Profile']} />
</div>
<div className="row pt-1">
{/*<div className="col-xxl-6 m-b-30">*/}
{/* <div className="card card-statistics h-100 mb-0" style={{minHeight: '100px'}}>*/}
{/* /!* <div className="card-header d-flex align-items-center justify-content-between">*/}
{/* <div className="card-heading">*/}
{/* <h4 className="card-title">My Product URLs</h4>*/}
{/* </div>*/}
{/* </div> *!/*/}
{/* </div>*/}
{/*</div>*/}
<div className="col-md-6 m-b-30">
<div className="card card-statistics h-100 mb-0">
{/* <div className="card-header d-flex align-items-center justify-content-between">
<div className="card-heading">
<h4 className="card-title">My Product URLs</h4>
</div>
</div> */}
{/* <div style={{minHeight: '400px'}}></div> */}
<div className="card-body">
<Formik
initialValues={initialValues}
validationSchema={validationSchema}
onSubmit={handleCompleteProfile}
>
{(props) => {
return (
<Form className='h-100 row flex-column'>
{/* <div className="row"> */}
<>
<div className="">
<div className="form-group position-relative">
<label className={`text-black fw-bold control-label ${(props.errors.practice && props.touched.practice) && 'text-danger'}`}>Practice :</label>
<div className="position-relative">
<select onChange={props.handleChange} name='practice' value={props.values.practice} className="form-control">
<option value=''>Select</option>
<option value='engineering'>Engineering</option>
</select>
<IoMdArrowDropdown className='position-absolute w-auto' style={{top: '50%', right: '2px', transform: 'translateY(-50%)'}} />
</div>
</div>
</div>
<div className="">
<div className="form-group">
<label className={`text-black fw-bold control-label ${(props.errors.specialization && props.touched.specialization) && 'text-danger'}`}>Specialization :</label>
<div className="position-relative">
<select onChange={props.handleChange} name='specialization' value={props.values.specialization} className="form-control">
<option value=''>Select</option>
<option value='construction'>Construction</option>
</select>
<IoMdArrowDropdown className='position-absolute w-auto' style={{top: '50%', right: '2px', transform: 'translateY(-50%)'}} />
</div>
</div>
</div>
<div className="">
<div className="form-group position-relative">
<label className={`text-black fw-bold control-label ${(props.errors.information && props.touched.information) && 'text-danger'}`}>General Information :</label>
<textarea name='information' rows={10} style={{resize: 'none'}} className="form-control" value={props.values.information} onChange={props.handleChange} />
</div>
</div>
{/* {(mutation.isErrorrror || mutation.isSuccess) &&
<>
<div className="col-12">
<p className={`${mutation.isSuccess ? 'text-success' : 'text-danger'}`}>{mutation.isSuccess ? 'Completed successfully' : mutation.error.message}</p>
</div>
</>
} */}
<div className="mt-auto text-end">
<button type='submit' className="btn btn-primary text-uppercase">{false ? 'loading...' : 'Continue'}</button>
</div>
</>
{/* </div> */}
</Form>
);
}}
</Formik>
</div>
</div>
</div>
<div className="col-md-6 m-b-30">
<div class="text-center img-block left-column wow fadeInRight">
<img className="img-fluid" src={getImage('img-07.png')} alt="content-image" />
</div>
</div>
</div>
</>;
}
+1
View File
@@ -3,6 +3,7 @@ const siteLinks = {
help: '/help',
home: '/',
dash: '/dash',
profile_complete: '/profile-complete',
product: '/product/*',
contacts: '/contacts',
comments: '/comments',
+8
View File
@@ -167,6 +167,14 @@ export const getSettingsData = (reqData) => {
}
// FUNCTION TO GET PRODUCT SUBSCRIPTIONS
export const completeProfile = (reqData) => {
let postData = {
...reqData,
}
return postAuxEnd(`/panel/`, postData, false)
}
// FUNCTION TO COMPLETE PROFILE
export const getSubscriptions = (reqData) => {
let postData = {
...reqData,
+17 -1
View File
@@ -1,6 +1,22 @@
import React from 'react'
import React, { useEffect } from 'react'
import ProductFactory from '../component/product/ProductFactory'
import { useSelector } from 'react-redux';
import siteLinks from '../links/siteLinks';
import { useNavigate } from 'react-router-dom';
export default function ProductPage() {
const navigate = useNavigate()
const { userDetails: { profile_completed }} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
useEffect(()=>{
if(!profile_completed){
navigate(siteLinks.profile_complete, {replace: true, state:{profile_completed: false}})
}
},[])
return (
<ProductFactory />
)
+5
View File
@@ -0,0 +1,5 @@
import ProfileCompleteCom from '../component/profile_complete/ProfileCompleteCom';
export default function ProfileCompletePage(){
return <ProfileCompleteCom />
}