update
2
.env
@ -1,4 +1,4 @@
|
|||||||
VITE_APP_NAME=brillian-bri-tl
|
VITE_APP_NAME=tpay-dashboard-tl
|
||||||
VITE_APP_VERSION=1=9.1.1
|
VITE_APP_VERSION=1=9.1.1
|
||||||
GENERATE_SOURCEMAP=false
|
GENERATE_SOURCEMAP=false
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
VITE_APP_NAME=brillian-bri-tl
|
VITE_APP_NAME=tpay-dashboard-tl
|
||||||
VITE_APP_VERSION=1=9.1.1
|
VITE_APP_VERSION=1=9.1.1
|
||||||
GENERATE_SOURCEMAP=false
|
GENERATE_SOURCEMAP=false
|
||||||
|
|
||||||
VITE_APP_API_URL=https://tpay.shiblysolution.id/api
|
VITE_APP_API_URL=https://tpay.shiblysolution.id/api
|
||||||
VITE_BASE_URL=/dashboard/
|
|
||||||
VITE_ENV=development
|
VITE_ENV=development
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
VITE_APP_NAME=brillian-bri-tl
|
VITE_APP_NAME=tpay-dashboard-tl
|
||||||
VITE_APP_VERSION=1=9.1.1
|
VITE_APP_VERSION=1=9.1.1
|
||||||
GENERATE_SOURCEMAP=false
|
GENERATE_SOURCEMAP=false
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,6 @@ VITE_APP_NAME=brillian-bri-tl
|
|||||||
VITE_APP_VERSION=1=9.1.1
|
VITE_APP_VERSION=1=9.1.1
|
||||||
GENERATE_SOURCEMAP=false
|
GENERATE_SOURCEMAP=false
|
||||||
|
|
||||||
VITE_APP_API_URL=https://brilianapps.shiblysolution.id/api
|
VITE_APP_API_URL=https://tpay.shiblysolution.id/api
|
||||||
VITE_BASE_URL=/credit/
|
VITE_BASE_URL=/dashboard/
|
||||||
VITE_ENV=staging
|
VITE_ENV=staging
|
||||||
32
index.html
@ -1,26 +1,30 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html class="h-full" lang="en" dir="ltr">
|
<html class="h-full" lang="en" dir="ltr">
|
||||||
|
<head>
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="/media/app/favicon.ico" />
|
<link rel="icon" href="/media/app/favicon.ico" />
|
||||||
<!-- <link rel="icon" href="/media/app/bri_tl_logo.png" /> -->
|
<!-- <link rel="icon" href="/media/app/app-logo.png.png" /> -->
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta charSet="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="description" content="" />
|
<meta name="description" content="" />
|
||||||
<meta name="keywords" content="keenthemes,react,material,kit,application,dashboard,admin,template" />
|
<meta
|
||||||
|
name="keywords"
|
||||||
|
content="keenthemes,react,material,kit,application,dashboard,admin,template"
|
||||||
|
/>
|
||||||
<meta name="author" content="Metronic - Tailwind React Template" />
|
<meta name="author" content="Metronic - Tailwind React Template" />
|
||||||
<style type="text/css">
|
<style type="text/css"></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700" />
|
<link
|
||||||
</head>
|
rel="stylesheet"
|
||||||
|
href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700"
|
||||||
|
/>
|
||||||
|
</head>
|
||||||
|
|
||||||
<body class="antialiased flex h-full text-base text-gray-700"
|
<body
|
||||||
style="overflow:visible !important; margin-right:0 !important; position:static !important;">
|
class="antialiased flex h-full text-base text-gray-700"
|
||||||
|
style="overflow: visible !important; margin-right: 0 !important; position: static !important"
|
||||||
|
>
|
||||||
<div class="flex grow" id="root"></div>
|
<div class="flex grow" id="root"></div>
|
||||||
<script type="module" src="/src/main.tsx"></script>
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
6
package-lock.json
generated
@ -43,6 +43,7 @@
|
|||||||
"cmdk": "^1.0.4",
|
"cmdk": "^1.0.4",
|
||||||
"date-fns": "^3.0.0",
|
"date-fns": "^3.0.0",
|
||||||
"formik": "^2.4.6",
|
"formik": "^2.4.6",
|
||||||
|
"https": "^1.0.0",
|
||||||
"leaflet": "^1.9.4",
|
"leaflet": "^1.9.4",
|
||||||
"lucide-react": "^0.456.0",
|
"lucide-react": "^0.456.0",
|
||||||
"mini-svg-data-uri": "^1.4.4",
|
"mini-svg-data-uri": "^1.4.4",
|
||||||
@ -6014,6 +6015,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||||
},
|
},
|
||||||
|
"node_modules/https": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/https/-/https-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-4EC57ddXrkaF0x83Oj8sM6SLQHAWXw90Skqu2M4AEWENZ3F02dFJE/GARA8igO79tcgYqGrD7ae4f5L3um2lgg=="
|
||||||
|
},
|
||||||
"node_modules/idb": {
|
"node_modules/idb": {
|
||||||
"version": "7.1.1",
|
"version": "7.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz",
|
||||||
|
|||||||
@ -50,6 +50,7 @@
|
|||||||
"cmdk": "^1.0.4",
|
"cmdk": "^1.0.4",
|
||||||
"date-fns": "^3.0.0",
|
"date-fns": "^3.0.0",
|
||||||
"formik": "^2.4.6",
|
"formik": "^2.4.6",
|
||||||
|
"https": "^1.0.0",
|
||||||
"leaflet": "^1.9.4",
|
"leaflet": "^1.9.4",
|
||||||
"lucide-react": "^0.456.0",
|
"lucide-react": "^0.456.0",
|
||||||
"mini-svg-data-uri": "^1.4.4",
|
"mini-svg-data-uri": "^1.4.4",
|
||||||
|
|||||||
BIN
public/media/app/app-logo.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 814 B |
|
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 15 KiB |
BIN
public/media/images/2600x1600/7.png
Normal file
|
After Width: | Height: | Size: 336 KiB |
BIN
public/media/images/2600x1600/bg-7.png
Normal file
|
After Width: | Height: | Size: 336 KiB |
@ -9,7 +9,7 @@ interface SaveLogsParams {
|
|||||||
action: string;
|
action: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
|
|
||||||
const getCurrentTimeJakarta = () => {
|
const getCurrentTimeJakarta = () => {
|
||||||
const jakartaTime = new Date().toLocaleString('id-ID', {
|
const jakartaTime = new Date().toLocaleString('id-ID', {
|
||||||
@ -38,7 +38,6 @@ export async function doSaveLogActivity(payload: SaveLogsParams): Promise<Action
|
|||||||
refresh_token: token.refresh_token,
|
refresh_token: token.refresh_token,
|
||||||
url: window.location.href,
|
url: window.location.href,
|
||||||
data_body: getCurrentTimeJakarta(),
|
data_body: getCurrentTimeJakarta(),
|
||||||
application: 'credit'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const response = await axios.post(`${API_URL}/user_activity/create`, dtParams);
|
const response = await axios.post(`${API_URL}/user_activity/create`, dtParams);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { apiConfig } from '@/config/api.config';
|
import { apiConfig } from '@/config/api.config';
|
||||||
import { ActionMenuReponseTypes, RoleList } from '@/types/GlobalTypes';
|
import { ActionMenuReponseTypes, RoleList } from '@/types/GlobalTypes';
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
|
|
||||||
export async function doGetNavbarMenu(): Promise<ActionMenuReponseTypes> {
|
export async function doGetNavbarMenu(): Promise<ActionMenuReponseTypes> {
|
||||||
try {
|
try {
|
||||||
@ -12,7 +12,7 @@ export async function doGetNavbarMenu(): Promise<ActionMenuReponseTypes> {
|
|||||||
throw new Error('No authentication token found');
|
throw new Error('No authentication token found');
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await axios.put(`${API_URL}/renew_token/${token.refresh_token}/credit`);
|
const response = await axios.put(`${API_URL}/renew_token/${token.refresh_token}`);
|
||||||
if (response.status !== 200 || !response.data.status) {
|
if (response.status !== 200 || !response.data.status) {
|
||||||
throw new Error(response.data.message ?? 'Failed to fetch navbar menu');
|
throw new Error(response.data.message ?? 'Failed to fetch navbar menu');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
import { User as Auth0UserModel } from '@auth0/auth0-spa-js';
|
import { User as Auth0UserModel } from '@auth0/auth0-spa-js';
|
||||||
|
|
||||||
import { getData, setData } from '@/utils';
|
import { getData, setData } from '@/utils';
|
||||||
import { type AuthModel } from './_models';
|
import { type AuthModel } from './_models';
|
||||||
|
// import https from 'https'
|
||||||
|
|
||||||
const AUTH_LOCAL_STORAGE_KEY = `${import.meta.env.VITE_APP_NAME}-auth-v${
|
const AUTH_LOCAL_STORAGE_KEY = `${import.meta.env.VITE_APP_NAME}-auth-v${import.meta.env.VITE_APP_VERSION
|
||||||
import.meta.env.VITE_APP_VERSION
|
}`;
|
||||||
}`;
|
|
||||||
|
|
||||||
const getAuth = (): AuthModel | undefined => {
|
const getAuth = (): AuthModel | undefined => {
|
||||||
try {
|
try {
|
||||||
@ -40,25 +39,12 @@ const removeAuth = () => {
|
|||||||
export function setupAxios(axios: any) {
|
export function setupAxios(axios: any) {
|
||||||
axios.defaults.headers.Accept = 'application/json';
|
axios.defaults.headers.Accept = 'application/json';
|
||||||
axios.interceptors.request.use(
|
axios.interceptors.request.use(
|
||||||
(config: { headers: { Authorization: string }; params?: any; url?: any }) => {
|
(config: { headers: { Authorization: string }; params?: any; url?: any; httpsAgent: any }) => {
|
||||||
const auth = getAuth();
|
const auth = getAuth();
|
||||||
|
|
||||||
if (auth?.access_token) {
|
if (auth?.access_token) {
|
||||||
config.headers.Authorization = `Bearer ${auth.access_token}`;
|
config.headers.Authorization = `Bearer ${auth.access_token}`;
|
||||||
|
|
||||||
if (
|
|
||||||
config.url &&
|
|
||||||
!config.url.includes('api/b/') &&
|
|
||||||
!config.url.includes('api/bg/') &&
|
|
||||||
!config.url.includes('api/c/')
|
|
||||||
) {
|
|
||||||
config.params = {
|
|
||||||
...config.params,
|
|
||||||
token: auth.access_token || ''
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
async (err: any) => await Promise.reject(err)
|
async (err: any) => await Promise.reject(err)
|
||||||
|
|||||||
@ -22,7 +22,6 @@ const loginSchema = Yup.object().shape({
|
|||||||
const initialValues = {
|
const initialValues = {
|
||||||
username: '',
|
username: '',
|
||||||
password: '',
|
password: '',
|
||||||
application: 'credit',
|
|
||||||
remember: false
|
remember: false
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -46,8 +45,8 @@ const Login = () => {
|
|||||||
throw new Error('JWTProvider is required for this form.');
|
throw new Error('JWTProvider is required for this form.');
|
||||||
}
|
}
|
||||||
|
|
||||||
await login(values.username, values.password, values.application);
|
await login(values.username, values.password);
|
||||||
console.log(login);
|
// console.log(login);
|
||||||
|
|
||||||
if (values.remember) {
|
if (values.remember) {
|
||||||
localStorage.setItem('username', values.username);
|
localStorage.setItem('username', values.username);
|
||||||
@ -75,28 +74,14 @@ const Login = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card max-w-[390px] border-0 shadow-none w-full">
|
<div className="card max-w-[390px] w-full">
|
||||||
<form className="card-body flex flex-col gap-5 p-5" onSubmit={formik.handleSubmit} noValidate>
|
<form
|
||||||
<div className="flex align-center justify-center text-center mb-2.5">
|
className="card-body flex flex-col gap-5 p-10"
|
||||||
<img
|
onSubmit={formik.handleSubmit}
|
||||||
src={toAbsoluteUrl('/media/app/bri_tl_logo.png')}
|
noValidate
|
||||||
className="h-[50px] max-w-none mb-2 text-center"
|
>
|
||||||
alt=""
|
<div className="text-center">
|
||||||
/>
|
<h3 className="text-lg font-semibold text-gray-900 leading-none ">Sign in</h3>
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-3">
|
|
||||||
<div className="flex gap-3 items-center">
|
|
||||||
<div>
|
|
||||||
<img
|
|
||||||
src={toAbsoluteUrl('/media/app/brilian_apps_logo.png')}
|
|
||||||
className="h-[40px] max-w-none"
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<h3 className="font-semibold text-gray-700" style={{ fontSize: '18px' }}>
|
|
||||||
/ Pengajuan Kredit
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{formik.status && <Alert variant="danger">{formik.status}</Alert>}
|
{formik.status && <Alert variant="danger">{formik.status}</Alert>}
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-1">
|
||||||
@ -176,9 +161,8 @@ const Login = () => {
|
|||||||
{loading ? 'Please wait...' : 'Sign In'}
|
{loading ? 'Please wait...' : 'Sign In'}
|
||||||
</button>
|
</button>
|
||||||
<div>
|
<div>
|
||||||
<p className="text-2sm" style={{ fontSize: '12px', letterSpacing: 0.25 }}>
|
<p className="text-2sm text-center" style={{ fontSize: '12px', letterSpacing: 0.25 }}>
|
||||||
Copyright {moment().year()} © Bank Rakyat Indonesia Timor Leste.
All rights
|
Copyright {moment().year()} © Telkomcel All rights reserved.
|
||||||
reserved.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import { type AuthModel, type UserModel } from '@/auth';
|
|||||||
import { apiConfig } from '@/config/api.config';
|
import { apiConfig } from '@/config/api.config';
|
||||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
|
|
||||||
export const LOGIN_URL = `${API_URL}/login`;
|
export const LOGIN_URL = `${API_URL}/login`;
|
||||||
export const FORGOT_PASSWORD_URL = `${API_URL}/reset_password`;
|
export const FORGOT_PASSWORD_URL = `${API_URL}/reset_password`;
|
||||||
@ -28,7 +28,7 @@ interface AuthContextProps {
|
|||||||
saveAuth: (auth: AuthModel | undefined) => void;
|
saveAuth: (auth: AuthModel | undefined) => void;
|
||||||
currentUser: UserModel | undefined;
|
currentUser: UserModel | undefined;
|
||||||
setCurrentUser: Dispatch<SetStateAction<UserModel | undefined>>;
|
setCurrentUser: Dispatch<SetStateAction<UserModel | undefined>>;
|
||||||
login: (email: string, password: string, application: string) => Promise<void>;
|
login: (email: string, password: string) => Promise<void>;
|
||||||
requestPasswordResetLink: (email: string) => Promise<void>;
|
requestPasswordResetLink: (email: string) => Promise<void>;
|
||||||
changePassword: (token: string, password: string, password_confirmation: string) => Promise<void>;
|
changePassword: (token: string, password: string, password_confirmation: string) => Promise<void>;
|
||||||
getUser: () => Promise<AxiosResponse<any> | {}>;
|
getUser: () => Promise<AxiosResponse<any> | {}>;
|
||||||
@ -70,13 +70,12 @@ const AuthProvider = ({ children }: PropsWithChildren) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const login = async (username: string, password: string, application: string) => {
|
const login = async (username: string, password: string) => {
|
||||||
try {
|
try {
|
||||||
const { data: auth } = await axios
|
const { data: auth } = await axios
|
||||||
.post(LOGIN_URL, { username, password, application })
|
.post(LOGIN_URL, { username, password })
|
||||||
.then((response) => response.data);
|
.then((response) => response.data);
|
||||||
|
|
||||||
// console.log('auth :', auth);
|
|
||||||
saveAuth({ ...auth.token, id: auth.user.id, role_name: auth.role_name, user: auth.user });
|
saveAuth({ ...auth.token, id: auth.user.id, role_name: auth.role_name, user: auth.user });
|
||||||
setCurrentUser(auth.user);
|
setCurrentUser(auth.user);
|
||||||
const createActivity = {
|
const createActivity = {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ const ScreenLoader = () => {
|
|||||||
<div className="flex flex-col items-center gap-2 justify-center fixed inset-0 z-50 bg-light transition-opacity duration-700 ease-in-out">
|
<div className="flex flex-col items-center gap-2 justify-center fixed inset-0 z-50 bg-light transition-opacity duration-700 ease-in-out">
|
||||||
<img
|
<img
|
||||||
className="h-[30px] max-w-none"
|
className="h-[30px] max-w-none"
|
||||||
src={toAbsoluteUrl('/media/app/mini-logo.svg')}
|
src={toAbsoluteUrl('/media/app/app-logo.png')}
|
||||||
alt="logo"
|
alt="logo"
|
||||||
/>
|
/>
|
||||||
<div className="text-gray-500 font-medium text-sm">Loading...</div>
|
<div className="text-gray-500 font-medium text-sm">Loading...</div>
|
||||||
|
|||||||
@ -1,18 +1,12 @@
|
|||||||
interface apiConfigProps {
|
interface apiConfigProps {
|
||||||
service_user: string;
|
service_dashboard: string;
|
||||||
service_master_data: string;
|
service_master_data: string;
|
||||||
service_bank: string;
|
|
||||||
service_bg: string;
|
|
||||||
service_credit: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const API_URL = import.meta.env.VITE_APP_API_URL;
|
const API_URL = import.meta.env.VITE_APP_API_URL;
|
||||||
const apiConfig: apiConfigProps = {
|
const apiConfig: apiConfigProps = {
|
||||||
service_user: `${API_URL}/u`,
|
service_dashboard: `${API_URL}/d`,
|
||||||
service_master_data: `${API_URL}/m`,
|
service_master_data: `${API_URL}/m`,
|
||||||
service_bank: `${API_URL}/b`,
|
|
||||||
service_bg: `${API_URL}/bg`,
|
|
||||||
service_credit: `${API_URL}/c`
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export { apiConfig };
|
export { apiConfig };
|
||||||
|
|||||||
@ -7,50 +7,6 @@ export const MENU_SIDEBAR: TMenuConfig = [
|
|||||||
{
|
{
|
||||||
title: 'Dashboard',
|
title: 'Dashboard',
|
||||||
path: '/'
|
path: '/'
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Pengajuan Kredit',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
title: 'Chart',
|
|
||||||
path: '/pengajuan_kredit/chart'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Summary',
|
|
||||||
path: '/pengajuan_kredit/summary'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'List',
|
|
||||||
path: '/pengajuan_kredit/list'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Instansi',
|
|
||||||
path: '/instansi'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Configuration',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
title: 'User Management',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
title: 'Manage Position',
|
|
||||||
path: '/configuration/user-management/manage-position'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Manage User',
|
|
||||||
path: '/configuration/user-management/manage-user'
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: 'Log Activity',
|
|
||||||
path: '/configuration/user-management/log-activity'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -67,7 +23,7 @@ export const MENU_SIDEBAR: TMenuConfig = [
|
|||||||
|
|
||||||
export const MENU_ROOT: TMenuConfig = [
|
export const MENU_ROOT: TMenuConfig = [
|
||||||
{
|
{
|
||||||
title: 'Pengajuan Kredit',
|
title: 'Dashboard',
|
||||||
icon: 'setting-2',
|
icon: 'setting-2',
|
||||||
rootPath: '/',
|
rootPath: '/',
|
||||||
path: '/',
|
path: '/',
|
||||||
|
|||||||
@ -1,71 +1,59 @@
|
|||||||
import { Link, Outlet } from 'react-router-dom';
|
import { Link, Outlet } from 'react-router-dom';
|
||||||
import { Fragment, useState, useEffect } from 'react';
|
import { Fragment } from 'react';
|
||||||
import { toAbsoluteUrl } from '@/utils';
|
import { toAbsoluteUrl } from '@/utils';
|
||||||
import useBodyClasses from '@/hooks/useBodyClasses';
|
import useBodyClasses from '@/hooks/useBodyClasses';
|
||||||
import { AuthBrandedLayoutProvider } from './AuthBrandedLayoutProvider';
|
import { AuthBrandedLayoutProvider } from './AuthBrandedLayoutProvider';
|
||||||
|
|
||||||
const Layout = () => {
|
const Layout = () => {
|
||||||
const backgroundImages = [
|
// Applying body classes to manage the background color in dark mode
|
||||||
'/media/login-image/img_01.jpg',
|
|
||||||
'/media/login-image/img_02.jpg',
|
|
||||||
'/media/login-image/img_03.jpg'
|
|
||||||
];
|
|
||||||
|
|
||||||
const [currentImageIndex, setCurrentImageIndex] = useState(0);
|
|
||||||
const [nextImageIndex, setNextImageIndex] = useState(1);
|
|
||||||
const [isTransitioning, setIsTransitioning] = useState(false);
|
|
||||||
useBodyClasses('dark:bg-coal-500');
|
useBodyClasses('dark:bg-coal-500');
|
||||||
useEffect(() => {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
const nextIndex = (currentImageIndex + 1) % backgroundImages.length;
|
|
||||||
setNextImageIndex(nextIndex);
|
|
||||||
setIsTransitioning(true);
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
setCurrentImageIndex(nextIndex);
|
|
||||||
setIsTransitioning(false);
|
|
||||||
}, 3000);
|
|
||||||
}, 5000);
|
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}, [currentImageIndex, backgroundImages.length]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div className="flex h-full w-full">
|
<style>
|
||||||
<div
|
{`
|
||||||
className="order-1 lg:order-1 hidden md:block xl:bg-cover lg:w-8/12 bg-no-repeat branded-bg"
|
.branded-bg {
|
||||||
style={{ borderRadius: 0 }}
|
background-image: url('${toAbsoluteUrl('/media/images/2600x1600/7.png')}');
|
||||||
>
|
}
|
||||||
<div className="relative h-screen w-full overflow-hidden">
|
.dark .branded-bg {
|
||||||
<img
|
background-image: url('${toAbsoluteUrl('/media/images/2600x1600/1-dark.png')}');
|
||||||
src={`${toAbsoluteUrl(backgroundImages[currentImageIndex])}`}
|
}
|
||||||
className={`absolute top-0 left-0 h-full w-full transition-opacity duration-3000 ${
|
`}
|
||||||
isTransitioning ? 'opacity-0' : 'opacity-100'
|
</style>
|
||||||
}`}
|
|
||||||
style={{ objectFit: 'cover' }}
|
|
||||||
alt={`Background ${currentImageIndex}`}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Next Image */}
|
<div className="grid lg:grid-cols-2 grow">
|
||||||
<img
|
<div className="flex justify-center items-center p-8 lg:p-10 order-2 lg:order-1">
|
||||||
src={`${toAbsoluteUrl(backgroundImages[nextImageIndex])}`}
|
|
||||||
className={`absolute top-0 left-0 h-full w-full transition-opacity duration-3000 ${
|
|
||||||
isTransitioning ? 'opacity-100' : 'opacity-0'
|
|
||||||
}`}
|
|
||||||
style={{ objectFit: 'cover' }}
|
|
||||||
alt={`Background ${nextImageIndex}`}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-center items-center lg:w-4/12 w-full order-2 lg:order-2 bg-white">
|
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="lg:rounded-xl lg:border lg:border-gray-200 lg:m-5 order-1 lg:order-2 bg-top xxl:bg-center xl:bg-cover bg-no-repeat branded-bg">
|
||||||
|
<div className="flex flex-col p-8 lg:p-16 gap-4">
|
||||||
|
<Link to="/">
|
||||||
|
<img
|
||||||
|
src={toAbsoluteUrl('/media/app/app-logo.png')}
|
||||||
|
className="h-12 max-w-none"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-3">
|
||||||
|
<h3 className="text-2xl font-semibold text-gray-900">TPAY Dashboard Portal</h3>
|
||||||
|
<div className="text-base font-medium text-gray-600">
|
||||||
|
A user-friendly interface providing seamless access to TPAY’s
|
||||||
|
<span className="text-gray-900 font-semibold">
|
||||||
|
<br />
|
||||||
|
transaction management, reporting tools, and configuration settings.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// AuthBrandedLayout component that wraps the Layout component with AuthBrandedLayoutProvider
|
||||||
const AuthBrandedLayout = () => (
|
const AuthBrandedLayout = () => (
|
||||||
<AuthBrandedLayoutProvider>
|
<AuthBrandedLayoutProvider>
|
||||||
<Layout />
|
<Layout />
|
||||||
|
|||||||
@ -43,59 +43,19 @@ const HeaderLogo = () => {
|
|||||||
alt="logo"
|
alt="logo"
|
||||||
/> */}
|
/> */}
|
||||||
<img
|
<img
|
||||||
src={toAbsoluteUrl('/media/app/bri_tl_logo.png')}
|
src={toAbsoluteUrl('/media/app/app-logo.png')}
|
||||||
className="dark:hidden h-10"
|
className="dark:hidden h-10"
|
||||||
alt="logo"
|
alt="logo"
|
||||||
/>
|
/>
|
||||||
<img
|
<img
|
||||||
src={toAbsoluteUrl('/media/app/bri_tl_logo.png')}
|
src={toAbsoluteUrl('/media/app/app-logo.png')}
|
||||||
className="hidden dark:inline-block min-h-[42px]"
|
className="hidden dark:inline-block min-h-[42px]"
|
||||||
alt="logo"
|
alt="logo"
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<h3 className="text-gray-700 text-base hidden md:block">Brillian Apps</h3>
|
<h3 className="text-gray-700 text-base hidden md:block">TPAY Dashboard Portal</h3>
|
||||||
<span className="text-sm text-gray-400 font-medium px-2.5 hidden md:inline">/</span>
|
|
||||||
|
|
||||||
<Menu className="menu-default">
|
|
||||||
<MenuItem
|
|
||||||
toggle="dropdown"
|
|
||||||
trigger="hover"
|
|
||||||
dropdownProps={{
|
|
||||||
placement: isRTL() ? 'bottom-end' : 'bottom-start',
|
|
||||||
modifiers: [
|
|
||||||
{
|
|
||||||
name: 'offset',
|
|
||||||
options: {
|
|
||||||
offset: [0, 10] // [skid, distance]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<MenuToggle className="text-gray-900 font-medium">
|
|
||||||
{selectedMenuItem.title}
|
|
||||||
<MenuArrow>
|
|
||||||
<KeenIcon icon="down" />
|
|
||||||
</MenuArrow>
|
|
||||||
</MenuToggle>
|
|
||||||
<MenuSub className="menu-default w-48">
|
|
||||||
{MENU_ROOT.map((item, index) => (
|
|
||||||
<MenuItem key={index} className={item === selectedMenuItem ? 'active' : ''}>
|
|
||||||
<MenuLink path={item.path}>
|
|
||||||
{item.icon && (
|
|
||||||
<MenuIcon>
|
|
||||||
<KeenIcon icon={item.icon} />
|
|
||||||
</MenuIcon>
|
|
||||||
)}
|
|
||||||
<MenuTitle>{item.title}</MenuTitle>
|
|
||||||
</MenuLink>
|
|
||||||
</MenuItem>
|
|
||||||
))}
|
|
||||||
</MenuSub>
|
|
||||||
</MenuItem>
|
|
||||||
</Menu>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -14,6 +14,7 @@ const BasicSettings = () => {
|
|||||||
// const user = localStorage.getItem('user');
|
// const user = localStorage.getItem('user');
|
||||||
// const parsedUser = user ? JSON.parse(user) : null;
|
// const parsedUser = user ? JSON.parse(user) : null;
|
||||||
const parsedUser = getAuth()?.user;
|
const parsedUser = getAuth()?.user;
|
||||||
|
console.log('parsedUser :', parsedUser);
|
||||||
const [newUsername, setNewUsername] = useState<string>(parsedUser?.username || '');
|
const [newUsername, setNewUsername] = useState<string>(parsedUser?.username || '');
|
||||||
const [newEmail, setNewEmail] = useState<string>(parsedUser?.email || '');
|
const [newEmail, setNewEmail] = useState<string>(parsedUser?.email || '');
|
||||||
const [newName, setNewName] = useState<string>(parsedUser?.name || '');
|
const [newName, setNewName] = useState<string>(parsedUser?.name || '');
|
||||||
|
|||||||
@ -34,7 +34,7 @@ const initialProps: ContextProps = {
|
|||||||
|
|
||||||
const AccountUserProfileContext = createContext<ContextProps>(initialProps);
|
const AccountUserProfileContext = createContext<ContextProps>(initialProps);
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
|
|
||||||
const AccountUserProfileContextProvider = ({ children }: { children: React.ReactNode }) => {
|
const AccountUserProfileContextProvider = ({ children }: { children: React.ReactNode }) => {
|
||||||
/* state */
|
/* state */
|
||||||
@ -60,8 +60,7 @@ const AccountUserProfileContextProvider = ({ children }: { children: React.React
|
|||||||
try {
|
try {
|
||||||
const validate = await PostData(`${API_URL}/login`, {
|
const validate = await PostData(`${API_URL}/login`, {
|
||||||
password: newPassword.current_password,
|
password: newPassword.current_password,
|
||||||
username: newPassword.username,
|
username: newPassword.username
|
||||||
application: 'credit'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!validate || !validate.status) {
|
if (!validate || !validate.status) {
|
||||||
|
|||||||
@ -26,7 +26,7 @@ const initialProps: ContextProps = {
|
|||||||
|
|
||||||
const LogActivityContext = createContext<ContextProps>(initialProps);
|
const LogActivityContext = createContext<ContextProps>(initialProps);
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
|
|
||||||
const LogActivityContextProvider = ({ children }: { children: React.ReactNode }) => {
|
const LogActivityContextProvider = ({ children }: { children: React.ReactNode }) => {
|
||||||
/* state */
|
/* state */
|
||||||
@ -122,9 +122,7 @@ const LogActivityContextProvider = ({ children }: { children: React.ReactNode })
|
|||||||
|
|
||||||
sorting = [{ id: 'user_activity.created_at', desc }];
|
sorting = [{ id: 'user_activity.created_at', desc }];
|
||||||
|
|
||||||
let dataFilter: any = {
|
let dataFilter: any = {};
|
||||||
application: 'credit'
|
|
||||||
};
|
|
||||||
|
|
||||||
if (filter && filter.length > 0) {
|
if (filter && filter.length > 0) {
|
||||||
filter.forEach((f: any) => {
|
filter.forEach((f: any) => {
|
||||||
@ -153,7 +151,6 @@ const LogActivityContextProvider = ({ children }: { children: React.ReactNode })
|
|||||||
order_field: sorting[0].id,
|
order_field: sorting[0].id,
|
||||||
order_direction: sorting[0].desc === false ? 'ASC' : 'DESC',
|
order_direction: sorting[0].desc === false ? 'ASC' : 'DESC',
|
||||||
filter: JSON.stringify(dataFilter),
|
filter: JSON.stringify(dataFilter),
|
||||||
token: parsedUser?.access_token,
|
|
||||||
all_user: all_user
|
all_user: all_user
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -172,9 +169,7 @@ const LogActivityContextProvider = ({ children }: { children: React.ReactNode })
|
|||||||
if (auth) {
|
if (auth) {
|
||||||
all_user = auth.role_name === 'Super Admin';
|
all_user = auth.role_name === 'Super Admin';
|
||||||
}
|
}
|
||||||
let dataFilter: any = {
|
let dataFilter: any = {};
|
||||||
application: 'credit'
|
|
||||||
};
|
|
||||||
|
|
||||||
if (filter && filter.length > 0) {
|
if (filter && filter.length > 0) {
|
||||||
filter.forEach((f: any) => {
|
filter.forEach((f: any) => {
|
||||||
@ -8,18 +8,17 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle
|
DialogTitle
|
||||||
} from '@/components/ui/dialog';
|
} from '@/components/ui/dialog';
|
||||||
|
|
||||||
import { useManagePositionContext } from '../hooks';
|
import { useManagePositionContext } from '../hooks';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { apiConfig } from '@/config/api.config';
|
import { apiConfig } from '@/config/api.config';
|
||||||
import { Alert, KeenIcon, useDataGrid } from '@/components';
|
import { Alert, useDataGrid } from '@/components';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { useCallApi } from '@/hooks';
|
import { useCallApi } from '@/hooks';
|
||||||
import { Checkbox } from '@/components/ui/checkbox';
|
import { Checkbox } from '@/components/ui/checkbox';
|
||||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
|
|
||||||
interface MenuItem {
|
interface MenuItem {
|
||||||
id: string;
|
id: string;
|
||||||
@ -88,7 +87,7 @@ const AddDialog = () => {
|
|||||||
name: formField.name,
|
name: formField.name,
|
||||||
roles: selectMenus,
|
roles: selectMenus,
|
||||||
status: 'Y',
|
status: 'Y',
|
||||||
application: 'credit'
|
application: 'ukln'
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response?.status) {
|
if (response?.status) {
|
||||||
@ -112,35 +111,36 @@ const AddDialog = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={showAddDialog} onOpenChange={(open) => handleAddDialog(open)}>
|
<Dialog open={showAddDialog} onOpenChange={(open) => handleAddDialog(open)}>
|
||||||
<DialogContent className="container-fixed max-w-[1024px] flex flex-col p-5 overflow-hidden [&>button]:hidden">
|
<DialogContent className="container-fixed max-w-screen-lg flex flex-col p-10 overflow-hidden [&>button]:hidden">
|
||||||
<DialogHeader className="p-0 border-0">
|
<DialogHeader className="p-0 border-0">
|
||||||
<DialogTitle></DialogTitle>
|
<DialogTitle></DialogTitle>
|
||||||
<DialogDescription></DialogDescription>
|
<DialogDescription></DialogDescription>
|
||||||
<div className="flex items-center justify-between flex-wrap grow">
|
<div className="flex items-center justify-between flex-wrap grow gap-5 pb-7.5">
|
||||||
<div className="flex flex-col justify-center">
|
<div className="flex flex-col justify-center gap-2">
|
||||||
<h1 className="text-xl font-semibold leading-none text-gray-900">
|
<h1 className="text-xl font-semibold leading-none text-gray-900">
|
||||||
Positions - Create
|
Positions - Create
|
||||||
</h1>
|
</h1>
|
||||||
|
<div className="flex items-center gap-2 text-sm font-normal text-gray-700"></div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<Button
|
||||||
className="cursor-pointer hover:opacity-100 opacity-50"
|
variant={'outline'}
|
||||||
onClick={() => {
|
color="#ddd"
|
||||||
handleAddDialog(false);
|
size={'sm'}
|
||||||
}}
|
onClick={() => handleAddDialog(false)}
|
||||||
>
|
>
|
||||||
<KeenIcon icon="cross" className="text-1.5xl" />
|
Close
|
||||||
</div>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<DialogBody className="scrollable-y px-0 pb-0" ref={parentRef}>
|
<DialogBody className="scrollable-y py-0 mb-5 ps-0 pe-3 -me-7" ref={parentRef}>
|
||||||
<div className="flex flex-col px-0">
|
<div className="flex flex-col items-stretch grow gap-5 lg:gap-7.5">
|
||||||
{alert.show && (
|
{alert.show && (
|
||||||
<Alert variant="danger" className="mb-3">
|
<Alert variant="danger">
|
||||||
<h3>{alert.message}</h3>
|
<h3>{alert.message}</h3>
|
||||||
</Alert>
|
</Alert>
|
||||||
)}
|
)}
|
||||||
<form action="" onSubmit={doCreatePosition}>
|
<form action="" onSubmit={doCreatePosition}>
|
||||||
<div className="card-body grid gap-5 p-0">
|
<div className="card-body grid gap-5">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
<label className="form-label flex items-center gap-1 max-w-56">Name</label>
|
<label className="form-label flex items-center gap-1 max-w-56">Name</label>
|
||||||
@ -157,8 +157,8 @@ const AddDialog = () => {
|
|||||||
|
|
||||||
<div className="grid md:grid-cols-3 w-full gap-5">
|
<div className="grid md:grid-cols-3 w-full gap-5">
|
||||||
{menus.map((menu) => (
|
{menus.map((menu) => (
|
||||||
<div className="card " key={menu.id}>
|
<div className="card" key={menu.id}>
|
||||||
<div className="card-body p-5 pt-2">
|
<div className="card-body">
|
||||||
<MenuItemComponent
|
<MenuItemComponent
|
||||||
menu={menu}
|
menu={menu}
|
||||||
selectMenus={selectMenus}
|
selectMenus={selectMenus}
|
||||||
@ -169,7 +169,7 @@ const AddDialog = () => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex justify-end">
|
<div className="flex justify-end pt-2.5">
|
||||||
<Button className="btn btn-primary" type="submit">
|
<Button className="btn btn-primary" type="submit">
|
||||||
Save Changes
|
Save Changes
|
||||||
</Button>
|
</Button>
|
||||||
@ -15,7 +15,7 @@ import { useCallApi } from '@/hooks';
|
|||||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||||
import { EnforceSwitch } from '@/components/switch';
|
import { EnforceSwitch } from '@/components/switch';
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
|
|
||||||
const DeleteDialog = () => {
|
const DeleteDialog = () => {
|
||||||
const { showDeleteDialog, handleDeleteDialog, selectedPosition } = useManagePositionContext();
|
const { showDeleteDialog, handleDeleteDialog, selectedPosition } = useManagePositionContext();
|
||||||
@ -25,7 +25,7 @@ import {
|
|||||||
} from '@/components/ui/select';
|
} from '@/components/ui/select';
|
||||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
|
|
||||||
interface MenuItem {
|
interface MenuItem {
|
||||||
id: string;
|
id: string;
|
||||||
@ -99,8 +99,7 @@ const EditDialog = () => {
|
|||||||
const response = await PutData(`${API_URL}/user_role/update/${selectedPosition.id}`, {
|
const response = await PutData(`${API_URL}/user_role/update/${selectedPosition.id}`, {
|
||||||
name: formField.name,
|
name: formField.name,
|
||||||
roles: selectMenus,
|
roles: selectMenus,
|
||||||
status: formField.status,
|
status: formField.status
|
||||||
application: 'credit'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response?.status) {
|
if (response?.status) {
|
||||||
@ -38,7 +38,7 @@ const initialProps: ContextProps = {
|
|||||||
|
|
||||||
const ManagePositionContext = createContext<ContextProps>(initialProps);
|
const ManagePositionContext = createContext<ContextProps>(initialProps);
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
const API_URL_MD = apiConfig.service_master_data;
|
const API_URL_MD = apiConfig.service_master_data;
|
||||||
|
|
||||||
const ManagePositionContextProvider = ({ children }: { children: React.ReactNode }) => {
|
const ManagePositionContextProvider = ({ children }: { children: React.ReactNode }) => {
|
||||||
@ -141,7 +141,7 @@ const ManagePositionContextProvider = ({ children }: { children: React.ReactNode
|
|||||||
with_deleted: false,
|
with_deleted: false,
|
||||||
order_field: sorting[0].id,
|
order_field: sorting[0].id,
|
||||||
order_direction: sorting[0].desc == false ? 'ASC' : 'DESC',
|
order_direction: sorting[0].desc == false ? 'ASC' : 'DESC',
|
||||||
filter: JSON.stringify({ ...filter, application: 'credit' })
|
filter: JSON.stringify({ ...filter })
|
||||||
});
|
});
|
||||||
|
|
||||||
return { data: response?.data.list, totalCount: response?.data.total_count };
|
return { data: response?.data.list, totalCount: response?.data.total_count };
|
||||||
@ -154,9 +154,9 @@ const ManagePositionContextProvider = ({ children }: { children: React.ReactNode
|
|||||||
with_deleted: false,
|
with_deleted: false,
|
||||||
order_field: 'order_number',
|
order_field: 'order_number',
|
||||||
order_direction: 'ASC',
|
order_direction: 'ASC',
|
||||||
filter: JSON.stringify({ application: 'credit' })
|
filter: JSON.stringify({})
|
||||||
};
|
};
|
||||||
const response = await GetData(`${API_URL_MD}/menu/list`, params);
|
const response = await GetData(`${API_URL}/menus/list`, params);
|
||||||
if (response?.status) {
|
if (response?.status) {
|
||||||
setMenus(() => [...response.data.list]);
|
setMenus(() => [...response.data.list]);
|
||||||
} else {
|
} else {
|
||||||
@ -35,7 +35,7 @@ interface CreateUserParams {
|
|||||||
status: string;
|
status: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
type PasswordType = 'password' | 'retype_password';
|
type PasswordType = 'password' | 'retype_password';
|
||||||
|
|
||||||
const AddDialog = () => {
|
const AddDialog = () => {
|
||||||
@ -9,7 +9,7 @@ import { useCallApi } from '@/hooks';
|
|||||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||||
import { EnforceSwitch } from '@/components/switch';
|
import { EnforceSwitch } from '@/components/switch';
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
|
|
||||||
const DeleteDialog = () => {
|
const DeleteDialog = () => {
|
||||||
const { showDeleteDialog, handleDeleteDialog, selectedUser } = useUserContext();
|
const { showDeleteDialog, handleDeleteDialog, selectedUser } = useUserContext();
|
||||||
@ -24,7 +24,7 @@ import { toast } from 'sonner';
|
|||||||
import { useCallApi } from '@/hooks';
|
import { useCallApi } from '@/hooks';
|
||||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
|
|
||||||
const EditDialog = () => {
|
const EditDialog = () => {
|
||||||
const parentRef = useRef<any | null>(null);
|
const parentRef = useRef<any | null>(null);
|
||||||
@ -86,7 +86,7 @@ const EditDialog = () => {
|
|||||||
const doFetchUserData = useCallback(async (id: string) => {
|
const doFetchUserData = useCallback(async (id: string) => {
|
||||||
const response = await GetData(`${API_URL}/user/detail/${id}`, { id });
|
const response = await GetData(`${API_URL}/user/detail/${id}`, { id });
|
||||||
if (response?.status) {
|
if (response?.status) {
|
||||||
let id_role = response.data.roles.filter((item: any) => item.application.id == 'credit');
|
let id_role = response.data.roles;
|
||||||
|
|
||||||
setFormField((prev) => ({
|
setFormField((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
@ -47,7 +47,7 @@ const initialProps: ContextProps = {
|
|||||||
|
|
||||||
const ConfigUserContext = createContext<ContextProps>(initialProps);
|
const ConfigUserContext = createContext<ContextProps>(initialProps);
|
||||||
|
|
||||||
const API_URL = apiConfig.service_user;
|
const API_URL = apiConfig.service_dashboard;
|
||||||
|
|
||||||
const ConfigUserContextProvider = ({ children }: { children: React.ReactNode }) => {
|
const ConfigUserContextProvider = ({ children }: { children: React.ReactNode }) => {
|
||||||
/* state */
|
/* state */
|
||||||
@ -114,10 +114,8 @@ const ConfigUserContextProvider = ({ children }: { children: React.ReactNode })
|
|||||||
|
|
||||||
let html = <p className="text-danger italic">Unassigned</p>;
|
let html = <p className="text-danger italic">Unassigned</p>;
|
||||||
for (let _role of roles) {
|
for (let _role of roles) {
|
||||||
if (_role.application.id == 'credit') {
|
|
||||||
html = _role.name;
|
html = _role.name;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return html;
|
return html;
|
||||||
},
|
},
|
||||||
meta: {
|
meta: {
|
||||||
@ -200,8 +198,7 @@ const ConfigUserContextProvider = ({ children }: { children: React.ReactNode })
|
|||||||
order_field: 'name',
|
order_field: 'name',
|
||||||
order_direction: 'ASC',
|
order_direction: 'ASC',
|
||||||
filter: JSON.stringify({
|
filter: JSON.stringify({
|
||||||
status: 'Y',
|
status: 'Y'
|
||||||
application: 'credit'
|
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
const response = await GetData(`${API_URL}/user_role/list`, params);
|
const response = await GetData(`${API_URL}/user_role/list`, params);
|
||||||
@ -7,7 +7,7 @@ import { Demo2Layout } from '@/layouts/demo2';
|
|||||||
import { ErrorsRouting } from '@/errors';
|
import { ErrorsRouting } from '@/errors';
|
||||||
|
|
||||||
import DashboardHomePage from '@/pages/dashboards/home/DashboardHomePage';
|
import DashboardHomePage from '@/pages/dashboards/home/DashboardHomePage';
|
||||||
import ConfigUserPage from '@/pages/configuration/user/user/ConfigUserPage';
|
import ConfigUserPage from '@/pages/settings/user/user/ConfigUserPage';
|
||||||
|
|
||||||
import CreditChartPage from '@/pages/pengajuan_kredit/chart/CreditChartPage';
|
import CreditChartPage from '@/pages/pengajuan_kredit/chart/CreditChartPage';
|
||||||
import CreditSummaryPage from '@/pages/pengajuan_kredit/summary/CreditSummaryPage';
|
import CreditSummaryPage from '@/pages/pengajuan_kredit/summary/CreditSummaryPage';
|
||||||
@ -15,8 +15,8 @@ import CreditListPage from '@/pages/pengajuan_kredit/list/CreditListPage';
|
|||||||
import CreditDetailPage from '@/pages/pengajuan_kredit/list/CreditDetailPage';
|
import CreditDetailPage from '@/pages/pengajuan_kredit/list/CreditDetailPage';
|
||||||
import CreditAddPage from '@/pages/pengajuan_kredit/list/CreditAddPage';
|
import CreditAddPage from '@/pages/pengajuan_kredit/list/CreditAddPage';
|
||||||
|
|
||||||
import LogActivityPage from '@/pages/configuration/user/log-activity/LogActivityPage';
|
import LogActivityPage from '@/pages/settings/user/log-activity/LogActivityPage';
|
||||||
import ManagePositionPage from '@/pages/configuration/user/manage-position/ManagePositionPage';
|
import ManagePositionPage from '@/pages/settings/user/manage-position/ManagePositionPage';
|
||||||
|
|
||||||
import InstansiPage from '@/pages/instansi/InstansiPage';
|
import InstansiPage from '@/pages/instansi/InstansiPage';
|
||||||
|
|
||||||
@ -28,18 +28,10 @@ const AppRoutingSetup = (): ReactElement => {
|
|||||||
<Route path="/" element={<DashboardHomePage />} />
|
<Route path="/" element={<DashboardHomePage />} />
|
||||||
<Route path="/account/home/user-profile" element={<AccountUserProfilePage />} />
|
<Route path="/account/home/user-profile" element={<AccountUserProfilePage />} />
|
||||||
|
|
||||||
<Route path="/pengajuan_kredit/chart" element={<CreditChartPage />} />
|
<Route path="/settings/user-management/manage-user" element={<ConfigUserPage />} />
|
||||||
<Route path="/pengajuan_kredit/summary" element={<CreditSummaryPage />} />
|
<Route path="/settings/user-management/log-activity" element={<LogActivityPage />} />
|
||||||
<Route path="/pengajuan_kredit/list" element={<CreditListPage />} />
|
|
||||||
<Route path="/pengajuan_kredit/list/add" element={<CreditAddPage />} />
|
|
||||||
<Route path="/pengajuan_kredit/list/details" element={<CreditDetailPage />} />
|
|
||||||
|
|
||||||
<Route path="/instansi" element={<InstansiPage />} />
|
|
||||||
|
|
||||||
<Route path="/configuration/user-management/manage-user" element={<ConfigUserPage />} />
|
|
||||||
<Route path="/configuration/user-management/log-activity" element={<LogActivityPage />} />
|
|
||||||
<Route
|
<Route
|
||||||
path="/configuration/user-management/manage-position"
|
path="/settings/user-management/manage-position"
|
||||||
element={<ManagePositionPage />}
|
element={<ManagePositionPage />}
|
||||||
/>
|
/>
|
||||||
</Route>
|
</Route>
|
||||||
|
|||||||
@ -2764,6 +2764,11 @@ hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-
|
|||||||
dependencies:
|
dependencies:
|
||||||
react-is "^16.7.0"
|
react-is "^16.7.0"
|
||||||
|
|
||||||
|
https@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.npmjs.org/https/-/https-1.0.0.tgz"
|
||||||
|
integrity sha512-4EC57ddXrkaF0x83Oj8sM6SLQHAWXw90Skqu2M4AEWENZ3F02dFJE/GARA8igO79tcgYqGrD7ae4f5L3um2lgg==
|
||||||
|
|
||||||
idb@7.1.1:
|
idb@7.1.1:
|
||||||
version "7.1.1"
|
version "7.1.1"
|
||||||
resolved "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz"
|
resolved "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz"
|
||||||
|
|||||||