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