Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f7f728c066 | |||
| 3845ecbefe | |||
| 43b0e60db2 | |||
| 51e06716e5 | |||
| 9d7605ebfe | |||
| 54b550b624 | |||
| cead31a6d1 | |||
| 4508743be4 | |||
| 7d43300724 | |||
| e05d465c2f | |||
| 75a7496164 | |||
| 25b48416b7 | |||
| 996eee612d |
@@ -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
|
||||
@@ -1,14 +1,17 @@
|
||||
PORT=3011
|
||||
VITE_APP_BASE_LAYOUT_CONFIG_KEY='metronic-react-demo1-8150'
|
||||
VITE_APP_API_URL=https://preview.keenthemes.com/metronic8/laravel/api
|
||||
VITE_APP_BASE_LAYOUT_CONFIG_KEY='digifi-agent'
|
||||
VITE_APP_API_URL=https://dev-agents.digifi.com
|
||||
VITE_APP_VERSION=v8.2.3
|
||||
VITE_APP_THEME_NAME=WrenchBoard
|
||||
VITE_APP_THEME_DEMO=demo1
|
||||
VITE_APP_THEME_NAME=digifi
|
||||
VITE_APP_THEME_DEMO=digifi
|
||||
VITE_APP_BOOTSTRAP_DOCS_LINK=https://getbootstrap.com/docs/5.0
|
||||
VITE_APP_SASS_PATH=src/_digifi/assets/sass/core/components
|
||||
VITE_APP_SASS_VARIABLES_PATH=src/_digifi/assets/sass/core/components/_variables.scss
|
||||
VITE_APP_PURCHASE_URL=https://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469
|
||||
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_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
|
||||
|
||||
# CUSTOM ENV VARIABLES ADDED
|
||||
VITE_APP_USER_ENDPOINT=https://digifi-apidev.chiefsoft.net/digibko/v1
|
||||
@@ -1,14 +1,17 @@
|
||||
PORT=3011
|
||||
VITE_APP_BASE_LAYOUT_CONFIG_KEY='metronic-react-demo1-8150'
|
||||
VITE_APP_API_URL=https://preview.keenthemes.com/metronic8/laravel/api
|
||||
VITE_APP_BASE_LAYOUT_CONFIG_KEY='digifi-agent'
|
||||
VITE_APP_API_URL=https://dev-agents.digifi.com
|
||||
VITE_APP_VERSION=v8.2.3
|
||||
VITE_APP_THEME_NAME=DigiFi
|
||||
VITE_APP_THEME_DEMO=demo1
|
||||
VITE_APP_THEME_NAME=digifi
|
||||
VITE_APP_THEME_DEMO=digifi
|
||||
VITE_APP_BOOTSTRAP_DOCS_LINK=https://getbootstrap.com/docs/5.0
|
||||
VITE_APP_SASS_PATH=src/_digifi/assets/sass/core/components
|
||||
VITE_APP_SASS_VARIABLES_PATH=src/_digifi/assets/sass/core/components/_variables.scss
|
||||
VITE_APP_PURCHASE_URL=https://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469
|
||||
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_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
|
||||
|
||||
# CUSTOM ENV VARIABLES ADDED
|
||||
VITE_APP_USER_ENDPOINT=https://digifi-apidev.chiefsoft.net/digibko/v1
|
||||
|
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 |
@@ -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> => { // FUNCTION TO GET USERS THAT HAVE STARTED LOAN APPLICATION
|
||||
return axios
|
||||
.get(`${GET_USERS_URL}?${query}`)
|
||||
.get(`${NEW_USER_ENDPOINT}/loan/started`)
|
||||
.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',
|
||||
},
|
||||
|
||||
@@ -53,9 +53,9 @@ export function setupAxios(axios: any) {
|
||||
axios.interceptors.request.use(
|
||||
(config: {headers: {Authorization: string}}) => {
|
||||
const auth = getAuth()
|
||||
if (auth && auth.api_token) {
|
||||
config.headers.Authorization = `Bearer ${auth.api_token}`
|
||||
}
|
||||
// if (auth && auth.api_token) {
|
||||
// config.headers.Authorization = `Bearer ${auth.api_token}`
|
||||
// }
|
||||
|
||||
return config
|
||||
},
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
import axios from "axios";
|
||||
|
||||
export function postAuxEnd(uri:string, reqData:any):Promise<any> {
|
||||
const endPoint = import.meta.env.VITE_APP_USER_ENDPOINT + uri;
|
||||
const formData = new FormData();
|
||||
for (let value in reqData) {
|
||||
formData.append(value, reqData[value]);
|
||||
}
|
||||
return axios.post(endPoint, formData)
|
||||
.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,6 +1,18 @@
|
||||
export interface AuthModel {
|
||||
api_token: string
|
||||
refreshToken?: string
|
||||
|
||||
message?: string
|
||||
call_return?: string
|
||||
username: string
|
||||
token?: string
|
||||
id?: string
|
||||
first_name?: string
|
||||
last_name?: string
|
||||
email?: string
|
||||
email_verified_at?: string
|
||||
created_at?: string
|
||||
updated_at?: string
|
||||
}
|
||||
|
||||
export interface UserAddressModel {
|
||||
@@ -64,4 +76,13 @@ export interface UserModel {
|
||||
communication?: UserCommunicationModel
|
||||
address?: UserAddressModel
|
||||
socialNetworks?: UserSocialNetworksModel
|
||||
|
||||
api_token: string
|
||||
refreshToken?: string
|
||||
message?: string
|
||||
call_return?: string
|
||||
token?: string
|
||||
email_verified_at?: string
|
||||
created_at?: string
|
||||
updated_at?: string
|
||||
}
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
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 GET_USER_BY_ACCESSTOKEN_URL = `${API_URL}/verify_token`;
|
||||
// export const LOGIN_URL = `${API_URL}/login`;
|
||||
|
||||
export const GET_USER_BY_ACCESSTOKEN_URL = '/identity/verify_token'
|
||||
export const LOGIN_URL = '/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,
|
||||
// });
|
||||
return postAuxEnd(LOGIN_URL, {username:email, pass:password})
|
||||
}
|
||||
|
||||
// Server should return AuthModel
|
||||
@@ -40,8 +46,12 @@ export function requestPassword(email: string) {
|
||||
});
|
||||
}
|
||||
|
||||
// export function getUserByToken(token: string) {
|
||||
// return axios.post<UserModel>(GET_USER_BY_ACCESSTOKEN_URL, {
|
||||
// api_token: token,
|
||||
// });
|
||||
// }
|
||||
|
||||
export function getUserByToken(token: string) {
|
||||
return axios.post<UserModel>(GET_USER_BY_ACCESSTOKEN_URL, {
|
||||
api_token: token,
|
||||
});
|
||||
return postAuxEnd(GET_USER_BY_ACCESSTOKEN_URL, {token})
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
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> = [
|
||||
{
|
||||
@@ -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,7 +74,7 @@ const ProcessPage = () => (
|
||||
element={
|
||||
<>
|
||||
<PageTitle breadcrumbs={processBreadCrumbs}>Rejected</PageTitle>
|
||||
<Connections />
|
||||
<StartedUserList />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -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}
|
||||