From 1f8744d11f615379cda7e2375ae764a4f4b34e86 Mon Sep 17 00:00:00 2001 From: amel Date: Sat, 5 Oct 2024 11:21:13 +0800 Subject: [PATCH 1/4] upd: pengumuman deskripsi: - validasi tambah pengumuman - validasi edit pengumuman - button back anggota tambah pengumuman - button back anggota edit pengumuman - tampilan border radius edit pengumuman - tampilan list kosong divisi pada edit pengumuman - loading button save tambah pengumuman No Issues --- .../announcement/ui/create_announcement.tsx | 45 +++++++--- .../ui/create_users_announcement.tsx | 25 ++++-- .../announcement/ui/edit_announcement.tsx | 84 ++++++++++--------- .../announcement/ui/edit_choose_member.tsx | 27 +++--- 4 files changed, 108 insertions(+), 73 deletions(-) diff --git a/src/module/announcement/ui/create_announcement.tsx b/src/module/announcement/ui/create_announcement.tsx index 5dbe027..25d72cf 100644 --- a/src/module/announcement/ui/create_announcement.tsx +++ b/src/module/announcement/ui/create_announcement.tsx @@ -19,14 +19,13 @@ export default function CreateAnnouncement() { const memberGroup = useHookstate(globalMemberAnnouncement) const memberValue = memberGroup.get() as GroupData[] const [selectedFiles, setSelectedFiles] = useState([]) + const [loadingKonfirmasi, setLoadingKonfirmasi] = useState(false) const router = useRouter() const tema = useHookstate(TEMA) const [data, setData] = useWibuRealtime({ WIBU_REALTIME_TOKEN: keyWibu, project: "sdm" }) - - const [isChooseMember, setIsChooseMember] = useState(false) const [isData, setisData] = useState({ title: "", @@ -37,8 +36,10 @@ export default function CreateAnnouncement() { desc: false }); + async function onSubmit() { try { + setLoadingKonfirmasi(true) const response = await funCreateAnnouncement({ title: isData.title, desc: isData.desc, @@ -56,9 +57,11 @@ export default function CreateAnnouncement() { } catch (error) { console.error(error) toast.error("Gagal menambahkan pengumuman, coba lagi nanti"); + } finally { + setLoadingKonfirmasi(false) + setOpen(false) } - setOpen(false) } async function loadData() { @@ -69,18 +72,31 @@ export default function CreateAnnouncement() { loadData() }, []) - function onToChooseMember() { - setIsChooseMember(true) - } - - if (isChooseMember) return { setIsChooseMember(false) }} /> function onCheck() { - if (Object.values(touched).some((v) => v == true)) + const cek = checkAll() + if (!cek) return false + + if (memberValue.length == 0) + return toast.error("Error! silahkan pilih divisi") + setOpen(true) } + function checkAll() { + let nilai = true + if (isData.title === "") { + setTouched(touched => ({ ...touched, title: true })) + nilai = false + } + if (isData.desc === "") { + setTouched(touched => ({ ...touched, desc: true })) + nilai = false + } + return nilai + } + function onValidation(kategori: string, val: string) { if (kategori == 'title') { @@ -100,6 +116,8 @@ export default function CreateAnnouncement() { } } + if (isChooseMember) return { setIsChooseMember(false) }} /> + return ( } /> @@ -151,7 +169,7 @@ export default function CreateAnnouncement() { padding: 10, borderRadius: 10 }} - onClick={() => { onToChooseMember() }} + onClick={() => { setIsChooseMember(true) }} > Tambah divisi penerima pengumuman @@ -162,7 +180,7 @@ export default function CreateAnnouncement() { Divisi Terpilih {(memberGroup.length === 0) ? ( - Belum ada anggota + Belum ada divisi yang dipilih ) : memberGroup.get().map((v: any, i: any) => { return ( @@ -195,13 +213,14 @@ export default function CreateAnnouncement() { Simpan - setOpen(false)} + setOpen(false)} description="Apakah Anda yakin ingin menambahkan data?" onYes={(val) => { if (val) { onSubmit() + } else { + setOpen(false) } - setOpen(false) }} /> diff --git a/src/module/announcement/ui/create_users_announcement.tsx b/src/module/announcement/ui/create_users_announcement.tsx index b4c1037..7d2e7e5 100644 --- a/src/module/announcement/ui/create_users_announcement.tsx +++ b/src/module/announcement/ui/create_users_announcement.tsx @@ -1,15 +1,16 @@ "use client"; -import { LayoutNavbarNew, TEMA, WARNA } from '@/module/_global'; +import { LayoutNavbarNew, TEMA } from '@/module/_global'; import { funGetGroupDivision } from '@/module/group/lib/api_group'; -import { Box, Button, Divider, Flex, Group, rem, Skeleton, Stack, Text } from '@mantine/core'; -import { useMediaQuery, useShallowEffect } from '@mantine/hooks'; -import React, { useState } from 'react'; -import { FaCheck } from 'react-icons/fa'; -import { GroupData } from '../lib/type_announcement'; import { useHookstate } from '@hookstate/core'; -import { globalMemberAnnouncement } from '../lib/val_announcement'; -import { FaMinus } from 'react-icons/fa6'; +import { ActionIcon, Box, Button, Divider, Group, rem, Skeleton, Stack, Text } from '@mantine/core'; +import { useMediaQuery, useShallowEffect } from '@mantine/hooks'; +import { useState } from 'react'; import toast from 'react-hot-toast'; +import { FaCheck } from 'react-icons/fa'; +import { FaMinus } from 'react-icons/fa6'; +import { HiChevronLeft } from 'react-icons/hi2'; +import { GroupData } from '../lib/type_announcement'; +import { globalMemberAnnouncement } from '../lib/val_announcement'; @@ -112,7 +113,13 @@ export default function CreateUsersAnnouncement({ onClose }: { onClose: (val: an return (
- } /> + + { onClose(true) }} bg={tema.get().bgIcon} size="lg" radius="lg" aria-label="Settings"> + + + + } title="Tambah Divisi Penerima Pengumuman" menu={<>} /> () const [loading, setLoading] = useState(true) @@ -75,6 +75,7 @@ export default function EditAnnouncement() { toast.error("Gagal mendapatkan pengumuman, coba lagi nanti") } finally { setLoading(false) + setOpen(false) } } @@ -94,30 +95,24 @@ export default function EditAnnouncement() { if (response.success) { toast.success(response.message) - setLoadingSubmit(false) router.push(`/announcement/${param.id}`) } else { toast.error(response.message) } - setLoadingSubmit(false) } catch (error) { console.error(error) toast.error("Gagal mengedit pengumuman, coba lagi nanti"); } finally { setLoadingSubmit(false) + setOpen(false) } - setOpen(false) } - - - - if (isChooseDivisi) return { setChooseDivisi(false) }} /> - - function onCheck() { if (Object.values(touched).some((v) => v == true)) return false + if (memberGroup.get().length == 0) + return toast.error("Error! silahkan pilih divisi") setOpen(true) } @@ -140,6 +135,8 @@ export default function EditAnnouncement() { } } + if (isChooseDivisi) return { setChooseDivisi(false) }} /> + return ( <> } /> @@ -160,7 +157,7 @@ export default function EditAnnouncement() { : <> { - return ( - - {v.name} - - - - { - v.Division.map((division: any) => { - return - {division.name} - - }) - } - - - - - ); + <> + Divisi Terpilih + { + memberGroup.get().length == 0 ? Belum ada divisi yang dipilih : + memberGroup.get().map((v: any, i: any) => { + return ( + + {v.name} + + + + { + v.Division.map((division: any) => { + return + {division.name} + + }) + } + + + + + ); + + }) + } + - } - ) } @@ -282,8 +285,9 @@ export default function EditAnnouncement() { onYes={(val) => { if (val) { onSubmit() + } else { + setOpen(false) } - setOpen(false) }} /> ) diff --git a/src/module/announcement/ui/edit_choose_member.tsx b/src/module/announcement/ui/edit_choose_member.tsx index 5f234d0..642883e 100644 --- a/src/module/announcement/ui/edit_choose_member.tsx +++ b/src/module/announcement/ui/edit_choose_member.tsx @@ -1,17 +1,16 @@ "use client"; -import { LayoutNavbarNew, TEMA, WARNA } from '@/module/_global'; +import { LayoutNavbarNew, TEMA } from '@/module/_global'; import { funGetGroupDivision } from '@/module/group/lib/api_group'; -import { Box, Button, Divider, Flex, Group, rem, Skeleton, Stack, Text } from '@mantine/core'; -import { useMediaQuery, useShallowEffect } from '@mantine/hooks'; -import React, { useState } from 'react'; -import { FaCheck } from 'react-icons/fa'; -import { GroupData, GroupDataEditAnnouncement } from '../lib/type_announcement'; import { useHookstate } from '@hookstate/core'; -import { globalMemberEditAnnouncement } from '../lib/val_announcement'; -import { FaMinus } from 'react-icons/fa6'; +import { ActionIcon, Box, Button, Divider, Group, rem, Skeleton, Stack, Text } from '@mantine/core'; +import { useMediaQuery, useShallowEffect } from '@mantine/hooks'; +import { useState } from 'react'; import toast from 'react-hot-toast'; - - +import { FaCheck } from 'react-icons/fa'; +import { FaMinus } from 'react-icons/fa6'; +import { HiChevronLeft } from 'react-icons/hi2'; +import { GroupData } from '../lib/type_announcement'; +import { globalMemberEditAnnouncement } from '../lib/val_announcement'; interface CheckedState { [key: string]: string[]; @@ -111,7 +110,13 @@ export default function EditChooseMember({ onClose }: { onClose: (val: any) => v return (
- } /> + + { onClose(true) }} bg={tema.get().bgIcon} size="lg" radius="lg" aria-label="Settings"> + + + + } title="Tambah Divisi Penerima Pengumuman" menu={<>} /> Date: Sat, 5 Oct 2024 12:12:10 +0800 Subject: [PATCH 2/4] upd: project Deskripsi: - update validasi tambah kegiatan - update validasi edit judul kegiatan No Issues --- src/module/project/ui/create_project.tsx | 76 ++++++++----- src/module/project/ui/edit_task_project.tsx | 114 +++++++++++--------- 2 files changed, 114 insertions(+), 76 deletions(-) diff --git a/src/module/project/ui/create_project.tsx b/src/module/project/ui/create_project.tsx index 30d7680..7ea3f6a 100644 --- a/src/module/project/ui/create_project.tsx +++ b/src/module/project/ui/create_project.tsx @@ -24,7 +24,6 @@ import ResultsFile from "./results_file"; export default function CreateProject() { const router = useRouter(); - const [openDrawer, setOpenDrawer] = useState(false) const [openDrawerFile, setOpenDrawerFile] = useState(false) const [openDrawerTask, setOpenDrawerTask] = useState(false) const [isModal, setModal] = useState(false) @@ -51,13 +50,12 @@ export default function CreateProject() { const [touched, setTouched] = useState({ title: false, idGroup: false, - desc: false }); const [data, setDataRealtime] = useWibuRealtime({ WIBU_REALTIME_TOKEN: keyWibu, project: "sdm" - }) + }) function deleteFile(index: number) { setListFile([...listFile.filter((val, i) => i !== index)]) @@ -93,7 +91,7 @@ export default function CreateProject() { function onChooseGroup(val: any) { member.set([]) - setBody({ ...body, idGroup: val }) + onValidation('idGroup', val) } useShallowEffect(() => { @@ -138,6 +136,51 @@ export default function CreateProject() { } } + function onCheck() { + const cek = checkAll() + if (!cek) + return false + + if (dataTask.length == 0) + return toast.error("Error! silahkan tambahkan tugas") + + if (memberValue.length == 0) + return toast.error("Error! silahkan pilih anggota") + + setModal(true) + } + + function checkAll() { + let nilai = true + if (body.idGroup === "" || String(body.idGroup) == "null") { + setTouched(touched => ({ ...touched, idGroup: true })) + nilai = false + } + if (body.title === "") { + setTouched(touched => ({ ...touched, title: true })) + nilai = false + } + return nilai + } + + function onValidation(kategori: string, val: string) { + if (kategori == 'idGroup') { + setBody({ ...body, idGroup: val }) + if (val === "" || String(val) == "null") { + setTouched({ ...touched, idGroup: true }) + } else { + setTouched({ ...touched, idGroup: false }) + } + } else if (kategori == 'title') { + setBody({ ...body, title: val }) + if (val === "") { + setTouched({ ...touched, title: true }) + } else { + setTouched({ ...touched, title: false }) + } + } + } + if (openTugas) return { setOpenTugas(false) }} onSet={(val) => { setDataTask([...dataTask, val]); setOpenTugas(false) }} />; @@ -169,14 +212,12 @@ export default function CreateProject() { }))} onChange={(val) => { onChooseGroup(val) - setTouched({ ...touched, idGroup: false }) }} value={(body.idGroup == "") ? null : body.idGroup} - onBlur={() => setTouched({ ...touched, idGroup: true })} error={ touched.idGroup && ( - body.idGroup == "" ? "Grup Tidak Boleh Kosong" : null + body.idGroup == "" || String(body.idGroup) == "null" ? "Grup Tidak Boleh Kosong" : null ) } /> @@ -195,11 +236,7 @@ export default function CreateProject() { placeholder="Nama Kegiatan" size="md" value={body.title} - onChange={(e) => { - setBody({ ...body, title: e.target.value }) - setTouched({ ...touched, title: false }) - }} - onBlur={() => setTouched({ ...touched, title: true })} + onChange={(e) => { onValidation('title', e.target.value) }} error={ touched.title && ( body.title == "" ? "Kegiatan Tidak Boleh Kosong" : null @@ -361,16 +398,7 @@ export default function CreateProject() { size="lg" radius={30} fullWidth - onClick={() => { - if ( - body.title !== "" && - body.idGroup !== "" - ) { - setModal(true) - } else { - toast.error("Mohon lengkapi data terlebih dahulu"); - } - }}> + onClick={() => { onCheck() }}> Simpan @@ -504,10 +532,10 @@ export default function CreateProject() { onYes={(val) => { if (val) { onSubmit() - }else{ + } else { setModal(false) } - + }} /> ); diff --git a/src/module/project/ui/edit_task_project.tsx b/src/module/project/ui/edit_task_project.tsx index 6f8e8bc..d747bd5 100644 --- a/src/module/project/ui/edit_task_project.tsx +++ b/src/module/project/ui/edit_task_project.tsx @@ -1,13 +1,13 @@ "use client" -import { useParams, useRouter } from 'next/navigation'; -import React, { useState } from 'react'; -import toast from 'react-hot-toast'; -import { funEditProject, funGetOneProjectById } from '../lib/api_project'; -import { useShallowEffect } from '@mantine/hooks'; -import { Box, Button, Input, rem, Skeleton, Stack, TextInput } from '@mantine/core'; -import { LayoutNavbarNew, TEMA} from '@/module/_global'; +import { LayoutNavbarNew, TEMA } from '@/module/_global'; import LayoutModal from '@/module/_global/layout/layout_modal'; import { useHookstate } from '@hookstate/core'; +import { Box, Button, rem, Skeleton, Stack, TextInput } from '@mantine/core'; +import { useShallowEffect } from '@mantine/hooks'; +import { useParams, useRouter } from 'next/navigation'; +import { useState } from 'react'; +import toast from 'react-hot-toast'; +import { funEditProject, funGetOneProjectById } from '../lib/api_project'; export default function EditTaskProject() { const router = useRouter() @@ -20,13 +20,6 @@ export default function EditTaskProject() { name: false, }); - function onVerification() { - if (name == "") - return toast.error("Error! harus memasukkan judul Kegiatan") - - setOpenModal(true) - } - async function onSubmit() { try { const res = await funEditProject(param.id, { name }) @@ -42,6 +35,27 @@ export default function EditTaskProject() { } } + function onCheck() { + if (name == "") { + setTouched({ ...touched, name: true }) + return false + } + setOpenModal(true) + } + + + + function onValidation(kategori: string, val: string) { + if (kategori == 'title') { + setName(val) + if (val === "") { + setTouched({ ...touched, name: true }) + } else { + setTouched({ ...touched, name: false }) + } + } + } + async function getOneData() { try { setLoading(true) @@ -69,32 +83,28 @@ export default function EditTaskProject() { - {loading ? - + {loading ? + : - { - setName(e.target.value) - setTouched({ ...touched, name: false }) - }} - error={ - touched.name && ( - name == "" ? "Judul Kegiatan Tidak Boleh Kosong" : null - ) - } - onBlur={() => setTouched({ ...touched, name: true })} - /> + { onValidation('title', e.target.value) }} + error={ + touched.name && ( + name == "" ? "Kegiatan Tidak Boleh Kosong" : null + ) + } + /> } @@ -104,19 +114,19 @@ export default function EditTaskProject() { backgroundColor: `${tema.get().bgUtama}`, }}> {loading ? - - : - - } + + : + + } From 02fbd27d605191c271c52ae661e531c8ecd8cb0c Mon Sep 17 00:00:00 2001 From: amel Date: Sat, 5 Oct 2024 14:50:35 +0800 Subject: [PATCH 3/4] upd: divisi Deskripsi: - validasi tambah divisi - validasi edit diviis No Issues --- .../division_new/ui/create_division.tsx | 103 +++++++++--------- src/module/division_new/ui/edit_division.tsx | 75 ++++++++----- .../division_new/ui/information_division.tsx | 12 +- 3 files changed, 103 insertions(+), 87 deletions(-) diff --git a/src/module/division_new/ui/create_division.tsx b/src/module/division_new/ui/create_division.tsx index 6618c5a..4cfab78 100644 --- a/src/module/division_new/ui/create_division.tsx +++ b/src/module/division_new/ui/create_division.tsx @@ -1,29 +1,15 @@ "use client"; import { LayoutNavbarNew, TEMA } from "@/module/_global"; -import { useHookstate } from "@hookstate/core"; -import { - Avatar, - Box, - Button, - Divider, - Flex, - Grid, - Group, - rem, - Select, - Stack, - Text, - Textarea, - TextInput, -} from "@mantine/core"; -import { useMediaQuery, useShallowEffect } from "@mantine/hooks"; -import { useRouter } from "next/navigation"; -import React, { useState } from "react"; -import { IoIosArrowDropright } from "react-icons/io"; -import { globalMemberDivision } from "../lib/val_division"; -import toast from "react-hot-toast"; import { funGetUserByCookies } from "@/module/auth"; import { funGetAllGroup, IDataGroup } from "@/module/group"; +import { useHookstate } from "@hookstate/core"; +import { Avatar, Box, Button, Divider, Grid, Group, rem, Select, Stack, Text, Textarea, TextInput } from "@mantine/core"; +import { useMediaQuery, useShallowEffect } from "@mantine/hooks"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; +import toast from "react-hot-toast"; +import { IoIosArrowDropright } from "react-icons/io"; +import { globalMemberDivision } from "../lib/val_division"; import NavbarAdminDivision from "./navbar_admin_division"; import NavbarCreateUsers from "./navbar_create_users"; @@ -58,23 +44,14 @@ export default function CreateDivision() { setRoleUser(loadUser.idUserRole) } - function onSubmit() { - if (roleUser == "supadmin" && (body.idGroup == "" || body.idGroup == null)) { - return toast.error("Error! grup harus diisi") - } - - if (body.name == "") { - return toast.error("Error! nama divisi harus diisi") - } - - if (member.length == 0) { + function onCheck() { + const cek = checkAll() + if (!cek) + return false + if (member.length == 0) return toast.error("Error! belum ada anggota yang terdaftar") - } - - setChooseAdmin(true) - } function onToChooseAnggota() { @@ -86,7 +63,7 @@ export default function CreateDivision() { function onChooseGroup(val: any) { member.set([]) - setBody({ ...body, idGroup: val }) + onValidation('idGroup', val) } @@ -95,6 +72,39 @@ export default function CreateDivision() { loadData(); }, []); + function onValidation(kategori: string, val: any) { + if (kategori == 'name') { + setBody({ ...body, name: val }) + if (val === "") { + setTouched({ ...touched, name: true }) + } else { + setTouched({ ...touched, name: false }) + } + } else if (kategori == 'idGroup') { + setBody({ ...body, idGroup: val, }) + if (val === "" || String(val) == "null") { + setTouched(touched => ({ ...touched, idGroup: true })) + } else { + setTouched({ ...touched, idGroup: false }) + } + } else if (kategori == 'desc') { + setBody({ ...body, desc: val }) + } + } + + function checkAll() { + let nilai = true + if (roleUser == "supadmin" && (body.idGroup === "" || String(body.idGroup) == "null")) { + setTouched(touched => ({ ...touched, idGroup: true })) + nilai = false + } + if (body.name === "") { + setTouched(touched => ({ ...touched, name: true })) + nilai = false + } + return nilai + } + if (isChooseAdmin) return { @@ -133,10 +143,9 @@ export default function CreateDivision() { onChange={(val) => { onChooseGroup(val) }} - onBlur={() => setTouched({ ...touched, idGroup: true })} error={ touched.idGroup && ( - body.idGroup == "" ? "Grup Tidak Boleh Kosong" : null + body.idGroup == "" || String(body.idGroup) == "null" ? "Grup Tidak Boleh Kosong" : null ) } value={body.idGroup} @@ -150,11 +159,10 @@ export default function CreateDivision() { required radius={10} value={body.name} - onChange={(val) => { setBody({ ...body, name: val.target.value }) }} - onBlur={() => setTouched({ ...touched, name: true })} + onChange={(val) => { onValidation('name', val.target.value) }} error={ touched.name && ( - body.name == "" ? "Nama Tidak Boleh Kosong" : null + body.name == "" ? "Nama Divisi Tidak Boleh Kosong" : null ) } /> @@ -230,16 +238,7 @@ export default function CreateDivision() { zIndex: 999, backgroundColor: `${tema.get().bgUtama}`, }}> - diff --git a/src/module/division_new/ui/edit_division.tsx b/src/module/division_new/ui/edit_division.tsx index 8610fd3..a1d09fd 100644 --- a/src/module/division_new/ui/edit_division.tsx +++ b/src/module/division_new/ui/edit_division.tsx @@ -1,25 +1,22 @@ "use client" import { LayoutNavbarNew, TEMA } from '@/module/_global'; import LayoutModal from '@/module/_global/layout/layout_modal'; -import { Box, Button, rem, Select, Skeleton, Stack, Textarea, TextInput } from '@mantine/core'; +import { useHookstate } from '@hookstate/core'; +import { Box, Button, rem, Skeleton, Stack, Textarea, TextInput } from '@mantine/core'; import { useShallowEffect } from '@mantine/hooks'; import { useParams, useRouter } from 'next/navigation'; -import React, { useState } from 'react'; +import { useState } from 'react'; import toast from 'react-hot-toast'; import { funEditDivision, funGetDivisionById } from '../lib/api_division'; -import { funGetAllGroup, IDataGroup } from '@/module/group'; -import { funGetUserByCookies } from '@/module/auth'; -import { useHookstate } from '@hookstate/core'; - export default function EditDivision() { const [openModal, setOpenModal] = useState(false) const router = useRouter() const param = useParams<{ id: string }>() const tema = useHookstate(TEMA) + const [loadingModal, setLoadingModal] = useState(false) const [loading, setLoading] = useState(false) const [body, setBody] = useState({ - idGroup: "", name: "", desc: "", }); @@ -28,6 +25,36 @@ export default function EditDivision() { name: false, }); + function onValidation(kategori: string, val: any) { + if (kategori == 'name') { + setBody({ ...body, name: val }) + if (val === "") { + setTouched({ ...touched, name: true }) + } else { + setTouched({ ...touched, name: false }) + } + } else if (kategori == "desc") { + setBody({ ...body, desc: val }) + } + } + + function onCheck() { + const cek = checkAll() + if (!cek) + return false + setOpenModal(true) + } + + function checkAll() { + let nilai = true + if (body.name === "") { + setTouched(touched => ({ ...touched, name: true })) + nilai = false + } + return nilai + } + + async function getOneData() { try { @@ -56,17 +83,19 @@ export default function EditDivision() { async function onUpdate() { try { + setLoadingModal(true) const res = await funEditDivision(param.id, body) if (res.success) { toast.success(res.message) } else { toast.error(res.message) } - setOpenModal(false) } catch (error) { console.error(error) - setOpenModal(false) toast.error("Gagal mengedit divisi, coba lagi nanti"); + } finally { + setLoadingModal(false) + setOpenModal(false) } } @@ -88,26 +117,22 @@ export default function EditDivision() { : <> { - setBody({ ...body, name: e.target.value }) - setTouched({ ...touched, name: false }) - }} - onBlur={() => setTouched({ ...touched, name: true })} + onChange={(e) => { onValidation('name', e.currentTarget.value) }} error={ touched.name && ( - body.name == "" ? "Judul Tidak Boleh Kosong" : null + body.name == "" ? "Nama Divisi Tidak Boleh Kosong" : null ) } />