This commit is contained in:
fro1991
2025-02-01 19:49:27 +07:00
parent 42c2a8e481
commit 13a2c4d42c
57 changed files with 159 additions and 295 deletions

2
.env
View File

@ -1,4 +1,4 @@
VITE_APP_NAME=brillian-bri-tl
VITE_APP_NAME=tpay-dashboard-tl
VITE_APP_VERSION=1=9.1.1
GENERATE_SOURCEMAP=false

View File

@ -1,7 +1,6 @@
VITE_APP_NAME=brillian-bri-tl
VITE_APP_NAME=tpay-dashboard-tl
VITE_APP_VERSION=1=9.1.1
GENERATE_SOURCEMAP=false
VITE_APP_API_URL=https://tpay.shiblysolution.id/api
VITE_BASE_URL=/dashboard/
VITE_ENV=development

View File

@ -1,4 +1,4 @@
VITE_APP_NAME=brillian-bri-tl
VITE_APP_NAME=tpay-dashboard-tl
VITE_APP_VERSION=1=9.1.1
GENERATE_SOURCEMAP=false

View File

@ -2,6 +2,6 @@ VITE_APP_NAME=brillian-bri-tl
VITE_APP_VERSION=1=9.1.1
GENERATE_SOURCEMAP=false
VITE_APP_API_URL=https://brilianapps.shiblysolution.id/api
VITE_BASE_URL=/credit/
VITE_APP_API_URL=https://tpay.shiblysolution.id/api
VITE_BASE_URL=/dashboard/
VITE_ENV=staging

View File

@ -1,26 +1,30 @@
<!doctype html>
<html class="h-full" lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/media/app/favicon.ico" />
<!-- <link rel="icon" href="/media/app/app-logo.png.png" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="utf-8" />
<meta name="description" content="" />
<meta
name="keywords"
content="keenthemes,react,material,kit,application,dashboard,admin,template"
/>
<meta name="author" content="Metronic - Tailwind React Template" />
<style type="text/css"></style>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700"
/>
</head>
<head>
<meta charset="utf-8" />
<link rel="icon" href="/media/app/favicon.ico" />
<!-- <link rel="icon" href="/media/app/bri_tl_logo.png" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charSet="utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="keenthemes,react,material,kit,application,dashboard,admin,template" />
<meta name="author" content="Metronic - Tailwind React Template" />
<style type="text/css">
</style>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link 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"
style="overflow:visible !important; margin-right:0 !important; position:static !important;">
<div class="flex grow" id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
<body
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>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

6
package-lock.json generated
View File

@ -43,6 +43,7 @@
"cmdk": "^1.0.4",
"date-fns": "^3.0.0",
"formik": "^2.4.6",
"https": "^1.0.0",
"leaflet": "^1.9.4",
"lucide-react": "^0.456.0",
"mini-svg-data-uri": "^1.4.4",
@ -6014,6 +6015,11 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"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": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz",

View File

@ -50,6 +50,7 @@
"cmdk": "^1.0.4",
"date-fns": "^3.0.0",
"formik": "^2.4.6",
"https": "^1.0.0",
"leaflet": "^1.9.4",
"lucide-react": "^0.456.0",
"mini-svg-data-uri": "^1.4.4",

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 KiB

View File

