Merge pull request #391 from bipproduction/amalia/28-jan-25
Amalia/28 jan 25
This commit is contained in:
@@ -50,6 +50,17 @@ export async function GET(request: Request, context: { params: { id: string } })
|
||||
}
|
||||
})
|
||||
|
||||
const dokumenShare = await prisma.divisionDocumentShare.count({
|
||||
where: {
|
||||
idDivision: String(id),
|
||||
isActive: true,
|
||||
DivisionDocumentFolderFile: {
|
||||
isActive: true,
|
||||
category: "FILE"
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const diskusi = await prisma.divisionDisscussion.count({
|
||||
where: {
|
||||
idDivision: String(id),
|
||||
@@ -74,7 +85,7 @@ export async function GET(request: Request, context: { params: { id: string } })
|
||||
|
||||
allData = {
|
||||
tugas: tugas,
|
||||
dokumen: dokumen,
|
||||
dokumen: dokumen + dokumenShare,
|
||||
diskusi: diskusi,
|
||||
kalender: kalender
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ export default function NavbarDocumentDivision() {
|
||||
}
|
||||
|
||||
const cek = selectedFiles.some((i: any) => i?.category == "FOLDER");
|
||||
if (cek || shareSelected || selectedFiles.length > 1) {
|
||||
if (cek || selectedFiles.length > 1) {
|
||||
setCopyAllowed(false);
|
||||
} else {
|
||||
setCopyAllowed(true);
|
||||
@@ -345,24 +345,23 @@ export default function NavbarDocumentDivision() {
|
||||
>
|
||||
<Flex justify={"center"} align={"center"} h={"100%"} w={"100%"}>
|
||||
<SimpleGrid cols={{ base: 5, sm: 5, lg: 5 }} spacing="xs">
|
||||
<Flex
|
||||
justify={"center"}
|
||||
align={"center"}
|
||||
direction={"column"}
|
||||
<Flex justify={"center"} align={"center"} direction={"column"}
|
||||
onClick={() => {
|
||||
if (selectedFiles.length > 0 && copyAllowed) {
|
||||
onDownload("selected");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<BsDownload
|
||||
size={20}
|
||||
color={
|
||||
selectedFiles.length > 0 && copyAllowed
|
||||
? "white"
|
||||
: "#656060"
|
||||
}
|
||||
/>
|
||||
<ActionIcon variant="subtle" aria-label="delete" >
|
||||
<BsDownload
|
||||
size={20}
|
||||
color={
|
||||
selectedFiles.length > 0 && copyAllowed
|
||||
? "white"
|
||||
: "#656060"
|
||||
}
|
||||
/>
|
||||
</ActionIcon>
|
||||
<Text
|
||||
fz={12}
|
||||
ta={"center"}
|
||||
@@ -375,16 +374,14 @@ export default function NavbarDocumentDivision() {
|
||||
Unduh
|
||||
</Text>
|
||||
</Flex>
|
||||
<Flex justify={"center"} align={"center"} direction={"column"}>
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
aria-label="delete"
|
||||
onClick={
|
||||
selectedFiles.length > 0 && !shareSelected
|
||||
? () => setIsDelete(true)
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<Flex justify={"center"} align={"center"} direction={"column"}
|
||||
onClick={
|
||||
selectedFiles.length > 0 && !shareSelected
|
||||
? () => setIsDelete(true)
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<ActionIcon variant="subtle" aria-label="delete" >
|
||||
<AiOutlineDelete
|
||||
size={20}
|
||||
color={
|
||||
@@ -406,16 +403,14 @@ export default function NavbarDocumentDivision() {
|
||||
Hapus
|
||||
</Text>
|
||||
</Flex>
|
||||
<Flex justify={"center"} align={"center"} direction={"column"}>
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
aria-label="rename"
|
||||
onClick={
|
||||
selectedFiles.length == 1 && !shareSelected
|
||||
? () => onChooseRename()
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<Flex justify={"center"} align={"center"} direction={"column"}
|
||||
onClick={
|
||||
selectedFiles.length == 1 && !shareSelected
|
||||
? () => onChooseRename()
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<ActionIcon variant="subtle" aria-label="rename" >
|
||||
<CgRename
|
||||
size={20}
|
||||
color={
|
||||
@@ -437,16 +432,14 @@ export default function NavbarDocumentDivision() {
|
||||
Ganti Nama
|
||||
</Text>
|
||||
</Flex>
|
||||
<Flex justify={"center"} align={"center"} direction={"column"}>
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
aria-label="share"
|
||||
onClick={
|
||||
selectedFiles.length > 0 && !shareSelected
|
||||
? () => setShare(true)
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<Flex justify={"center"} align={"center"} direction={"column"}
|
||||
onClick={
|
||||
selectedFiles.length > 0 && !shareSelected
|
||||
? () => setShare(true)
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<ActionIcon variant="subtle" aria-label="share" >
|
||||
<LuShare2
|
||||
size={20}
|
||||
color={
|
||||
@@ -468,16 +461,14 @@ export default function NavbarDocumentDivision() {
|
||||
Bagikan
|
||||
</Text>
|
||||
</Flex>
|
||||
<Flex justify={"center"} align={"center"} direction={"column"}>
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
aria-label="share"
|
||||
onClick={
|
||||
(selectedFiles.length == 1) || (selectedFiles.length > 0 && !shareSelected)
|
||||
? () => setMore(true)
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<Flex justify={"center"} align={"center"} direction={"column"}
|
||||
onClick={
|
||||
(selectedFiles.length == 1) || (selectedFiles.length > 0 && !shareSelected)
|
||||
? () => setMore(true)
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<ActionIcon variant="subtle" aria-label="share" >
|
||||
<MdOutlineMoreHoriz
|
||||
size={20}
|
||||
color={
|
||||
|
||||
Reference in New Issue
Block a user