Update Versi 1.5.27 #32
@@ -82,11 +82,11 @@ export function Admin_V3_ComponentButtonUserCircle({
|
||||
label: "Notifikasi",
|
||||
color: "",
|
||||
onClick: () => {
|
||||
ComponentAdminGlobal_NotifikasiPeringatan(
|
||||
"Notifikasi: Masih dalam pengembangan",
|
||||
2000
|
||||
);
|
||||
// setDrawerNotifikasi(true);
|
||||
// ComponentAdminGlobal_NotifikasiPeringatan(
|
||||
// "Notifikasi: Masih dalam pengembangan",
|
||||
// 2000
|
||||
// );
|
||||
setDrawerNotifikasi(true);
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -109,12 +109,11 @@ export function Admin_V3_ComponentButtonUserCircle({
|
||||
label: "Notifikasi",
|
||||
color: "",
|
||||
onClick: () => {
|
||||
ComponentAdminGlobal_NotifikasiPeringatan(
|
||||
"Notifikasi: Masih dalam pengembangan",
|
||||
2000
|
||||
);
|
||||
|
||||
// setDrawerNotifikasi(true);
|
||||
// ComponentAdminGlobal_NotifikasiPeringatan(
|
||||
// "Notifikasi: Masih dalam pengembangan",
|
||||
// 2000
|
||||
// );
|
||||
setDrawerNotifikasi(true);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -83,7 +83,6 @@ export function Admin_V3_MainLayout({
|
||||
const [opened, handlers] = useDisclosure(false);
|
||||
const [openedDrawer, handlersDrawer] = useDisclosure(false);
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
@@ -171,7 +170,7 @@ export function Admin_V3_MainLayout({
|
||||
color: AccentColor.white,
|
||||
},
|
||||
header: {
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
backgroundColor: MainColor.darkblue,
|
||||
color: AccentColor.white,
|
||||
},
|
||||
close: {
|
||||
@@ -202,7 +201,7 @@ export function Admin_V3_MainLayout({
|
||||
setActiveChildId(val.childId);
|
||||
}}
|
||||
onToggleNavbar={(val: any) => {
|
||||
handlersDrawer.close
|
||||
val === false && handlersDrawer.close();
|
||||
}}
|
||||
/>
|
||||
{/* <ComponentAdmin_UIDrawerNotifikasi
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
import {
|
||||
gs_adminDonasi_triggerReview,
|
||||
gs_adminEvent_triggerReview,
|
||||
gs_adminJob_triggerReview,
|
||||
gs_adminVoting_triggerReview,
|
||||
ITypeStatusNotifikasi,
|
||||
gs_adminVoting_triggerReview
|
||||
} from "@/lib/global_state";
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
import { clientLogger } from "@/util/clientLogger";
|
||||
import { Badge, Card, Divider, Group, Stack, Text } from "@mantine/core";
|
||||
import { IconCheck, IconChecks, IconSpeakerphone } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { clientLogger } from "@/util/clientLogger";
|
||||
import moment from "moment";
|
||||
import "moment/locale/id";
|
||||
import {
|
||||
IAdmin_ActivePage,
|
||||
IAdmin_ActiveChildId,
|
||||
} from "../../notifikasi/route_setting/type_of_select_page";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
|
||||
import adminNotifikasi_findRouterForum from "../../notifikasi/route_setting/forum";
|
||||
import { adminNotifikasi_findRouterJob } from "../../notifikasi/route_setting/job";
|
||||
import {
|
||||
IAdmin_ActiveChildId,
|
||||
IAdmin_ActivePage,
|
||||
} from "../../notifikasi/route_setting/type_of_select_page";
|
||||
|
||||
export default function Admin_V3_ComponentCardNotifikasi({
|
||||
data,
|
||||
@@ -70,13 +71,6 @@ export default function Admin_V3_ComponentCardNotifikasi({
|
||||
appId: data.appId,
|
||||
notifikasiId: data.id,
|
||||
router: router,
|
||||
activePage: activePage,
|
||||
// onLoadCountNotif(val) {
|
||||
// onLoadCountNotif(val);
|
||||
// },
|
||||
// onLoadDataNotifikasi(val) {
|
||||
// onLoadDataNotifikasi(val);
|
||||
// },
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar({
|
||||
id: val.id,
|
||||
@@ -96,6 +90,30 @@ export default function Admin_V3_ComponentCardNotifikasi({
|
||||
}
|
||||
// ========================== JOB ========================== //
|
||||
|
||||
// ========================== FORUM ==============================//
|
||||
|
||||
if (data.kategoriApp === "FORUM") {
|
||||
setDataId(data.id);
|
||||
|
||||
const checkForum = await adminNotifikasi_findRouterForum({
|
||||
data: data,
|
||||
router: router,
|
||||
onChangeNavbar(val) {
|
||||
onChangeNavbar(val);
|
||||
},
|
||||
});
|
||||
|
||||
if (checkForum !== "") {
|
||||
router.push(checkForum);
|
||||
setDataId("");
|
||||
setVisible(false);
|
||||
onToggleNavbar(false);
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiPeringatan("Gagal memuat forum");
|
||||
}
|
||||
}
|
||||
// ========================== FORUM ==============================//
|
||||
|
||||
// ========================== EVENT ========================== //
|
||||
|
||||
// if (data.kategoriApp == "EVENT") {
|
||||
@@ -236,18 +254,7 @@ export default function Admin_V3_ComponentCardNotifikasi({
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // FORUM
|
||||
// e?.kategoriApp === "FORUM" &&
|
||||
// adminNotifikasi_findRouterForum({
|
||||
// data: e,
|
||||
// router: router,
|
||||
// onChangeNavbar(val) {
|
||||
// onChangeNavbar(val);
|
||||
// },
|
||||
// onToggleNavbar(val) {
|
||||
// onToggleNavbar(val);
|
||||
// },
|
||||
// });
|
||||
// ========================== INVESTASI ========================== //
|
||||
} catch (error) {
|
||||
clientLogger.error("Error notifikasi function", error);
|
||||
} finally {
|
||||
@@ -260,9 +267,10 @@ export default function Admin_V3_ComponentCardNotifikasi({
|
||||
<Card
|
||||
style={{
|
||||
transition: "0.5s",
|
||||
cursor: "pointer",
|
||||
}}
|
||||
mb={"15px"}
|
||||
c={"white"}
|
||||
c={data.isRead ? "gray" : "white"}
|
||||
key={data.id}
|
||||
bg={data.isRead ? AccentColor.blackgray : AccentColor.darkblue}
|
||||
sx={{
|
||||
@@ -306,9 +314,9 @@ export default function Admin_V3_ComponentCardNotifikasi({
|
||||
<Text lineClamp={2} fw={"bold"} fz={"xs"}>
|
||||
{data.title}
|
||||
</Text>
|
||||
<Text lineClamp={2} fz={"xs"}>
|
||||
{/* <Text lineClamp={2} fz={"xs"}>
|
||||
{data.pesan}
|
||||
</Text>
|
||||
</Text> */}
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
<Card.Section p={"sm"}>
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
import {
|
||||
MainColor
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Divider,
|
||||
Group,
|
||||
Loader,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
Text
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import _ from "lodash";
|
||||
import { ScrollOnly } from "next-scroll-loader";
|
||||
import adminNotifikasi_getByUserId from "../../notifikasi/fun/get/get_notifikasi_by_user_id";
|
||||
import { useState } from "react";
|
||||
import {
|
||||
apiGetNotifikasiByUserId,
|
||||
apiPostIsReadNotifikasi,
|
||||
} from "../../notifikasi/lib/api_fetch_notifikasi";
|
||||
import AdminNotifikasi_ViewCardDrawer from "../../notifikasi/view_card_drawer";
|
||||
import Admin_V3_ComponentCardNotifikasi from "./comp_card_notifikasi";
|
||||
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
||||
import {
|
||||
IAdmin_ActivePage,
|
||||
IAdmin_ActiveChildId,
|
||||
IAdmin_ActivePage,
|
||||
} from "../../notifikasi/route_setting/type_of_select_page";
|
||||
import Admin_V3_ComponentCardNotifikasi from "./comp_card_notifikasi";
|
||||
|
||||
export function Admin_V3_ViewDrawerNotifikasi({
|
||||
userLoginId,
|
||||
@@ -158,8 +158,12 @@ export function Admin_V3_ViewDrawerNotifikasi({
|
||||
return (
|
||||
<>
|
||||
<Stack pt={"sm"} pb={"xl"}>
|
||||
<Group>
|
||||
<Group position="right">
|
||||
<Button
|
||||
size="xs"
|
||||
bg={MainColor.yellow}
|
||||
color="yellow"
|
||||
c={"black"}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
handleUpdateReadAll();
|
||||
@@ -176,6 +180,7 @@ export function Admin_V3_ViewDrawerNotifikasi({
|
||||
Tandai belum baca
|
||||
</Button>
|
||||
</Group>
|
||||
<Divider color={MainColor.white}/>
|
||||
|
||||
{_.isEmpty(data) ? (
|
||||
<Center>
|
||||
|
||||
@@ -1,33 +1,45 @@
|
||||
import { RouterAdminForum } from "@/lib/router_admin/router_admin_forum";
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { IAdmin_ActivePage, IAdmin_ActiveChildId } from "./type_of_select_page";
|
||||
import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
|
||||
|
||||
export default async function adminNotifikasi_findRouterForum({
|
||||
data,
|
||||
router,
|
||||
onChangeNavbar,
|
||||
onToggleNavbar,
|
||||
}: {
|
||||
data: MODEL_NOTIFIKASI;
|
||||
router: AppRouterInstance;
|
||||
onChangeNavbar: (val: any) => void;
|
||||
onToggleNavbar: (val: any) => void;
|
||||
onChangeNavbar: (val: {
|
||||
id: IAdmin_ActivePage;
|
||||
childId: IAdmin_ActiveChildId;
|
||||
}) => void;
|
||||
}) {
|
||||
if (data.status === "Report Posting") {
|
||||
const routeName = RouterAdminForum.table_report_posting;
|
||||
router.push(routeName);
|
||||
onChangeNavbar({
|
||||
id: 7,
|
||||
childId: 73,
|
||||
});
|
||||
}
|
||||
const udpateReadNotifikasi = await adminNotifikasi_funUpdateIsReadById({
|
||||
notifId: data.id,
|
||||
});
|
||||
if (udpateReadNotifikasi.status == 200) {
|
||||
let pagePath = "";
|
||||
if (data.status === "Report Posting") {
|
||||
pagePath = RouterAdminForum.table_report_posting;
|
||||
// router.push(routeName);
|
||||
onChangeNavbar({
|
||||
id: "Forum",
|
||||
childId: "Forum_3",
|
||||
});
|
||||
}
|
||||
|
||||
if (data.status === "Report Komentar") {
|
||||
const routeName = RouterAdminForum.table_report_komentar;
|
||||
router.push(routeName);
|
||||
onChangeNavbar({
|
||||
id: 7,
|
||||
childId: 74,
|
||||
});
|
||||
if (data.status === "Report Komentar") {
|
||||
pagePath = RouterAdminForum.table_report_komentar;
|
||||
// router.push(routeName);
|
||||
onChangeNavbar({
|
||||
id: "Forum",
|
||||
childId: "Forum_4",
|
||||
});
|
||||
}
|
||||
return pagePath;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,18 @@
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
|
||||
import { admin_funCheckStatusJob } from "../fun/get/fun_check_status_job";
|
||||
import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import adminNotifikasi_countNotifikasi from "../fun/count/count_is_read";
|
||||
import adminNotifikasi_getByUserId from "../fun/get/get_notifikasi_by_user_id";
|
||||
import { IAdmin_ActivePage, IAdmin_ActiveChildId } from "./type_of_select_page";
|
||||
import { IAdmin_ActiveChildId, IAdmin_ActivePage } from "./type_of_select_page";
|
||||
|
||||
export async function adminNotifikasi_findRouterJob({
|
||||
appId,
|
||||
notifikasiId,
|
||||
router,
|
||||
activePage,
|
||||
// onLoadCountNotif,
|
||||
// onLoadDataNotifikasi ,
|
||||
onChangeNavbar,
|
||||
}: {
|
||||
appId: string;
|
||||
notifikasiId: string;
|
||||
router: AppRouterInstance;
|
||||
activePage: number;
|
||||
// onLoadCountNotif: (val: any) => void;
|
||||
// onLoadDataNotifikasi: (val: any) => void;
|
||||
onChangeNavbar: (val: {
|
||||
id: IAdmin_ActivePage;
|
||||
childId: IAdmin_ActiveChildId;
|
||||
@@ -35,14 +26,6 @@ export async function adminNotifikasi_findRouterJob({
|
||||
});
|
||||
|
||||
if (udpateReadNotifikasi.status == 200) {
|
||||
// const loadCountNotif = await adminNotifikasi_countNotifikasi();
|
||||
// onLoadCountNotif(loadCountNotif);
|
||||
|
||||
// const loadListNotifikasi = await adminNotifikasi_getByUserId({
|
||||
// page: 1,
|
||||
// });
|
||||
// onLoadDataNotifikasi(loadListNotifikasi);
|
||||
|
||||
const path = `/dev/admin/job/child/${check.statusName}`;
|
||||
|
||||
if (check.statusName == "draft") {
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
gs_adminVoting_triggerReview,
|
||||
ITypeStatusNotifikasi,
|
||||
} from "@/lib/global_state";
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
||||
import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
import { Badge, Card, Divider, Group, Stack, Text } from "@mantine/core";
|
||||
@@ -263,11 +263,12 @@ export default function AdminNotifikasi_ViewCardDrawer({
|
||||
<Card
|
||||
style={{
|
||||
transition: "0.5s",
|
||||
border: `2px solid ${MainColor.soft_darkblue}`,
|
||||
}}
|
||||
mb={"15px"}
|
||||
c={"white"}
|
||||
key={data.id}
|
||||
bg={data.isRead ? "gray" : AccentColor.darkblue}
|
||||
bg={data.isRead ? "gray" : MainColor.darkblue}
|
||||
sx={{
|
||||
borderColor: AccentColor.blue,
|
||||
borderStyle: "solid",
|
||||
|
||||
Reference in New Issue
Block a user