Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 51e06716e5 | |||
| 9d7605ebfe | |||
| 54b550b624 | |||
| cead31a6d1 | |||
| 4508743be4 | |||
| 7d43300724 | |||
| e05d465c2f | |||
| 75a7496164 | |||
| 25b48416b7 | |||
| 996eee612d | |||
| aa7c1b0354 | |||
| 4877e349f2 | |||
| d163528f68 |
@@ -11,4 +11,7 @@ VITE_APP_PURCHASE_URL=https://www.digifi.com/
|
||||
VITE_APP_PREVIEW_URL=https://www.digifi.com/demo1/
|
||||
VITE_APP_PREVIEW_REACT_URL=https://www.digifi.com
|
||||
VITE_APP_PREVIEW_DOCS_URL=https://www.digifi.com/
|
||||
VITE_APP_THEME_API_URL=https://api.digifi/api/api
|
||||
VITE_APP_THEME_API_URL=https://api.digifi/api/api
|
||||
|
||||
# CUSTOM ENV VARIABLES ADDED
|
||||
VITE_APP_USER_ENDPOINT=https://digifi-apidev.chiefsoft.net/digibko/v1
|
||||
@@ -11,4 +11,7 @@ VITE_APP_PURCHASE_URL=https://themeforest.net/item/metronic-responsive-admin-das
|
||||
VITE_APP_PREVIEW_URL=https://preview.keenthemes.com/metronic8/react/demo1/
|
||||
VITE_APP_PREVIEW_REACT_URL=https://preview.keenthemes.com/metronic8/react
|
||||
VITE_APP_PREVIEW_DOCS_URL=https://preview.keenthemes.com/metronic8/react/docs
|
||||
VITE_APP_THEME_API_URL=https://preview.keenthemes.com/theme-api/api
|
||||
VITE_APP_THEME_API_URL=https://preview.keenthemes.com/theme-api/api
|
||||
|
||||
# CUSTOM ENV VARIABLES ADDED
|
||||
VITE_APP_USER_ENDPOINT=https://digifi-apidev.chiefsoft.net/digibko/v1
|
||||
@@ -11,4 +11,7 @@ VITE_APP_PURCHASE_URL=https://themeforest.net/item/metronic-responsive-admin-das
|
||||
VITE_APP_PREVIEW_URL=https://preview.keenthemes.com/metronic8/react/demo1/
|
||||
VITE_APP_PREVIEW_REACT_URL=https://preview.keenthemes.com/metronic8/react
|
||||
VITE_APP_PREVIEW_DOCS_URL=https://preview.keenthemes.com/metronic8/react/docs
|
||||
VITE_APP_THEME_API_URL=https://preview.keenthemes.com/theme-api/api
|
||||
VITE_APP_THEME_API_URL=https://preview.keenthemes.com/theme-api/api
|
||||
|
||||
# CUSTOM ENV VARIABLES ADDED
|
||||
VITE_APP_USER_ENDPOINT=https://digifi-apidev.chiefsoft.net/digibko/v1
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta name="description" content="WrenchBoard Agent" />
|
||||
<meta name="description" content="digiFi BackOffice" />
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700" />
|
||||
<title>digiFi Back Office</title>
|
||||
<link rel="shortcut icon" href="media/logos/favicon.ico" />
|
||||
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 713 B After Width: | Height: | Size: 490 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 950 B |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -34,7 +34,7 @@ const MasterLayout = () => {
|
||||
|
||||
{/* begin:: Drawers */}
|
||||
<ActivityDrawer />
|
||||
<RightToolbar />
|
||||
{/* <RightToolbar /> */}
|
||||
<DrawerMessenger />
|
||||
{/* end:: Drawers */}
|
||||
|
||||
|
||||
@@ -21,26 +21,26 @@ const SidebarMenuMain = () => {
|
||||
</div>
|
||||
</div>
|
||||
<SidebarMenuItemWithSub
|
||||
to='/crafted/pages'
|
||||
to='/loan/pages'
|
||||
title='Process'
|
||||
fontIcon='bi-archive'
|
||||
icon='element-plus'
|
||||
>
|
||||
<SidebarMenuItemWithSub to='/crafted/pages/process' title='Loan' hasBullet={true}>
|
||||
<SidebarMenuItem to='/crafted/pages/process/started' title='Started' hasBullet={true} />
|
||||
<SidebarMenuItem to='/crafted/pages/process/pending' title='Pending' hasBullet={true} />
|
||||
<SidebarMenuItemWithSub to='/loan/pages/process' title='Loan' hasBullet={true}>
|
||||
<SidebarMenuItem to='/loan/pages/process/started' title='Started' hasBullet={true} />
|
||||
<SidebarMenuItem to='/loan/pages/process/pending' title='Pending' hasBullet={true} />
|
||||
<SidebarMenuItem
|
||||
to='/crafted/pages/process/ready'
|
||||
to='/loan/pages/process/ready'
|
||||
title='Ready'
|
||||
hasBullet={true}
|
||||
/>
|
||||
<SidebarMenuItem
|
||||
to='/crafted/pages/process/approved'
|
||||
to='/loan/pages/process/approved'
|
||||
title='Approved'
|
||||
hasBullet={true}
|
||||
/>
|
||||
<SidebarMenuItem
|
||||
to='/crafted/pages/process/rejected'
|
||||
to='/loan/pages/process/rejected'
|
||||
title='Rejected'
|
||||
hasBullet={true}
|
||||
/>
|
||||
|
||||
@@ -21,7 +21,7 @@ const HeaderUserMenu: FC = () => {
|
||||
<div className='d-flex flex-column'>
|
||||
<div className='fw-bolder d-flex align-items-center fs-5'>
|
||||
{currentUser?.first_name} {currentUser?.first_name}
|
||||
<span className='badge badge-light-success fw-bolder fs-8 px-2 py-1 ms-2'>Pro</span>
|
||||
{/*<span className='badge badge-light-success fw-bolder fs-8 px-2 py-1 ms-2'>Pro</span>*/}
|
||||
</div>
|
||||
<a href='#' className='fw-bold text-muted text-hover-primary fs-7'>
|
||||
{currentUser?.email}
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
stringifyRequestQuery,
|
||||
WithChildren,
|
||||
} from '../../../../../../_digifi/helpers'
|
||||
import {getUsers} from './_requests'
|
||||
import {getStartedUsers} from './_requests'
|
||||
import {User} from './_models'
|
||||
import {useQueryRequest} from './QueryRequestProvider'
|
||||
|
||||
@@ -34,7 +34,7 @@ const QueryResponseProvider: FC<WithChildren> = ({children}) => {
|
||||
} = useQuery(
|
||||
`${QUERIES.USERS_LIST}-${query}`,
|
||||
() => {
|
||||
return getUsers(query)
|
||||
return getStartedUsers(query)
|
||||
},
|
||||
{cacheTime: 0, keepPreviousData: true, refetchOnWindowFocus: false}
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@ export type User = {
|
||||
id?: ID
|
||||
name?: string
|
||||
avatar?: string
|
||||
email?: string
|
||||
// email?: string
|
||||
position?: string
|
||||
role?: string
|
||||
last_login?: string
|
||||
@@ -14,6 +14,21 @@ export type User = {
|
||||
label: string
|
||||
state: string
|
||||
}
|
||||
firstname?: string,
|
||||
lastname?: string
|
||||
uid?: string
|
||||
loan_amount?: string
|
||||
payment_month?: string
|
||||
sales_agent?: string
|
||||
gender?: string | null
|
||||
marital_status?: string
|
||||
email?: string
|
||||
address?: string
|
||||
state?: string
|
||||
country?: string
|
||||
status?: string
|
||||
added?: string
|
||||
updated?: string
|
||||
}
|
||||
|
||||
export type UsersQueryResponse = Response<Array<User>>
|
||||
|
||||
@@ -4,11 +4,18 @@ import { User, UsersQueryResponse } from "./_models";
|
||||
|
||||
const API_URL = import.meta.env.VITE_APP_THEME_API_URL;
|
||||
const USER_URL = `${API_URL}/user`;
|
||||
const GET_USERS_URL = `${API_URL}/users/query`;
|
||||
// const GET_USERS_URL = `${API_URL}/users/query`;
|
||||
|
||||
const getUsers = (query: string): Promise<UsersQueryResponse> => {
|
||||
const NEW_USER_ENDPOINT = import.meta.env.VITE_APP_USER_ENDPOINT
|
||||
|
||||
// const getStartedUsers = (query: string): Promise<UsersQueryResponse> => {
|
||||
// return axios
|
||||
// .get(`${GET_USERS_URL}?${query}`)
|
||||
// .then((d: AxiosResponse<UsersQueryResponse>) => d.data);
|
||||
// };
|
||||
const getStartedUsers = (query: string): Promise<UsersQueryResponse> => {
|
||||
return axios
|
||||
.get(`${GET_USERS_URL}?${query}`)
|
||||
.get(`${NEW_USER_ENDPOINT}/loan/started?${query}`)
|
||||
.then((d: AxiosResponse<UsersQueryResponse>) => d.data);
|
||||
};
|
||||
|
||||
@@ -43,7 +50,7 @@ const deleteSelectedUsers = (userIds: Array<ID>): Promise<void> => {
|
||||
};
|
||||
|
||||
export {
|
||||
getUsers,
|
||||
getStartedUsers,
|
||||
deleteUser,
|
||||
deleteSelectedUsers,
|
||||
getUserById,
|
||||
|
||||
@@ -11,6 +11,7 @@ import {KTCardBody} from '../../../../../../_digifi/helpers'
|
||||
|
||||
const UsersTable = () => {
|
||||
const users = useQueryResponseData()
|
||||
// console.log('users', users)
|
||||
const isLoading = useQueryResponseLoading()
|
||||
const data = useMemo(() => users, [users])
|
||||
const columns = useMemo(() => usersColumns, [])
|
||||
|
||||
@@ -20,26 +20,26 @@ const usersColumns: ReadonlyArray<Column<User>> = [
|
||||
Cell: ({...props}) => <UserInfoCell user={props.data[props.row.index]} />,
|
||||
},
|
||||
{
|
||||
Header: (props) => <UserCustomHeader tableProps={props} title='Role' className='min-w-125px' />,
|
||||
Header: (props) => <UserCustomHeader tableProps={props} title='Amount' className='min-w-125px' />,
|
||||
accessor: 'role',
|
||||
},
|
||||
{
|
||||
Header: (props) => (
|
||||
<UserCustomHeader tableProps={props} title='Last login' className='min-w-125px' />
|
||||
<UserCustomHeader tableProps={props} title='Payment Terms' className='min-w-125px' />
|
||||
),
|
||||
id: 'last_login',
|
||||
Cell: ({...props}) => <UserLastLoginCell last_login={props.data[props.row.index].last_login} />,
|
||||
},
|
||||
{
|
||||
Header: (props) => (
|
||||
<UserCustomHeader tableProps={props} title='Two steps' className='min-w-125px' />
|
||||
<UserCustomHeader tableProps={props} title='Agent' className='min-w-125px' />
|
||||
),
|
||||
id: 'two_steps',
|
||||
Cell: ({...props}) => <UserTwoStepsCell two_steps={props.data[props.row.index].two_steps} />,
|
||||
},
|
||||
{
|
||||
Header: (props) => (
|
||||
<UserCustomHeader tableProps={props} title='Joined day' className='min-w-125px' />
|
||||
<UserCustomHeader tableProps={props} title='Added' className='min-w-125px' />
|
||||
),
|
||||
accessor: 'joined_day',
|
||||
},
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
import axios from "axios";
|
||||
|
||||
export function postAuxEnd(uri:string, reqData:any):Promise<any> {
|
||||
// const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
||||
const formData = new FormData();
|
||||
for (let value in reqData) {
|
||||
formData.append(value, reqData[value]);
|
||||
}
|
||||
return axios.post(uri, reqData)
|
||||
.then((response) => {
|
||||
console.log(response);
|
||||
// if (response.data.internal_return == "-9999") {
|
||||
// localStorage.clear();
|
||||
// window.location.href = `/login?sessionExpired=true`;
|
||||
// }
|
||||
return response;
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.response) {
|
||||
//response status is an error code
|
||||
console.log(
|
||||
"ERROR-------------------------------------------------------"
|
||||
);
|
||||
console.log(error.response.status);
|
||||
console.log(
|
||||
"ERROR-------------------------------------------------------"
|
||||
);
|
||||
} else if (error.request) {
|
||||
//response not received though the request was sent
|
||||
console.log(
|
||||
"ERROR2-------------------------------------------------------"
|
||||
);
|
||||
console.log(error?.request);
|
||||
console.log(
|
||||
"ERROR2-------------------------------------------------------"
|
||||
);
|
||||
} else {
|
||||
//an error occurred when setting up the request
|
||||
console.log(
|
||||
"ERROR3-------------------------------------------------------"
|
||||
);
|
||||
console.log(error);
|
||||
console.log(
|
||||
"ERROR3-------------------------------------------------------"
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
import axios from "axios";
|
||||
import { AuthModel, UserModel } from "./_models";
|
||||
|
||||
import { postAuxEnd } from "./AxiosCallHelper";
|
||||
|
||||
const API_URL = import.meta.env.VITE_APP_API_URL;
|
||||
|
||||
export const GET_USER_BY_ACCESSTOKEN_URL = `${API_URL}/verify_token`;
|
||||
export const LOGIN_URL = `${API_URL}/login`;
|
||||
// export const LOGIN_URL = 'https://digifi-apidev.chiefsoft.net/digibko/v1/identity/token'
|
||||
export const REGISTER_URL = `${API_URL}/register`;
|
||||
export const REQUEST_PASSWORD_URL = `${API_URL}/forgot_password`;
|
||||
|
||||
// Server should return AuthModel
|
||||
//Function to login user in // Server should return AuthModel
|
||||
export function login(email: string, password: string) {
|
||||
return axios.post<AuthModel>(LOGIN_URL, {
|
||||
email,
|
||||
password,
|
||||
});
|
||||
// return axios.post<AuthModel>(LOGIN_URL, {
|
||||
// email,
|
||||
// password,
|
||||
// });
|
||||
|
||||
// let formData = new FormData()
|
||||
// formData.append('username', email)
|
||||
// formData.append('pass', password)
|
||||
// return axios.post<AuthModel>(LOGIN_URL, formData);
|
||||
|
||||
return postAuxEnd(LOGIN_URL, {email, password})
|
||||
}
|
||||
|
||||
// Server should return AuthModel
|
||||
|
||||
@@ -147,9 +147,9 @@ const ProcessHeader: FC = () => {
|
||||
<Link
|
||||
className={
|
||||
`nav-link text-active-primary me-6 ` +
|
||||
(location.pathname === '/crafted/pages/process/started' && 'active')
|
||||
(location.pathname === '/loan/pages/process/started' && 'active')
|
||||
}
|
||||
to='/crafted/pages/process/started'
|
||||
to='/loan/pages/process/started'
|
||||
>
|
||||
Started
|
||||
</Link>
|
||||
@@ -158,9 +158,9 @@ const ProcessHeader: FC = () => {
|
||||
<Link
|
||||
className={
|
||||
`nav-link text-active-primary me-6 ` +
|
||||
(location.pathname === '/crafted/pages/process/pending' && 'active')
|
||||
(location.pathname === '/loan/pages/process/pending' && 'active')
|
||||
}
|
||||
to='/crafted/pages/process/pending'
|
||||
to='/loan/pages/process/pending'
|
||||
>
|
||||
Pending
|
||||
</Link>
|
||||
@@ -169,9 +169,9 @@ const ProcessHeader: FC = () => {
|
||||
<Link
|
||||
className={
|
||||
`nav-link text-active-primary me-6 ` +
|
||||
(location.pathname === '/crafted/pages/process/ready' && 'active')
|
||||
(location.pathname === '/loan/pages/process/ready' && 'active')
|
||||
}
|
||||
to='/crafted/pages/process/ready'
|
||||
to='/loan/pages/process/ready'
|
||||
>
|
||||
Ready
|
||||
</Link>
|
||||
@@ -180,9 +180,9 @@ const ProcessHeader: FC = () => {
|
||||
<Link
|
||||
className={
|
||||
`nav-link text-active-primary me-6 ` +
|
||||
(location.pathname === '/crafted/pages/process/approved' && 'active')
|
||||
(location.pathname === '/loan/pages/process/approved' && 'active')
|
||||
}
|
||||
to='/crafted/pages/process/approved'
|
||||
to='/loan/pages/process/approved'
|
||||
>
|
||||
Approved
|
||||
</Link>
|
||||
@@ -191,9 +191,9 @@ const ProcessHeader: FC = () => {
|
||||
<Link
|
||||
className={
|
||||
`nav-link text-active-primary me-6 ` +
|
||||
(location.pathname === '/crafted/pages/process/rejected' && 'active')
|
||||
(location.pathname === '/loan/pages/process/rejected' && 'active')
|
||||
}
|
||||
to='/crafted/pages/process/rejected'
|
||||
to='/loan/pages/process/rejected'
|
||||
>
|
||||
Rejected
|
||||
</Link>
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import {Navigate, Routes, Route, Outlet} from 'react-router-dom'
|
||||
import {PageLink, PageTitle} from '../../../_digifi/layout/core'
|
||||
import {Overview} from './components/Overview'
|
||||
import {Projects} from './components/Projects'
|
||||
import {Campaigns} from './components/Campaigns'
|
||||
import {Documents} from './components/Documents'
|
||||
import {Connections} from './components/Connections'
|
||||
import {ProcessHeader} from './ProcessHeader'
|
||||
// import {Overview} from './components/Overview'
|
||||
// import {Projects} from './components/Projects'
|
||||
// import {Campaigns} from './components/Campaigns'
|
||||
// import {Documents} from './components/Documents'
|
||||
// import {Connections} from './components/Connections'
|
||||
// import {ProcessHeader} from './ProcessHeader'
|
||||
import { StartedUserList } from './components/StartedUserList'
|
||||
|
||||
const processBreadCrumbs: Array<PageLink> = [
|
||||
{
|
||||
title: 'Loan',
|
||||
path: '/crafted/pages/process/started',
|
||||
path: '/loan/pages/process/started',
|
||||
isSeparator: false,
|
||||
isActive: false,
|
||||
},
|
||||
@@ -27,7 +28,7 @@ const ProcessPage = () => (
|
||||
<Route
|
||||
element={
|
||||
<>
|
||||
<ProcessHeader />
|
||||
{/* <ProcessHeader /> */}
|
||||
<Outlet />
|
||||
</>
|
||||
}
|
||||
@@ -37,7 +38,7 @@ const ProcessPage = () => (
|
||||
element={
|
||||
<>
|
||||
<PageTitle breadcrumbs={processBreadCrumbs}>Started</PageTitle>
|
||||
<Overview />
|
||||
<StartedUserList />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
@@ -46,7 +47,7 @@ const ProcessPage = () => (
|
||||
element={
|
||||
<>
|
||||
<PageTitle breadcrumbs={processBreadCrumbs}>Pending</PageTitle>
|
||||
<Projects />
|
||||
<StartedUserList />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
@@ -55,7 +56,7 @@ const ProcessPage = () => (
|
||||
element={
|
||||
<>
|
||||
<PageTitle breadcrumbs={processBreadCrumbs}>Ready</PageTitle>
|
||||
<Campaigns />
|
||||
<StartedUserList />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
@@ -64,7 +65,7 @@ const ProcessPage = () => (
|
||||
element={
|
||||
<>
|
||||
<PageTitle breadcrumbs={processBreadCrumbs}>Approved</PageTitle>
|
||||
<Documents />
|
||||
<StartedUserList />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
@@ -73,11 +74,11 @@ const ProcessPage = () => (
|
||||
element={
|
||||
<>
|
||||
<PageTitle breadcrumbs={processBreadCrumbs}>Rejected</PageTitle>
|
||||
<Connections />
|
||||
<StartedUserList />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
<Route index element={<Navigate to='/crafted/pages/profile/started' />} />
|
||||
<Route index element={<Navigate to='/loan/pages/profile/started' />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import { KTCard } from "../../../../_digifi/helpers"
|
||||
import { Content } from "../../../../_digifi/layout/components/content"
|
||||
import { ToolbarWrapper } from "../../../../_digifi/layout/components/toolbar"
|
||||
import { UsersListHeader } from "../../apps/user-management/users-list/components/header/UsersListHeader"
|
||||
import { ListViewProvider, useListView } from "../../apps/user-management/users-list/core/ListViewProvider"
|
||||
import { QueryRequestProvider } from "../../apps/user-management/users-list/core/QueryRequestProvider"
|
||||
import { QueryResponseProvider } from "../../apps/user-management/users-list/core/QueryResponseProvider"
|
||||
import { UsersTable } from "../../apps/user-management/users-list/table/UsersTable"
|
||||
import { UserEditModal } from "../../apps/user-management/users-list/user-edit-modal/UserEditModal"
|
||||
|
||||
const UsersList = () => {
|
||||
const {itemIdForUpdate} = useListView()
|
||||
return (
|
||||
<>
|
||||
<KTCard>
|
||||
<UsersListHeader />
|
||||
<UsersTable />
|
||||
</KTCard>
|
||||
{itemIdForUpdate !== undefined && <UserEditModal />}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
const StartedUserList = () => (
|
||||
<QueryRequestProvider>
|
||||
<QueryResponseProvider>
|
||||
<ListViewProvider>
|
||||
<ToolbarWrapper />
|
||||
<Content>
|
||||
<UsersList />
|
||||
</Content>
|
||||
</ListViewProvider>
|
||||
</QueryResponseProvider>
|
||||
</QueryRequestProvider>
|
||||
)
|
||||
|
||||
export {StartedUserList}
|
||||
@@ -27,7 +27,7 @@ const PrivateRoutes = () => {
|
||||
<Route path='menu-test' element={<MenuTestPage />} />
|
||||
{/* Lazy Modules */}
|
||||
<Route
|
||||
path='crafted/pages/process/*'
|
||||
path='loan/pages/process/*'
|
||||
element={
|
||||
<SuspensedView>
|
||||
<ProcessPage />
|
||||
|
||||