| @@ -41,7 +41,15 @@ import AdminLogo from 'components/AdminLogo'; | |||
| import MobileLogo from 'components/MobileLogo'; | |||
| import Profile from './HeaderContent/Profile'; | |||
| import "assets/style/navbarStyles.css"; | |||
| import { isUserLoggedIn, isGLDLoggedIn, isPrimaryLoggedIn, isCreditorLoggedIn } from "utils/Utils"; | |||
| import { | |||
| isUserLoggedIn, | |||
| isGLDLoggedIn, | |||
| isPrimaryLoggedIn, | |||
| isCreditorLoggedIn, | |||
| isINDLoggedIn, | |||
| // isORGLoggedIn, | |||
| getUserId | |||
| } from "utils/Utils"; | |||
| import { handleLogoutFunction } from 'auth/index'; | |||
| // assets | |||
| @@ -197,12 +205,39 @@ function Header(props) { | |||
| </ul> | |||
| </> | |||
| : | |||
| isINDLoggedIn()? | |||
| <> | |||
| <Link className="userSetting" > | |||
| <Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} onClick={(event) => console.log(event)}> | |||
| <FormattedMessage id="setting" /> | |||
| </Typography> | |||
| </Link> | |||
| <ul className='dropdown'> | |||
| <li> | |||
| <Link className="manageUser" to={'/indUser/'+getUserId()}> | |||
| <Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | |||
| <FormattedMessage id="companyOrUserRecord" /> | |||
| </Typography> | |||
| </Link> | |||
| </li> | |||
| </ul> | |||
| </> | |||
| : | |||
| <> | |||
| <Link className="userSetting" > | |||
| <Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} onClick={(event) => console.log(event)}> | |||
| <FormattedMessage id="setting" /> | |||
| </Typography> | |||
| </Link> | |||
| <ul className='dropdown'> | |||
| <li> | |||
| <Link className="manageUser" to={'/orgUser/'+getUserId()}> | |||
| <Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | |||
| <FormattedMessage id="companyOrUserRecord" /> | |||
| </Typography> | |||
| </Link> | |||
| </li> | |||
| </ul> | |||
| </> | |||
| } | |||
| </li> | |||
| @@ -158,13 +158,21 @@ const Index = () => { | |||
| */ | |||
| setResponeDataData(responseData) | |||
| const timeoutdatetime = responseData.fpsmerchanttimeoutdatetime | |||
| const convertedDateString = timeoutdatetime.replace("[UTC]", ""); | |||
| const searchString = "[UTC]"; | |||
| let convertedDateString = ""; | |||
| if ( timeoutdatetime.toString().includes(searchString) ){ | |||
| convertedDateString = timeoutdatetime.replace("[UTC]", ""); | |||
| } else { | |||
| convertedDateString = timeoutdatetime; | |||
| } | |||
| setFpsmerchanttimeoutdatetime(convertedDateString) | |||
| // const parsedUrl = new URL(responseData.fpsqrcodeurl); | |||
| // const fpsqrcodeurl = parsedUrl.pathname; | |||
| const openPASGUrl = pasgPath + '?pay_req_obj=' + encodeURIComponent(responseData.fpsqrcodeurl) + '&callback=' | |||
| const parsedUrl = new URL(responseData.fpsqrcodeurl); | |||
| const fpsqrcodeurl = paymentPath+parsedUrl.pathname; | |||
| const openPASGUrl = pasgPath + '?pay_req_obj=' + encodeURIComponent(fpsqrcodeurl) + '&callback=' | |||
| + encodeURIComponent("https://"+window.location.hostname+ '/paymentPage/fps/fpscallback?TRANSACTION_ID='+paymentData.transactionid+"&WEB_TOKEN="+paymentData.webtoken+"&PAYMENT_ID="+localStorage.getItem("paymentId")); | |||
| const openPASGUrlPrd = pasgPathPrd + '?pay_req_obj=' + encodeURIComponent(responseData.fpsqrcodeurl) + '&callback=' | |||
| const openPASGUrlPrd = pasgPathPrd + '?pay_req_obj=' + encodeURIComponent(fpsqrcodeurl) + '&callback=' | |||
| + encodeURIComponent("https://"+window.location.hostname+ '/paymentPage/fps/fpscallback?TRANSACTION_ID='+paymentData.transactionid+"&WEB_TOKEN="+paymentData.webtoken+"&PAYMENT_ID="+localStorage.getItem("paymentId")); | |||
| setFpsqrcodeurl(openPASGUrl) | |||
| setFpsqrcodeurlPrd(openPASGUrlPrd) | |||
| @@ -20,14 +20,6 @@ import { | |||
| Dialog, DialogTitle, DialogContent, DialogActions, | |||
| } from '@mui/material'; | |||
| // //icon | |||
| // import VisaIcon from "assets/images/icons/visacard.svg"; | |||
| // import MasterIcon from "assets/images/icons/mastercard.svg"; | |||
| // import JcbIcon from "assets/images/icons/jcb.svg"; | |||
| // import UnionPayIcon from "assets/images/icons/unionpay.svg"; | |||
| // import PpsIcon from "assets/images/icons/ppshk.svg"; | |||
| // import FpsIcon from "assets/images/icons/fps.svg"; | |||
| import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | |||
| import {ThemeProvider} from "@emotion/react"; | |||
| import {PNSPS_BUTTON_THEME} from "../../themes/buttonConst"; | |||
| @@ -77,8 +69,9 @@ const Index = () => { | |||
| useEffect(() => { | |||
| setAppIds(location.state?.appIdList ?? []) | |||
| setTotalAmount(location.state?.amount ?? 2000) | |||
| // getAvailablePayment() | |||
| // getTransactionId() | |||
| localStorage.removeItem("webtoken"); | |||
| localStorage.removeItem("transactionid"); | |||
| localStorage.removeItem("paymentId"); | |||
| }, []); | |||
| useEffect(() => { | |||
| @@ -0,0 +1,54 @@ | |||
| import { lazy } from 'react'; | |||
| // project import | |||
| import Loadable from 'components/Loadable'; | |||
| import { Navigate } from "react-router"; | |||
| const MainLayout = Loadable(lazy(() => import('layout/MainLayout'))); | |||
| // ==============================|| MAIN ROUTING ||============================== // | |||
| const AfterLoginRoutes = { | |||
| path: '/', | |||
| element: <MainLayout />, | |||
| children: [ | |||
| { | |||
| path: 'login', | |||
| element: <Navigate to="/dashboard" /> | |||
| }, | |||
| { | |||
| path: 'register', | |||
| element: <Navigate to="/dashboard" /> | |||
| }, | |||
| { | |||
| path: 'registerFrom', | |||
| element: <Navigate to="/dashboard" /> | |||
| }, | |||
| { | |||
| path: 'iamsmart/logincallback', | |||
| element: <Navigate to="/dashboard" /> | |||
| }, | |||
| { | |||
| path: 'iamsmart/loginfallback', | |||
| element: <Navigate to="/dashboard" /> | |||
| }, | |||
| { | |||
| path: 'iamsmart/registrycallback', | |||
| element: <Navigate to="/dashboard" /> | |||
| }, | |||
| { | |||
| path: 'iamsmart/loginFail', | |||
| element: <Navigate to="/dashboard" /> | |||
| }, | |||
| { | |||
| path: 'iamsmart/loginSucess', | |||
| element: <Navigate to="/dashboard" /> | |||
| }, | |||
| { | |||
| path: 'verify/:verifyCode/:email', | |||
| element: <Navigate to="/dashboard" /> | |||
| }, | |||
| ] | |||
| }; | |||
| export default AfterLoginRoutes; | |||
| @@ -23,6 +23,8 @@ const Payment_Callback = Loadable(lazy(() => import('pages/Payment/PaymentCallba | |||
| const PaymentSearch_Public = Loadable(lazy(() => import('pages/Payment/Search_Public'))); | |||
| const PaymentDetails_Public = Loadable(lazy(() => import('pages/Payment/Details_Public'))); | |||
| const DemandNote_Public = Loadable(lazy(() => import('pages/DemandNote/Search_Public'))); | |||
| const UserMaintainPage_Individual = Loadable(lazy(() => import('pages/User/DetailsPage_Individual'))); | |||
| const UserMaintainPage_Organization = Loadable(lazy(() => import('pages/User/DetailsPage_Organization'))); | |||
| // ==============================|| MAIN ROUTING ||============================== // | |||
| @@ -105,6 +107,14 @@ const PublicDashboard = { | |||
| path: 'paymentPage/demandNote', | |||
| element: <DemandNote_Public/> | |||
| }, | |||
| { | |||
| path: '/indUser/:id', | |||
| element: <UserMaintainPage_Individual /> | |||
| }, | |||
| { | |||
| path: '/orgUser/:id', | |||
| element: <UserMaintainPage_Organization /> | |||
| }, | |||
| ] | |||
| }, | |||
| ] | |||
| @@ -1,6 +1,6 @@ | |||
| // project import | |||
| import LoginRoutes from './LoginRoutes' | |||
| import MainRoutes from './MainRoutes' | |||
| // import MainRoutes from './MainRoutes' | |||
| import PublicUserRoutes from './PublicUserRoutes' | |||
| import GLDUserRoutes from './GLDUserRoutes' | |||
| import TestRoutes from './_TestRoutes' | |||
| @@ -17,9 +17,8 @@ import { | |||
| SetupAxiosInterceptors, | |||
| } from "auth/index"; | |||
| import SettingRoutes from './SettingRoutes'; | |||
| // import Loadable from 'components/Loadable'; | |||
| // import { lazy } from 'react'; | |||
| // const SettingRoutes = Loadable(lazy(() => import('./SettingRoutes'))); | |||
| import AfterLoginRoutes from './AfterLoginRoutes'; | |||
| // ==============================|| ROUTING RENDER ||============================== // | |||
| export default function ThemeRoutes() { | |||
| @@ -44,7 +43,12 @@ export default function ThemeRoutes() { | |||
| }) | |||
| ] | |||
| }, | |||
| isUserLoggedIn() ? MainRoutes : LoginRoutes, | |||
| // isUserLoggedIn() ? MainRoutes : LoginRoutes, | |||
| isUserLoggedIn() ? AfterLoginRoutes : | |||
| { | |||
| path: '/dashboard', | |||
| element: <Navigate to="/login" /> | |||
| }, | |||
| isUserLoggedIn() && isINDLoggedIn() || isUserLoggedIn() && isORGLoggedIn() ? PublicUserRoutes : LoginRoutes, | |||
| isUserLoggedIn() && isGLDLoggedIn() ? SettingRoutes : LoginRoutes, | |||
| isUserLoggedIn() && isGLDLoggedIn() ? GLDUserRoutes : LoginRoutes, | |||
| @@ -136,3 +136,9 @@ export const gazetteLength = (length,noOfPages) => { | |||
| } | |||
| return countLength+" cm" | |||
| } | |||
| export const getUserId = () =>{ | |||
| if (localStorage.getItem('userData') != null){ | |||
| return JSON.parse(localStorage.getItem('userData')).id | |||
| } | |||
| } | |||