#Job admin
- Tampilan user done - Tampilan admin done git commit -m
This commit is contained in:
200
src/app_modules/admin/job/child/arsip/index.tsx
Normal file
200
src/app_modules/admin/job/child/arsip/index.tsx
Normal file
@@ -0,0 +1,200 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
import {
|
||||
MODEL_EVENT,
|
||||
MODEL_EVENT_PESERTA,
|
||||
} from "@/app_modules/event/model/interface";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import {
|
||||
MODEL_VOTE_KONTRIBUTOR,
|
||||
MODEL_VOTING,
|
||||
MODEL_VOTING_DAFTAR_NAMA_VOTE,
|
||||
} from "@/app_modules/vote/model/interface";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Modal,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconEyeCheck, IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminJob_TableArsip({
|
||||
dataVote,
|
||||
}: {
|
||||
dataVote?: any;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Job Vacancy: Table Arsip" />
|
||||
<TableStatus listArsip={dataVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listArsip }: { listArsip: MODEL_JOB[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listArsip);
|
||||
const [img, setImg] = useState("");
|
||||
|
||||
const TableRows = data?.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Spoiler
|
||||
w={200}
|
||||
maxHeight={50}
|
||||
hideLabel="sembunyikan"
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.title}
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Center w={150}>
|
||||
{e.imagesId ? (
|
||||
<Button
|
||||
color="green"
|
||||
radius={"xl"}
|
||||
leftIcon={<IconEyeCheck />}
|
||||
onClick={() => {
|
||||
setImg(e.imagesId);
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Lihat
|
||||
</Button>
|
||||
) : (
|
||||
<Center w={150}>
|
||||
<Text fw={"bold"} fz={"xs"} fs={"italic"}>
|
||||
Tidak ada poster
|
||||
</Text>
|
||||
</Center>
|
||||
)}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.content }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.deskripsi }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
opened={opened}
|
||||
onClose={close}
|
||||
size={"xl"}
|
||||
withCloseButton={false}
|
||||
>
|
||||
{/* <ComponentAdminVote_DetailHasil
|
||||
hasil={hasil}
|
||||
kontributor={kontributor}
|
||||
/> */}
|
||||
</Modal>
|
||||
<Box>
|
||||
<Box bg={"gray.1"} p={"xs"}>
|
||||
<Title order={6} c={"gray"}>
|
||||
ARSIP
|
||||
</Title>
|
||||
</Box>
|
||||
<ScrollArea w={"100%"}>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Poster</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Syarat Ketentuan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
async function onList(
|
||||
voteId: string,
|
||||
setHasil: any,
|
||||
setKontributor: any,
|
||||
setLoading: any,
|
||||
open: any
|
||||
) {
|
||||
// await AdminVote_getHasilById(voteId).then((res) => {
|
||||
// setHasil(res);
|
||||
// setLoading(false);
|
||||
// });
|
||||
|
||||
// await AdminVote_getListKontributorById(voteId).then((res) => {
|
||||
// setKontributor(res);
|
||||
// setLoading(false);
|
||||
// });
|
||||
|
||||
open();
|
||||
}
|
||||
171
src/app_modules/admin/job/child/table_publish/index.tsx
Normal file
171
src/app_modules/admin/job/child/table_publish/index.tsx
Normal file
@@ -0,0 +1,171 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Modal,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconBan, IconEyeCheck, IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminJob_TablePublish({
|
||||
dataVote,
|
||||
}: {
|
||||
dataVote?: any;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Job Vacancy: Table Publish" />
|
||||
<TableStatus listReview={dataVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listReview }: { listReview: MODEL_JOB[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listReview);
|
||||
const [img, setImg] = useState("");
|
||||
|
||||
const TableRows = data?.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Spoiler
|
||||
w={200}
|
||||
maxHeight={50}
|
||||
hideLabel="sembunyikan"
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.title}
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Center w={150}>
|
||||
{e.imagesId ? (
|
||||
<Button
|
||||
color="green"
|
||||
radius={"xl"}
|
||||
leftIcon={<IconEyeCheck />}
|
||||
onClick={() => {
|
||||
setImg(e.imagesId);
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Lihat
|
||||
</Button>
|
||||
) : (
|
||||
<Center w={150}>
|
||||
<Text fw={"bold"} fz={"xs"} fs={"italic"}>
|
||||
Tidak ada poster
|
||||
</Text>
|
||||
</Center>
|
||||
)}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.content }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.deskripsi }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={close} withCloseButton={false} centered>
|
||||
<Center>
|
||||
<Image
|
||||
alt="Foto"
|
||||
src={RouterJob.api_gambar + img}
|
||||
mah={500}
|
||||
maw={300}
|
||||
/>
|
||||
</Center>
|
||||
</Modal>
|
||||
|
||||
<Box>
|
||||
<Box bg={"green.1"} p={"xs"}>
|
||||
<Title order={6} c={"green"}>
|
||||
PUBLISH
|
||||
</Title>
|
||||
</Box>
|
||||
<ScrollArea w={"100%"}>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Poster</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Syarat Ketentuan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
251
src/app_modules/admin/job/child/table_reject/index.tsx
Normal file
251
src/app_modules/admin/job/child/table_reject/index.tsx
Normal file
@@ -0,0 +1,251 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Modal,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
Textarea,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconBan, IconEyeCheck, IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { AdminJob_funEditCatatanById } from "../../fun/edit/fun_edit_catatan_by_id";
|
||||
import { AdminJob_getListTableByStatusId } from "../../fun/get/get_list_table_by_status_id";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
|
||||
export default function AdminJob_TableReject({ dataVote }: { dataVote?: any }) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Job Vacancy: Table Reject" />
|
||||
<TableStatus listReject={dataVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listReject }: { listReject: MODEL_JOB[] }) {
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listReject);
|
||||
const [reject, setReject] = useState(false);
|
||||
const [img, setImg] = useState("");
|
||||
const [jobId, setJobId] = useState("");
|
||||
const [catatan, setCatatan] = useState("");
|
||||
|
||||
const TableRows = data?.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Spoiler
|
||||
w={200}
|
||||
maxHeight={50}
|
||||
hideLabel="sembunyikan"
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.title}
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Center w={150}>
|
||||
{e.imagesId ? (
|
||||
<Button
|
||||
color="green"
|
||||
radius={"xl"}
|
||||
leftIcon={<IconEyeCheck />}
|
||||
onClick={() => {
|
||||
setImg(e.imagesId);
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Lihat
|
||||
</Button>
|
||||
) : (
|
||||
<Center w={150}>
|
||||
<Text fw={"bold"} fz={"xs"} fs={"italic"}>
|
||||
Tidak ada poster
|
||||
</Text>
|
||||
</Center>
|
||||
)}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
hideLabel="sembunyikan"
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.content }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.deskripsi }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.catatan}
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Button
|
||||
color={"red"}
|
||||
leftIcon={<IconBan />}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
setReject(true);
|
||||
setJobId(e.id);
|
||||
setCatatan(e.catatan);
|
||||
}}
|
||||
>
|
||||
Reject
|
||||
</Button>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={close} withCloseButton={false} centered>
|
||||
<Center>
|
||||
<Image
|
||||
alt="Foto"
|
||||
src={RouterJob.api_gambar + img}
|
||||
mah={500}
|
||||
maw={300}
|
||||
/>
|
||||
</Center>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
opened={reject}
|
||||
onClose={() => {
|
||||
setReject(false);
|
||||
}}
|
||||
withCloseButton={false}
|
||||
size={"lg"}
|
||||
centered
|
||||
>
|
||||
<Stack>
|
||||
<Textarea
|
||||
minRows={2}
|
||||
maxRows={5}
|
||||
maxLength={300}
|
||||
autosize
|
||||
label="Alasan Penolakan"
|
||||
placeholder="Masukkan alasan penolakan lowongan ini"
|
||||
value={catatan}
|
||||
onChange={(val) => setCatatan(val.currentTarget.value)}
|
||||
/>
|
||||
<Group position="right">
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onReject(jobId, catatan, setData);
|
||||
setReject(false);
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
<Box>
|
||||
<Box bg={"red.1"} p={"xs"}>
|
||||
<Title order={6} c={"red"}>
|
||||
REJECT
|
||||
</Title>
|
||||
</Box>
|
||||
<ScrollArea w={"100%"}>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Poster</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Syarat Ketentuan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Catatan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
async function onReject(jobId: string, catatan: string, setData: any) {
|
||||
await AdminJob_funEditCatatanById(jobId, catatan).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
await AdminJob_getListTableByStatusId("4").then((val) => {
|
||||
setData(val);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
263
src/app_modules/admin/job/child/table_review/index.tsx
Normal file
263
src/app_modules/admin/job/child/table_review/index.tsx
Normal file
@@ -0,0 +1,263 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Modal,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
Textarea,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconBan, IconEyeCheck, IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { AdminJob_funEditStatusPublishById } from "../../fun/edit/fun_edit_status_publish_by_id";
|
||||
import { AdminJob_getListTableByStatusId } from "../../fun/get/get_list_table_by_status_id";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { AdminJob_funEditCatatanById } from "../../fun/edit/fun_edit_catatan_by_id";
|
||||
|
||||
export default function AdminJob_TableReview({ dataVote }: { dataVote?: any }) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Job Vacancy: Table Review" />
|
||||
<TableStatus listReview={dataVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listReview }: { listReview: MODEL_JOB[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listReview);
|
||||
const [reject, setReject] = useState(false);
|
||||
const [img, setImg] = useState("");
|
||||
const [jobId, setJobId] = useState("");
|
||||
const [catatan, setCatatan] = useState("");
|
||||
|
||||
const TableRows = data?.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Spoiler
|
||||
w={200}
|
||||
maxHeight={50}
|
||||
hideLabel="sembunyikan"
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.title}
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Center w={150}>
|
||||
{e.imagesId ? (
|
||||
<Button
|
||||
color="green"
|
||||
radius={"xl"}
|
||||
leftIcon={<IconEyeCheck />}
|
||||
onClick={() => {
|
||||
setImg(e.imagesId);
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Lihat
|
||||
</Button>
|
||||
) : (
|
||||
<Center w={150}>
|
||||
<Text fw={"bold"} fz={"xs"} fs={"italic"}>
|
||||
Tidak ada poster
|
||||
</Text>
|
||||
</Center>
|
||||
)}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.content }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.deskripsi }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Stack>
|
||||
<Stack align="center">
|
||||
<Button
|
||||
color={"green"}
|
||||
leftIcon={<IconEyeShare />}
|
||||
radius={"xl"}
|
||||
onClick={() => onPublish(e.id, setData)}
|
||||
>
|
||||
Publish
|
||||
</Button>
|
||||
<Button
|
||||
color={"red"}
|
||||
leftIcon={<IconBan />}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
setReject(true);
|
||||
setJobId(e.id);
|
||||
}}
|
||||
>
|
||||
Reject
|
||||
</Button>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={close} withCloseButton={false} centered>
|
||||
<Center>
|
||||
<Image
|
||||
alt="Foto"
|
||||
src={RouterJob.api_gambar + img}
|
||||
mah={500}
|
||||
maw={300}
|
||||
/>
|
||||
</Center>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
opened={reject}
|
||||
onClose={() => {
|
||||
setReject(false);
|
||||
}}
|
||||
withCloseButton={false}
|
||||
size={"lg"}
|
||||
centered
|
||||
>
|
||||
<Stack>
|
||||
<Textarea
|
||||
minRows={2}
|
||||
maxRows={5}
|
||||
maxLength={300}
|
||||
autosize
|
||||
label="Alasan Penolakan"
|
||||
placeholder="Masukkan alasan penolakan lowongan ini"
|
||||
onChange={(val) => setCatatan(val.currentTarget.value)}
|
||||
/>
|
||||
<Group position="right">
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onReject(jobId, catatan, setData);
|
||||
setReject(false);
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
<Box>
|
||||
<Box bg={"orange.1"} p={"xs"}>
|
||||
<Title order={6} c={"orange"}>
|
||||
REVIEW
|
||||
</Title>
|
||||
</Box>
|
||||
<ScrollArea w={"100%"}>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Poster</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Syarat Ketentuan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
async function onPublish(jobId: string, setData: any) {
|
||||
await AdminJob_funEditStatusPublishById(jobId).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
await AdminJob_getListTableByStatusId("2").then((res) => {
|
||||
setData(res);
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Update");
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function onReject(jobId: string, catatan: string, setData: any) {
|
||||
await AdminJob_funEditCatatanById(jobId, catatan).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
await AdminJob_getListTableByStatusId("2").then((val) => {
|
||||
setData(val);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function AdminJob_funCountStatusByStatusId(statusId: string) {
|
||||
if (statusId === "0") {
|
||||
const data = await prisma.job.count({
|
||||
where: {
|
||||
masterStatusId: "1",
|
||||
isArsip: true,
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
if (statusId === "1") {
|
||||
const data = await prisma.job.count({
|
||||
where: {
|
||||
masterStatusId: "1",
|
||||
isArsip: false,
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
if (statusId === "2") {
|
||||
const data = await prisma.job.count({
|
||||
where: {
|
||||
masterStatusId: "2",
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
if (statusId === "4") {
|
||||
const data = await prisma.job.count({
|
||||
where: {
|
||||
masterStatusId: "4",
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
23
src/app_modules/admin/job/fun/edit/fun_edit_catatan_by_id.ts
Normal file
23
src/app_modules/admin/job/fun/edit/fun_edit_catatan_by_id.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function AdminJob_funEditCatatanById(
|
||||
jobId: string,
|
||||
catatan: string
|
||||
) {
|
||||
const up = await prisma.job.update({
|
||||
where: {
|
||||
id: jobId,
|
||||
},
|
||||
data: {
|
||||
masterStatusId: "4",
|
||||
catatan: catatan,
|
||||
},
|
||||
});
|
||||
|
||||
if (!up) return { status: 400, message: "Gagal reject" };
|
||||
revalidatePath("/dev/admin/job/child/table_review");
|
||||
return { status: 200, message: "Berhasil reject" };
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function AdminJob_funEditStatusPublishById(jobId: string) {
|
||||
const updt = await prisma.job.update({
|
||||
where: {
|
||||
id: jobId,
|
||||
},
|
||||
data: {
|
||||
masterStatusId: "1",
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
if(!updt) return {status: 400, message: "Update Gagal"}
|
||||
revalidatePath("/dev/admin/job/child/table_review");
|
||||
return {status: 200, message: "Berhasil Update"}
|
||||
}
|
||||
114
src/app_modules/admin/job/fun/get/get_list_table_by_status_id.ts
Normal file
114
src/app_modules/admin/job/fun/get/get_list_table_by_status_id.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function AdminJob_getListTableByStatusId(statusId: string) {
|
||||
if (statusId === "0") {
|
||||
const getData = await prisma.job.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
masterStatusId: "1",
|
||||
isActive: true,
|
||||
isArsip: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
isArsip: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
content: true,
|
||||
deskripsi: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
imagesId: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
if (statusId === "1") {
|
||||
const getData = await prisma.job.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
masterStatusId: "1",
|
||||
isActive: true,
|
||||
isArsip: false,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
content: true,
|
||||
deskripsi: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
imagesId: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
if (statusId === "2") {
|
||||
const getData = await prisma.job.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
masterStatusId: "2",
|
||||
isActive: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
content: true,
|
||||
deskripsi: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
imagesId: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
|
||||
if (statusId === "4") {
|
||||
const getData = await prisma.job.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
masterStatusId: "4",
|
||||
isActive: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
content: true,
|
||||
deskripsi: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
imagesId: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
}
|
||||
6
src/app_modules/admin/job/index.tsx
Normal file
6
src/app_modules/admin/job/index.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import AdminJob_Main from "./main";
|
||||
import AdminJob_TablePublish from "./child/table_publish";
|
||||
import AdminJob_TableReview from "./child/table_review";
|
||||
import AdminJob_TableReject from "./child/table_reject";
|
||||
|
||||
export { AdminJob_Main, AdminJob_TablePublish, AdminJob_TableReview, AdminJob_TableReject };
|
||||
80
src/app_modules/admin/job/main/index.tsx
Normal file
80
src/app_modules/admin/job/main/index.tsx
Normal file
@@ -0,0 +1,80 @@
|
||||
"use client";
|
||||
|
||||
import { Group, Paper, SimpleGrid, Stack, Text, Title } from "@mantine/core";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "../../component/header_tamplate";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function AdminJob_Main({
|
||||
countPublish,
|
||||
countReview,
|
||||
countReject,
|
||||
countArsip,
|
||||
}: {
|
||||
countPublish: number;
|
||||
countReview: number;
|
||||
countReject: number;
|
||||
countArsip: number
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
const listStatus = [
|
||||
{
|
||||
id: 1,
|
||||
name: "Publish",
|
||||
jumlah: countPublish,
|
||||
color: "green",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "Review",
|
||||
jumlah: countReview,
|
||||
color: "orange",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Reject",
|
||||
jumlah: countReject,
|
||||
color: "red",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "Arsip",
|
||||
jumlah: countArsip,
|
||||
color: "gray",
|
||||
},
|
||||
];
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Job Vacancy" />
|
||||
<SimpleGrid
|
||||
cols={4}
|
||||
spacing="lg"
|
||||
breakpoints={[
|
||||
{ maxWidth: "62rem", cols: 4, spacing: "lg" },
|
||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||
]}
|
||||
>
|
||||
{listStatus.map((e, i) => (
|
||||
<Paper
|
||||
key={i}
|
||||
bg={`${e.color}.2`}
|
||||
shadow="md"
|
||||
radius="md"
|
||||
p="md"
|
||||
// sx={{ borderColor: e.color, borderStyle: "solid" }}
|
||||
>
|
||||
<Group position="center">
|
||||
<Stack align="center" spacing={0}>
|
||||
<Text>{e.name}</Text>
|
||||
<Title>{e.jumlah ? e.jumlah : 0}</Title>
|
||||
</Stack>
|
||||
</Group>
|
||||
</Paper>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
import React, { useState } from "react";
|
||||
import ComponentGlobal_HeaderTamplate from "../component_global/header_tamplate";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconLetterH, IconLogout } from "@tabler/icons-react";
|
||||
import { IconCircleDot, IconCircleDotFilled, IconHome, IconLetterH, IconLogout } from "@tabler/icons-react";
|
||||
import {
|
||||
RouterAdminAward,
|
||||
RouterAdminDashboard,
|
||||
@@ -38,6 +38,8 @@ import Admin_Logout from "./component/logout";
|
||||
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
||||
import _ from "lodash";
|
||||
import { listAdminPage } from "./list_page";
|
||||
import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote";
|
||||
import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job";
|
||||
|
||||
export default function AdminLayout({
|
||||
children,
|
||||
@@ -50,6 +52,8 @@ export default function AdminLayout({
|
||||
const [active, setActive] = useAtom(gs_admin_hotMenu);
|
||||
const [activeChild, setActiveChild] = useAtom(gs_admin_subMenu);
|
||||
|
||||
|
||||
|
||||
const navbarItems = listAdminPage.map((e, i) => (
|
||||
<Box key={e.id}>
|
||||
<NavLink
|
||||
@@ -59,7 +63,8 @@ export default function AdminLayout({
|
||||
},
|
||||
}}
|
||||
fw={active === e.id ? "bold" : "normal"}
|
||||
label={<Text size={"md"}>{e.name}</Text>}
|
||||
icon={e.icon}
|
||||
label={<Text size={"sm"}>{e.name}</Text>}
|
||||
onClick={() => {
|
||||
setActive(e.id);
|
||||
setActiveChild(null);
|
||||
@@ -81,6 +86,7 @@ export default function AdminLayout({
|
||||
}}
|
||||
fw={activeChild === v.id ? "bold" : "normal"}
|
||||
label={<Text>{v.name}</Text>}
|
||||
icon={activeChild === v.id ? <IconCircleDotFilled size={10}/> : <IconCircleDot size={10}/> }
|
||||
onClick={() => {
|
||||
setActive(e.id);
|
||||
setActiveChild(v.id);
|
||||
@@ -98,9 +104,10 @@ export default function AdminLayout({
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
padding="sm"
|
||||
padding="md"
|
||||
navbarOffsetBreakpoint="md"
|
||||
asideOffsetBreakpoint="sm"
|
||||
|
||||
navbar={
|
||||
<MediaQuery smallerThan={"md"} styles={{ display: "none" }}>
|
||||
<Navbar
|
||||
|
||||
@@ -1,34 +1,48 @@
|
||||
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
||||
import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job";
|
||||
import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote";
|
||||
import {
|
||||
RouterAdminDashboard,
|
||||
RouterAdminDonasi,
|
||||
RouterAdminInvestasi,
|
||||
} from "@/app/lib/router_hipmi/router_admin";
|
||||
import { IconBriefcase } from "@tabler/icons-react";
|
||||
import {
|
||||
IconHeartHandshake,
|
||||
IconHome,
|
||||
IconMoneybag,
|
||||
IconPackageImport,
|
||||
IconPresentation,
|
||||
} from "@tabler/icons-react";
|
||||
|
||||
export const listAdminPage = [
|
||||
{
|
||||
id: 1,
|
||||
name: "Main Dashboard",
|
||||
path: RouterAdminDashboard.main_admin,
|
||||
icon: <IconHome />,
|
||||
child: [],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "Investasi",
|
||||
path: RouterAdminInvestasi.main_investasi,
|
||||
icon: <IconMoneybag />,
|
||||
|
||||
child: [],
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Donasi",
|
||||
path: RouterAdminDonasi.main_donasi,
|
||||
icon: <IconHeartHandshake />,
|
||||
child: [],
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "Event",
|
||||
path: "",
|
||||
icon: <IconPresentation />,
|
||||
child: [
|
||||
{
|
||||
id: 41,
|
||||
@@ -66,6 +80,7 @@ export const listAdminPage = [
|
||||
id: 5,
|
||||
name: "Voting",
|
||||
path: "",
|
||||
icon: <IconPackageImport />,
|
||||
child: [
|
||||
{
|
||||
id: 51,
|
||||
@@ -94,4 +109,37 @@ export const listAdminPage = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: "Job Vacancy",
|
||||
path: "",
|
||||
icon: <IconBriefcase />,
|
||||
child: [
|
||||
{
|
||||
id: 61,
|
||||
name: "Dashboard",
|
||||
path: RouterAdminJob.main,
|
||||
},
|
||||
{
|
||||
id: 62,
|
||||
name: "Table Publish",
|
||||
path: RouterAdminJob.table_publish,
|
||||
},
|
||||
{
|
||||
id: 63,
|
||||
name: "Table Review",
|
||||
path: RouterAdminJob.table_review,
|
||||
},
|
||||
{
|
||||
id: 64,
|
||||
name: "Table Reject",
|
||||
path: RouterAdminJob.table_reject,
|
||||
},
|
||||
{
|
||||
id: 65,
|
||||
name: "Arsip",
|
||||
path: RouterAdminJob.arsip,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -79,15 +79,7 @@ export default function AdminVote_Main({
|
||||
</Paper>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
<SimpleGrid
|
||||
cols={4}
|
||||
spacing="lg"
|
||||
breakpoints={[
|
||||
{ maxWidth: "62rem", cols: 4, spacing: "lg" },
|
||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||
]}
|
||||
></SimpleGrid>
|
||||
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user