Update Versi 1.5.27 #32

Merged
bagasbanuna merged 1009 commits from staging into main 2025-12-17 12:22:28 +08:00
34 changed files with 567 additions and 46 deletions
Showing only changes of commit b638865c33 - Show all commits

View File

@@ -1,20 +0,0 @@
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { funGlobal_getUserById } from "@/app_modules/_global/fun/get/fun_get_user_by_id";
import { redirect } from "next/navigation";
export default async function Layout({
children,
}: {
children: React.ReactNode;
}) {
const userLoginId = await funGetUserIdByToken();
const dataUser = await funGlobal_getUserById({
userId: userLoginId as string,
});
if (dataUser?.masterUserRoleId != "1")
return redirect(RouterAdminDashboard.splash_admin);
return <>{children}</>;
}

View File

@@ -14,6 +14,7 @@ export default async function Layout({
const authorId = dataProfile?.userId;
const userLoginId = await funGetUserIdByToken();
const userRoleId = dataProfile?.User?.masterUserRoleId;
return (
<>
@@ -21,6 +22,7 @@ export default async function Layout({
profileId={profileId}
userLoginId={userLoginId as string}
authorId={authorId as any}
userRoleId={userRoleId as string}
>
{children}
</KatalogLayout>

View File

@@ -14,6 +14,7 @@ import {
Menu,
Modal,
Popover,
SimpleGrid,
Stack,
Text,
Title,
@@ -82,11 +83,21 @@ export function Admin_ComponentButtonUserCircle({
<Divider />
<Center>
<Button radius={"xl"} onClick={() => setOpenModal(true)}>
<SimpleGrid cols={2}>
<Button
radius={"xl"}
onClick={() => router.push("/dev/home", { scroll: false })}
>
User Access
</Button>
<Button
radius={"xl"}
color="red"
onClick={() => setOpenModal(true)}
>
Keluar
</Button>
</Center>
</SimpleGrid>
</Stack>
</Popover.Dropdown>
</Popover>

View File

@@ -11,10 +11,12 @@ export function ComponentKatalog_ButtonHeaderRight({
profileId,
userLoginId,
authorId,
userRoleId,
}: {
profileId: string;
userLoginId: string;
authorId: string;
userRoleId: string
}) {
const [opened, { open, close }] = useDisclosure();
@@ -33,6 +35,7 @@ export function ComponentKatalog_ButtonHeaderRight({
close={() => close()}
profileId={profileId}
userId={userLoginId}
userRoleId={userRoleId}
/>
</>
);

View File

@@ -1,3 +1,4 @@
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
import {
RouterPortofolio,
RouterProfile,
@@ -14,6 +15,7 @@ import {
Text,
} from "@mantine/core";
import {
IconDashboard,
IconEdit,
IconPencilPlus,
IconPhotoEdit,
@@ -27,16 +29,19 @@ export function ComponentKatalog_DrawerKatalog({
opened,
close,
profileId,
userId
userId,
userRoleId
}: {
opened: boolean;
close: () => void;
profileId: string;
userId: string
userRoleId: string
}) {
const router = useRouter();
const [pageId, setPageId] = useState("");
const [isLoading, setIsLoading] = useState(false);
const [isLoadingAdmin, setIsLoadingAdmin] = useState(false);
const listPage = [
{
@@ -125,6 +130,27 @@ export function ComponentKatalog_DrawerKatalog({
))}
<Component_ButtonLogout userId={userId} />
{userRoleId != "1" && (
<Stack align="center" spacing={"xs"}>
<ActionIcon
variant="transparent"
c="white"
onClick={() => {
router.push(RouterAdminDashboard.main_admin, { scroll: false });
setIsLoadingAdmin(true);
}}
>
{isLoadingAdmin ? (
<ComponentGlobal_Loader />
) : (
<IconDashboard/>
)}
</ActionIcon>
<Text align="center" color="white">
Dashboard Admin
</Text>
</Stack>
)}
</SimpleGrid>
</Stack>
</Drawer>

View File

@@ -9,11 +9,13 @@ export default function KatalogLayout({
profileId,
userLoginId,
authorId,
userRoleId,
}: {
children: any;
profileId: any;
userLoginId: string;
authorId: string;
userRoleId: string
}) {
return (
<>
@@ -26,6 +28,7 @@ export default function KatalogLayout({
profileId={profileId}
userLoginId={userLoginId}
authorId={authorId as any}
userRoleId={userRoleId}
/>
}
/>

View File

@@ -10,13 +10,15 @@ import { useState } from "react";
export function Profile_ComponentLoadBackgroundImage({
fileId,
size
}: {
fileId: string;
size?: number
}) {
const router = useRouter();
const [isImage, setIsImage] = useState<boolean | null>(null);
const [isLoading, setLoading] = useState(false);
const url = APIs.GET({ fileId: fileId });
const url = APIs.GET({ fileId: fileId,size: size ? size.toString() : "200" });
useShallowEffect(() => {
onLoadImage();

View File

@@ -68,6 +68,7 @@ export function Profile_UiView({
<Box>
<Profile_ComponentLoadBackgroundImage
fileId={profile.imageBackgroundId as any}
size={500}
/>
<Box