diff --git a/src/app/dev/vote/create/loading.tsx b/src/app/dev/vote/create/loading.tsx
deleted file mode 100644
index 380b3fcd..00000000
--- a/src/app/dev/vote/create/loading.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/draft/[id]/loading.tsx b/src/app/dev/vote/detail/draft/[id]/loading.tsx
deleted file mode 100644
index 380b3fcd..00000000
--- a/src/app/dev/vote/detail/draft/[id]/loading.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/main/[id]/loading.tsx b/src/app/dev/vote/detail/main/[id]/loading.tsx
deleted file mode 100644
index 380b3fcd..00000000
--- a/src/app/dev/vote/detail/main/[id]/loading.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/publish/[id]/loading.tsx b/src/app/dev/vote/detail/publish/[id]/loading.tsx
deleted file mode 100644
index 380b3fcd..00000000
--- a/src/app/dev/vote/detail/publish/[id]/loading.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/reject/[id]/loading.tsx b/src/app/dev/vote/detail/reject/[id]/loading.tsx
deleted file mode 100644
index 380b3fcd..00000000
--- a/src/app/dev/vote/detail/reject/[id]/loading.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/review/[id]/loading.tsx b/src/app/dev/vote/detail/review/[id]/loading.tsx
deleted file mode 100644
index 380b3fcd..00000000
--- a/src/app/dev/vote/detail/review/[id]/loading.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/edit/[id]/loading.tsx b/src/app/dev/vote/edit/[id]/loading.tsx
deleted file mode 100644
index 380b3fcd..00000000
--- a/src/app/dev/vote/edit/[id]/loading.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/main/beranda/page.tsx b/src/app/dev/vote/main/beranda/page.tsx
index 25623b91..25ca9990 100644
--- a/src/app/dev/vote/main/beranda/page.tsx
+++ b/src/app/dev/vote/main/beranda/page.tsx
@@ -1,8 +1,8 @@
import { Vote_Beranda } from "@/app_modules/vote";
-import { Vote_getAllListPublish } from "@/app_modules/vote/fun/get/get_all_list_publish";
+import { vote_getAllListPublish } from "@/app_modules/vote/fun/get/get_all_list_publish";
export default async function Page() {
- const dataVote = await Vote_getAllListPublish()
+ const dataVote = await vote_getAllListPublish({page: 1})
return (
<>
diff --git a/src/app/dev/vote/main/loading.tsx b/src/app/dev/vote/main/loading.tsx
deleted file mode 100644
index 380b3fcd..00000000
--- a/src/app/dev/vote/main/loading.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/main/status/page.tsx b/src/app/dev/vote/main/status/page.tsx
index 8c612930..9946bbbe 100644
--- a/src/app/dev/vote/main/status/page.tsx
+++ b/src/app/dev/vote/main/status/page.tsx
@@ -1,12 +1,14 @@
import { Vote_Status } from "@/app_modules/vote";
-import { Vote_getListByStatusId } from "@/app_modules/vote/fun/get/get_list_status_by_status_id";
+import { vote_getAllDraft } from "@/app_modules/vote/fun/get/status/get_all_draft";
+import { vote_getAllPublish } from "@/app_modules/vote/fun/get/status/get_all_publish";
+import { vote_getAllReject } from "@/app_modules/vote/fun/get/status/get_all_reject";
+import { vote_getAllReview } from "@/app_modules/vote/fun/get/status/get_all_review";
export default async function Page() {
- const listPublish = await Vote_getListByStatusId("1");
- const listReview = await Vote_getListByStatusId("2");
- const listDraft = await Vote_getListByStatusId("3");
- const listReject = await Vote_getListByStatusId("4");
-
+ const listPublish = await vote_getAllPublish({page: 1});
+ const listReview = await vote_getAllReview({page: 1});
+ const listDraft = await vote_getAllDraft({page: 1});
+ const listReject = await vote_getAllReject({page: 1});
return (
<>
diff --git a/src/app/dev/vote/splash/loading.tsx b/src/app/dev/vote/splash/loading.tsx
deleted file mode 100644
index 380b3fcd..00000000
--- a/src/app/dev/vote/splash/loading.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app_modules/_global/component/button_create.tsx b/src/app_modules/_global/component/button_create.tsx
new file mode 100644
index 00000000..25e4b486
--- /dev/null
+++ b/src/app_modules/_global/component/button_create.tsx
@@ -0,0 +1,43 @@
+"use client";
+
+import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import { ActionIcon, Loader } from "@mantine/core";
+import { IconPencilPlus } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+export default function ComponentGlobal_CreateButton({ path }: { path: string }) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+
+ return (
+ <>
+ {
+ setLoading(true);
+ router.push(path);
+ }}
+ >
+ {isLoading ? (
+
+ ) : (
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/main/layout.tsx b/src/app_modules/forum/main/layout.tsx
index e072a3f8..7715dd2d 100644
--- a/src/app_modules/forum/main/layout.tsx
+++ b/src/app_modules/forum/main/layout.tsx
@@ -1,33 +1,17 @@
"use client";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
+import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { MODEL_USER } from "@/app_modules/home/model/interface";
import {
ActionIcon,
- AppShell,
Avatar,
- Center,
- Footer,
- Grid,
- Group,
- Header,
- Loader,
- Stack,
- Text,
- Title,
+ Loader
} from "@mantine/core";
-import React, { useState } from "react";
-import ComponentForum_HeaderTamplate from "../component/header/header_tamplate";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
-import { IconChevronLeft, IconCircle, IconHome } from "@tabler/icons-react";
-import router from "next/router";
import { useRouter } from "next/navigation";
-import { title } from "process";
-import { MODEL_USER } from "@/app_modules/home/model/interface";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
+import React, { useState } from "react";
export default function LayoutForum_Main({
children,
diff --git a/src/app_modules/job/detail/draft/layout.tsx b/src/app_modules/job/detail/draft/layout.tsx
index caeb6c78..f1f4e02d 100644
--- a/src/app_modules/job/detail/draft/layout.tsx
+++ b/src/app_modules/job/detail/draft/layout.tsx
@@ -1,31 +1,15 @@
"use client";
-import {
- ActionIcon,
- AppShell,
- Box,
- Drawer,
- Group,
- Paper,
- SimpleGrid,
- Stack,
- Text,
- Title,
-} from "@mantine/core";
-import React from "react";
-import ComponentJob_HeaderTamplate from "../../component/header_tamplate";
-import { IconDots, IconDotsVertical, IconEdit, IconX } from "@tabler/icons-react";
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
-import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import { useRouter } from "next/navigation";
-import { useDisclosure } from "@mantine/hooks";
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
+import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
+import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import {
+ ActionIcon
+} from "@mantine/core";
+import { useDisclosure } from "@mantine/hooks";
+import { IconDotsVertical, IconEdit } from "@tabler/icons-react";
+import React from "react";
export default function LayoutJob_DetailDraft({
children,
@@ -34,7 +18,6 @@ export default function LayoutJob_DetailDraft({
children: React.ReactNode;
jobId: string;
}) {
- const router = useRouter();
const [opened, { open, close }] = useDisclosure();
const listComponent = [
diff --git a/src/app_modules/job/main/arsip/ui_arsip.tsx b/src/app_modules/job/main/arsip/ui_arsip.tsx
index 0284a39a..d1285ad6 100644
--- a/src/app_modules/job/main/arsip/ui_arsip.tsx
+++ b/src/app_modules/job/main/arsip/ui_arsip.tsx
@@ -1,55 +1,54 @@
-"use client"
+"use client";
-import { useState } from "react"
-import { MODEL_JOB } from "../../model/interface"
-import _ from "lodash";
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Box, Center, Loader } from "@mantine/core";
+import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
+import { useState } from "react";
import ComponentJob_CardStatus from "../../component/card/card_view";
-import job_getAllStatusPublish from "../../fun/get/status/get_list_publish";
import { job_getAllArsipById } from "../../fun/get/get_all_arsip";
+import { MODEL_JOB } from "../../model/interface";
-export function Job_UI_Arsip({listData}: {listData: MODEL_JOB[]}){
- const [data, setData] = useState(listData)
- const [activePage, setActivePage] = useState(1);
+export function Job_UI_Arsip({ listData }: { listData: MODEL_JOB[] }) {
+ const [data, setData] = useState(listData);
+ const [activePage, setActivePage] = useState(1);
- return (
- <>
- {_.isEmpty(data) ? (
-
- ) : (
- // --- Main component --- //
-
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await job_getAllArsipById({
- page: activePage + 1,
- });
+ return (
+ <>
+ {_.isEmpty(data) ? (
+
+ ) : (
+ // --- Main component --- //
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData}
+ moreData={async () => {
+ const loadData = await job_getAllArsipById({
+ page: activePage + 1,
+ });
- setActivePage((val) => val + 1);
+ setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
-
- )}
- >
- );
-}
\ No newline at end of file
+ return loadData;
+ }}
+ >
+ {(item) => (
+
+ )}
+
+
+ )}
+ >
+ );
+}
diff --git a/src/app_modules/job/main/layout.tsx b/src/app_modules/job/main/layout.tsx
index dcbf3602..bce57031 100644
--- a/src/app_modules/job/main/layout.tsx
+++ b/src/app_modules/job/main/layout.tsx
@@ -79,42 +79,6 @@ export default function LayoutJob_Main({
))}
- //
- //
- // {listFooter.map((e) => (
- // {
- // // setLoading(true);
- // // setTimeout(() => router.replace(e.path), 3000);
- // router.replace(e.path);
- // setHotMenuId(e.id);
- // // setTimeout(() => setLoading(false), 1000);
- // }}
- // >
- //
- //
- //
- // {e.icon}
- //
- //
- // {e.name}
- //
- //
- //
- //
- // ))}
- //
- //
}
>
{children}
diff --git a/src/app_modules/vote/component/card_view_publish.tsx b/src/app_modules/vote/component/card_view_publish.tsx
index 357b8d65..622baae5 100644
--- a/src/app_modules/vote/component/card_view_publish.tsx
+++ b/src/app_modules/vote/component/card_view_publish.tsx
@@ -13,11 +13,15 @@ import {
Text,
Title,
Box,
+ Center,
+ Progress,
} from "@mantine/core";
import moment from "moment";
import { useRouter } from "next/navigation";
import { MODEL_VOTING } from "../model/interface";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import { toNumber } from "lodash";
export default function ComponentVote_CardViewPublish({
data,
@@ -35,7 +39,19 @@ export default function ComponentVote_CardViewPublish({
const router = useRouter();
return (
<>
-
+
{/* Header name */}
{authorName ? (
@@ -48,6 +64,7 @@ export default function ComponentVote_CardViewPublish({
) : (
""
)}
+
{/* Isi deskripsi */}
-
- {data ? data.title : "Judul Voting"}
-
-
-
- {data
- ? data?.awalVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })
- : "tgl awal voting"}
-
- -
-
- {data
- ? data?.akhirVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })
- : "tgl akhir voting"}
-
-
-
+
+
+
+ {data ? data.title : "Judul Voting"}
+
+
+
+
+ {data
+ ? data?.awalVote.toLocaleDateString(["id-ID"], {
+ dateStyle: "medium",
+ })
+ : "tgl awal voting"}
+
+ -
+
+ {data
+ ? data?.akhirVote.toLocaleDateString(["id-ID"], {
+ dateStyle: "medium",
+ })
+ : "tgl akhir voting"}
+
+
+
+
{data ? (
-
- {data?.Voting_DaftarNamaVote.map((v) => (
-
-
-
- {v.value}
-
+ {data?.Voting_DaftarNamaVote.map((v, i) => (
+
+ {v.value}
+
+
+ //
+ //
+ //
+ // {v.value}
+ //
-
- {v.jumlah}
-
-
-
- ))}
-
+ //
+ // {v.jumlah}
+ //
+ //
+ //
+ ))}
) : (
diff --git a/src/app_modules/vote/component/card_view_status.tsx b/src/app_modules/vote/component/card_view_status.tsx
index a30c5e73..311417a1 100644
--- a/src/app_modules/vote/component/card_view_status.tsx
+++ b/src/app_modules/vote/component/card_view_status.tsx
@@ -1,20 +1,10 @@
"use client";
-import {
- Card,
- Stack,
- Title,
- Badge,
- Group,
- Radio,
- Grid,
- Center,
- Text,
-} from "@mantine/core";
-import moment from "moment";
+import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import { Badge, Card, Group, Stack, Text } from "@mantine/core";
import { useRouter } from "next/navigation";
import { MODEL_VOTING } from "../model/interface";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
export default function ComponentVote_CardViewStatus({
path,
@@ -27,10 +17,14 @@ export default function ComponentVote_CardViewStatus({
return (
<>
{
if (data?.id === undefined) {
ComponentGlobal_NotifikasiPeringatan("Path tidak ditemukan");
@@ -41,11 +35,21 @@ export default function ComponentVote_CardViewStatus({
>
{/* Isi deskripsi */}
-
-
+
+
{data?.title}
-
+
{data?.awalVote.toLocaleDateString(["id-ID"], {
diff --git a/src/app_modules/vote/component/detail/detail_daftar_kontributor.tsx b/src/app_modules/vote/component/detail/detail_daftar_kontributor.tsx
index 989f1fbd..8cd44e18 100644
--- a/src/app_modules/vote/component/detail/detail_daftar_kontributor.tsx
+++ b/src/app_modules/vote/component/detail/detail_daftar_kontributor.tsx
@@ -1,23 +1,20 @@
"use client";
-import {
- Card,
- Stack,
- Center,
- Title,
- Badge,
- Group,
- Radio,
- Grid,
- Text,
- Avatar,
- Divider,
- Box,
-} from "@mantine/core";
-import moment from "moment";
-import { MODEL_VOTE_KONTRIBUTOR } from "../../model/interface";
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import {
+ Avatar,
+ Badge,
+ Card,
+ Center,
+ Divider,
+ Grid,
+ Stack,
+ Text,
+ Title
+} from "@mantine/core";
import _ from "lodash";
import { useRouter } from "next/navigation";
+import { MODEL_VOTE_KONTRIBUTOR } from "../../model/interface";
export default function ComponentVote_DaftarKontributorVoter({
listKontributor,
@@ -27,7 +24,15 @@ export default function ComponentVote_DaftarKontributorVoter({
const router = useRouter()
return (
<>
-
+
@@ -36,15 +41,22 @@ export default function ComponentVote_DaftarKontributorVoter({
{_.isEmpty(listKontributor) ? (
- - Tidak ada voting -
+
+ - Tidak ada voting -
+
) : (
{listKontributor?.map((e, i) => (
- router.push(RouterProfile.katalog + e.Author.Profile.id)}
+
+ router.push(
+ RouterProfile.katalog + e.Author.Profile.id
+ )
+ }
>
-
+
- {data?.title}
+
+ {data?.title}
+
{data?.deskripsi}
-
+
Batas Voting
-
+
{data?.awalVote.toLocaleDateString(["id-ID"], {
diff --git a/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx b/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx
index 0bb49b7a..949de897 100644
--- a/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx
+++ b/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx
@@ -15,6 +15,7 @@ import { MODEL_VOTING } from "../../model/interface";
import { IconCircle } from "@tabler/icons-react";
import _ from "lodash";
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
+import { AccentColor } from "@/app_modules/_global/color/color_pallet";
export default function ComponentVote_DetailDataSetelahPublish({
data,
@@ -25,7 +26,15 @@ export default function ComponentVote_DetailDataSetelahPublish({
}) {
return (
<>
-
+
{authorName ? (
- {data?.title}
+
+ {data?.title}
+
{data?.deskripsi}
-
+
Batas Voting
-
-
-
-
- {data?.awalVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
-
- -
-
- {data?.akhirVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
-
-
-
+
+
+
+ {data?.awalVote.toLocaleDateString(["id-ID"], {
+ dateStyle: "medium",
+ })}
+
+ -
+
+ {data?.akhirVote.toLocaleDateString(["id-ID"], {
+ dateStyle: "medium",
+ })}
+
+
+
+
diff --git a/src/app_modules/vote/component/detail/detail_hasil_voting.tsx b/src/app_modules/vote/component/detail/detail_hasil_voting.tsx
index 74b4113b..61a872b6 100644
--- a/src/app_modules/vote/component/detail/detail_hasil_voting.tsx
+++ b/src/app_modules/vote/component/detail/detail_hasil_voting.tsx
@@ -1,16 +1,14 @@
"use client";
+import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import {
Avatar,
- Box,
Card,
Center,
Grid,
- Group,
- List,
Stack,
Text,
- Title,
+ Title
} from "@mantine/core";
import { MODEL_VOTING_DAFTAR_NAMA_VOTE } from "../../model/interface";
@@ -21,7 +19,15 @@ export default function ComponentVote_HasilVoting({
}) {
return (
<>
-
+
@@ -36,11 +42,13 @@ export default function ComponentVote_HasilVoting({
radius={100}
size={70}
variant="outline"
- color="blue"
+ color="yellow"
>
- {e.jumlah}
+ {e.jumlah}
- {e.value}
+
+ {e.value}
+
))}
diff --git a/src/app_modules/vote/create/index.tsx b/src/app_modules/vote/create/index.tsx
index 544b96ff..b2909bfd 100644
--- a/src/app_modules/vote/create/index.tsx
+++ b/src/app_modules/vote/create/index.tsx
@@ -13,7 +13,7 @@ import {
Stack,
Text,
TextInput,
- Textarea
+ Textarea,
} from "@mantine/core";
import { DatePickerInput } from "@mantine/dates";
import { IconMinus, IconPlus } from "@tabler/icons-react";
@@ -26,6 +26,7 @@ import { useState } from "react";
import { Vote_funCreate } from "../fun/create/create_vote";
import { gs_vote_hotMenu, gs_vote_status } from "../global_state";
import { MODEL_VOTING } from "../model/interface";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
export default function Vote_Create() {
const router = useRouter();
@@ -36,13 +37,10 @@ export default function Vote_Create() {
const [data, setData] = useState({
title: "",
deskripsi: "",
- awalVote: Date,
- akhirVote: Date,
+ awalVote: "",
+ akhirVote: "",
});
- // const [range, setRange] = useState({
- // });
-
const [listVote, setListVote] = useState([
{
name: "Nama Pilihan",
@@ -56,9 +54,14 @@ export default function Vote_Create() {
return (
<>
-
+
-
+
{listVote.map((e, index) => (
}
- variant="outline"
onClick={() => {
setListVote([...listVote.slice(0, -1)]);
}}
+ compact
+ bg={MainColor.yellow}
+ color={"yellow"}
+ c={"black"}
>
Kurangi List
@@ -173,7 +193,15 @@ export default function Vote_Create() {
@@ -222,7 +256,7 @@ async function onSave(
await Vote_funCreate(data, listVote).then((res) => {
if (res.status === 201) {
- setHotMenu(1);
+ setHotMenu(2);
setTabsStatus("Review");
router.replace(RouterVote.status);
ComponentGlobal_NotifikasiBerhasil(res.message);
diff --git a/src/app_modules/vote/create/layout.tsx b/src/app_modules/vote/create/layout.tsx
index 6711b105..48fb1dfd 100644
--- a/src/app_modules/vote/create/layout.tsx
+++ b/src/app_modules/vote/create/layout.tsx
@@ -1,9 +1,8 @@
"use client";
-import { AppShell } from "@mantine/core";
+import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
+import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import React from "react";
-import ComponentVote_HeaderTamplate from "../component/header_tamplate";
-import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
export default function LayoutVote_Create({
children,
@@ -12,9 +11,9 @@ export default function LayoutVote_Create({
}) {
return (
<>
- }>
+ }>
{children}
-
+
>
);
}
diff --git a/src/app_modules/vote/detail/draft/index.tsx b/src/app_modules/vote/detail/draft/index.tsx
index aaf25c7a..ea1fb05e 100644
--- a/src/app_modules/vote/detail/draft/index.tsx
+++ b/src/app_modules/vote/detail/draft/index.tsx
@@ -13,6 +13,13 @@ import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_glo
import { Vote_funDeleteById } from "../../fun/delete/fun_delete_by_id";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import moment from "moment";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
+import { useState } from "react";
+import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
+import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
export default function Vote_DetailDraft({
dataVote,
@@ -21,7 +28,15 @@ export default function Vote_DetailDraft({
}) {
return (
<>
-
+
+ {dataVote?.catatan ? (
+
+ ) : (
+ ""
+ )}
@@ -38,7 +53,9 @@ function ButtonAction({
}) {
const router = useRouter();
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
- const [opened, { open, close }] = useDisclosure(false);
+ const [openModal1, setOpenModal1] = useState(false);
+ const [openModal2, setOpenModal2] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
async function onUpdate() {
const hariIni = new Date();
@@ -51,6 +68,7 @@ function ButtonAction({
if (res.status === 200) {
setTabsStatus("Review");
ComponentGlobal_NotifikasiBerhasil("Berhasil Ajukan Review", 2000);
+ setIsLoading(true);
router.back();
} else {
ComponentGlobal_NotifikasiGagal(res.message);
@@ -75,9 +93,10 @@ function ButtonAction({
-
-
- Yakin menghapus vote ini ?
-
-
-
-
-
-
+ {/* MODAL AJUKAN */}
+ setOpenModal1(false)}
+ buttonKiri={
+
+ }
+ buttonKanan={
+
+ }
+ />
+
+ {/* MODAL HAPUS */}
+ setOpenModal2(false)}
+ buttonKiri={
+
+ }
+ buttonKanan={
+
+ }
+ />
>
);
}
diff --git a/src/app_modules/vote/detail/draft/layout.tsx b/src/app_modules/vote/detail/draft/layout.tsx
index ead3fb25..9a13182c 100644
--- a/src/app_modules/vote/detail/draft/layout.tsx
+++ b/src/app_modules/vote/detail/draft/layout.tsx
@@ -1,32 +1,57 @@
"use client";
-import { AppShell } from "@mantine/core";
-import React from "react";
+import { ActionIcon, AppShell } from "@mantine/core";
+import React, { useState } from "react";
import ComponentVote_HeaderTamplate from "../../component/header_tamplate";
-import { IconEdit } from "@tabler/icons-react";
+import { IconDotsVertical, IconEdit } from "@tabler/icons-react";
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
+import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
+import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
export default function LayoutVote_DetailDraft({
children,
- voteId
+ voteId,
}: {
children: React.ReactNode;
- voteId: string
+ voteId: string;
}) {
+ const [openDrawer, setOpenDrawer] = useState(false);
+ const listComponent = [
+ {
+ id: "1",
+ name: "Edit Voting",
+ icon: ,
+ path: RouterVote.edit + voteId,
+ },
+ ];
+
return (
<>
- }
- route2={RouterVote.edit + voteId}
+ customButtonRight={
+ setOpenDrawer(true)}
+ >
+
+
+ }
/>
}
>
{children}
-
+
+
+ setOpenDrawer(false)}
+ component={listComponent}
+ />
>
);
}
diff --git a/src/app_modules/vote/detail/main/index.tsx b/src/app_modules/vote/detail/main/index.tsx
index c74c1878..e5ecd3a2 100644
--- a/src/app_modules/vote/detail/main/index.tsx
+++ b/src/app_modules/vote/detail/main/index.tsx
@@ -1,37 +1,36 @@
"use client";
+import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import {
- Card,
- Stack,
- Center,
- Title,
+ Avatar,
Badge,
- Group,
- Radio,
- Grid,
- Text,
Box,
Button,
- Avatar,
+ Card,
+ Center,
Divider,
+ Grid,
+ Group,
+ Radio,
+ Stack,
+ Text,
+ Title,
} from "@mantine/core";
-import moment from "moment";
-import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
+import _ from "lodash";
+import { useState } from "react";
import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_daftar_kontributor";
+import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
+import { Vote_funCreateHasil } from "../../fun/create/create_hasil";
+import { Vote_getOnebyId } from "../../fun/get/get_one_by_id";
import {
MODEL_VOTE_KONTRIBUTOR,
MODEL_VOTING,
MODEL_VOTING_DAFTAR_NAMA_VOTE,
} from "../../model/interface";
-import { useState } from "react";
-import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
-import _ from "lodash";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import { Vote_funCreatePilihanVotingById } from "../../fun/create/create_pilihan_voting";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { Vote_funCreateHasil } from "../../fun/create/create_hasil";
-import { Vote_getOnebyId } from "../../fun/get/get_one_by_id";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
export default function Vote_MainDetail({
dataVote,
@@ -79,8 +78,16 @@ function TampilanDataVoting({
const [votingNameId, setVotingNameId] = useState("");
return (
<>
-
-
+
+
- {dataVote?.title}
+
+ {dataVote?.title}
+
{dataVote?.deskripsi}
-
+
Batas Voting
-
-
-
-
- {dataVote?.awalVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
-
- -
-
- {dataVote?.akhirVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
-
-
-
+
+
+
+
+ {dataVote?.awalVote.toLocaleDateString(["id-ID"], {
+ dateStyle: "medium",
+ })}
+
+ -
+
+ {dataVote?.akhirVote.toLocaleDateString(["id-ID"], {
+ dateStyle: "medium",
+ })}
+
+
+
+
@@ -122,7 +141,13 @@ function TampilanDataVoting({
{/* Voting View */}
{isKontributor ? (
-
+
Pilihan anda:
@@ -131,8 +156,18 @@ function TampilanDataVoting({
) : (
-
+
{
setVotingNameId(val);
@@ -146,7 +181,12 @@ function TampilanDataVoting({
{dataVote?.Voting_DaftarNamaVote.map((v) => (
-
+
))}
@@ -162,6 +202,9 @@ function TampilanDataVoting({
onClick={() =>
onVote(votingNameId, dataVote?.id as any, setData)
}
+ bg={MainColor.yellow}
+ color="yellow"
+ c={"black"}
>
Vote
diff --git a/src/app_modules/vote/detail/main/layout.tsx b/src/app_modules/vote/detail/main/layout.tsx
index 26c0821a..73091b34 100644
--- a/src/app_modules/vote/detail/main/layout.tsx
+++ b/src/app_modules/vote/detail/main/layout.tsx
@@ -4,6 +4,8 @@ import { AppShell } from "@mantine/core";
import React from "react";
import ComponentVote_HeaderTamplate from "../../component/header_tamplate";
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
+import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
export default function LayoutVote_MainDetail({
children,
@@ -12,11 +14,11 @@ export default function LayoutVote_MainDetail({
}) {
return (
<>
- }
+ }
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/vote/detail/publish/layout.tsx b/src/app_modules/vote/detail/publish/layout.tsx
index ad16b7ad..8a1dfa82 100644
--- a/src/app_modules/vote/detail/publish/layout.tsx
+++ b/src/app_modules/vote/detail/publish/layout.tsx
@@ -4,6 +4,8 @@ import { AppShell } from "@mantine/core";
import React from "react";
import ComponentVote_HeaderTamplate from "../../component/header_tamplate";
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
+import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
export default function LayoutVote_DetailPublish({
children,
@@ -12,11 +14,11 @@ export default function LayoutVote_DetailPublish({
}) {
return (
<>
- }
+ }
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/vote/detail/reject/index.tsx b/src/app_modules/vote/detail/reject/index.tsx
index 1786eff9..a00089cb 100644
--- a/src/app_modules/vote/detail/reject/index.tsx
+++ b/src/app_modules/vote/detail/reject/index.tsx
@@ -20,6 +20,10 @@ import { Vote_funDeleteById } from "../../fun/delete/fun_delete_by_id";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
import ComponentVote_NotedBox from "../../component/noted_box";
+import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
+import { useState } from "react";
+import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
export default function Vote_DetailReject({
dataVote,
@@ -29,7 +33,10 @@ export default function Vote_DetailReject({
return (
<>
-
+
@@ -40,7 +47,10 @@ export default function Vote_DetailReject({
function ButtonAction({ voteId }: { voteId: string }) {
const router = useRouter();
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
- const [opened, { open, close }] = useDisclosure(false);
+
+ const [openModal1, setOpenModal1] = useState(false);
+ const [openModal2, setOpenModal2] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
async function onUpdate() {
await Vote_funEditStatusByStatusId(voteId, "3").then((res) => {
@@ -73,7 +83,7 @@ function ButtonAction({ voteId }: { voteId: string }) {
radius={"xl"}
color="orange"
onClick={() => {
- onUpdate();
+ setOpenModal1(true);
}}
>
Edit Kembali
@@ -82,37 +92,69 @@ function ButtonAction({ voteId }: { voteId: string }) {
radius={"xl"}
color="red"
onClick={() => {
- open();
+ setOpenModal2(true);
}}
>
Hapus
-
-
- Yakin menghapus vote ini ?
-
-
-
-
-
-
+ setOpenModal1(false)}
+ buttonKiri={
+
+ }
+ buttonKanan={
+
+ }
+ />
+
+ {/* MODAL HAPUS */}
+ setOpenModal2(false)}
+ buttonKiri={
+
+ }
+ buttonKanan={
+
+ }
+ />
>
);
}
diff --git a/src/app_modules/vote/detail/reject/layout.tsx b/src/app_modules/vote/detail/reject/layout.tsx
index 839dd412..0b361379 100644
--- a/src/app_modules/vote/detail/reject/layout.tsx
+++ b/src/app_modules/vote/detail/reject/layout.tsx
@@ -1,9 +1,8 @@
"use client";
-import { AppShell } from "@mantine/core";
+import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
+import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import React from "react";
-import ComponentVote_HeaderTamplate from "../../component/header_tamplate";
-import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
export default function LayoutVote_DetailReject({
children,
@@ -12,11 +11,11 @@ export default function LayoutVote_DetailReject({
}) {
return (
<>
- }
+ }
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/vote/detail/review/index.tsx b/src/app_modules/vote/detail/review/index.tsx
index 45320efc..7782b291 100644
--- a/src/app_modules/vote/detail/review/index.tsx
+++ b/src/app_modules/vote/detail/review/index.tsx
@@ -1,28 +1,16 @@
"use client";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import {
- Badge,
- Button,
- Card,
- Center,
- Grid,
- Group,
- Radio,
- Stack,
- Text,
- Title,
-} from "@mantine/core";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { Button, Stack } from "@mantine/core";
import { useAtom } from "jotai";
-import moment from "moment";
-import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { useRouter } from "next/navigation";
-import { gs_vote_status } from "../../global_state";
+import { useState } from "react";
import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
+import { gs_vote_status } from "../../global_state";
import { MODEL_VOTING } from "../../model/interface";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { useState } from "react";
+import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
export default function Vote_DetailReview({
dataVote,
@@ -43,6 +31,7 @@ function ButtonAction({ voteId }: { voteId: string }) {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
+ const [openModal, setOpenModal] = useState(false);
async function onUpdate() {
await Vote_funEditStatusByStatusId(voteId, "3").then((res) => {
@@ -59,16 +48,36 @@ function ButtonAction({ voteId }: { voteId: string }) {
return (
<>
+
+ setOpenModal(false)}
+ buttonKiri={
+
+ }
+ buttonKanan={
+
+ }
+ />
>
);
}
diff --git a/src/app_modules/vote/detail/review/layout.tsx b/src/app_modules/vote/detail/review/layout.tsx
index 542c8095..25e8ce74 100644
--- a/src/app_modules/vote/detail/review/layout.tsx
+++ b/src/app_modules/vote/detail/review/layout.tsx
@@ -1,9 +1,8 @@
"use client";
-import { AppShell } from "@mantine/core";
+import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
+import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import React from "react";
-import ComponentVote_HeaderTamplate from "../../component/header_tamplate";
-import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
export default function LayoutVote_DetailReview({
children,
@@ -12,11 +11,11 @@ export default function LayoutVote_DetailReview({
}) {
return (
<>
- }
+ }
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/vote/edit/index.tsx b/src/app_modules/vote/edit/index.tsx
index 7886baf1..b9d4f710 100644
--- a/src/app_modules/vote/edit/index.tsx
+++ b/src/app_modules/vote/edit/index.tsx
@@ -14,7 +14,7 @@ import {
Stack,
Text,
TextInput,
- Textarea
+ Textarea,
} from "@mantine/core";
import { DatePickerInput } from "@mantine/dates";
import { IconPlus, IconTrash } from "@tabler/icons-react";
@@ -29,6 +29,9 @@ import {
MODEL_VOTING,
MODEL_VOTING_DAFTAR_NAMA_VOTE,
} from "../model/interface";
+import { useShallowEffect } from "@mantine/hooks";
+import { Vote_getListDaftarNamaById } from "../fun/get/get_list_daftar_vote_by_id";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
export default function Vote_Edit({
dataVote,
@@ -40,10 +43,24 @@ export default function Vote_Edit({
const [data, setData] = useState(dataVote);
const [pilihanNama, setPilihanNama] = useState(listDaftarVote);
+ useShallowEffect(() => {
+ onLoadList();
+ }, []);
+
+ async function onLoadList() {
+ const loadList = await Vote_getListDaftarNamaById(data.id);
+ setPilihanNama(loadList as any);
+ }
+
return (
<>
-
+