Fix Tampilan Admin dan Modal di Donasi, Voting, dan Job Vacancy

This commit is contained in:
2025-01-21 17:36:54 +08:00
parent b0243977ab
commit a3b815cfea
20 changed files with 359 additions and 118 deletions

View File

@@ -6,7 +6,6 @@ import {
Box,
Button,
Center,
Group,
Modal,
Pagination,
Paper,
@@ -15,20 +14,18 @@ import {
Stack,
Table,
Text,
TextInput,
Title,
TextInput
} from "@mantine/core";
import { useDisclosure } from "@mantine/hooks";
import { IconEyeCheck, IconSearch } from "@tabler/icons-react";
import _ from "lodash";
import { IconReportAnalytics, IconSearch } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
import { useState } from "react";
import ComponentAdminVote_DetailHasil from "../../component/detail_hasil";
import { adminVote_funGetListRiwayat } from "../../fun";
import { AdminVote_getHasilById } from "../../fun/get/get_hasil_by_id";
import { AdminVote_getListKontributorById } from "../../fun/get/get_list_kontributor_by_id";
import { adminVote_funGetListRiwayat } from "../../fun";
import { IconCircleCheckFilled } from "@tabler/icons-react";
export default function AdminVote_Riwayat({
dataVote,
@@ -88,7 +85,7 @@ function TableStatus({ listPublish }: { listPublish: any }) {
}
radius={"xl"}
color="green"
leftIcon={<IconCircleCheckFilled />}
leftIcon={<IconReportAnalytics />}
onClick={async () => {
setVoteId(e?.id);
setLoading(true);
@@ -144,7 +141,21 @@ function TableStatus({ listPublish }: { listPublish: any }) {
<>
<Stack spacing={"xs"} h={"100%"}>
{/* <pre>{JSON.stringify(listUser, null, 2)}</pre> */}
<Group
<ComponentAdminGlobal_TitlePage
name="Riwayat"
color="gray.4"
component={
<TextInput
icon={<IconSearch size={20} />}
radius={"xl"}
placeholder="Masukan judul"
onChange={(val) => {
onSearch(val.currentTarget.value);
}}
/>
}
/>
{/* <Group
position="apart"
bg={"gray.4"}
p={"xs"}
@@ -159,7 +170,7 @@ function TableStatus({ listPublish }: { listPublish: any }) {
onSearch(val.currentTarget.value);
}}
/>
</Group>
</Group> */}
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
<ScrollArea w={"100%"} h={"90%"}>

View File

@@ -26,6 +26,9 @@ import ComponentAdminVote_DetailHasil from "../../component/detail_hasil";
import { AdminVote_getHasilById } from "../../fun/get/get_hasil_by_id";
import { AdminVote_getListKontributorById } from "../../fun/get/get_list_kontributor_by_id";
import { adminVote_funGetListPublish } from "../../fun/get/status/get_list_publish";
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
import { MainColor } from "@/app_modules/_global/color";
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
export default function AdminVote_TablePublish({
dataVote,
@@ -141,7 +144,21 @@ function TableStatus({ listPublish }: { listPublish: any }) {
<>
<Stack spacing={"xs"} h={"100%"}>
{/* <pre>{JSON.stringify(listUser, null, 2)}</pre> */}
<Group
<ComponentAdminGlobal_TitlePage
name="Publish"
color={AdminColor.green}
component={
<TextInput
icon={<IconSearch size={20} />}
radius={"xl"}
placeholder="Masukan judul"
onChange={(val) => {
onSearch(val.currentTarget.value);
}}
/>
}
/>
{/* <Group
position="apart"
bg={"green.4"}
p={"xs"}
@@ -156,7 +173,7 @@ function TableStatus({ listPublish }: { listPublish: any }) {
onSearch(val.currentTarget.value);
}}
/>
</Group>
</Group> */}
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
<ScrollArea w={"100%"} h={"90%"}>

View File

@@ -27,6 +27,9 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import { adminVote_funGetListReject } from "../../fun";
import { AdminVote_funEditCatatanRejectById } from "../../fun/edit/fun_edit_catatan_reject_by_id";
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
import { MainColor } from "@/app_modules/_global/color";
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
export default function AdminVote_TableReject({ dataVote }: { dataVote: any }) {
return (
@@ -169,7 +172,21 @@ function TableStatus({ listData }: { listData: any }) {
<>
<Stack spacing={"xs"} h={"100%"}>
{/* <pre>{JSON.stringify(listUser, null, 2)}</pre> */}
<Group
<ComponentAdminGlobal_TitlePage
name="Reject"
color={AdminColor.red}
component={
<TextInput
icon={<IconSearch size={20} />}
radius={"xl"}
placeholder="Masukan judul"
onChange={(val) => {
onSearch(val.currentTarget.value);
}}
/>
}
/>
{/* <Group
position="apart"
bg={"red.4"}
p={"xs"}
@@ -184,7 +201,7 @@ function TableStatus({ listData }: { listData: any }) {
onSearch(val.currentTarget.value);
}}
/>
</Group>
</Group> */}
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
<ScrollArea w={"100%"} h={"90%"}>

View File

@@ -33,7 +33,7 @@ import {
gs_adminVoting_triggerReview,
IRealtimeData,
} from "@/app/lib/global_state";
import { AccentColor } from "@/app_modules/_global/color";
import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
@@ -46,6 +46,8 @@ import { WibuRealtime } from "wibu-pkg";
import { adminVote_funGetListReview } from "../../fun";
import { AdminVote_funEditStatusPublishById } from "../../fun/edit/fun_edit_status_publish_by_id";
import { AdminEvent_funEditCatatanById } from "../../fun/edit/fun_edit_status_reject_by_id";
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
export default function AdminVote_TableReview({
listVote,
@@ -63,7 +65,8 @@ export default function AdminVote_TableReview({
}
function TableStatus({ listData }: { listData: any }) {
const [opened, { open, close }] = useDisclosure(false);
const [openedReject, { open: openReject, close: closeReject }] = useDisclosure(false);
const [openedPublish, { open: openPublish, close: closePublish }] = useDisclosure(false);
const [data, setData] = useState<MODEL_VOTING[]>(listData.data);
const [isNPage, setNPage] = useState(listData.nPage);
const [votingId, setVotingId] = useState("");
@@ -160,25 +163,28 @@ function TableStatus({ listData }: { listData: any }) {
<td>
<Stack align="center">
<Button
loaderPosition="center"
loading={
e?.id === votingId ? (isLoadingPublish ? true : false) : false
}
// loaderPosition="center"
// loading={
// e?.id === votingId ? (isLoadingPublish ? true : false) : false
// }
w={120}
color={"green"}
leftIcon={<IconCircleCheck />}
radius={"xl"}
onClick={() =>
onPublish({
voteId: e.id,
awalVote: e.awalVote,
setLoadingPublish: setLoadingPublish,
setVotingId: setVotingId,
setData(val) {
setData(val.data);
setNPage(val.nPage);
},
})
onClick={() => {
openPublish();
setVotingId(e.id);
}
// onPublish({
// // voteId: e.id,
// // awalVote: e.awalVote,
// // setLoadingPublish: setLoadingPublish,
// // setVotingId: setVotingId,
// // setData(val) {
// // setData(val.data);
// // setNPage(val.nPage);
// // },
// })
}
>
Publish
@@ -189,7 +195,7 @@ function TableStatus({ listData }: { listData: any }) {
leftIcon={<IconBan />}
radius={"xl"}
onClick={() => {
open();
openReject();
setVotingId(e.id);
}}
>
@@ -204,7 +210,21 @@ function TableStatus({ listData }: { listData: any }) {
<>
<Stack spacing={"xs"} h={"100%"}>
{/* <pre>{JSON.stringify(listUser, null, 2)}</pre> */}
<Group
<ComponentAdminGlobal_TitlePage
name="Review"
color={AdminColor.orange}
component={
<TextInput
icon={<IconSearch size={20} />}
radius={"xl"}
placeholder="Masukan judul"
onChange={(val) => {
onSearch(val.currentTarget.value);
}}
/>
}
/>
{/* <Group
position="apart"
bg={"orange.4"}
p={"xs"}
@@ -219,7 +239,7 @@ function TableStatus({ listData }: { listData: any }) {
onSearch(val.currentTarget.value);
}}
/>
</Group>
</Group> */}
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
{isShowReload && (
@@ -296,8 +316,8 @@ function TableStatus({ listData }: { listData: any }) {
</Stack>
<Modal
opened={opened}
onClose={close}
opened={openedReject}
onClose={closeReject}
centered
withCloseButton={false}
size={"md"}
@@ -315,7 +335,7 @@ function TableStatus({ listData }: { listData: any }) {
}}
/>
<Group position="right">
<Button radius={"xl"} onClick={() => close()}>
<Button radius={"xl"} onClick={() => closeReject()}>
Batal
</Button>
<Button
@@ -331,13 +351,61 @@ function TableStatus({ listData }: { listData: any }) {
setNPage(val.nPage);
},
close: () => {
close();
closeReject();
},
setSaveLoading(val) {
setSaveLoading(val);
},
});
}}
style={{
backgroundColor: MainColor.green
}}
>
Simpan
</Button>
</Group>
</Stack>
</Modal>
<Modal
opened={openedPublish}
onClose={closePublish}
centered
withCloseButton={false}
size={"md"}
>
<Stack align="center">
<Title order={5}>Apakah anda yakin ingin mempublish vote ini?</Title>
<Group position="center">
<Button radius={"xl"} onClick={() => closePublish()}>
Batal
</Button>
<Button
loaderPosition="center"
loading={isLoadingPublish ? true : false}
radius={"xl"}
onClick={() => {
onPublish({
awalVote: data[0].awalVote,
voteId: votingId,
setData(val) {
setData(val.data);
setNPage(val.nPage);
},
close: () => {
closePublish();
},
setLoadingPublish: (val) => {
setLoadingPublish(val);
},
setVotingId: (val) => {
setVotingId(val);
},
});
}}
style={{
backgroundColor: MainColor.green,
}}
>
Simpan
</Button>
@@ -349,12 +417,14 @@ function TableStatus({ listData }: { listData: any }) {
}
async function onPublish({
close,
voteId,
setData,
awalVote,
setLoadingPublish,
setVotingId,
}: {
close: any,
voteId: string;
setData: (val: { data: any[]; nPage: number }) => void;
awalVote: Date;
@@ -473,4 +543,4 @@ async function onReject({
} else {
ComponentGlobal_NotifikasiGagal(res.message);
}
}
}