Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c686acf1e8 | |||
| 5d8d5aa2be | |||
| 5c8f96d92a | |||
| ae0500a799 | |||
| fc38378210 | |||
| 044b880726 | |||
| 28b3d85b24 | |||
| f440c5a9b9 | |||
| 4481e6b826 | |||
| b46d96d1b8 | |||
| f712c80c67 | |||
| 97189d08f6 | |||
| b090dbb056 | |||
| 455b6677fa | |||
| 447f15f7d9 | |||
| 04b7c5c4ff | |||
| 6c98292fce | |||
| cc5c215eb9 | |||
| f7430cc231 | |||
| 7d39c0fc23 | |||
| 43e8b9601a | |||
| a2c7ecd1f5 | |||
| 0113f047dd |
@@ -7,6 +7,7 @@ INSTAGRAM_URL=https://www.instagram.com
|
||||
|
||||
# BACKEND END POINTS
|
||||
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
||||
# REACT_APP_MAIN_API="http://localhost:14700"
|
||||
|
||||
# ENQUIRIES CONTACTS
|
||||
VITE_CALL_ENDPOINT='09099000000'
|
||||
|
||||
@@ -7,6 +7,7 @@ VITE_INSTAGRAM_URL=https://www.instagram.com
|
||||
|
||||
# BACKEND END POINTS
|
||||
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
||||
# REACT_APP_MAIN_API="http://localhost:14700"
|
||||
|
||||
# ENQUIRIES CONTACTS
|
||||
VITE_CALL_ENDPOINT='09099000000'
|
||||
|
||||
@@ -7,6 +7,7 @@ INSTAGRAM_URL=https://www.instagram.com
|
||||
|
||||
# BACKEND END POINTS
|
||||
REACT_APP_MAIN_API="https://api.mermsemr.com"
|
||||
#REACT_APP_MAIN_API="http://localhost:14700"
|
||||
|
||||
# ENQUIRIES CONTACTS
|
||||
VITE_CALL_ENDPOINT='09099000000'
|
||||
|
||||
+2
-2
@@ -27,9 +27,9 @@ COPY . .
|
||||
|
||||
#RUN npm run build
|
||||
|
||||
|
||||
RUN npm run start
|
||||
# CMD [ "npm", "run", "preview" ]
|
||||
##CMD [ "npm", "run", "start" ,"--", "--host"]
|
||||
|
||||
CMD /bin/sh ./run.sh
|
||||
#CMD /bin/sh ./run.sh
|
||||
|
||||
|
||||
@@ -24,5 +24,14 @@ else
|
||||
# npm run start
|
||||
nginx -g 'daemon off;' -c /usr/src/app/nginx.conf
|
||||
nginx -c /usr/src/app/nginx.conf
|
||||
|
||||
# build the app and serve it via nginx
|
||||
echo "Production build"
|
||||
npm install --legacy-peer-deps
|
||||
npm run build
|
||||
# Testing sometimes
|
||||
# npm run start
|
||||
nginx -g 'daemon off;' -c /usr/src/app/nginx.conf
|
||||
nginx -c /usr/src/app/nginx.conf
|
||||
fi
|
||||
|
||||
|
||||
@@ -3,9 +3,11 @@ const RouteLinks = {
|
||||
homePage: '/',
|
||||
customerPage: '/customer',
|
||||
accountDetails: '/account-view/*',
|
||||
accountEdit:'/account-edit/*',
|
||||
subscriptionDetails: '/subscription-view/*',
|
||||
subscriptions: '/subscriptions',
|
||||
billings: '/billings',
|
||||
files_uploads: '/files-uploads',
|
||||
recentSignup: '/recent-signup',
|
||||
loansPage: '/loans',
|
||||
transactionsPage: '/transactions',
|
||||
|
||||
+8
-4
@@ -22,8 +22,9 @@ import ProductTemplatePage from "./pages/ProductTemplatePage";
|
||||
import CustomTemplatePage from "./pages/CustomTemplatePage";
|
||||
import SubscriptionDetailsPage from "./pages/SubscriptionDetailsPage";
|
||||
import CountrySettingsPage from "./pages/CountrySettingsPage";
|
||||
import ProductViewPage from "./pages/ProductViewPage"; // TRANSACTION DETAILS PAGE
|
||||
|
||||
import ProductViewPage from "./pages/ProductViewPage";
|
||||
import FilesUploadPage from "./pages/FilesUploadPage"; // TRANSACTION DETAILS PAGE
|
||||
import AccountEditpage from "./pages/AccountEditPage";
|
||||
|
||||
// const Home = lazy(() => import('./pages/Home'));
|
||||
|
||||
@@ -38,18 +39,21 @@ export default function SiteRoutes() {
|
||||
<Route path={RouteLinks.subscriptions} element={<SubscriptionsPage/>}/> {`*/SUBSCRIPTIONS PAGE*/`}
|
||||
<Route path={RouteLinks.customerPage} element={<CustomerPage/>}/> {`*/CUSTOMER PAGE*/`}
|
||||
<Route path={RouteLinks.accountDetails} element={<AccountDetailsPage/>}/> {`*/CUSTOMER PAGE*/`}
|
||||
<Route path={RouteLinks.accountEdit} element={<AccountEditpage/>}/> {`*/CUSTOMER EDIT PAGE*/`}
|
||||
|
||||
<Route path={RouteLinks.billings} element={<BillingsPage/>}/> {`*/BILLINGS PAGE*/`}
|
||||
<Route path={RouteLinks.products} element={<ProductsPage/>}/> {`*/PRODUCTS PAGE*/`}
|
||||
<Route path={RouteLinks.productView} element={<ProductViewPage/>}/> {`*/PRODUCTS VIEW PAGE*/`}
|
||||
<Route path={RouteLinks.usersAdmin} element={<UsersAdminPage/>}/> {`*/ADMIN USERS PAGE*/`}
|
||||
|
||||
<Route path={RouteLinks.files_uploads} element={<FilesUploadPage/>}/> {`*/FILES PAGE*/`}
|
||||
|
||||
<Route path={RouteLinks.countrySettings} element={<CountrySettingsPage/>}/> {`*/PRODUCTS TEMPLATE PAGE*/`}
|
||||
<Route path={RouteLinks.productTemplates} element={<ProductTemplatePage/>}/> {`*/PRODUCTS TEMPLATE PAGE*/`}
|
||||
<Route path={RouteLinks.customTemplates} element={<CustomTemplatePage/>}/> {`*/CUSTOM TEMPLATES PAGE*/`}
|
||||
|
||||
<Route path={RouteLinks.loansPage} element={<LoansPage/>}/> {`*/LOANS PAGE*/`}
|
||||
<Route path={RouteLinks.transaction_details_page}
|
||||
element={<TransactionDetailsPage/>}/> {`*/TRANSACTION PAGE*/`}
|
||||
<Route path={RouteLinks.transaction_details_page} element={<TransactionDetailsPage/>}/> {`*/TRANSACTION PAGE*/`}
|
||||
<Route path={RouteLinks.subscriptionDetails} element={<SubscriptionDetailsPage/>} />
|
||||
</Route>
|
||||
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
|
||||
import {Link} from 'react-router-dom'
|
||||
import Icons from "../Icons";
|
||||
|
||||
export default function AccountBannerCom({accountInfo}) {
|
||||
return <>
|
||||
<div className="pb-5">
|
||||
<div className="flex flex-col gap-1">
|
||||
<div className="w-full">
|
||||
<h4 className="font-semibold text-lg">Account Info</h4>
|
||||
</div>
|
||||
<div className="w-full overflow-x-auto">
|
||||
<>
|
||||
<table className="py-2 w-full text-sm bg-[aliceblue] dark:bg-transparent rounded-[10px]">
|
||||
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||
<tr>
|
||||
|
||||
<th scope="col" className="px-2 py-2">
|
||||
Firstname
|
||||
</th>
|
||||
<th scope="col" className="px-2">
|
||||
Lastname
|
||||
</th>
|
||||
<th scope="col" className="px-2">
|
||||
Username
|
||||
</th>
|
||||
<th scope="col" className="px-2">
|
||||
Email
|
||||
</th>
|
||||
<th scope="col" className="px-2">
|
||||
Country
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Action
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{(accountInfo && Object.keys(accountInfo).length > 0) ?
|
||||
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||
{/*<td className="px-2 py-2">*/}
|
||||
{/* <div className="text-left">*/}
|
||||
{/* <div className="text-base font-semibold">{1}</div>*/}
|
||||
{/* </div>*/}
|
||||
{/*</td>*/}
|
||||
<td className="px-2">
|
||||
<div className="text-left">
|
||||
<div className="text-base font-semibold">{accountInfo?.firstname}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-left">
|
||||
<div className="text-base font-semibold">{accountInfo?.lastname}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-left">
|
||||
<div className="text-base font-semibold">{accountInfo?.username}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-left">
|
||||
<div className="text-base font-semibold">{accountInfo?.email}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-left">
|
||||
<div className="text-base font-semibold">{accountInfo?.country}</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
:
|
||||
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||
<td className="px-3 py-2" colSpan={6}>
|
||||
<div className="flex justify-center items-center">
|
||||
No Record Found
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
import { useEffect } from "react";
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
|
||||
import BreadcrumbCom from "../breadcrumb/BreadcrumbCom";
|
||||
import RouteLinks from "../../RouteLinks";
|
||||
import { getAccountView } from "../../services/siteServices";
|
||||
import queryKeys from "../../services/queryKeys";
|
||||
import AccountBannerCom from "./AccountBannerCom";
|
||||
|
||||
|
||||
export default function AccountEditCom() {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const { state } = useLocation();
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
if (!state?.memberUID) {
|
||||
navigate(RouteLinks.homePage, { replace: true });
|
||||
}
|
||||
}, [navigate, state?.memberUID]);
|
||||
|
||||
const { data, isFetching, isError, error } = useQuery({
|
||||
queryKey: queryKeys.account_view,
|
||||
queryFn: () => {
|
||||
// const filterData = filter?.type ? {[filter?.type]: filter.id} : {}
|
||||
const reqData = {
|
||||
member_uid: state?.memberUID,
|
||||
// page,
|
||||
// ...filterData
|
||||
};
|
||||
return getAccountView(reqData);
|
||||
},
|
||||
staleTime: 0, //0 mins
|
||||
});
|
||||
const accountsViewData = data?.data; // ACCOUNT EDIT DATA
|
||||
const account_info = accountsViewData?.account;
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
queryClient.refetchQueries({
|
||||
queryKey: [...queryKeys.account_view],
|
||||
// type: 'active',
|
||||
// exact: true,
|
||||
});
|
||||
}, [queryClient, state?.memberUID]);
|
||||
|
||||
return (
|
||||
<div className="w-full flex flex-col gap-8">
|
||||
<BreadcrumbCom
|
||||
title={`Account Edit [${state?.memberUID}]`}
|
||||
paths={["Dashboard", "Account Edit"]}
|
||||
/>
|
||||
|
||||
<div className="box bg-white dark:bg-black-box text-black-body dark:text-white-body">
|
||||
{isFetching ? (
|
||||
<>
|
||||
<p className="text-slate-800">Loading...</p>
|
||||
</>
|
||||
) : isError ? (
|
||||
<p className="text-red-500">{error.message}</p>
|
||||
) : (
|
||||
<>
|
||||
<AccountBannerCom accountInfo={account_info} />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,70 +1,79 @@
|
||||
import {useEffect, useState} from 'react'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { useEffect } from "react";
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
import {useLocation, useNavigate, Link} from 'react-router-dom'
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
|
||||
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
||||
import RouteLinks from '../../RouteLinks'
|
||||
import { getAccountView } from '../../services/siteServices'
|
||||
import queryKeys from '../../services/queryKeys'
|
||||
import BreadcrumbCom from "../breadcrumb/BreadcrumbCom";
|
||||
import RouteLinks from "../../RouteLinks";
|
||||
import { getAccountView } from "../../services/siteServices";
|
||||
import queryKeys from "../../services/queryKeys";
|
||||
import CustomerAccountView from "./CustomerAccountView";
|
||||
import AccountProfileView from "./AccountProfileView";
|
||||
import CustomerSubscriptionsView from "./CustomerSubscriptionsView";
|
||||
import CustomerPaymentsView from "./CustomerPaymentsView";
|
||||
|
||||
export default function AccountViewCom() {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const {state} = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const { state } = useLocation();
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(()=>{
|
||||
if(!state?.memberUID){
|
||||
navigate(RouteLinks.homePage, {replace: true})
|
||||
}
|
||||
},[])
|
||||
useEffect(() => {
|
||||
if (!state?.memberUID) {
|
||||
navigate(RouteLinks.homePage, { replace: true });
|
||||
}
|
||||
}, [navigate, state?.memberUID]);
|
||||
|
||||
const {data, isFetching, isError, error} = useQuery({
|
||||
queryKey: queryKeys.account_view,
|
||||
queryFn: () => {
|
||||
// const filterData = filter?.type ? {[filter?.type]: filter.id} : {}
|
||||
const reqData = {
|
||||
member_uid: state?.memberUID
|
||||
// page,
|
||||
// ...filterData
|
||||
}
|
||||
return getAccountView(reqData)
|
||||
},
|
||||
staleTime: 0 //0 mins
|
||||
})
|
||||
const accountsViewData = data?.data // ACCOUNT VIEW DATA
|
||||
const account_info = accountsViewData?.account
|
||||
const account_profile = accountsViewData?.account_profile
|
||||
const subscriptions = accountsViewData?.subscriptions
|
||||
const payments = accountsViewData?.payments
|
||||
// console.log('DATA', payments, subscriptions)
|
||||
const { data, isFetching, isError, error } = useQuery({
|
||||
queryKey: queryKeys.account_view,
|
||||
queryFn: () => {
|
||||
// const filterData = filter?.type ? {[filter?.type]: filter.id} : {}
|
||||
const reqData = {
|
||||
member_uid: state?.memberUID,
|
||||
// page,
|
||||
// ...filterData
|
||||
};
|
||||
return getAccountView(reqData);
|
||||
},
|
||||
staleTime: 0, //0 mins
|
||||
});
|
||||
const accountsViewData = data?.data; // ACCOUNT VIEW DATA
|
||||
const account_info = accountsViewData?.account;
|
||||
const account_profile = accountsViewData?.account_profile;
|
||||
const subscriptions = accountsViewData?.subscriptions;
|
||||
const payments = accountsViewData?.payments;
|
||||
|
||||
return (
|
||||
<div className='w-full flex flex-col gap-8'>
|
||||
<BreadcrumbCom title={`Account View [${state?.memberUID}]`} paths={['Dashboard', 'Account View']}/>
|
||||
useEffect(() => {
|
||||
queryClient.refetchQueries({
|
||||
queryKey: [...queryKeys.account_view],
|
||||
// type: 'active',
|
||||
// exact: true,
|
||||
});
|
||||
}, [queryClient, state?.memberUID]);
|
||||
|
||||
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||
{isFetching ?
|
||||
<>
|
||||
<p className='text-slate-800'>Loading...</p>
|
||||
</>
|
||||
: isError ?
|
||||
<p className='text-red-500'>{error.message}</p>
|
||||
:
|
||||
<>
|
||||
<CustomerAccountView accountInfo={account_info} />
|
||||
<AccountProfileView profile={account_profile} />
|
||||
<CustomerSubscriptionsView subscriptions={subscriptions} />
|
||||
<CustomerPaymentsView payments={payments} />
|
||||
</>
|
||||
return (
|
||||
<div className="w-full flex flex-col gap-8">
|
||||
<BreadcrumbCom
|
||||
title={`Account View [${state?.memberUID}]`}
|
||||
paths={["Dashboard", "Account View"]}
|
||||
/>
|
||||
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<div className="box bg-white dark:bg-black-box text-black-body dark:text-white-body">
|
||||
{isFetching ? (
|
||||
<>
|
||||
<p className="text-slate-800">Loading...</p>
|
||||
</>
|
||||
) : isError ? (
|
||||
<p className="text-red-500">{error.message}</p>
|
||||
) : (
|
||||
<>
|
||||
<CustomerAccountView accountInfo={account_info} />
|
||||
<AccountProfileView profile={account_profile} />
|
||||
<CustomerSubscriptionsView subscriptions={subscriptions} />
|
||||
<CustomerPaymentsView payments={payments} />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {Link} from 'react-router-dom'
|
||||
import Icons from "../Icons";
|
||||
import RouteLinks from '../../RouteLinks';
|
||||
|
||||
export default function CustomerAccountView({accountInfo}) {
|
||||
return <>
|
||||
@@ -26,7 +27,9 @@ export default function CustomerAccountView({accountInfo}) {
|
||||
<th scope="col" className="px-2">
|
||||
Email
|
||||
</th>
|
||||
|
||||
<th scope="col" className="px-2">
|
||||
Country
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Action
|
||||
</th>
|
||||
@@ -60,13 +63,21 @@ export default function CustomerAccountView({accountInfo}) {
|
||||
<div className="text-base font-semibold">{accountInfo?.email}</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td className="px-2">
|
||||
<div className="text-left">
|
||||
<div className="text-base font-semibold">{accountInfo?.country}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2 text-right">
|
||||
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
||||
<div
|
||||
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
||||
<Link
|
||||
// to={`/subscription-view/63554d40-9ba1-4afe-80c2-ca147236f7ee`}
|
||||
to={`/account-edit/${accountInfo?.uid}`}
|
||||
state={{
|
||||
customerID: accountInfo?.id,
|
||||
memberUID: accountInfo?.uid,
|
||||
}}
|
||||
>
|
||||
<Icons name='eye'/>
|
||||
</Link>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import getDateTimeFromDateString from "../../helpers/getDateTimeFromDateString";
|
||||
import RouteLinks from "../../RouteLinks";
|
||||
import Icons from "../Icons";
|
||||
import {Link} from 'react-router-dom'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, {useState} from 'react'
|
||||
import {useState} from 'react'
|
||||
import {useDispatch} from 'react-redux'
|
||||
import {useNavigate, Link} from 'react-router-dom'
|
||||
import {useNavigate} from 'react-router-dom'
|
||||
import {useMutation} from '@tanstack/react-query'
|
||||
import {Formik, Form} from 'formik'
|
||||
import * as Yup from "yup";
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useState } from "react";
|
||||
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query'
|
||||
import queryKeys from '../../services/queryKeys'
|
||||
import BreadcrumbCom from "../breadcrumb/BreadcrumbCom";
|
||||
import { getCountry, setCountry } from "../../services/siteServices";
|
||||
import TableWrapper from "../tableWrapper/TableWrapper";
|
||||
|
||||
export default function CountrySettings(){
|
||||
|
||||
@@ -11,7 +10,7 @@ export default function CountrySettings(){
|
||||
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
const {data, isFetching, status, isError, error} = useQuery({
|
||||
const {data, status, isError, error} = useQuery({
|
||||
queryKey: queryKeys.country_list,
|
||||
queryFn: () => {
|
||||
const reqData = {
|
||||
@@ -49,12 +48,12 @@ export default function CountrySettings(){
|
||||
const handleStatusChange = (event, details) => {
|
||||
setSelected(event.target.id)
|
||||
const name = event.target.name
|
||||
const val = name.toUpperCase() == 'STATUS' ? details.status : details.signup
|
||||
const val = name.toUpperCase() === 'STATUS' ? details.status : details.signup
|
||||
const reqData = {
|
||||
'val_type': name.toUpperCase(),
|
||||
'country_uid': details?.country_uid,
|
||||
'code': details?.code,
|
||||
'val': val == 0 ? 1 : 0
|
||||
'val': val === 0 ? 1 : 0
|
||||
}
|
||||
statusChange.mutate(reqData)
|
||||
};
|
||||
@@ -110,7 +109,7 @@ export default function CountrySettings(){
|
||||
<td className="px-8">
|
||||
<div className="flex justify-center">
|
||||
<>
|
||||
{selected == 'status' + index ?
|
||||
{selected === 'status' + index ?
|
||||
<div role="status" className="text-center">
|
||||
<svg aria-hidden="true" className="w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-primary" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
|
||||
@@ -134,7 +133,7 @@ export default function CountrySettings(){
|
||||
<td className="px-8">
|
||||
<div className="flex justify-center">
|
||||
<>
|
||||
{selected == `signup${index}`
|
||||
{selected === `signup${index}`
|
||||
?
|
||||
<div role="status" className="text-center">
|
||||
<svg aria-hidden="true" className="w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-primary" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
import {useState} from 'react'
|
||||
import {useQuery} from '@tanstack/react-query'
|
||||
import queryKeys from '../../services/queryKeys'
|
||||
|
||||
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
||||
import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper'
|
||||
import Icons from '../Icons'
|
||||
import {getFilesUpload} from '../../services/siteServices'
|
||||
import getDateTimeFromDateString from '../../helpers/getDateTimeFromDateString';
|
||||
|
||||
export default function FileUploadCom() {
|
||||
|
||||
const [page, setPage] = useState(1)
|
||||
const [filter, setFilter] = useState({type: '', id: ''})
|
||||
const [willFilter, setWillFilter] = useState(false)
|
||||
|
||||
const handleFilter = ({target: {name, value}}) => {
|
||||
setFilter(prev => ({...prev, [name]: value}))
|
||||
}
|
||||
|
||||
const handleFilterByParams = () => {
|
||||
if (filter.type && !filter.id) {
|
||||
return
|
||||
} else if (!filter.type) {
|
||||
setPage(1)
|
||||
setWillFilter(prev => !prev)
|
||||
setFilter({type: '', id: ''})
|
||||
} else {
|
||||
setPage(1)
|
||||
setWillFilter(prev => !prev)
|
||||
}
|
||||
}
|
||||
|
||||
const {data, isFetching, isError, error} = useQuery({
|
||||
queryKey: [...queryKeys.billings, page, willFilter],
|
||||
queryFn: () => {
|
||||
const filterData = filter?.type ? {[filter?.type]: filter.id} : {}
|
||||
const reqData = {
|
||||
page,
|
||||
...filterData
|
||||
}
|
||||
return getFilesUpload(reqData)
|
||||
},
|
||||
staleTime: 0 //0 mins
|
||||
})
|
||||
const billingData = data?.data?.file_list; // file_list
|
||||
const media_server = data?.data?.media_server; // file_list
|
||||
const pagination = data?.data?.pagination
|
||||
debugger;
|
||||
return (
|
||||
<div className='w-full flex flex-col gap-8'>
|
||||
<BreadcrumbCom title='Files' paths={['Dashboard', 'Files']}/>
|
||||
|
||||
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||
{isError ?
|
||||
<p className='text-red-500'>{error?.message}</p>
|
||||
:
|
||||
<>
|
||||
{/* filter section */}
|
||||
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
||||
<Icons name='filter' className='text-3xl'/>
|
||||
<div className='w-full sm:max-w-48'>
|
||||
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md'
|
||||
onChange={handleFilter}>
|
||||
<option value=''>All</option>
|
||||
<option value='file_group'>File Group</option>
|
||||
<option value='member_id'>Member ID</option>
|
||||
</select>
|
||||
</div>
|
||||
<div className='w-full sm:max-w-48'>
|
||||
<input name='id' value={filter?.id} disabled={!filter.type}
|
||||
className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`}
|
||||
onChange={handleFilter}/>
|
||||
</div>
|
||||
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id}
|
||||
className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit
|
||||
</button>
|
||||
</div>
|
||||
{/* end of filter section */}
|
||||
|
||||
<TablePaginatedWrapper data={billingData} isFetching={isFetching} setPage={setPage}
|
||||
itemsPerPage={pagination?.limit} pagination={pagination}>
|
||||
{({data}) => (
|
||||
<>
|
||||
<table className="py-2 w-full text-sm">
|
||||
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||
<tr>
|
||||
<th scope="col" className="px-2 py-2">
|
||||
Added
|
||||
</th>
|
||||
<th scope="col" className="px-2">
|
||||
Member ID
|
||||
</th>
|
||||
<th scope="col" className="px-2">
|
||||
File Name
|
||||
</th>
|
||||
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Group
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Status
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{(data && data.length > 0) ? data?.map((item, index) => {
|
||||
const file_url = (media_server + "/" + item?.file_group + "/" + item?.file_uid + "/" + item.filename).toLowerCase();
|
||||
return (
|
||||
<tr key={index}
|
||||
className="py-2 border-t border-dashed border-slate-300">
|
||||
<td className="px-2 py-2">
|
||||
<div
|
||||
className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
|
||||
<div className="text-left">
|
||||
<div
|
||||
className="text-base font-semibold">{getDateTimeFromDateString(item?.added)}</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-left">
|
||||
<div
|
||||
className="text-base font-semibold">{item?.member_id}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-left">
|
||||
<div
|
||||
className="text-base font-semibold">
|
||||
<a href={`${file_url}`} target='_blank'
|
||||
rel="noreferrer">
|
||||
{item?.filename}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div
|
||||
className="text-base font-semibold">{item?.file_group}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div
|
||||
className="text-base font-semibold">{item?.status}</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
)
|
||||
:
|
||||
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||
<td className="px-3 py-2" colSpan={4}>
|
||||
<div className="flex justify-center items-center">
|
||||
No Record Found
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</>
|
||||
)
|
||||
}
|
||||
</TablePaginatedWrapper>
|
||||
</>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import {useLocation} from 'react-router-dom'
|
||||
import { useSelector } from "react-redux";
|
||||
import {useSelector} from "react-redux";
|
||||
import RouteLinks from "../../../RouteLinks";
|
||||
import DummyLogo from "../../DummyLogo";
|
||||
import MainBtn from "../../MainBtn";
|
||||
@@ -17,7 +17,7 @@ export default function DashboardAside() {
|
||||
|
||||
const {setLogoutModal, handleActiveMenu} = GeneralLayoutContext()
|
||||
|
||||
const {userDetails:{username, email}} = useSelector((state) => state.userDetails) // GETS LOGGED IN USER
|
||||
const {userDetails: {username, email}} = useSelector((state) => state.userDetails) // GETS LOGGED IN USER
|
||||
// const {role}= userDetails
|
||||
|
||||
return (
|
||||
@@ -156,6 +156,7 @@ const asideNavLinks = [
|
||||
{name: 'Provisions', status: 1, icon: 'dot', to: RouteLinks.subscriptions},
|
||||
{name: 'Customers', status: 1, icon: 'dot', to: RouteLinks.customerPage},
|
||||
{name: 'Billings', status: 1, icon: 'dot', to: RouteLinks.billings},
|
||||
{name: 'Files & Uploads', status: 1, icon: 'dot', to: RouteLinks.files_uploads},
|
||||
{
|
||||
name: 'Configurations', status: 1, icon: 'arrow-right', subLinks: [
|
||||
{name: 'Country', status: 1, icon: 'dot', to: RouteLinks.countrySettings},
|
||||
|
||||
@@ -1,84 +1,143 @@
|
||||
import React from 'react'
|
||||
import {Link} from 'react-router-dom'
|
||||
import Img from '../../../assets/user_avatar.jpg'
|
||||
import CustomCounter from '../../CustomCounter'
|
||||
import RouteLinks from '../../../RouteLinks'
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import Img from "../../../assets/user_avatar.jpg";
|
||||
import CustomCounter from "../../CustomCounter";
|
||||
|
||||
export default function RecentPaymentsBar({data, isFetching, isError, error}) {
|
||||
|
||||
const recentPayment = data?.data?.recent_payment_summary
|
||||
const recentLogin = data?.data?.recent_login
|
||||
export default function RecentPaymentsBar({
|
||||
data,
|
||||
isFetching,
|
||||
isError,
|
||||
error,
|
||||
}) {
|
||||
const recentPayment = data?.data?.recent_payment_summary;
|
||||
const recentLogin = data?.data?.recent_login;
|
||||
const systemList = data?.data?.system_url;
|
||||
|
||||
return (
|
||||
<div className='h-full p-2 sm:p-4 large:p-8 flex flex-col gap-16 aside-scroll-design'>
|
||||
<div className='flex flex-col gap-4'>
|
||||
<p className='text-base text-white-body font-bold'>Recent Payments [7 days]</p>
|
||||
{isFetching ?
|
||||
<div className='w-full flex justify-center'>
|
||||
<div className="w-6 h-6 border-2 border-gray-300 border-b-gray-500 rounded-full animate-spin"></div>
|
||||
</div>
|
||||
:
|
||||
isError ?
|
||||
<p className='text-base text-white-body font-bold'>{error?.message}</p>
|
||||
:
|
||||
<div className='grid grid-cols-2 gap-4 sm:gap-6 large:gap-8'>
|
||||
<div className='p-2 sm:p-3 large:p-4 flex flex-col border border-slate-500 border-dashed'>
|
||||
<p className='text-base font-bold text-white-body'>
|
||||
<CustomCounter targetNumber={recentPayment?.approved} timeInSeconds={1} />
|
||||
</p>
|
||||
<p className='text-sm text-slate-500'>Approved</p>
|
||||
</div>
|
||||
<div className='p-2 sm:p-3 large:p-4 flex flex-col border border-slate-500 border-dashed'>
|
||||
<p className='text-base font-bold text-white-body'>
|
||||
<CustomCounter targetNumber={recentPayment?.verified} timeInSeconds={1} />
|
||||
</p>
|
||||
<p className='text-sm text-slate-500'>Verified</p>
|
||||
</div>
|
||||
<div className='p-2 sm:p-3 large:p-4 flex flex-col border border-slate-500 border-dashed'>
|
||||
<p className='text-base font-bold text-white-body'>
|
||||
<CustomCounter targetNumber={recentPayment?.failed} timeInSeconds={1} />
|
||||
</p>
|
||||
<p className='text-sm text-slate-500'>Failed</p>
|
||||
</div>
|
||||
<div className='p-2 sm:p-3 large:p-4 flex flex-col border border-slate-500 border-dashed'>
|
||||
<p className='text-base font-bold text-white-body'>
|
||||
<CustomCounter targetNumber={recentPayment?.total} timeInSeconds={1} />
|
||||
</p>
|
||||
<p className='text-sm text-slate-500'>Total</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="h-full p-2 sm:p-4 large:p-8 flex flex-col gap-16 aside-scroll-design">
|
||||
<div className="flex flex-col gap-4">
|
||||
<p className="text-base text-white-body font-bold">
|
||||
Recent Payments [7 days]
|
||||
</p>
|
||||
{isFetching ? (
|
||||
<div className="w-full flex justify-center">
|
||||
<div className="w-6 h-6 border-2 border-gray-300 border-b-gray-500 rounded-full animate-spin"></div>
|
||||
</div>
|
||||
) : isError ? (
|
||||
<p className="text-base text-white-body font-bold">
|
||||
{error?.message}
|
||||
</p>
|
||||
) : (
|
||||
<div className="grid grid-cols-2 gap-4 sm:gap-6 large:gap-8">
|
||||
<div className="p-2 sm:p-3 large:p-4 flex flex-col border border-slate-500 border-dashed">
|
||||
<p className="text-base font-bold text-white-body">
|
||||
<CustomCounter
|
||||
targetNumber={recentPayment?.approved}
|
||||
timeInSeconds={1}
|
||||
/>
|
||||
</p>
|
||||
<p className="text-sm text-slate-500">Approved</p>
|
||||
</div>
|
||||
<div className='overflow-y-auto h-full flex flex-col gap-4'>
|
||||
<p className='text-base text-white-body font-bold'>Recent Login</p>
|
||||
{isFetching ?
|
||||
<div className='w-full flex justify-center'>
|
||||
<div className="w-6 h-6 border-2 border-gray-300 border-b-gray-500 rounded-full animate-spin"></div>
|
||||
</div>
|
||||
:
|
||||
isError ?
|
||||
<p className='text-base text-white-body font-bold'>{error?.message}</p>
|
||||
:
|
||||
<div className='flex flex-col gap-4'>
|
||||
{recentLogin.map((item, index)=> {
|
||||
if(index < 5){
|
||||
return (
|
||||
<div key={index} className='flex gap-3 items-center'>
|
||||
<div className='px-4 py-2 bg-[#0E172E] rounded-md'>
|
||||
<img src={Img} className='w-8' alt="Order" />
|
||||
</div>
|
||||
<div className='flex-col'>
|
||||
<p className='text-base font-bold text-white-body'>{item.firstname} {item.lastname}</p>
|
||||
<p className='text-sm text-slate-500'>{item.username}</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
<div className="p-2 sm:p-3 large:p-4 flex flex-col border border-slate-500 border-dashed">
|
||||
<p className="text-base font-bold text-white-body">
|
||||
<CustomCounter
|
||||
targetNumber={recentPayment?.verified}
|
||||
timeInSeconds={1}
|
||||
/>
|
||||
</p>
|
||||
<p className="text-sm text-slate-500">Verified</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
<div className="p-2 sm:p-3 large:p-4 flex flex-col border border-slate-500 border-dashed">
|
||||
<p className="text-base font-bold text-white-body">
|
||||
<CustomCounter
|
||||
targetNumber={recentPayment?.failed}
|
||||
timeInSeconds={1}
|
||||
/>
|
||||
</p>
|
||||
<p className="text-sm text-slate-500">Failed</p>
|
||||
</div>
|
||||
<div className="p-2 sm:p-3 large:p-4 flex flex-col border border-slate-500 border-dashed">
|
||||
<p className="text-base font-bold text-white-body">
|
||||
<CustomCounter
|
||||
targetNumber={recentPayment?.total}
|
||||
timeInSeconds={1}
|
||||
/>
|
||||
</p>
|
||||
<p className="text-sm text-slate-500">Total</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="overflow-y-auto h-full flex flex-col gap-4">
|
||||
<p className="text-base text-white-body font-bold">Systems</p>
|
||||
{isFetching ? (
|
||||
<div className="w-full flex justify-center">
|
||||
<div className="w-6 h-6 border-2 border-gray-300 border-b-gray-500 rounded-full animate-spin"></div>
|
||||
</div>
|
||||
) : isError ? (
|
||||
<p className="text-base text-white-body font-bold">
|
||||
{error?.message}
|
||||
</p>
|
||||
) : (
|
||||
<div className="flex flex-col gap-4">
|
||||
{systemList.map((item, index) => {
|
||||
return (
|
||||
<Link
|
||||
to={item.url}
|
||||
key={index}
|
||||
className="flex gap-3 items-center"
|
||||
>
|
||||
<div className="px-4 py-2 bg-[#0E172E] rounded-md">
|
||||
<img src={Img} className="w-8" alt="Order" />
|
||||
</div>
|
||||
<div className="flex-col">
|
||||
<p className="text-base font-bold text-white-body">
|
||||
{item.name}
|
||||
</p>
|
||||
<p className="text-sm text-slate-500">{item.url}</p>
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="overflow-y-auto h-full flex flex-col gap-4">
|
||||
<p className="text-base text-white-body font-bold">Recent Login</p>
|
||||
{isFetching ? (
|
||||
<div className="w-full flex justify-center">
|
||||
<div className="w-6 h-6 border-2 border-gray-300 border-b-gray-500 rounded-full animate-spin"></div>
|
||||
</div>
|
||||
) : isError ? (
|
||||
<p className="text-base text-white-body font-bold">
|
||||
{error?.message}
|
||||
</p>
|
||||
) : (
|
||||
<div className="flex flex-col gap-4">
|
||||
{recentLogin.map((item, index) => {
|
||||
return (
|
||||
<Link
|
||||
to={`/account-view/${item?.member_uid}`}
|
||||
state={{ customerID: item?.id, memberUID: item?.member_uid }}
|
||||
key={index}
|
||||
className="flex gap-3 items-center"
|
||||
>
|
||||
<div className="px-4 py-2 bg-[#0E172E] rounded-md">
|
||||
<img src={Img} className="w-8" alt="Order" />
|
||||
</div>
|
||||
<div className="flex-col">
|
||||
<p className="text-base font-bold text-white-body">
|
||||
{item.firstname} {item.lastname}
|
||||
</p>
|
||||
<p className="text-sm text-slate-500">{item.username}</p>
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import React from 'react'
|
||||
import {Link} from 'react-router-dom'
|
||||
import Img from '../../../assets/user_avatar.jpg'
|
||||
import CustomCounter from '../../CustomCounter'
|
||||
|
||||
export default function Tickets({data, isFetching, isError, error}) {
|
||||
|
||||
const recentDeployment = data?.data?.recent_deployment_summary
|
||||
const recentSignup = data?.data?.recent_signup
|
||||
|
||||
|
||||
return (
|
||||
<div className='h-full p-2 sm:p-4 large:p-8 flex flex-col gap-16 overflow-y-auto aside-scroll-design'>
|
||||
<div className='h-full p-2 sm:p-4 large:p-8 flex flex-col gap-16 aside-scroll-design'>
|
||||
<div className='flex flex-col gap-4'>
|
||||
<p className='text-base text-white-body font-bold'>Recent Deployments</p>
|
||||
{isFetching ?
|
||||
@@ -46,8 +49,8 @@ export default function Tickets({data, isFetching, isError, error}) {
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div className='flex flex-col gap-4'>
|
||||
<p className='text-base text-white-body font-bold'>Tracked Errors</p>
|
||||
<div className='overflow-y-auto h-full flex flex-col gap-4'>
|
||||
<p className='text-base text-white-body font-bold'>Recent Signup</p>
|
||||
{isFetching ?
|
||||
<div className='w-full flex justify-center'>
|
||||
<div className="w-6 h-6 border-2 border-gray-300 border-b-gray-500 rounded-full animate-spin"></div>
|
||||
@@ -57,42 +60,25 @@ export default function Tickets({data, isFetching, isError, error}) {
|
||||
<p className='text-base text-white-body font-bold'>{error?.message}</p>
|
||||
:
|
||||
<div className='flex flex-col gap-4'>
|
||||
<div className='flex gap-3 items-center'>
|
||||
<div className='px-4 py-2 bg-[#0E172E] rounded-md'>
|
||||
<img src={Img} className='w-8' alt="Order" />
|
||||
</div>
|
||||
<div className='flex-col'>
|
||||
<p className='text-base font-bold text-white-body'>Project Briefing</p>
|
||||
<p className='text-sm text-slate-500'>Project Manager</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex gap-3 items-center'>
|
||||
<div className='px-4 py-2 bg-[#0E172E] rounded-md'>
|
||||
<img src={Img} className='w-8' alt="Order" />
|
||||
</div>
|
||||
<div className='flex-col'>
|
||||
<p className='text-base font-bold text-white-body'>Project Briefing</p>
|
||||
<p className='text-sm text-slate-500'>Project Manager</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex gap-3 items-center'>
|
||||
<div className='px-4 py-2 bg-[#0E172E] rounded-md'>
|
||||
<img src={Img} className='w-8' alt="Order" />
|
||||
</div>
|
||||
<div className='flex-col'>
|
||||
<p className='text-base font-bold text-white-body'>Project Briefing</p>
|
||||
<p className='text-sm text-slate-500'>Project Manager</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex gap-3 items-center'>
|
||||
<div className='px-4 py-2 bg-[#0E172E] rounded-md'>
|
||||
<img src={Img} className='w-8' alt="Order" />
|
||||
</div>
|
||||
<div className='flex-col'>
|
||||
<p className='text-base font-bold text-white-body'>Project Briefing</p>
|
||||
<p className='text-sm text-slate-500'>Project Manager</p>
|
||||
</div>
|
||||
</div>
|
||||
{recentSignup.map((item, index)=> {
|
||||
return (
|
||||
<Link
|
||||
to={`/account-view/${item?.member_uid}`}
|
||||
state={{customerID: item?.id, memberUID: item?.member_uid}}
|
||||
key={index}
|
||||
className='flex gap-3 items-center'
|
||||
>
|
||||
<div className='px-4 py-2 bg-[#0E172E] rounded-md'>
|
||||
<img src={Img} className='w-8' alt="Order" />
|
||||
</div>
|
||||
<div className='flex-col'>
|
||||
<p className='text-base font-bold text-white-body'>{item.firstname} {item.lastname}</p>
|
||||
<p className='text-sm text-slate-500'>{item.username}</p>
|
||||
</div>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
import {useMutation} from '@tanstack/react-query'
|
||||
import {Formik, Form} from 'formik'
|
||||
import * as Yup from "yup";
|
||||
// import InputText from '../InputText'
|
||||
@@ -19,7 +19,7 @@ export default function ProductDetails({productDetails}) {
|
||||
sale_text: productDetails?.sale_text,
|
||||
};
|
||||
|
||||
const queryClient = useQueryClient()
|
||||
// const queryClient = useQueryClient()
|
||||
|
||||
const productUpdate = useMutation({
|
||||
mutationFn: (fields) => {
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
import { useState } from 'react'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import queryKeys from '../../services/queryKeys'
|
||||
|
||||
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
||||
import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper'
|
||||
import Icons from '../Icons'
|
||||
import { getProductsTemplate } from '../../services/siteServices'
|
||||
import { getProductsTemplate, setProductsTemplate } from '../../services/siteServices'
|
||||
// import getDateTimeFromDateString from '../../helpers/getDateTimeFromDateString'
|
||||
|
||||
export default function ProductTemplates() {
|
||||
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
const [selected, setSelected] = useState('')
|
||||
|
||||
const [page, setPage] = useState(1)
|
||||
const [filter, setFilter] = useState({type: '', id: ''})
|
||||
const [willFilter, setWillFilter] = useState(false)
|
||||
@@ -43,9 +47,62 @@ export default function ProductTemplates() {
|
||||
},
|
||||
staleTime: 0 //0 mins
|
||||
})
|
||||
const productsTemData = data?.data?.templates // PRODUCTS TEMPLATE LIST
|
||||
const pagination = data?.data?.pagination
|
||||
// const productsTemData = data?.data?.templates // PRODUCTS TEMPLATE LIST
|
||||
// const pagination = data?.data?.pagination
|
||||
// console.log('DATA', data?.data)
|
||||
const [productsTemData, setProductsTemData] = useState([])
|
||||
const [pagination, setPagination] = useState({})
|
||||
useEffect(()=>{
|
||||
if(data){
|
||||
setProductsTemData(data?.data?.templates)
|
||||
setPagination(data?.data?.pagination)
|
||||
}
|
||||
},[data])
|
||||
|
||||
|
||||
const statusChange = useMutation({
|
||||
mutationFn: (fields) => {
|
||||
return setProductsTemplate(fields)
|
||||
},
|
||||
onError: (error) => {
|
||||
},
|
||||
onSuccess: (res) => {
|
||||
queryClient.refetchQueries({
|
||||
queryKey: [...queryKeys.country_list],
|
||||
// type: 'active',
|
||||
// exact: true,
|
||||
})
|
||||
},
|
||||
onSettled: () => {
|
||||
setSelected('')
|
||||
}
|
||||
})
|
||||
|
||||
//FUNCTION TO CHANGE STATUS OR SIGNUP
|
||||
const handleStatusChange = (event, details) => {
|
||||
setSelected(event.target.id)
|
||||
const name = event.target.name
|
||||
const val = name.toUpperCase() === 'STATUS' ? details.status : details.signup
|
||||
const reqData = {
|
||||
'val_type': name.toUpperCase(),
|
||||
'country_uid': details?.country_uid,
|
||||
'code': details?.code,
|
||||
'val': val === 0 ? 1 : 0
|
||||
}
|
||||
statusChange.mutate(reqData)
|
||||
|
||||
setTimeout(()=>{
|
||||
setSelected('')
|
||||
const NewData = productsTemData.map(item => { // remove later
|
||||
if(item.product_id === event.target.id){
|
||||
return ({...item, status: !item.status})
|
||||
}else{
|
||||
return item
|
||||
}
|
||||
})
|
||||
setProductsTemData(NewData)
|
||||
},3000) // remove later
|
||||
};
|
||||
|
||||
return (
|
||||
<div className='w-full flex flex-col gap-8'>
|
||||
@@ -62,7 +119,8 @@ export default function ProductTemplates() {
|
||||
<div className='w-full sm:max-w-48'>
|
||||
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}>
|
||||
<option value=''>All</option>
|
||||
<option value='name'>Name</option>
|
||||
<option value='product_id'>Product ID</option>
|
||||
<option value='provision_name'>Provision Name</option>
|
||||
</select>
|
||||
</div>
|
||||
<div className='w-full sm:max-w-48'>
|
||||
@@ -84,7 +142,7 @@ export default function ProductTemplates() {
|
||||
<th scope="col" className="px-8">
|
||||
Provision Name
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
<th scope="col" className="px-2 text-center">
|
||||
Status
|
||||
</th>
|
||||
</tr>
|
||||
@@ -105,8 +163,27 @@ export default function ProductTemplates() {
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div className="text-base font-semibold">{item?.status}</div>
|
||||
<div className="flex justify-center">
|
||||
<>
|
||||
{selected === item?.product_id ?
|
||||
<div role="status" className="text-center">
|
||||
<svg aria-hidden="true" className="w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-primary" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
|
||||
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
|
||||
</svg>
|
||||
<span className="sr-only">Loading...</span>
|
||||
</div>
|
||||
:
|
||||
<input
|
||||
className="w-4 h-4 cursor-pointer text-primary bg-gray-100 border-gray-300 rounded-sm focus:ring-primary/80 dark:focus:ring-primary dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
|
||||
onChange={(e)=>handleStatusChange(e, item)}
|
||||
type="checkbox"
|
||||
checked={item?.status}
|
||||
name="status"
|
||||
id={item?.product_id}
|
||||
/>
|
||||
}
|
||||
</>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {useEffect, useState} from 'react';
|
||||
import {useEffect} from 'react';
|
||||
import {useLocation, useNavigate} from 'react-router-dom'
|
||||
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
||||
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import queryKeys from '../../services/queryKeys'
|
||||
import { getProductView } from "../../services/siteServices";
|
||||
import ProductDetails from './ProductDetails';
|
||||
@@ -14,12 +14,15 @@ export default function ProductView() {
|
||||
const navigate = useNavigate()
|
||||
|
||||
useEffect(() => {
|
||||
if (!state?.productID) {
|
||||
navigate(RouteLinks.homePage, {replace: true})
|
||||
const stateExist = () => {
|
||||
if (!state?.productID) {
|
||||
navigate(RouteLinks.homePage, {replace: true})
|
||||
}
|
||||
}
|
||||
stateExist()
|
||||
}, [])
|
||||
|
||||
const {data, isFetching, status, isError, error} = useQuery({
|
||||
const {data, isFetching, isError, error} = useQuery({
|
||||
queryKey: queryKeys.product_view,
|
||||
queryFn: () => {
|
||||
const reqData = {
|
||||
|
||||
@@ -1,146 +1,203 @@
|
||||
import { useState } from 'react'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import queryKeys from '../../services/queryKeys'
|
||||
import { useState } from "react";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import queryKeys from "../../services/queryKeys";
|
||||
|
||||
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
||||
import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper'
|
||||
import Icons from '../Icons'
|
||||
import { getRecentSignup } from '../../services/siteServices'
|
||||
import getDateTimeFromDateString from '../../helpers/getDateTimeFromDateString'
|
||||
// import formatNumber from '../../helpers/formatNumber'
|
||||
// import formatNumber from '../../helpers/formatNumber'
|
||||
// import Avatar from '../../assets/user_avatar.jpg'
|
||||
import BreadcrumbCom from "../breadcrumb/BreadcrumbCom";
|
||||
import TablePaginatedWrapper from "../tableWrapper/TablePaginatedWrapper";
|
||||
import Icons from "../Icons";
|
||||
import { getRecentSignup } from "../../services/siteServices";
|
||||
import getDateTimeFromDateString from "../../helpers/getDateTimeFromDateString";
|
||||
import {Link} from 'react-router-dom';
|
||||
|
||||
|
||||
export default function RecentSignup() {
|
||||
const [page, setPage] = useState(1);
|
||||
const [filter, setFilter] = useState({ type: "", id: "" });
|
||||
const [willFilter, setWillFilter] = useState(false);
|
||||
|
||||
const [page, setPage] = useState(1)
|
||||
const [filter, setFilter] = useState({type: '', id: ''})
|
||||
const [willFilter, setWillFilter] = useState(false)
|
||||
const handleFilter = ({ target: { name, value } }) => {
|
||||
setFilter((prev) => ({ ...prev, [name]: value }));
|
||||
};
|
||||
|
||||
const handleFilter = ({target:{name, value}}) => {
|
||||
setFilter(prev => ({...prev, [name]:value}))
|
||||
const handleFilterByParams = () => {
|
||||
if (filter.type && !filter.id) {
|
||||
return;
|
||||
} else if (!filter.type) {
|
||||
setPage(1);
|
||||
setWillFilter((prev) => !prev);
|
||||
setFilter({ type: "", id: "" });
|
||||
} else {
|
||||
setPage(1);
|
||||
setWillFilter((prev) => !prev);
|
||||
}
|
||||
};
|
||||
|
||||
const handleFilterByParams = () => {
|
||||
if(filter.type && !filter.id){
|
||||
return
|
||||
}else if(!filter.type){
|
||||
setPage(1)
|
||||
setWillFilter(prev => !prev)
|
||||
setFilter({type: '', id: ''})
|
||||
}else{
|
||||
setPage(1)
|
||||
setWillFilter(prev => !prev)
|
||||
}
|
||||
}
|
||||
const { data, isFetching, isError, error } = useQuery({
|
||||
queryKey: [...queryKeys.recent_signup, page, willFilter],
|
||||
queryFn: () => {
|
||||
const filterData = filter?.type ? { [filter?.type]: filter.id } : {};
|
||||
const reqData = {
|
||||
page,
|
||||
...filterData,
|
||||
};
|
||||
return getRecentSignup(reqData);
|
||||
},
|
||||
staleTime: 0, //0 mins
|
||||
});
|
||||
const recentSignupData = data?.data?.members; // BILLINGS LIST
|
||||
const pagination = data?.data?.pagination;
|
||||
// console.log('DATA', data?.data)
|
||||
|
||||
const {data, isFetching, isError, error} = useQuery({
|
||||
queryKey: [...queryKeys.recent_signup, page, willFilter],
|
||||
queryFn: () => {
|
||||
const filterData = filter?.type ? {[filter?.type]: filter.id} : {}
|
||||
const reqData = {
|
||||
page,
|
||||
...filterData
|
||||
}
|
||||
return getRecentSignup(reqData)
|
||||
},
|
||||
staleTime: 0 //0 mins
|
||||
})
|
||||
const recentSignupData = data?.data?.payments // BILLINGS LIST
|
||||
const pagination = data?.data?.pagination
|
||||
// console.log('DATA', data?.data)
|
||||
return (
|
||||
<div className="w-full flex flex-col gap-8">
|
||||
<BreadcrumbCom
|
||||
title="Recent Signup"
|
||||
paths={["Dashboard", "Recent Acc"]}
|
||||
/>
|
||||
|
||||
return (
|
||||
<div className='w-full flex flex-col gap-8'>
|
||||
<BreadcrumbCom title='Recent Signup' paths={['Dashboard', 'Recent Acc']} />
|
||||
|
||||
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||
{ isError ?
|
||||
<p className='text-red-500'>{error?.message}</p>
|
||||
:
|
||||
<>
|
||||
{/* filter section */}
|
||||
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
||||
<Icons name='filter' className='text-3xl' />
|
||||
<div className='w-full sm:max-w-48'>
|
||||
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}>
|
||||
<option value=''>All</option>
|
||||
<option value='name'>Name</option>
|
||||
</select>
|
||||
</div>
|
||||
<div className='w-full sm:max-w-48'>
|
||||
<input name='id' value={filter?.id} disabled={!filter.type} className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`} onChange={handleFilter} />
|
||||
</div>
|
||||
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id} className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit</button>
|
||||
</div>
|
||||
{/* end of filter section */}
|
||||
|
||||
<TablePaginatedWrapper data={recentSignupData} isFetching={isFetching} setPage={setPage} itemsPerPage={pagination?.limit} pagination={pagination}>
|
||||
{({ data }) => (
|
||||
<>
|
||||
<table className="py-2 w-full text-sm">
|
||||
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||
<tr>
|
||||
<th scope="col" className="px-2 py-2">
|
||||
Added
|
||||
</th>
|
||||
<th scope="col" className="px-2">
|
||||
Option Name
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Amount
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Status
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{(data && data.length > 0) ? data?.map((item, index) => (
|
||||
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
||||
<td className="px-2 py-2">
|
||||
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
|
||||
<div className="text-left">
|
||||
<div className="text-base font-semibold">{getDateTimeFromDateString(item?.added)}</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-left">
|
||||
<div className="text-base font-semibold">{item?.option_name}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div className="text-base font-semibold">${item?.amount}</div>
|
||||
{/* <div className="font-normal text-gray-500">{item?.external_url}</div> */}
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div className="text-base font-semibold">{item?.status}</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))
|
||||
:
|
||||
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||
<td className="px-3 py-2" colSpan={4}>
|
||||
<div className="flex justify-center items-center">
|
||||
No Record Found
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</>
|
||||
)}
|
||||
</TablePaginatedWrapper>
|
||||
</>
|
||||
}
|
||||
<div className="box bg-white dark:bg-black-box text-black-body dark:text-white-body">
|
||||
{isError ? (
|
||||
<p className="text-red-500">{error?.message}</p>
|
||||
) : (
|
||||
<>
|
||||
{/* filter section */}
|
||||
<div className="px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2">
|
||||
<Icons name="filter" className="text-3xl" />
|
||||
<div className="w-full sm:max-w-48">
|
||||
<select
|
||||
name="type"
|
||||
value={filter?.type}
|
||||
className="h-10 w-full p-2 rounded-md"
|
||||
onChange={handleFilter}
|
||||
>
|
||||
<option value="">All</option>
|
||||
<option value="username">Username</option>
|
||||
</select>
|
||||
</div>
|
||||
<div className="w-full sm:max-w-48">
|
||||
<input
|
||||
name="id"
|
||||
value={filter?.id}
|
||||
disabled={!filter.type}
|
||||
className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && "opacity-30"}`}
|
||||
onChange={handleFilter}
|
||||
/>
|
||||
</div>
|
||||
<button
|
||||
onClick={handleFilterByParams}
|
||||
disabled={filter.type && !filter.id}
|
||||
className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${filter.type && !filter.id && "opacity-50"}`}
|
||||
>
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
{/* end of filter section */}
|
||||
|
||||
<TablePaginatedWrapper
|
||||
data={recentSignupData}
|
||||
isFetching={isFetching}
|
||||
setPage={setPage}
|
||||
itemsPerPage={pagination?.limit}
|
||||
pagination={pagination}
|
||||
>
|
||||
{({ data }) => (
|
||||
<>
|
||||
<table className="py-2 w-full text-sm">
|
||||
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||
<tr>
|
||||
<th scope="col" className="px-2 py-2">
|
||||
Added
|
||||
</th>
|
||||
<th scope="col" className="px-2">
|
||||
User Name /Email
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Name
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Country
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Action
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{data && data.length > 0 ? (
|
||||
data?.map((item, index) => (
|
||||
<tr
|
||||
key={index}
|
||||
className="py-2 border-t border-dashed border-slate-300"
|
||||
>
|
||||
<td className="px-2 py-2">
|
||||
<div className="w-full min-w-48 flex items-center gap-2 whitespace-nowrap">
|
||||
<div className="text-left">
|
||||
<div className="text-base font-semibold">
|
||||
{getDateTimeFromDateString(item?.added)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-left">
|
||||
<div className="text-base font-semibold">
|
||||
{item?.username}
|
||||
</div>
|
||||
<div className="text-base font-semibold">
|
||||
{item?.email}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div className="text-base font-semibold">
|
||||
{item?.firstname} {item?.lastname}
|
||||
</div>
|
||||
{/* <div className="font-normal text-gray-500">{item?.external_url}</div> */}
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div className="text-base font-semibold">
|
||||
{item?.country}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td className="px-2 text-right">
|
||||
<div className="flex items-center justify-end gap-3 md:gap-4">
|
||||
<div className="p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md">
|
||||
<Link
|
||||
to={`/account-view/${item?.member_uid}`}
|
||||
state={{
|
||||
customerID: item?.id,
|
||||
memberUID: item?.member_uid,
|
||||
}}
|
||||
>
|
||||
<Icons name="eye" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))
|
||||
) : (
|
||||
<tr className="py-2 border-t border-dashed border-slate-300">
|
||||
<td className="px-3 py-2" colSpan={4}>
|
||||
<div className="flex justify-center items-center">
|
||||
No Record Found
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</>
|
||||
)}
|
||||
</TablePaginatedWrapper>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {useLocation, useNavigate, Link} from 'react-router-dom'
|
||||
import {useLocation, useNavigate} from 'react-router-dom'
|
||||
import {useQuery, useMutation} from '@tanstack/react-query'
|
||||
import {FaCaretDown} from "react-icons/fa";
|
||||
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
|
||||
@@ -20,9 +20,9 @@ export default function SubscriptionViewCom() {
|
||||
const [values, setValues] = useState({custom_id: '', template_uid: ''})
|
||||
|
||||
const handleValueChange = ({target: {name, value}}) => {
|
||||
if (name == 'custom_template') {
|
||||
if (name === 'custom_template') {
|
||||
setValues(prev => ({...prev, custom_id: value}))
|
||||
} else if (name == 'template') {
|
||||
} else if (name === 'template') {
|
||||
setValues(prev => ({...prev, template_uid: value}))
|
||||
} else {
|
||||
setValues(prev => ({...prev}))
|
||||
@@ -30,9 +30,12 @@ export default function SubscriptionViewCom() {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!state?.subscriptionUID) {
|
||||
navigate(RouteLinks.homePage, {replace: true})
|
||||
const stateExist = () => {
|
||||
if (!state?.subscriptionUID) {
|
||||
navigate(RouteLinks.homePage, {replace: true})
|
||||
}
|
||||
}
|
||||
stateExist()
|
||||
}, [])
|
||||
|
||||
const {data, isFetching, isError, error} = useQuery({
|
||||
@@ -52,8 +55,8 @@ export default function SubscriptionViewCom() {
|
||||
const customTemplates = subscriptionViewData?.available_custom_templates
|
||||
const availableTemplates = subscriptionViewData?.available_templates
|
||||
const selectedSubscription = subscriptionViewData?.subscription
|
||||
const currentCustomTem = subscriptionViewData?.available_custom_templates?.filter(item => item?.custom_id == subscriptionViewData?.subscription?.custom_template)[0]?.custom_id
|
||||
const currentTemplate = subscriptionViewData?.available_templates?.filter(item => item?.template_uid == subscriptionViewData?.subscription?.product_template)[0]?.template_uid
|
||||
const currentCustomTem = subscriptionViewData?.available_custom_templates?.filter(item => item?.custom_id === subscriptionViewData?.subscription?.custom_template)[0]?.custom_id
|
||||
const currentTemplate = subscriptionViewData?.available_templates?.filter(item => item?.template_uid === subscriptionViewData?.subscription?.product_template)[0]?.template_uid
|
||||
// // console.log('subscriptionViewData', subscriptionViewData, currentCustomTem, currentTemplate)
|
||||
|
||||
// useEffect(()=>{
|
||||
@@ -187,8 +190,8 @@ export default function SubscriptionViewCom() {
|
||||
|
||||
|
||||
<div className="text-base font-semibold">
|
||||
<br/><span>Template :</span> {selectedSubscription?.product_template}
|
||||
<br/><span>Custom :</span> {selectedSubscription?.custom_template}
|
||||
<br/><span>TM :</span> - {selectedSubscription?.template_name} - {selectedSubscription?.product_template} - {selectedSubscription?.flavor}
|
||||
<br/><span>CS :</span> {selectedSubscription?.custom_template}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -11,7 +11,7 @@ import formatNumber from '../../helpers/formatNumber';
|
||||
|
||||
export default function LoanChargeDetails({transactionID}) {
|
||||
|
||||
const [page, setPage] = useState(1)
|
||||
const [page] = useState(1)
|
||||
|
||||
const {data, isFetching, isError, error} = useQuery({
|
||||
queryKey: [...queryKeys.loan_charges, page],
|
||||
|
||||
@@ -11,7 +11,7 @@ import formatNumber from '../../helpers/formatNumber';
|
||||
|
||||
export default function RepaymentScheduleDetails({transactionID}) {
|
||||
|
||||
const [page, setPage] = useState(1)
|
||||
const [page] = useState(1)
|
||||
|
||||
const {data, isFetching, isError, error} = useQuery({
|
||||
queryKey: [...queryKeys.repayment_schedule, page],
|
||||
|
||||
@@ -11,7 +11,7 @@ import localImgLoader from '../../helpers/localImageLoader';
|
||||
|
||||
export default function TransactionDetails({transactionID}) {
|
||||
|
||||
const [page, setPage] = useState(1)
|
||||
const [page] = useState(1)
|
||||
|
||||
const {data, isFetching, isError, error} = useQuery({
|
||||
queryKey: [...queryKeys.transactions, page],
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import React from 'react'
|
||||
import AccountEditCom from "../components/account_edit/AccountEditCom";
|
||||
export default function AccountEditPage() {
|
||||
return (
|
||||
<AccountEditCom />
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import React from 'react'
|
||||
import FileUploadCom from "../components/file_uploads/FileUploadCom";
|
||||
|
||||
export default function FilesUploadPage() {
|
||||
return (
|
||||
<FileUploadCom />
|
||||
)
|
||||
}
|
||||
@@ -11,7 +11,7 @@ export default function TransactionDetailsPage() {
|
||||
if(!state?.transactionID){
|
||||
navigate('/', {replace: true})
|
||||
}
|
||||
},[state])
|
||||
},[navigate, state])
|
||||
return (
|
||||
<TransactionDetailsCom id={state?.transactionID} />
|
||||
)
|
||||
|
||||
@@ -88,6 +88,12 @@ export const getBillings = (reqData) => {
|
||||
return getAuxEnd(`/billings`, postData)
|
||||
}
|
||||
|
||||
// FUNCTION TO GET FILES
|
||||
export const getFilesUpload = (reqData) => {
|
||||
const postData = { ...reqData }
|
||||
return getAuxEnd(`/file-uploads`, postData)
|
||||
}
|
||||
|
||||
// FUNCTION TO GET SUBSCRIPTIONS
|
||||
export const getSubscriptions = (reqData) => {
|
||||
const postData = { ...reqData }
|
||||
@@ -124,6 +130,14 @@ export const getProductsTemplate = (reqData) => {
|
||||
return getAuxEnd(`/products-templates`, postData)
|
||||
}
|
||||
|
||||
// FUNCTION TO SET COUNTRY
|
||||
export const setProductsTemplate = (reqData) => {
|
||||
let postData = {
|
||||
...reqData
|
||||
}
|
||||
return postAuxEnd('/set-product', postData, false)
|
||||
}
|
||||
|
||||
// FUNCTION TO INITIATE TEMPLATE REBUILD
|
||||
export const rebuildTemplate = (reqData) => {
|
||||
let postData = {
|
||||
|
||||
Reference in New Issue
Block a user