Merge pull request #399 from bipproduction/amalia/04-feb-25
Amalia/04 feb 25
This commit is contained in:
46
src/app/api/project/[id]/lainnya/route.ts
Normal file
46
src/app/api/project/[id]/lainnya/route.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import { prisma } from "@/module/_global";
|
||||||
|
import { funGetUserByCookies } from "@/module/auth";
|
||||||
|
import { createLogUser } from "@/module/user";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export async function DELETE(request: Request, context: { params: { id: string } }) {
|
||||||
|
try {
|
||||||
|
const user = await funGetUserByCookies()
|
||||||
|
if (user.id == undefined) {
|
||||||
|
return NextResponse.json({ success: false, message: "Anda harus login untuk mengakses ini" }, { status: 401 });
|
||||||
|
}
|
||||||
|
|
||||||
|
const { id } = context.params
|
||||||
|
const data = await prisma.project.count({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (data == 0) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false, message: "Gagal mendapatkan kegiatan, data tidak ditemukan",
|
||||||
|
},
|
||||||
|
{ status: 404 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const dataDelete = await prisma.project.update({
|
||||||
|
where: {
|
||||||
|
id
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
isActive: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// create log user
|
||||||
|
const log = await createLogUser({ act: 'DELETE', desc: 'User menghapus data kegiatan', table: 'project', data: String(id) })
|
||||||
|
return NextResponse.json({ success: true, message: "Kegiatan berhasil dihapus" }, { status: 200 });
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
return NextResponse.json({ success: false, message: "Gagal menghapus kegiatan, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
||||||
|
}
|
||||||
|
}
|
||||||
48
src/app/api/task/[id]/lainnya/route.ts
Normal file
48
src/app/api/task/[id]/lainnya/route.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { prisma } from "@/module/_global";
|
||||||
|
import { funGetUserByCookies } from "@/module/auth";
|
||||||
|
import { createLogUser } from "@/module/user";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
// PEMBATALAN TASK DIVISI
|
||||||
|
export async function DELETE(request: Request, context: { params: { id: string } }) {
|
||||||
|
try {
|
||||||
|
const user = await funGetUserByCookies()
|
||||||
|
if (user.id == undefined) {
|
||||||
|
return NextResponse.json({ success: false, message: "Anda harus login untuk mengakses ini" }, { status: 401 });
|
||||||
|
}
|
||||||
|
|
||||||
|
const { id } = context.params;
|
||||||
|
const data = await prisma.divisionProject.count({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (data == 0) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Penghapusan tugas gagal, data tugas tidak ditemukan",
|
||||||
|
},
|
||||||
|
{ status: 404 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const update = await prisma.divisionProject.update({
|
||||||
|
where: {
|
||||||
|
id
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
isActive: false,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// create log user
|
||||||
|
const log = await createLogUser({ act: 'DELETE', desc: 'User menghapus tugas divisi', table: 'divisionProject', data: id })
|
||||||
|
|
||||||
|
return NextResponse.json({ success: true, message: "Tugas berhasil dihapuskan", }, { status: 200 });
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
return NextResponse.json({ success: false, message: "Gagal menghapus tugas, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -55,8 +55,9 @@ export async function GET(request: Request, context: { params: { id: string } })
|
|||||||
const position = users?.Position.name
|
const position = users?.Position.name
|
||||||
const idUserRole = users?.UserRole.id
|
const idUserRole = users?.UserRole.id
|
||||||
const phone = users?.phone.substr(2)
|
const phone = users?.phone.substr(2)
|
||||||
|
const role = users?.UserRole.name
|
||||||
|
|
||||||
const result = { ...userData, group, position, idUserRole, phone };
|
const result = { ...userData, group, position, idUserRole, phone, role };
|
||||||
|
|
||||||
const omitData = _.omit(result, ["Group", "Position", "UserRole"]);
|
const omitData = _.omit(result, ["Group", "Position", "UserRole"]);
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ export async function GET(request: Request) {
|
|||||||
select: {
|
select: {
|
||||||
name: true
|
name: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
UserRole:{
|
||||||
|
select:{
|
||||||
|
name: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -43,10 +48,11 @@ export async function GET(request: Request) {
|
|||||||
const group = data?.Group.name
|
const group = data?.Group.name
|
||||||
const position = data?.Position.name
|
const position = data?.Position.name
|
||||||
const phone = data?.phone.substr(2)
|
const phone = data?.phone.substr(2)
|
||||||
|
const role = data?.UserRole.name
|
||||||
|
|
||||||
const omitData = _.omit(data, ["Group", "Position", "phone"])
|
const omitData = _.omit(data, ["Group", "Position", "phone", "UserRole"]);
|
||||||
|
|
||||||
const result = { ...userData, group, position, phone };
|
const result = { ...userData, group, position, phone, role };
|
||||||
|
|
||||||
return NextResponse.json({ success: true, data: result });
|
return NextResponse.json({ success: true, data: result });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
|||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: Request) {
|
||||||
try {
|
try {
|
||||||
return NextResponse.json({ success: true, version: "1.2.2", tahap: "beta", update:"-unshare dokumen divisi -jumlah dokumen pada detail divisi -tampil dokumen share pada detail divisi -loguser pada saat share dokumen divisi -boleh unduh file share" }, { status: 200 });
|
return NextResponse.json({ success: true, version: "1.2.3", tahap: "beta", update:"-nama grup darmasaba jadi lembaga desa, -menampilkan user role pada profile pada detail anggota, -fitur hapus pada data yg telah dibatalkan pada fitur kegiatan dan tugas divisi" }, { status: 200 });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { keyWibu, TEMA } from '@/module/_global';
|
import { keyWibu, TEMA } from '@/module/_global';
|
||||||
import LayoutModal from '@/module/_global/layout/layout_modal';
|
import LayoutModal from '@/module/_global/layout/layout_modal';
|
||||||
|
import { useHookstate } from '@hookstate/core';
|
||||||
import { Box, Flex, SimpleGrid, Stack, Text } from '@mantine/core';
|
import { Box, Flex, SimpleGrid, Stack, Text } from '@mantine/core';
|
||||||
import { useParams, useRouter } from 'next/navigation';
|
import { useParams, useRouter } from 'next/navigation';
|
||||||
import React, { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import toast from 'react-hot-toast';
|
import toast from 'react-hot-toast';
|
||||||
import { MdDelete, MdEdit } from 'react-icons/md';
|
import { FaTrash, FaUsers } from 'react-icons/fa6';
|
||||||
import { funDeleteCalenderById } from '../lib/api_calender';
|
import { MdEdit } from 'react-icons/md';
|
||||||
import { FaUsers } from 'react-icons/fa6';
|
|
||||||
import { useHookstate } from '@hookstate/core';
|
|
||||||
import { useWibuRealtime } from 'wibu-realtime';
|
import { useWibuRealtime } from 'wibu-realtime';
|
||||||
|
import { funDeleteCalenderById } from '../lib/api_calender';
|
||||||
|
|
||||||
export default function DrawerDetailEvent({ idCalendar, close }: { idCalendar: string, close: (val: boolean) => void }) {
|
export default function DrawerDetailEvent({ idCalendar, close }: { idCalendar: string, close: (val: boolean) => void }) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -82,7 +82,7 @@ export default function DrawerDetailEvent({ idCalendar, close }: { idCalendar: s
|
|||||||
</Flex>
|
</Flex>
|
||||||
<Flex onClick={() => setModal(true)} justify={'center'} align={'center'} direction={'column'} >
|
<Flex onClick={() => setModal(true)} justify={'center'} align={'center'} direction={'column'} >
|
||||||
<Box>
|
<Box>
|
||||||
<MdDelete size={30} color={tema.get().utama} />
|
<FaTrash size={30} color={tema.get().utama} />
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text ta={"center"} c={tema.get().utama}>Hapus Acara</Text>
|
<Text ta={"center"} c={tema.get().utama}>Hapus Acara</Text>
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ export default function FormCreateDiscussionGeneral() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function onToChooseAnggota() {
|
function onToChooseAnggota() {
|
||||||
if (roleLogin.get() == "supadmin" && body.idGroup == "")
|
if (roleLogin.get() == "supadmin" && (body.idGroup == "" || String(body.idGroup) == "null"))
|
||||||
return toast.error("Error! grup harus diisi")
|
return toast.error("Error! lembaga desa tidak boleh kosong")
|
||||||
setChooseAnggota(true)
|
setChooseAnggota(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,8 +158,8 @@ export default function FormCreateDiscussionGeneral() {
|
|||||||
{
|
{
|
||||||
(roleLogin.get() == "supadmin") && (
|
(roleLogin.get() == "supadmin") && (
|
||||||
<Select
|
<Select
|
||||||
placeholder="Grup"
|
placeholder="Lembaga Desa"
|
||||||
label="Grup"
|
label="Lembaga Desa"
|
||||||
size="md"
|
size="md"
|
||||||
styles={{
|
styles={{
|
||||||
input: {
|
input: {
|
||||||
@@ -178,7 +178,7 @@ export default function FormCreateDiscussionGeneral() {
|
|||||||
value={(body.idGroup == "") ? null : body.idGroup}
|
value={(body.idGroup == "") ? null : body.idGroup}
|
||||||
error={
|
error={
|
||||||
touched.idGroup && (
|
touched.idGroup && (
|
||||||
body.idGroup == "" || String(body.idGroup) == "null" ? "Grup Tidak Boleh Kosong" : null
|
body.idGroup == "" || String(body.idGroup) == "null" ? "Lembaga Desa Tidak Boleh Kosong" : null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ export default function CreateDivision() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onToChooseAnggota() {
|
function onToChooseAnggota() {
|
||||||
if (roleUser == "supadmin" && body.idGroup == "")
|
if (roleUser == "supadmin" && (body.idGroup == "" || String(body.idGroup) == "null"))
|
||||||
return toast.error("Error! grup harus diisi")
|
return toast.error("Error! lembaga desa tidak boleh kosong")
|
||||||
setChooseAnggota(true)
|
setChooseAnggota(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,8 +147,8 @@ export default function CreateDivision() {
|
|||||||
{
|
{
|
||||||
(roleUser == "supadmin") && (
|
(roleUser == "supadmin") && (
|
||||||
<Select
|
<Select
|
||||||
placeholder="Grup"
|
placeholder="Lembaga Desa"
|
||||||
label="Grup"
|
label="Lembaga Desa"
|
||||||
size="md"
|
size="md"
|
||||||
required
|
required
|
||||||
radius={10}
|
radius={10}
|
||||||
@@ -161,7 +161,7 @@ export default function CreateDivision() {
|
|||||||
}}
|
}}
|
||||||
error={
|
error={
|
||||||
touched.idGroup && (
|
touched.idGroup && (
|
||||||
body.idGroup == "" || String(body.idGroup) == "null" ? "Grup Tidak Boleh Kosong" : null
|
body.idGroup == "" || String(body.idGroup) == "null" ? "Lembaga Desa Tidak Boleh Kosong" : null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
value={body.idGroup}
|
value={body.idGroup}
|
||||||
|
|||||||
@@ -5,17 +5,16 @@ import { useHookstate } from "@hookstate/core";
|
|||||||
import { Badge, Box, Select, Skeleton, Stack, Table } from "@mantine/core";
|
import { Badge, Box, Select, Skeleton, Stack, Table } from "@mantine/core";
|
||||||
import { DateInput } from "@mantine/dates";
|
import { DateInput } from "@mantine/dates";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
|
import _ from "lodash";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
|
import router from "next/router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { funGetReportDivision } from "../lib/api_division";
|
import { funGetReportDivision } from "../lib/api_division";
|
||||||
|
import EchartBarReportCalender from "./echart_bar_calender";
|
||||||
import EchartBarReport from "./echart_bar_report";
|
import EchartBarReport from "./echart_bar_report";
|
||||||
import EchartPaiReport from "./echart_pai_report";
|
import EchartPaiReport from "./echart_pai_report";
|
||||||
import EventReport from "./event_report";
|
|
||||||
import _ from "lodash";
|
|
||||||
import router from "next/router";
|
|
||||||
import EchartBarReportCalender from "./echart_bar_calender";
|
|
||||||
|
|
||||||
export default function CreateReport() {
|
export default function CreateReport() {
|
||||||
const [value, setValue] = useState<Date | null>(null);
|
const [value, setValue] = useState<Date | null>(null);
|
||||||
@@ -150,8 +149,8 @@ export default function CreateReport() {
|
|||||||
<Stack>
|
<Stack>
|
||||||
{roleLogin.get() == "supadmin" &&
|
{roleLogin.get() == "supadmin" &&
|
||||||
<Select
|
<Select
|
||||||
placeholder="Grup"
|
placeholder="Lembaga Desa"
|
||||||
label="Grup"
|
label="Lembaga Desa"
|
||||||
size="md"
|
size="md"
|
||||||
required
|
required
|
||||||
radius={10}
|
radius={10}
|
||||||
@@ -160,7 +159,7 @@ export default function CreateReport() {
|
|||||||
label: pro.name
|
label: pro.name
|
||||||
}))}
|
}))}
|
||||||
onChange={(val) => { onChangeDate(val, 'grup') }}
|
onChange={(val) => { onChangeDate(val, 'grup') }}
|
||||||
error={touched.grup && "Grup tidak boleh kosong"}
|
error={touched.grup && "Lembaga desa tidak boleh kosong"}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export default function DrawerGroup({ onSuccess, }: { onSuccess: (val: boolean)
|
|||||||
<IoAddCircle size={30} color={tema.get().utama} />
|
<IoAddCircle size={30} color={tema.get().utama} />
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text c={tema.get().utama}>Tambah Darmasaba</Text>
|
<Text c={tema.get().utama} ta={"center"}>Tambah Lembaga Desa</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
</SimpleGrid>
|
</SimpleGrid>
|
||||||
@@ -86,7 +86,7 @@ export default function DrawerGroup({ onSuccess, }: { onSuccess: (val: boolean)
|
|||||||
<LayoutDrawer
|
<LayoutDrawer
|
||||||
opened={openDrawerGroup}
|
opened={openDrawerGroup}
|
||||||
onClose={() => setOpenDrawerGroup(false)}
|
onClose={() => setOpenDrawerGroup(false)}
|
||||||
title={"Tambah Darmasaba"}
|
title={"Tambah Lembaga Desa"}
|
||||||
>
|
>
|
||||||
<Box pos={"relative"} h={"28.5vh"}>
|
<Box pos={"relative"} h={"28.5vh"}>
|
||||||
<TextInput
|
<TextInput
|
||||||
@@ -99,9 +99,9 @@ export default function DrawerGroup({ onSuccess, }: { onSuccess: (val: boolean)
|
|||||||
}}
|
}}
|
||||||
size="md"
|
size="md"
|
||||||
radius={10}
|
radius={10}
|
||||||
label="Darmasaba"
|
label="Lembaga Desa"
|
||||||
required
|
required
|
||||||
placeholder="Darmasaba"
|
placeholder="Nama Lembaga Desa"
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
onValidation('name', e.target.value)
|
onValidation('name', e.target.value)
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ export default function EditDrawerGroup({ onUpdated, id, isActive, }: { onUpdate
|
|||||||
<LayoutDrawer
|
<LayoutDrawer
|
||||||
opened={openDrawerGroup}
|
opened={openDrawerGroup}
|
||||||
onClose={() => setOpenDrawerGroup(false)}
|
onClose={() => setOpenDrawerGroup(false)}
|
||||||
title={"Edit Darmasaba"}
|
title={"Edit Lembaga Desa"}
|
||||||
>
|
>
|
||||||
<Box pos={"relative"} h={"28.5vh"}>
|
<Box pos={"relative"} h={"28.5vh"}>
|
||||||
<TextInput
|
<TextInput
|
||||||
@@ -162,8 +162,8 @@ export default function EditDrawerGroup({ onUpdated, id, isActive, }: { onUpdate
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
radius={10}
|
radius={10}
|
||||||
placeholder="Darmasaba"
|
placeholder="Nama Lembaga Desa"
|
||||||
label="Darmasaba"
|
label="Lembaga Desa"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<Box pos={"absolute"} bottom={10} left={0} right={0}>
|
<Box pos={"absolute"} bottom={10} left={0} right={0}>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default function ListGroupActive() {
|
|||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.error("Gagal mendapatkan grup, coba lagi nanti");
|
toast.error("Gagal mendapatkan lembaga desa, coba lagi nanti");
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default function NavbarGroup() {
|
|||||||
const tema = useHookstate(TEMA)
|
const tema = useHookstate(TEMA)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LayoutNavbarNew back='/home' title='Darmasaba'
|
<LayoutNavbarNew back='/home' title='Lembaga Desa'
|
||||||
menu={
|
menu={
|
||||||
<ActionIcon onClick={() => setOpen(true)} variant="light" bg={tema.get().bgIcon} size="lg" radius="lg" aria-label="Settings">
|
<ActionIcon onClick={() => setOpen(true)} variant="light" bg={tema.get().bgIcon} size="lg" radius="lg" aria-label="Settings">
|
||||||
<HiMenu size={20} color='white' />
|
<HiMenu size={20} color='white' />
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ export default function ViewDetailFeature() {
|
|||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Center>
|
</Center>
|
||||||
<Center>
|
<Center>
|
||||||
<Text fz={isMobile ? 13 : 15} c={tema.get().utama}>Darmasaba</Text>
|
<Text fz={isMobile ? 13 : 15} c={tema.get().utama} ta={'center'}>Lembaga Desa</Text>
|
||||||
</Center>
|
</Center>
|
||||||
</Box>
|
</Box>
|
||||||
<Box onClick={() => router.push('/color-palette')}>
|
<Box onClick={() => router.push('/color-palette')}>
|
||||||
|
|||||||
@@ -157,8 +157,8 @@ export default function DrawerListPosition({ onCreated }: { onCreated: (val: boo
|
|||||||
{
|
{
|
||||||
roleLogin.get() == "supadmin" &&
|
roleLogin.get() == "supadmin" &&
|
||||||
<Select
|
<Select
|
||||||
label="Grup"
|
label="Lembaga Desa"
|
||||||
placeholder="Pilih grup"
|
placeholder="Pilih Lembaga Desa"
|
||||||
data={
|
data={
|
||||||
listGroup
|
listGroup
|
||||||
? listGroup.map((data) => ({
|
? listGroup.map((data) => ({
|
||||||
@@ -181,7 +181,7 @@ export default function DrawerListPosition({ onCreated }: { onCreated: (val: boo
|
|||||||
}}
|
}}
|
||||||
error={
|
error={
|
||||||
touched.idGroup && (
|
touched.idGroup && (
|
||||||
listData.idGroup == "" || String(listData.idGroup) == "null" ? "Grup Tidak Boleh Kosong" : null
|
listData.idGroup == "" || String(listData.idGroup) == "null" ? "Lembaga Desa Tidak Boleh Kosong" : null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -148,3 +148,14 @@ export const funAddFileProject = async (path: string, data: FormData) => {
|
|||||||
});
|
});
|
||||||
return await response.json().catch(() => null);
|
return await response.json().catch(() => null);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const funDeleteProject = async (path: string) => {
|
||||||
|
const response = await fetch(`/api/project/${path}/lainnya`, {
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return await response.json().catch(() => null);
|
||||||
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ export default function CreateProject() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onToChooseAnggota() {
|
function onToChooseAnggota() {
|
||||||
if (roleLogin.get() == "supadmin" && body.idGroup == "")
|
if (roleLogin.get() == "supadmin" && (body.idGroup == "" || String(body.idGroup) == "null"))
|
||||||
return toast.error("Error! grup harus diisi")
|
return toast.error("Error! lembaga desa tidak boleh kosong")
|
||||||
setChooseAnggota(true)
|
setChooseAnggota(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,8 +196,8 @@ export default function CreateProject() {
|
|||||||
{
|
{
|
||||||
(roleLogin.get() == "supadmin") && (
|
(roleLogin.get() == "supadmin") && (
|
||||||
<Select
|
<Select
|
||||||
placeholder="Grup"
|
placeholder="Lembaga Desa"
|
||||||
label="Grup"
|
label="Lembaga Desa"
|
||||||
size="md"
|
size="md"
|
||||||
styles={{
|
styles={{
|
||||||
input: {
|
input: {
|
||||||
@@ -217,7 +217,7 @@ export default function CreateProject() {
|
|||||||
value={(body.idGroup == "") ? null : body.idGroup}
|
value={(body.idGroup == "") ? null : body.idGroup}
|
||||||
error={
|
error={
|
||||||
touched.idGroup && (
|
touched.idGroup && (
|
||||||
body.idGroup == "" || String(body.idGroup) == "null" ? "Grup Tidak Boleh Kosong" : null
|
body.idGroup == "" || String(body.idGroup) == "null" ? "Lembaga Desa Tidak Boleh Kosong" : null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { globalRole, keyWibu, LayoutDrawer, LayoutNavbarNew, TEMA } from '@/module/_global';
|
import { globalRole, keyWibu, LayoutDrawer, LayoutNavbarNew, TEMA } from '@/module/_global';
|
||||||
|
import LayoutModal from '@/module/_global/layout/layout_modal';
|
||||||
import { useHookstate } from '@hookstate/core';
|
import { useHookstate } from '@hookstate/core';
|
||||||
import { ActionIcon, Box, Flex, SimpleGrid, Stack, Text } from '@mantine/core';
|
import { ActionIcon, Box, Flex, SimpleGrid, Stack, Text } from '@mantine/core';
|
||||||
import { useShallowEffect } from '@mantine/hooks';
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
import { useParams, useRouter } from 'next/navigation';
|
import { useParams, useRouter } from 'next/navigation';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import toast from 'react-hot-toast';
|
import toast from 'react-hot-toast';
|
||||||
import { FaFileCirclePlus, FaPencil, FaUsers } from 'react-icons/fa6';
|
import { FaFileCirclePlus, FaPencil, FaTrash, FaUsers } from 'react-icons/fa6';
|
||||||
import { HiMenu } from 'react-icons/hi';
|
import { HiMenu } from 'react-icons/hi';
|
||||||
import { IoAddCircle } from 'react-icons/io5';
|
import { IoAddCircle } from 'react-icons/io5';
|
||||||
import { MdCancel } from 'react-icons/md';
|
import { MdCancel } from 'react-icons/md';
|
||||||
import { useWibuRealtime } from 'wibu-realtime';
|
import { useWibuRealtime } from 'wibu-realtime';
|
||||||
import { funGetOneProjectById } from '../lib/api_project';
|
import { funDeleteProject, funGetOneProjectById } from '../lib/api_project';
|
||||||
import { globalIsMemberProject } from '../lib/val_project';
|
import { globalIsMemberProject } from '../lib/val_project';
|
||||||
|
|
||||||
export default function NavbarDetailProject() {
|
export default function NavbarDetailProject() {
|
||||||
@@ -24,6 +25,8 @@ export default function NavbarDetailProject() {
|
|||||||
const memberProject = useHookstate(globalIsMemberProject)
|
const memberProject = useHookstate(globalIsMemberProject)
|
||||||
const tema = useHookstate(TEMA)
|
const tema = useHookstate(TEMA)
|
||||||
const [reason, setReason] = useState("")
|
const [reason, setReason] = useState("")
|
||||||
|
const [openModal, setOpenModal] = useState(false)
|
||||||
|
const [loadingModal, setLoadingModal] = useState(false)
|
||||||
const [dataRealTime, setDataRealtime] = useWibuRealtime({
|
const [dataRealTime, setDataRealtime] = useWibuRealtime({
|
||||||
WIBU_REALTIME_TOKEN: keyWibu,
|
WIBU_REALTIME_TOKEN: keyWibu,
|
||||||
project: "sdm"
|
project: "sdm"
|
||||||
@@ -39,10 +42,32 @@ export default function NavbarDetailProject() {
|
|||||||
} else {
|
} else {
|
||||||
toast.error(res.message);
|
toast.error(res.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
toast.error("Gagal mendapatkan data Kegiatan, coba lagi nanti");
|
toast.error("Gagal mendapatkan data kegiatan, coba lagi nanti");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function deleteDataProject() {
|
||||||
|
try {
|
||||||
|
setLoadingModal(true)
|
||||||
|
const res = await funDeleteProject(param.id);
|
||||||
|
if (res.success) {
|
||||||
|
setDataRealtime([{
|
||||||
|
category: "project-delete",
|
||||||
|
id: param.id,
|
||||||
|
}])
|
||||||
|
toast.success(res.message)
|
||||||
|
router.push("/project")
|
||||||
|
} else {
|
||||||
|
toast.error(res.message)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
toast.error("Gagal menghapus data kegiatan, coba lagi nanti");
|
||||||
|
} finally {
|
||||||
|
setLoadingModal(false)
|
||||||
|
setOpenModal(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,6 +79,13 @@ export default function NavbarDetailProject() {
|
|||||||
if (dataRealTime && dataRealTime.some((i: any) => (i.category == 'project-detail' || i.category == 'project-detail-status') && i.id == param.id)) {
|
if (dataRealTime && dataRealTime.some((i: any) => (i.category == 'project-detail' || i.category == 'project-detail-status') && i.id == param.id)) {
|
||||||
getOneData()
|
getOneData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dataRealTime && dataRealTime.some((i: any) => (i.category == 'project-delete') && i.id == param.id)) {
|
||||||
|
toast.error("Data telah dihapus, anda akan beralih ke halaman list kegiatan")
|
||||||
|
setTimeout(() => {
|
||||||
|
router.push("/project")
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
}, [dataRealTime])
|
}, [dataRealTime])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -158,11 +190,9 @@ export default function NavbarDetailProject() {
|
|||||||
<Text c={reason == null ? tema.get().utama : "gray"} ta='center'>Edit</Text>
|
<Text c={reason == null ? tema.get().utama : "gray"} ta='center'>Edit</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
{
|
||||||
<Flex justify={'center'} align={'center'} direction={'column'}
|
reason == null ?
|
||||||
style={{
|
<Flex justify={'center'} align={'center'} direction={'column'} style={{ cursor: 'pointer' }}
|
||||||
cursor: 'pointer'
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
reason == null ?
|
reason == null ?
|
||||||
router.push(param.id + '/cancel')
|
router.push(param.id + '/cancel')
|
||||||
@@ -176,6 +206,18 @@ export default function NavbarDetailProject() {
|
|||||||
<Text c={reason == null ? tema.get().utama : "gray"} ta='center'>Batal</Text>
|
<Text c={reason == null ? tema.get().utama : "gray"} ta='center'>Batal</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
:
|
||||||
|
<Flex justify={'center'} align={'center'} direction={'column'} style={{ cursor: 'pointer' }}
|
||||||
|
onClick={() => { setOpenModal(true) }}
|
||||||
|
>
|
||||||
|
<Box>
|
||||||
|
<FaTrash size={30} color={tema.get().utama} />
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text c={tema.get().utama} ta='center'>Hapus</Text>
|
||||||
|
</Box>
|
||||||
|
</Flex>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,6 +225,10 @@ export default function NavbarDetailProject() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
</LayoutDrawer>
|
</LayoutDrawer>
|
||||||
|
|
||||||
|
<LayoutModal loading={loadingModal} opened={openModal} onClose={() => setOpenModal(false)}
|
||||||
|
description="Apakah Anda yakin ingin menghapus kegiatan ini?"
|
||||||
|
onYes={(val) => { val ? deleteDataProject() : setOpenModal(false) }} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,3 +145,13 @@ export const funAddFileTask = async (path: string, data: FormData) => {
|
|||||||
});
|
});
|
||||||
return await response.json().catch(() => null);
|
return await response.json().catch(() => null);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const funDeleteTask = async (path: string) => {
|
||||||
|
const response = await fetch(`/api/task/${path}/lainnya`, {
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return await response.json().catch(() => null);
|
||||||
|
};
|
||||||
@@ -7,12 +7,13 @@ import { useShallowEffect } from "@mantine/hooks";
|
|||||||
import { useParams, useRouter } from "next/navigation";
|
import { useParams, useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { FaFileCirclePlus, FaPencil, FaUsers } from "react-icons/fa6";
|
import { FaFileCirclePlus, FaPencil, FaTrash, FaUsers } from "react-icons/fa6";
|
||||||
import { HiMenu } from "react-icons/hi";
|
import { HiMenu } from "react-icons/hi";
|
||||||
import { IoAddCircle } from "react-icons/io5";
|
import { IoAddCircle } from "react-icons/io5";
|
||||||
import { MdCancel } from "react-icons/md";
|
import { MdCancel } from "react-icons/md";
|
||||||
import { funGetTaskDivisionById } from "../lib/api_task";
|
import { funDeleteTask, funGetTaskDivisionById } from "../lib/api_task";
|
||||||
import { useWibuRealtime } from "wibu-realtime";
|
import { useWibuRealtime } from "wibu-realtime";
|
||||||
|
import LayoutModal from "@/module/_global/layout/layout_modal";
|
||||||
|
|
||||||
export default function NavbarDetailDivisionTask() {
|
export default function NavbarDetailDivisionTask() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -24,6 +25,8 @@ export default function NavbarDetailDivisionTask() {
|
|||||||
const memberDivision = useHookstate(globalIsMemberDivision)
|
const memberDivision = useHookstate(globalIsMemberDivision)
|
||||||
const tema = useHookstate(TEMA)
|
const tema = useHookstate(TEMA)
|
||||||
const [reason, setReason] = useState("")
|
const [reason, setReason] = useState("")
|
||||||
|
const [loadingModal, setLoadingModal] = useState(false)
|
||||||
|
const [openModal, setOpenModal] = useState(false)
|
||||||
const [dataRealTime, setDataRealtime] = useWibuRealtime({
|
const [dataRealTime, setDataRealtime] = useWibuRealtime({
|
||||||
WIBU_REALTIME_TOKEN: keyWibu,
|
WIBU_REALTIME_TOKEN: keyWibu,
|
||||||
project: "sdm"
|
project: "sdm"
|
||||||
@@ -45,6 +48,29 @@ export default function NavbarDetailDivisionTask() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function deleteDataProject() {
|
||||||
|
try {
|
||||||
|
setLoadingModal(true)
|
||||||
|
const res = await funDeleteTask(param.detail);
|
||||||
|
if (res.success) {
|
||||||
|
setDataRealtime([{
|
||||||
|
category: "tugas-delete",
|
||||||
|
id: param.detail,
|
||||||
|
}])
|
||||||
|
toast.success(res.message)
|
||||||
|
router.push("/division/" + param.id + "/task")
|
||||||
|
} else {
|
||||||
|
toast.error(res.message)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
toast.error("Gagal menghapus data tugas divisi, coba lagi nanti");
|
||||||
|
} finally {
|
||||||
|
setLoadingModal(false)
|
||||||
|
setOpenModal(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
getOneData();
|
getOneData();
|
||||||
}, [param.detail])
|
}, [param.detail])
|
||||||
@@ -54,6 +80,13 @@ export default function NavbarDetailDivisionTask() {
|
|||||||
if (dataRealTime && dataRealTime.some((i: any) => (i.category == 'tugas-detail' || i.category == 'tugas-detail-status') && i.id == param.detail)) {
|
if (dataRealTime && dataRealTime.some((i: any) => (i.category == 'tugas-detail' || i.category == 'tugas-detail-status') && i.id == param.detail)) {
|
||||||
getOneData()
|
getOneData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dataRealTime && dataRealTime.some((i: any) => i.category == 'tugas-delete' && i.id == param.detail)) {
|
||||||
|
toast.error("Data telah dihapus, anda akan beralih ke halaman list tugas divisi")
|
||||||
|
setTimeout(() => {
|
||||||
|
router.push("/division/" + param.id + "/task")
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
}, [dataRealTime])
|
}, [dataRealTime])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -156,7 +189,8 @@ export default function NavbarDetailDivisionTask() {
|
|||||||
<Text c={reason == null ? tema.get().utama : "gray"} ta='center'>Edit</Text>
|
<Text c={reason == null ? tema.get().utama : "gray"} ta='center'>Edit</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
{
|
||||||
|
reason == null ?
|
||||||
<Flex justify={'center'} align={'center'} direction={'column'}
|
<Flex justify={'center'} align={'center'} direction={'column'}
|
||||||
style={{
|
style={{
|
||||||
cursor: 'pointer'
|
cursor: 'pointer'
|
||||||
@@ -173,6 +207,21 @@ export default function NavbarDetailDivisionTask() {
|
|||||||
<Text c={reason == null ? tema.get().utama : "gray"} ta='center'>Batal</Text>
|
<Text c={reason == null ? tema.get().utama : "gray"} ta='center'>Batal</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
:
|
||||||
|
<Flex justify={'center'} align={'center'} direction={'column'}
|
||||||
|
style={{
|
||||||
|
cursor: 'pointer'
|
||||||
|
}}
|
||||||
|
onClick={() => { setOpenModal(true) }} >
|
||||||
|
<Box>
|
||||||
|
<FaTrash size={30} color={tema.get().utama} />
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text c={tema.get().utama} ta='center'>Hapus</Text>
|
||||||
|
</Box>
|
||||||
|
</Flex>
|
||||||
|
}
|
||||||
|
|
||||||
</> : <></>
|
</> : <></>
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -182,6 +231,10 @@ export default function NavbarDetailDivisionTask() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
</LayoutDrawer>
|
</LayoutDrawer>
|
||||||
|
|
||||||
|
<LayoutModal loading={loadingModal} opened={openModal} onClose={() => setOpenModal(false)}
|
||||||
|
description="Apakah Anda yakin ingin menghapus tugas divisi ini?"
|
||||||
|
onYes={(val) => { val ? deleteDataProject() : setOpenModal(false) }} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,8 @@ export interface IListMember {
|
|||||||
position: string,
|
position: string,
|
||||||
group: string,
|
group: string,
|
||||||
img: string,
|
img: string,
|
||||||
isActive: boolean
|
isActive: boolean,
|
||||||
|
role: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IFormMember {
|
export interface IFormMember {
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export default function CreateMember() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
toast.error("Gagal mendapatkan grup, coba lagi nanti");
|
toast.error("Gagal mendapatkan lembaga desa, coba lagi nanti");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,8 +300,8 @@ export default function CreateMember() {
|
|||||||
{
|
{
|
||||||
roleLogin.get() == "supadmin" &&
|
roleLogin.get() == "supadmin" &&
|
||||||
<Select
|
<Select
|
||||||
placeholder="Pilih Grup"
|
placeholder="Lembaga Desa"
|
||||||
label="Grup"
|
label="Lembaga Desa"
|
||||||
w={"100%"}
|
w={"100%"}
|
||||||
size="md"
|
size="md"
|
||||||
required
|
required
|
||||||
@@ -325,7 +325,7 @@ export default function CreateMember() {
|
|||||||
onChange={(val: any) => { changeGrup(val) }}
|
onChange={(val: any) => { changeGrup(val) }}
|
||||||
error={
|
error={
|
||||||
touched.idGroup && (
|
touched.idGroup && (
|
||||||
listData.idGroup == "" || String(listData.idGroup) == "null" ? "Grup Tidak Boleh Kosong" : null
|
listData.idGroup == "" || String(listData.idGroup) == "null" ? "Lembaga Desa Tidak Boleh Kosong" : null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { ActionIcon, Avatar, Box, Center, Grid, Group, Skeleton, Stack, Text } f
|
|||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { FaSquarePhone } from "react-icons/fa6";
|
import { FaBuildingUser, FaSquarePhone } from "react-icons/fa6";
|
||||||
import { HiMenu } from "react-icons/hi";
|
import { HiMenu } from "react-icons/hi";
|
||||||
import { IoMaleFemale } from "react-icons/io5";
|
import { IoMaleFemale } from "react-icons/io5";
|
||||||
import { MdEmail } from "react-icons/md";
|
import { MdEmail } from "react-icons/md";
|
||||||
@@ -14,6 +14,8 @@ import { valueRoleUser } from "../../lib/val_user";
|
|||||||
import { funGetOneMember } from "../lib/api_member";
|
import { funGetOneMember } from "../lib/api_member";
|
||||||
import { IListMember, IMember } from "../lib/type_member";
|
import { IListMember, IMember } from "../lib/type_member";
|
||||||
import DrawerDetailMember from "./drawer_detail_member";
|
import DrawerDetailMember from "./drawer_detail_member";
|
||||||
|
import { BiSolidUserBadge } from "react-icons/bi";
|
||||||
|
import { PiGenderIntersexFill } from "react-icons/pi";
|
||||||
|
|
||||||
|
|
||||||
export default function NavbarDetailMember({ id }: IMember) {
|
export default function NavbarDetailMember({ id }: IMember) {
|
||||||
@@ -47,7 +49,7 @@ export default function NavbarDetailMember({ id }: IMember) {
|
|||||||
setLoading(false)
|
setLoading(false)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
toast.error("Gagal mendapatkan detail user, coba lagi nanti");
|
toast.error("Gagal mendapatkan detail anggota, coba lagi nanti");
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
}
|
}
|
||||||
@@ -89,7 +91,7 @@ export default function NavbarDetailMember({ id }: IMember) {
|
|||||||
:
|
:
|
||||||
<>
|
<>
|
||||||
<Text c={'white'} fw={'bold'} fz={25} ta={"center"}>{dataOne?.name}</Text>
|
<Text c={'white'} fw={'bold'} fz={25} ta={"center"}>{dataOne?.name}</Text>
|
||||||
<Text c={'white'} fw={'lighter'} fz={15}>{dataOne?.group} - {dataOne?.position}</Text>
|
<Text c={'white'} fw={'lighter'} fz={15}>{dataOne?.role}</Text>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -113,6 +115,28 @@ export default function NavbarDetailMember({ id }: IMember) {
|
|||||||
<Text fz={15} fw={'bold'} ta={"right"}>{dataOne?.nik}</Text>
|
<Text fz={15} fw={'bold'} ta={"right"}>{dataOne?.nik}</Text>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={5}>
|
||||||
|
<Group>
|
||||||
|
<FaBuildingUser size={25} />
|
||||||
|
<Text fz={15}>Lembaga Desa</Text>
|
||||||
|
</Group>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={7}>
|
||||||
|
<Text fz={15} fw={'bold'} ta={"right"}>{dataOne?.group}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={4}>
|
||||||
|
<Group>
|
||||||
|
<BiSolidUserBadge size={25} />
|
||||||
|
<Text fz={15}>Jabatan</Text>
|
||||||
|
</Group>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={8}>
|
||||||
|
<Text fz={15} fw={'bold'} ta={"right"}>{dataOne?.position}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={5}>
|
<Grid.Col span={5}>
|
||||||
<Group>
|
<Group>
|
||||||
@@ -138,7 +162,7 @@ export default function NavbarDetailMember({ id }: IMember) {
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<Group>
|
<Group>
|
||||||
<IoMaleFemale size={25} />
|
<PiGenderIntersexFill size={25} />
|
||||||
<Text fz={15}>Jenis Kelamin</Text>
|
<Text fz={15}>Jenis Kelamin</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export interface IProfileById {
|
|||||||
idPosition: string
|
idPosition: string
|
||||||
group: string
|
group: string
|
||||||
position: string
|
position: string
|
||||||
|
role:string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IEditDataProfile {
|
export interface IEditDataProfile {
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ import { useShallowEffect } from "@mantine/hooks";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { FaSquarePhone } from "react-icons/fa6";
|
import { BiSolidUserBadge } from "react-icons/bi";
|
||||||
import { IoMaleFemale } from "react-icons/io5";
|
import { FaBuildingUser, FaSquarePhone } from "react-icons/fa6";
|
||||||
import { LuLogOut } from "react-icons/lu";
|
import { LuLogOut } from "react-icons/lu";
|
||||||
import { MdEmail } from "react-icons/md";
|
import { MdEmail } from "react-icons/md";
|
||||||
|
import { PiGenderIntersexFill } from "react-icons/pi";
|
||||||
import { RiIdCardFill } from "react-icons/ri";
|
import { RiIdCardFill } from "react-icons/ri";
|
||||||
import { funGetProfileByCookies } from "../lib/api_profile";
|
import { funGetProfileByCookies } from "../lib/api_profile";
|
||||||
import { IProfileById } from "../lib/type_profile";
|
import { IProfileById } from "../lib/type_profile";
|
||||||
@@ -88,7 +89,7 @@ export default function Profile() {
|
|||||||
:
|
:
|
||||||
<>
|
<>
|
||||||
<Text c={'white'} fw={'bold'} fz={25} ta={"center"}>{isData?.name}</Text>
|
<Text c={'white'} fw={'bold'} fz={25} ta={"center"}>{isData?.name}</Text>
|
||||||
<Text c={'white'} fw={'lighter'} fz={15}>{isData?.group} - {isData?.position}</Text>
|
<Text c={'white'} fw={'lighter'} fz={15}>{isData?.role}</Text>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -115,6 +116,28 @@ export default function Profile() {
|
|||||||
<Text fz={15} fw={'bold'} ta={"right"}>{isData?.nik}</Text>
|
<Text fz={15} fw={'bold'} ta={"right"}>{isData?.nik}</Text>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={5}>
|
||||||
|
<Group>
|
||||||
|
<FaBuildingUser size={25} />
|
||||||
|
<Text fz={15}>Lembaga Desa</Text>
|
||||||
|
</Group>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={7}>
|
||||||
|
<Text fz={15} fw={'bold'} ta={"right"}>{isData?.group}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={4}>
|
||||||
|
<Group>
|
||||||
|
<BiSolidUserBadge size={25} />
|
||||||
|
<Text fz={15}>Jabatan</Text>
|
||||||
|
</Group>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={8}>
|
||||||
|
<Text fz={15} fw={'bold'} ta={"right"}>{isData?.position}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={5}>
|
<Grid.Col span={5}>
|
||||||
<Group>
|
<Group>
|
||||||
@@ -140,7 +163,7 @@ export default function Profile() {
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<Group>
|
<Group>
|
||||||
<IoMaleFemale size={25} />
|
<PiGenderIntersexFill size={25} />
|
||||||
<Text fz={15}>Jenis Kelamin</Text>
|
<Text fz={15}>Jenis Kelamin</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
|||||||
Reference in New Issue
Block a user