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