Fix modal, button all admin feature
This commit is contained in:
@@ -11,8 +11,6 @@ function Admin_ComponentModalPublish({ onClose, opened, title, buttonKiri, butto
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
style={{ fontWeight: "bold" }}
|
||||
fw={"bold"}
|
||||
centered
|
||||
opened={opened}
|
||||
onClose={onClose}
|
||||
|
||||
@@ -24,6 +24,8 @@ import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/noti
|
||||
import adminNotifikasi_funCreateToAllUser from "../../notifikasi/fun/create/fun_create_notif_to_all_user";
|
||||
import { clientLogger } from "@/util/clientLogger";
|
||||
import { apiGetAllUserWithExceptId } from "@/app_modules/_global/lib/api_user";
|
||||
import Admin_ComponentModalPublish from "../../_admin_global/_component/comp_admin_modal_publish";
|
||||
import { MainColor } from "@/app_modules/_global/color";
|
||||
|
||||
export default function AdminDonasi_DetailReview({
|
||||
dataReview,
|
||||
@@ -65,10 +67,11 @@ function ButtonOnHeader({
|
||||
const router = useRouter();
|
||||
const [isLoadingPublish, setLoadingPublish] = useState(false);
|
||||
const [isLoadingReject, setLoadingReject] = useState(false);
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [openedPublish, { open: openPublish, close: closePublish }] = useDisclosure(false);
|
||||
const [openedReject, { open: openReject, close: closeReject }] = useDisclosure(false);
|
||||
const [catatan, setCatatan] = useState("");
|
||||
|
||||
async function onPulish() {
|
||||
async function onPublish() {
|
||||
try {
|
||||
setLoadingPublish(true);
|
||||
const checkStatus = await donasi_checkStatus({ id: donasi.id });
|
||||
@@ -210,16 +213,15 @@ function ButtonOnHeader({
|
||||
{donasi.donasiMaster_StatusDonasiId === "2" ? (
|
||||
<Group>
|
||||
<Button
|
||||
loading={isLoadingPublish}
|
||||
loaderPosition="center"
|
||||
radius={"xl"}
|
||||
bg={"green"}
|
||||
color="green"
|
||||
onClick={() => onPulish()}
|
||||
onClick={openPublish}
|
||||
>
|
||||
Publish
|
||||
</Button>
|
||||
<Button radius={"xl"} bg={"red"} color="red" onClick={open}>
|
||||
<Button radius={"xl"} bg={"red"} color="red" onClick={openReject}>
|
||||
Reject
|
||||
</Button>
|
||||
</Group>
|
||||
@@ -230,8 +232,8 @@ function ButtonOnHeader({
|
||||
{/* <Divider /> */}
|
||||
|
||||
<Admin_ComponentModalReport
|
||||
opened={opened}
|
||||
onClose={close}
|
||||
opened={openedReject}
|
||||
onClose={closeReject}
|
||||
title={"Alasan penolakan"}
|
||||
onHandlerChange={(val: any) => setCatatan(val.target.value)}
|
||||
buttonKiri={
|
||||
@@ -239,7 +241,7 @@ function ButtonOnHeader({
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
close();
|
||||
closeReject();
|
||||
}}
|
||||
>
|
||||
Batal
|
||||
@@ -249,6 +251,7 @@ function ButtonOnHeader({
|
||||
buttonKanan={
|
||||
<>
|
||||
<Button
|
||||
bg={MainColor.green}
|
||||
loaderPosition="center"
|
||||
loading={isLoadingReject ? true : false}
|
||||
radius={"xl"}
|
||||
@@ -269,6 +272,42 @@ function ButtonOnHeader({
|
||||
</>
|
||||
}
|
||||
/>
|
||||
<Admin_ComponentModalPublish
|
||||
opened={openedPublish}
|
||||
onClose={closePublish}
|
||||
title={"Anda yakin ingin publish donasi ini?"}
|
||||
buttonKiri={
|
||||
<>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
closePublish();
|
||||
}}
|
||||
>
|
||||
Batal
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
buttonKanan={
|
||||
<>
|
||||
<Button
|
||||
bg={MainColor.green}
|
||||
loaderPosition="center"
|
||||
loading={isLoadingPublish ? true : false}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onPublish();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{/* <Modal
|
||||
opened={opened}
|
||||
|
||||
@@ -25,6 +25,7 @@ import { useState } from "react";
|
||||
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||
import adminDonasi_getListReject from "../fun/get/get_list_reject";
|
||||
import { IconEyeCheck } from "@tabler/icons-react";
|
||||
|
||||
export default function AdminDonasi_TableReject({
|
||||
dataReject,
|
||||
@@ -95,7 +96,7 @@ function TableStatus({ dataReject }: { dataReject: any }) {
|
||||
<Button
|
||||
style={{ backgroundColor: MainColor.green }}
|
||||
color={AccentColor.white}
|
||||
leftIcon={<IconEyeEdit />}
|
||||
leftIcon={<IconEyeCheck />}
|
||||
radius={"xl"}
|
||||
onClick={() =>
|
||||
router.push(RouterAdminDonasi_OLD.detail_reject + `${e.id}`)
|
||||
|
||||
@@ -120,10 +120,9 @@ function TableStatus({ listReview }: { listReview: any }) {
|
||||
<Button
|
||||
loaderPosition="center"
|
||||
loading={isLoading && e?.id == idData ? true : false}
|
||||
color={"orange"}
|
||||
style={{ backgroundColor: MainColor.green, color: AccentColor.white }}
|
||||
leftIcon={<IconEyeCheck />}
|
||||
radius={"xl"}
|
||||
variant="outline"
|
||||
onClick={() => {
|
||||
setLoading(true);
|
||||
setIdData(e?.id);
|
||||
@@ -146,13 +145,13 @@ function TableStatus({ listReview }: { listReview: any }) {
|
||||
color={AdminColor.orange}
|
||||
component={
|
||||
<TextInput
|
||||
icon={<IconSearch size={20} />}
|
||||
radius={"xl"}
|
||||
placeholder="Masukan judul"
|
||||
onChange={(val) => {
|
||||
onSearch(val.currentTarget.value);
|
||||
}}
|
||||
/>
|
||||
icon={<IconSearch size={20} />}
|
||||
radius={"xl"}
|
||||
placeholder="Masukan judul"
|
||||
onChange={(val) => {
|
||||
onSearch(val.currentTarget.value);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
{/* <Group
|
||||
|
||||
@@ -47,6 +47,8 @@ import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status
|
||||
import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id";
|
||||
import { event_checkStatus } from "@/app_modules/event/fun/get/fun_check_status_by_id";
|
||||
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
|
||||
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function AdminEvent_ComponentTableReview({
|
||||
listData,
|
||||
@@ -324,7 +326,21 @@ export default function AdminEvent_ComponentTableReview({
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"xs"} h={"100%"}>
|
||||
<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"}
|
||||
@@ -339,7 +355,7 @@ export default function AdminEvent_ComponentTableReview({
|
||||
onSearch(val.currentTarget.value);
|
||||
}}
|
||||
/>
|
||||
</Group>
|
||||
</Group> */}
|
||||
|
||||
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||
{isShowReload && (
|
||||
|
||||
@@ -27,6 +27,7 @@ import QRCode from "react-qr-code";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
|
||||
import { MainColor } from "@/app_modules/_global/color";
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function AdminEvent_TablePublish({
|
||||
listPublish,
|
||||
@@ -224,7 +225,7 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
||||
<Stack spacing={"xs"} h={"100%"}>
|
||||
<ComponentAdminGlobal_TitlePage
|
||||
name="Publish"
|
||||
color={MainColor.green}
|
||||
color={AdminColor.green}
|
||||
component={
|
||||
<TextInput
|
||||
icon={<IconSearch size={20} />}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ComponentAdminGlobal_TampilanRupiah } from "@/app_modules/admin/_admin_global/_component";
|
||||
import { ComponentAdminGlobal_TampilanRupiah, ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
|
||||
import {
|
||||
MODEL_INVOICE_INVESTASI,
|
||||
MODEL_STATUS_INVOICE_INVESTASI,
|
||||
@@ -165,7 +165,38 @@ export function AdminInvestasi_ViewDaftarTransaksi({
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"xs"} h={"100%"}>
|
||||
<Group
|
||||
<ComponentAdminGlobal_TitlePage
|
||||
name="Transkasi"
|
||||
color="gray.4"
|
||||
component={<Group>
|
||||
<ActionIcon
|
||||
size={"lg"}
|
||||
radius={"xl"}
|
||||
variant="light"
|
||||
onClick={() => {
|
||||
onReload();
|
||||
}}
|
||||
>
|
||||
<IconReload />
|
||||
</ActionIcon>
|
||||
<Select
|
||||
placeholder="Pilih status"
|
||||
value={selectedStatus}
|
||||
data={
|
||||
isEmpty(listStatsus)
|
||||
? []
|
||||
: listStatsus.map((e) => ({
|
||||
value: e.id,
|
||||
label: e.name,
|
||||
}))
|
||||
}
|
||||
onChange={(val: any) => {
|
||||
onSelected(val);
|
||||
}}
|
||||
/>
|
||||
</Group>}
|
||||
/>
|
||||
{/* <Group
|
||||
position="apart"
|
||||
bg={"gray.4"}
|
||||
p={"xs"}
|
||||
@@ -199,7 +230,7 @@ export function AdminInvestasi_ViewDaftarTransaksi({
|
||||
}}
|
||||
/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group> */}
|
||||
|
||||
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||
<ScrollArea w={"100%"} h={"90%"}>
|
||||
|
||||
@@ -33,6 +33,7 @@ import {
|
||||
IconBan,
|
||||
IconSearch,
|
||||
IconRefresh,
|
||||
IconCircleCheck,
|
||||
} from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
@@ -44,7 +45,7 @@ import { AdminJob_funEditStatusPublishById } from "../fun/edit/fun_edit_status_p
|
||||
import adminJob_getListReview from "../fun/get/get_list_review";
|
||||
import { useAtom } from "jotai";
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { AdminColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function AdminJob_ViewTavleReview({
|
||||
listReview,
|
||||
@@ -56,7 +57,7 @@ export default function AdminJob_ViewTavleReview({
|
||||
const [nPage, setNPage] = useState(listReview.nPage);
|
||||
const [activePage, setActivePage] = useState(1);
|
||||
const [isSearch, setSearch] = useState("");
|
||||
|
||||
const [publish, setPublish] = useState(false);
|
||||
const [reject, setReject] = useState(false);
|
||||
const [jobId, setJobId] = useState("");
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
@@ -189,16 +190,13 @@ export default function AdminJob_ViewTavleReview({
|
||||
<Stack align="center">
|
||||
<Button
|
||||
color={"green"}
|
||||
leftIcon={<IconEyeShare />}
|
||||
leftIcon={<IconCircleCheck />}
|
||||
radius={"xl"}
|
||||
onClick={() =>
|
||||
onPublish({
|
||||
jobId: e?.id,
|
||||
onLoadData(val: any) {
|
||||
setData(val.data);
|
||||
setNPage(val.nPage);
|
||||
},
|
||||
})
|
||||
onClick={() => {
|
||||
setJobId(e?.id);
|
||||
setPublish(true);
|
||||
}
|
||||
|
||||
}
|
||||
>
|
||||
Publish
|
||||
@@ -222,6 +220,41 @@ export default function AdminJob_ViewTavleReview({
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
title={"Apakah anda yakin ingin mempublish job ini?"}
|
||||
withCloseButton={false}
|
||||
opened={publish}
|
||||
onClose={() => {
|
||||
setPublish(false);
|
||||
}}
|
||||
size={"sm"}
|
||||
centered
|
||||
>
|
||||
<Stack>
|
||||
<Group position="center">
|
||||
<Button radius={"xl"} onClick={() => setPublish(false)}>
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
style={{ transition: "0.5s", backgroundColor: MainColor.green }}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onPublish({
|
||||
jobId: jobId,
|
||||
onLoadData(val: any) {
|
||||
setData(val.data);
|
||||
setNPage(val.nPage);
|
||||
},
|
||||
})
|
||||
setPublish(false);
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
opened={reject}
|
||||
onClose={() => {
|
||||
@@ -252,7 +285,8 @@ export default function AdminJob_ViewTavleReview({
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
style={{ transition: "0.5s" }}
|
||||
style={{ transition: "0.5s", }}
|
||||
bg={MainColor.green}
|
||||
disabled={catatan === "" ? true : false}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
@@ -272,6 +306,7 @@ export default function AdminJob_ViewTavleReview({
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
|
||||
<Stack spacing={"xs"} h={"100%"}>
|
||||
<ComponentAdminGlobal_TitlePage
|
||||
|
||||
Reference in New Issue
Block a user