@ -9,7 +9,7 @@ interface SaveLogsParams {
action: string;
}
const API_URL = apiConfig.service_user;
const API_URL = apiConfig.service_dashboard;
const getCurrentTimeJakarta = () => {
const jakartaTime = new Date().toLocaleString('id-ID', {
@ -38,7 +38,6 @@ export async function doSaveLogActivity(payload: SaveLogsParams): Promise<Action
refresh_token: token.refresh_token,
url: window.location.href,
data_body: getCurrentTimeJakarta(),
application: 'credit'
};
const response = await axios.post(`${API_URL}/user_activity/create`, dtParams);

View File

@ -1,7 +1,7 @@
import axios from 'axios';
import { apiConfig } from '@/config/api.config';
import { ActionMenuReponseTypes, RoleList } from '@/types/GlobalTypes';
const API_URL = apiConfig.service_user;
const API_URL = apiConfig.service_dashboard;
export async function doGetNavbarMenu(): Promise<ActionMenuReponseTypes> {
try {
@ -12,7 +12,7 @@ export async function doGetNavbarMenu(): Promise<ActionMenuReponseTypes> {
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) {
throw new Error(response.data.message ?? 'Failed to fetch navbar menu');
}

View File

@ -1,11 +1,10 @@
import { User as Auth0UserModel } from '@auth0/auth0-spa-js';
import { getData, setData } from '@/utils';
import { type AuthModel } from './_models';
// import https from 'https'
const AUTH_LOCAL_STORAGE_KEY = `${import.meta.env.VITE_APP_NAME}-auth-v${
import.meta.env.VITE_APP_VERSION
}`;
const AUTH_LOCAL_STORAGE_KEY = `${import.meta.env.VITE_APP_NAME}-auth-v${import.meta.env.VITE_APP_VERSION
}`;
const getAuth = (): AuthModel | undefined => {
try {
@ -40,25 +39,12 @@ const removeAuth = () => {
export function setupAxios(axios: any) {
axios.defaults.headers.Accept = 'application/json';
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();
if (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;
},
async (err: any) => await Promise.reject(err)

View File

@ -22,7 +22,6 @@ const loginSchema = Yup.object().shape({
const initialValues = {
username: '',
password: '',
application: 'credit',
remember: false
};
@ -46,8 +45,8 @@ const Login = () => {
throw new Error('JWTProvider is required for this form.');
}
await login(values.username, values.password, values.application);
console.log(login);
await login(values.username, values.password);
// console.log(login);
if (values.remember) {
localStorage.setItem('username', values.username);
@ -75,28 +74,14 @@ const Login = () => {
};
return (
<div className="card max-w-[390px] border-0 shadow-none w-full">
<form className="card-body flex flex-col gap-5 p-5" onSubmit={formik.handleSubmit} noValidate>
<div className="flex align-center justify-center text-center mb-2.5">
<img
src={toAbsoluteUrl('/media/app/bri_tl_logo.png')}
className="h-[50px] max-w-none mb-2 text-center"
alt=""
/>
</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 className="card max-w-[390px] w-full">
<form
className="card-body flex flex-col gap-5 p-10"
onSubmit={formik.handleSubmit}
noValidate
>
<div className="text-center">
<h3 className="text-lg font-semibold text-gray-900 leading-none ">Sign in</h3>
</div>
{formik.status && <Alert variant="danger">{formik.status}</Alert>}
<div className="flex flex-col gap-1">
@ -176,9 +161,8 @@ const Login = () => {
{loading ? 'Please wait...' : 'Sign In'}
</button>
<div>
<p className="text-2sm" style={{ fontSize: '12px', letterSpacing: 0.25 }}>
Copyright {moment().year()} &copy; Bank Rakyat Indonesia Timor Leste.All rights
reserved.
<p className="text-2sm text-center" style={{ fontSize: '12px', letterSpacing: 0.25 }}>
Copyright {moment().year()} &copy; Telkomcel All rights reserved.
</p>
</div>
</form>

View File

@ -14,7 +14,7 @@ import { type AuthModel, type UserModel } from '@/auth';
import { apiConfig } from '@/config/api.config';
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 FORGOT_PASSWORD_URL = `${API_URL}/reset_password`;
@ -28,7 +28,7 @@ interface AuthContextProps {
saveAuth: (auth: AuthModel | undefined) => void;
currentUser: 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>;
changePassword: (token: string, password: string, password_confirmation: string) => Promise<void>;
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 {
const { data: auth } = await axios
.post(LOGIN_URL, { username, password, application })
.post(LOGIN_URL, { username, password })
.then((response) => response.data);
// console.log('auth :', auth);
saveAuth({ ...auth.token, id: auth.user.id, role_name: auth.role_name, user: auth.user });
setCurrentUser(auth.user);
const createActivity = {

View File

@ -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">
<img
className="h-[30px] max-w-none"
src={toAbsoluteUrl('/media/app/mini-logo.svg')}
src={toAbsoluteUrl('/media/app/app-logo.png')}
alt="logo"
/>
<div className="text-gray-500 font-medium text-sm">Loading...</div>

View File

@ -1,18 +1,12 @@
interface apiConfigProps {
service_user: string;
service_dashboard: 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 apiConfig: apiConfigProps = {
service_user: `${API_URL}/u`,
service_dashboard: `${API_URL}/d`,
service_master_data: `${API_URL}/m`,
service_bank: `${API_URL}/b`,
service_bg: `${API_URL}/bg`,
service_credit: `${API_URL}/c`
};
export { apiConfig };

View File

@ -7,50 +7,6 @@ export const MENU_SIDEBAR: TMenuConfig = [
{
title: 'Dashboard',
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 = [
{
title: 'Pengajuan Kredit',
title: 'Dashboard',
icon: 'setting-2',
rootPath: '/',
path: '/',

View File

@ -1,71 +1,59 @@
import { Link, Outlet } from 'react-router-dom';
import { Fragment, useState, useEffect } from 'react';
import { Fragment } from 'react';
import { toAbsoluteUrl } from '@/utils';
import useBodyClasses from '@/hooks/useBodyClasses';
import { AuthBrandedLayoutProvider } from './AuthBrandedLayoutProvider';
const Layout = () => {
const backgroundImages = [
'/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);
// Applying body classes to manage the background color in dark mode
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 (
<Fragment>
<div className="flex h-full w-full">
<div
className="order-1 lg:order-1 hidden md:block xl:bg-cover lg:w-8/12 bg-no-repeat branded-bg"
style={{ borderRadius: 0 }}
>
<div className="relative h-screen w-full overflow-hidden">
<img
src={`${toAbsoluteUrl(backgroundImages[currentImageIndex])}`}
className={`absolute top-0 left-0 h-full w-full transition-opacity duration-3000 ${
isTransitioning ? 'opacity-0' : 'opacity-100'
}`}
style={{ objectFit: 'cover' }}
alt={`Background ${currentImageIndex}`}
/>
<style>
{`
.branded-bg {
background-image: url('${toAbsoluteUrl('/media/images/2600x1600/7.png')}');
}
.dark .branded-bg {
background-image: url('${toAbsoluteUrl('/media/images/2600x1600/1-dark.png')}');
}
`}
</style>
{/* Next Image */}
<img
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">
<div className="grid lg:grid-cols-2 grow">
<div className="flex justify-center items-center p-8 lg:p-10 order-2 lg:order-1">
<Outlet />
</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 TPAYs
<span className="text-gray-900 font-semibold">
<br />
transaction management, reporting tools, and configuration settings.
</span>
</div>
</div>
</div>
</div>
</div>
</Fragment>
);
};
// AuthBrandedLayout component that wraps the Layout component with AuthBrandedLayoutProvider
const AuthBrandedLayout = () => (
<AuthBrandedLayoutProvider>
<Layout />

View File

@ -43,59 +43,19 @@ const HeaderLogo = () => {
alt="logo"
/> */}
<img
src={toAbsoluteUrl('/media/app/bri_tl_logo.png')}
src={toAbsoluteUrl('/media/app/app-logo.png')}
className="dark:hidden h-10"
alt="logo"
/>
<img
src={toAbsoluteUrl('/media/app/bri_tl_logo.png')}
src={toAbsoluteUrl('/media/app/app-logo.png')}
className="hidden dark:inline-block min-h-[42px]"
alt="logo"
/>
</Link>
<div className="flex items-center">
<h3 className="text-gray-700 text-base hidden md:block">Brillian Apps</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>
<h3 className="text-gray-700 text-base hidden md:block">TPAY Dashboard Portal</h3>
</div>
</div>
);

View File

@ -14,6 +14,7 @@ const BasicSettings = () => {
// const user = localStorage.getItem('user');
// const parsedUser = user ? JSON.parse(user) : null;
const parsedUser = getAuth()?.user;
console.log('parsedUser :', parsedUser);
const [newUsername, setNewUsername] = useState<string>(parsedUser?.username || '');
const [newEmail, setNewEmail] = useState<string>(parsedUser?.email || '');
const [newName, setNewName] = useState<string>(parsedUser?.name || '');

View File

@ -34,7 +34,7 @@ const initialProps: ContextProps = {
const AccountUserProfileContext = createContext<ContextProps>(initialProps);
const API_URL = apiConfig.service_user;
const API_URL = apiConfig.service_dashboard;
const AccountUserProfileContextProvider = ({ children }: { children: React.ReactNode }) => {
/* state */
@ -60,8 +60,7 @@ const AccountUserProfileContextProvider = ({ children }: { children: React.React
try {
const validate = await PostData(`${API_URL}/login`, {
password: newPassword.current_password,
username: newPassword.username,
application: 'credit'
username: newPassword.username
});
if (!validate || !validate.status) {

View File

@ -26,7 +26,7 @@ const initialProps: ContextProps = {
const LogActivityContext = createContext<ContextProps>(initialProps);
const API_URL = apiConfig.service_user;
const API_URL = apiConfig.service_dashboard;
const LogActivityContextProvider = ({ children }: { children: React.ReactNode }) => {
/* state */
@ -122,9 +122,7 @@ const LogActivityContextProvider = ({ children }: { children: React.ReactNode })
sorting = [{ id: 'user_activity.created_at', desc }];
let dataFilter: any = {
application: 'credit'
};
let dataFilter: any = {};
if (filter && filter.length > 0) {
filter.forEach((f: any) => {
@ -153,7 +151,6 @@ const LogActivityContextProvider = ({ children }: { children: React.ReactNode })
order_field: sorting[0].id,
order_direction: sorting[0].desc === false ? 'ASC' : 'DESC',
filter: JSON.stringify(dataFilter),
token: parsedUser?.access_token,
all_user: all_user
});
@ -172,9 +169,7 @@ const LogActivityContextProvider = ({ children }: { children: React.ReactNode })
if (auth) {
all_user = auth.role_name === 'Super Admin';
}
let dataFilter: any = {
application: 'credit'
};
let dataFilter: any = {};
if (filter && filter.length > 0) {
filter.forEach((f: any) => {

View File

@ -8,18 +8,17 @@ import {
DialogHeader,
DialogTitle
} from '@/components/ui/dialog';
import { useManagePositionContext } from '../hooks';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
import { apiConfig } from '@/config/api.config';
import { Alert, KeenIcon, useDataGrid } from '@/components';
import { Alert, useDataGrid } from '@/components';
import { toast } from 'sonner';
import { useCallApi } from '@/hooks';
import { Checkbox } from '@/components/ui/checkbox';
import { doSaveLogActivity } from '@/actions/GlobalActions';
const API_URL = apiConfig.service_user;
const API_URL = apiConfig.service_dashboard;
interface MenuItem {
id: string;
@ -88,7 +87,7 @@ const AddDialog = () => {
name: formField.name,
roles: selectMenus,
status: 'Y',
application: 'credit'
application: 'ukln'
});
if (response?.status) {
@ -112,35 +111,36 @@ const AddDialog = () => {
return (
<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">
<DialogTitle></DialogTitle>
<DialogDescription></DialogDescription>
<div className="flex items-center justify-between flex-wrap grow">
<div className="flex flex-col justify-center">
<div className="flex items-center justify-between flex-wrap grow gap-5 pb-7.5">
<div className="flex flex-col justify-center gap-2">
<h1 className="text-xl font-semibold leading-none text-gray-900">
Positions - Create
</h1>
<div className="flex items-center gap-2 text-sm font-normal text-gray-700"></div>
</div>
<div
className="cursor-pointer hover:opacity-100 opacity-50"
onClick={() => {
handleAddDialog(false);
}}
<Button
variant={'outline'}
color="#ddd"
size={'sm'}
onClick={() => handleAddDialog(false)}
>
<KeenIcon icon="cross" className="text-1.5xl" />
</div>
Close
</Button>
</div>
</DialogHeader>
<DialogBody className="scrollable-y px-0 pb-0" ref={parentRef}>
<div className="flex flex-col px-0">
<DialogBody className="scrollable-y py-0 mb-5 ps-0 pe-3 -me-7" ref={parentRef}>
<div className="flex flex-col items-stretch grow gap-5 lg:gap-7.5">
{alert.show && (
<Alert variant="danger" className="mb-3">
<Alert variant="danger">
<h3>{alert.message}</h3>
</Alert>
)}
<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="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>
@ -157,8 +157,8 @@ const AddDialog = () => {
<div className="grid md:grid-cols-3 w-full gap-5">
{menus.map((menu) => (
<div className="card " key={menu.id}>
<div className="card-body p-5 pt-2">
<div className="card" key={menu.id}>
<div className="card-body">
<MenuItemComponent
menu={menu}
selectMenus={selectMenus}
@ -169,7 +169,7 @@ const AddDialog = () => {
))}
</div>
<div className="flex justify-end">
<div className="flex justify-end pt-2.5">
<Button className="btn btn-primary" type="submit">
Save Changes
</Button>

View File

@ -15,7 +15,7 @@ import { useCallApi } from '@/hooks';
import { doSaveLogActivity } from '@/actions/GlobalActions';
import { EnforceSwitch } from '@/components/switch';
const API_URL = apiConfig.service_user;
const API_URL = apiConfig.service_dashboard;
const DeleteDialog = () => {
const { showDeleteDialog, handleDeleteDialog, selectedPosition } = useManagePositionContext();

View File

@ -25,7 +25,7 @@ import {
} from '@/components/ui/select';
import { doSaveLogActivity } from '@/actions/GlobalActions';
const API_URL = apiConfig.service_user;
const API_URL = apiConfig.service_dashboard;
interface MenuItem {
id: string;
@ -99,8 +99,7 @@ const EditDialog = () => {
const response = await PutData(`${API_URL}/user_role/update/${selectedPosition.id}`, {
name: formField.name,
roles: selectMenus,
status: formField.status,
application: 'credit'
status: formField.status
});
if (response?.status) {

View File

@ -38,7 +38,7 @@ const initialProps: ContextProps = {
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 ManagePositionContextProvider = ({ children }: { children: React.ReactNode }) => {
@ -141,7 +141,7 @@ const ManagePositionContextProvider = ({ children }: { children: React.ReactNode
with_deleted: false,
order_field: sorting[0].id,
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 };
@ -154,9 +154,9 @@ const ManagePositionContextProvider = ({ children }: { children: React.ReactNode
with_deleted: false,
order_field: 'order_number',
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) {
setMenus(() => [...response.data.list]);
} else {

View File

@ -35,7 +35,7 @@ interface CreateUserParams {
status: string;
}
const API_URL = apiConfig.service_user;
const API_URL = apiConfig.service_dashboard;
type PasswordType = 'password' | 'retype_password';
const AddDialog = () => {

View File

@ -9,7 +9,7 @@ import { useCallApi } from '@/hooks';
import { doSaveLogActivity } from '@/actions/GlobalActions';
import { EnforceSwitch } from '@/components/switch';
const API_URL = apiConfig.service_user;
const API_URL = apiConfig.service_dashboard;
const DeleteDialog = () => {
const { showDeleteDialog, handleDeleteDialog, selectedUser } = useUserContext();

View File

@ -24,7 +24,7 @@ import { toast } from 'sonner';
import { useCallApi } from '@/hooks';
import { doSaveLogActivity } from '@/actions/GlobalActions';
const API_URL = apiConfig.service_user;
const API_URL = apiConfig.service_dashboard;
const EditDialog = () => {
const parentRef = useRef<any | null>(null);
@ -86,7 +86,7 @@ const EditDialog = () => {
const doFetchUserData = useCallback(async (id: string) => {
const response = await GetData(`${API_URL}/user/detail/${id}`, { id });
if (response?.status) {
let id_role = response.data.roles.filter((item: any) => item.application.id == 'credit');
let id_role = response.data.roles;
setFormField((prev) => ({
...prev,

View File

@ -47,7 +47,7 @@ const initialProps: ContextProps = {
const ConfigUserContext = createContext<ContextProps>(initialProps);
const API_URL = apiConfig.service_user;
const API_URL = apiConfig.service_dashboard;
const ConfigUserContextProvider = ({ children }: { children: React.ReactNode }) => {
/* state */
@ -114,9 +114,7 @@ const ConfigUserContextProvider = ({ children }: { children: React.ReactNode })
let html = <p className="text-danger italic">Unassigned</p>;
for (let _role of roles) {
if (_role.application.id == 'credit') {
html = _role.name;
}
html = _role.name;
}
return html;
},
@ -200,8 +198,7 @@ const ConfigUserContextProvider = ({ children }: { children: React.ReactNode })
order_field: 'name',
order_direction: 'ASC',
filter: JSON.stringify({
status: 'Y',
application: 'credit'
status: 'Y'
})
};
const response = await GetData(`${API_URL}/user_role/list`, params);

View File

@ -7,7 +7,7 @@ import { Demo2Layout } from '@/layouts/demo2';
import { ErrorsRouting } from '@/errors';
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 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 CreditAddPage from '@/pages/pengajuan_kredit/list/CreditAddPage';
import LogActivityPage from '@/pages/configuration/user/log-activity/LogActivityPage';
import ManagePositionPage from '@/pages/configuration/user/manage-position/ManagePositionPage';
import LogActivityPage from '@/pages/settings/user/log-activity/LogActivityPage';
import ManagePositionPage from '@/pages/settings/user/manage-position/ManagePositionPage';
import InstansiPage from '@/pages/instansi/InstansiPage';
@ -28,18 +28,10 @@ const AppRoutingSetup = (): ReactElement => {
<Route path="/" element={<DashboardHomePage />} />
<Route path="/account/home/user-profile" element={<AccountUserProfilePage />} />
<Route path="/pengajuan_kredit/chart" element={<CreditChartPage />} />
<Route path="/pengajuan_kredit/summary" element={<CreditSummaryPage />} />
<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 path="/settings/user-management/manage-user" element={<ConfigUserPage />} />
<Route path="/settings/user-management/log-activity" element={<LogActivityPage />} />
<Route
path="/configuration/user-management/manage-position"
path="/settings/user-management/manage-position"
element={<ManagePositionPage />}
/>
</Route>

View File

@ -2764,6 +2764,11 @@ hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-
dependencies:
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:
version "7.1.1"
resolved "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz"