Fix: Avatar
Deskripsi: - Avatar job - Avatar collaboration - Avatar event ## No Issuue
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { Card, Stack } from "@mantine/core";
|
||||
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||
import { Stack } from "@mantine/core";
|
||||
import { MODEL_COLLABORATION } from "../../model/interface";
|
||||
import ComponentColab_CardSectionData from "./card_section_data";
|
||||
import ComponentColab_CardSectionHeaderAuthorName from "./card_section_header_author_name";
|
||||
import ComponentColab_JumlahPartisipan from "./card_section_jumlah_partisipan";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export function ComponentColab_CardBeranda({
|
||||
data,
|
||||
@@ -15,28 +13,14 @@ export function ComponentColab_CardBeranda({
|
||||
data: MODEL_COLLABORATION;
|
||||
userLoginId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loadingCreate, setLoadingCreate] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
color: "white",
|
||||
borderRadius: "10px",
|
||||
marginBottom: "20px",
|
||||
padding: "15px",
|
||||
}}
|
||||
>
|
||||
<ComponentGlobal_CardStyles marginBottom={"15px"}>
|
||||
<Stack>
|
||||
<ComponentColab_CardSectionHeaderAuthorName
|
||||
authorName={data?.Author?.Profile?.name}
|
||||
imagesId={data?.Author?.Profile?.imagesId}
|
||||
profileId={data?.Author?.Profile?.id}
|
||||
isAuthor={userLoginId === data.Author.id ? true : false}
|
||||
colabId={data.id}
|
||||
profile={data.Author.Profile as any}
|
||||
/>
|
||||
<ComponentColab_CardSectionData
|
||||
colabId={data.id}
|
||||
@@ -47,7 +31,7 @@ export function ComponentColab_CardBeranda({
|
||||
jumlah={data.ProjectCollaboration_Partisipasi}
|
||||
/>
|
||||
</Stack>
|
||||
</Card>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,23 +1,14 @@
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { Card, Stack } from "@mantine/core";
|
||||
import { MODEL_COLLABORATION } from "../../model/interface";
|
||||
import ComponentColab_CardSectionData from "./card_section_data";
|
||||
import ComponentColab_JumlahPartisipan from "./card_section_jumlah_partisipan";
|
||||
import { MODEL_COLLABORATION } from "../../model/interface";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||
|
||||
export function ComponentColab_CardProyekSaya({data, path}: {data: MODEL_COLLABORATION, path: string}) {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
style={{
|
||||
padding: "15px",
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
borderRadius: "10px",
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
color: "white",
|
||||
marginBottom: "15px",
|
||||
}}
|
||||
>
|
||||
<ComponentGlobal_CardStyles marginBottom={"15px"}>
|
||||
<Stack>
|
||||
<ComponentColab_CardSectionData
|
||||
colabId={data.id}
|
||||
@@ -28,7 +19,7 @@ export function ComponentColab_CardProyekSaya({data, path}: {data: MODEL_COLLABO
|
||||
jumlah={data.ProjectCollaboration_Partisipasi}
|
||||
/>
|
||||
</Stack>
|
||||
</Card>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/noti
|
||||
import { Card, Center, Grid, Stack, Text, Title } from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { MODEL_COLLABORATION } from "../../model/interface";
|
||||
import { useState } from "react";
|
||||
import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
|
||||
|
||||
export default function ComponentColab_CardSectionData({
|
||||
colabId,
|
||||
@@ -15,6 +17,7 @@ export default function ComponentColab_CardSectionData({
|
||||
data?: MODEL_COLLABORATION;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -22,6 +25,7 @@ export default function ComponentColab_CardSectionData({
|
||||
px={"md"}
|
||||
onClick={() => {
|
||||
if (path) {
|
||||
setVisible(true);
|
||||
router.push(path + colabId);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan("Path tidak ditemukan");
|
||||
@@ -79,6 +83,7 @@ export default function ComponentColab_CardSectionData({
|
||||
</Text>
|
||||
</Stack>
|
||||
</Stack>
|
||||
{visible && <ComponentGlobal_CardLoadingOverlay />}
|
||||
</Card.Section>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,87 +1,74 @@
|
||||
"use client";
|
||||
|
||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
||||
import {
|
||||
ActionIcon,
|
||||
Avatar,
|
||||
Card,
|
||||
Divider,
|
||||
Grid,
|
||||
Menu,
|
||||
Stack,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import ComponentColab_AuthorNameOnHeader from "../header_author_name";
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { IconDots, IconEdit } from "@tabler/icons-react";
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { useState } from "react";
|
||||
import { ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component";
|
||||
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
|
||||
import { ActionIcon, Group, Stack } from "@mantine/core";
|
||||
import { IconDots, IconEdit } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function ComponentColab_CardSectionHeaderAuthorName({
|
||||
profileId,
|
||||
imagesId,
|
||||
authorName,
|
||||
isPembatas,
|
||||
isAuthor,
|
||||
colabId,
|
||||
profile,
|
||||
}: {
|
||||
profileId?: string;
|
||||
imagesId?: string;
|
||||
authorName?: string;
|
||||
isPembatas?: boolean;
|
||||
isAuthor?: boolean;
|
||||
colabId?: string;
|
||||
profile?: any;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card.Section px={"md"}>
|
||||
<Stack spacing={"xs"}>
|
||||
<Grid>
|
||||
<Grid.Col
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
if (profileId) {
|
||||
router.push(RouterProfile.katalogOLD + profileId);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
size={30}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
imagesId
|
||||
? RouterProfile.api_foto_profile + imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Stack justify="center" h={"100%"}>
|
||||
<Text lineClamp={1} fz={"sm"} fw={"bold"}>
|
||||
{authorName ? authorName : "Nama author"}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"content"}>
|
||||
<Stack spacing={"xs"}>
|
||||
<ComponentGlobal_AvatarAndUsername
|
||||
profile={profile}
|
||||
component={
|
||||
<Group position="right">
|
||||
<ButtonAction
|
||||
isAuthor={isAuthor as any}
|
||||
colabId={colabId as any}
|
||||
/>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
{isPembatas ? <Divider /> : ""}
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Group>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* <Grid>
|
||||
<Grid.Col
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
if (profileId) {
|
||||
router.push(RouterProfile.katalogOLD + profileId);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
size={30}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
imagesId
|
||||
? RouterProfile.api_foto_profile + imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Stack justify="center" h={"100%"}>
|
||||
<Text lineClamp={1} fz={"sm"} fw={"bold"}>
|
||||
{authorName ? authorName : "Nama author"}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"content"}>
|
||||
</Grid.Col>
|
||||
</Grid> */}
|
||||
{/* {isPembatas ? <Divider /> : ""} */}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -94,7 +81,7 @@ function ButtonAction({
|
||||
colabId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [openDrawe, setOpenDrawer] = useState(false);
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
|
||||
const listPage = [
|
||||
{
|
||||
@@ -107,40 +94,12 @@ function ButtonAction({
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <Menu
|
||||
opened={opened}
|
||||
onChange={setOpened}
|
||||
position="left-start"
|
||||
offset={0}
|
||||
shadow="lg"
|
||||
withArrow
|
||||
arrowPosition="center"
|
||||
>
|
||||
<Menu.Target >
|
||||
<Stack justify="center" h={"100%"} >
|
||||
<ActionIcon variant="transparent">
|
||||
{isAuthor ? <IconDots size={20} /> : ""}
|
||||
</ActionIcon>
|
||||
</Stack>
|
||||
</Menu.Target>
|
||||
<Menu.Dropdown bg={"gray.1"} >
|
||||
<Menu.Item
|
||||
icon={<IconEdit size={15} />}
|
||||
onClick={() => {
|
||||
router.push(RouterColab.edit + colabId);
|
||||
}}
|
||||
>
|
||||
Edit
|
||||
</Menu.Item>
|
||||
</Menu.Dropdown>
|
||||
</Menu> */}
|
||||
|
||||
<ActionIcon variant="transparent" onClick={() => setOpenDrawer(true)}>
|
||||
{isAuthor ? <IconDots size={20} color="white" /> : ""}
|
||||
</ActionIcon>
|
||||
|
||||
<UIGlobal_Drawer
|
||||
opened={openDrawe}
|
||||
opened={openDrawer}
|
||||
close={() => setOpenDrawer(false)}
|
||||
component={listPage}
|
||||
/>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { Stack, Divider, Center, Text, Grid, Card } from "@mantine/core";
|
||||
import { IconUsersGroup } from "@tabler/icons-react";
|
||||
import { Card, Center, Divider, Grid, Stack, Text } from "@mantine/core";
|
||||
|
||||
export default function ComponentColab_JumlahPartisipan({
|
||||
jumlah,
|
||||
@@ -10,18 +9,18 @@ export default function ComponentColab_JumlahPartisipan({
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Card.Section px={"md"}>
|
||||
<Card.Section px={"md"} >
|
||||
<Stack>
|
||||
<Divider />
|
||||
<Center>
|
||||
<Grid>
|
||||
<Grid.Col span={"content"}>
|
||||
<Text c={"gray"} fz={"xs"} fw={"bold"}>
|
||||
<Text c={"white"} fz={"xs"} fw={"bold"}>
|
||||
{jumlah?.length ? jumlah?.length : 0}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text c={"gray"} fz={"xs"} fw={"bold"}>
|
||||
<Text c={"white"} fz={"xs"} fw={"bold"}>
|
||||
Partisipan
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { Card, Stack } from "@mantine/core";
|
||||
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||
import { Stack } from "@mantine/core";
|
||||
import {
|
||||
MODEL_COLLABORATION,
|
||||
MODEL_COLLABORATION_PARTISIPASI,
|
||||
MODEL_COLLABORATION_PARTISIPASI
|
||||
} from "../../model/interface";
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import ComponentColab_CardSectionData from "./card_section_data";
|
||||
import ComponentColab_CardSectionHeaderAuthorName from "./card_section_header_author_name";
|
||||
import ComponentColab_JumlahPartisipan from "./card_section_jumlah_partisipan";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export function ComponentColab_CardSemuaPartisipan({
|
||||
data,
|
||||
@@ -18,21 +16,11 @@ export function ComponentColab_CardSemuaPartisipan({
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
style={{
|
||||
padding: "15px",
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
borderRadius: "10px",
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
color: "white",
|
||||
marginBottom: "15px",
|
||||
}}
|
||||
>
|
||||
<ComponentGlobal_CardStyles marginBottom={"15px"}>
|
||||
<Stack>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
<ComponentColab_CardSectionHeaderAuthorName
|
||||
authorName={data?.ProjectCollaboration.Author.Profile.name}
|
||||
imagesId={data?.ProjectCollaboration.Author.Profile.imagesId}
|
||||
profileId={data?.ProjectCollaboration.Author.Profile.id}
|
||||
profile={data?.ProjectCollaboration.Author.Profile}
|
||||
/>
|
||||
<ComponentColab_CardSectionData
|
||||
colabId={data?.ProjectCollaboration.id}
|
||||
@@ -43,7 +31,7 @@ export function ComponentColab_CardSemuaPartisipan({
|
||||
jumlah={data?.ProjectCollaboration.ProjectCollaboration_Partisipasi}
|
||||
/>
|
||||
</Stack>
|
||||
</Card>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||
import {
|
||||
ActionIcon,
|
||||
Avatar,
|
||||
Button,
|
||||
Divider,
|
||||
Drawer,
|
||||
Grid,
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
ScrollArea,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
Title
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconCaretRight, IconX } from "@tabler/icons-react";
|
||||
@@ -89,8 +89,27 @@ export default function ComponentColab_AuthorNameOnListPartisipan({
|
||||
</Stack>
|
||||
</Drawer>
|
||||
|
||||
<Stack spacing={"xs"}>
|
||||
<Grid>
|
||||
<Stack spacing={"xs"} p={"xs"}>
|
||||
<ComponentGlobal_AvatarAndUsername
|
||||
profile={author?.Profile as any}
|
||||
fontSize={"sm"}
|
||||
component={
|
||||
<Stack justify="center" align="flex-end" h={"100%"}>
|
||||
{deskripsi ? (
|
||||
<ActionIcon
|
||||
onClick={() => open()}
|
||||
radius={"xl"}
|
||||
variant="transparent"
|
||||
>
|
||||
<IconCaretRight color={MainColor.yellow} />
|
||||
</ActionIcon>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Stack>
|
||||
}
|
||||
/>
|
||||
{/* <Grid>
|
||||
<Grid.Col
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
@@ -136,7 +155,7 @@ export default function ComponentColab_AuthorNameOnListPartisipan({
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
{isPembatas ? <Divider /> : ""}
|
||||
{isPembatas ? <Divider /> : ""} */}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -30,6 +30,7 @@ import { MODEL_COLLABORATION_PARTISIPASI } from "../../model/interface";
|
||||
import ComponentColab_AuthorNameOnListPartisipan from "./header_author_list_partisipan";
|
||||
import notifikasiToUser_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_user";
|
||||
import mqtt_client from "@/util/mqtt_client";
|
||||
|
||||
export default function ComponentColab_DetailListPartisipasiUser({
|
||||
listPartisipan,
|
||||
userLoginId,
|
||||
@@ -117,6 +118,7 @@ export default function ComponentColab_DetailListPartisipasiUser({
|
||||
},
|
||||
}}
|
||||
>
|
||||
|
||||
<Stack spacing={"xs"}>
|
||||
<Group position="right">
|
||||
<ActionIcon onClick={close} variant="transparent">
|
||||
@@ -125,7 +127,7 @@ export default function ComponentColab_DetailListPartisipasiUser({
|
||||
</Group>
|
||||
<Textarea
|
||||
maxLength={300}
|
||||
label="Deskripsi Diri"
|
||||
label={<Text c={"white"} mb={"sm"} fw={"bold"}>Deskripsi Diri</Text>}
|
||||
placeholder="Deskripsikan diri anda yang sesuai dengan proyek ini.."
|
||||
minRows={4}
|
||||
onChange={(val) => {
|
||||
@@ -179,7 +181,6 @@ export default function ComponentColab_DetailListPartisipasiUser({
|
||||
backgroundColor: AccentColor.blue,
|
||||
color: "white",
|
||||
borderRadius: "10px",
|
||||
marginBottom: "20px",
|
||||
padding: "15px",
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -1,31 +1,38 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { Stack, Grid, Avatar, Divider, Text, Group } from "@mantine/core";
|
||||
import { ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component";
|
||||
import { Group, Stack, Text } from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import moment from "moment";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
|
||||
export default function ComponentColab_AuthorNameOnHeader({
|
||||
profileId,
|
||||
imagesId,
|
||||
authorName,
|
||||
tglPublish,
|
||||
isPembatas,
|
||||
profile,
|
||||
}: {
|
||||
profileId?: string;
|
||||
imagesId?: string;
|
||||
authorName?: string;
|
||||
tglPublish?: Date;
|
||||
isPembatas?: boolean;
|
||||
profile: any;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"xs"} style={{
|
||||
color: "white"
|
||||
}}>
|
||||
<Grid>
|
||||
<ComponentGlobal_AvatarAndUsername
|
||||
profile={profile}
|
||||
component={
|
||||
<Group position="right">
|
||||
{tglPublish ? (
|
||||
<Text fz={"xs"}>
|
||||
{new Intl.DateTimeFormat("id-ID", {
|
||||
dateStyle: "medium",
|
||||
}).format(tglPublish)}
|
||||
</Text>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Group>
|
||||
}
|
||||
/>
|
||||
|
||||
<Stack spacing={"xs"}>
|
||||
{/* <Grid>
|
||||
<Grid.Col
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
@@ -69,8 +76,7 @@ export default function ComponentColab_AuthorNameOnHeader({
|
||||
)}
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
{isPembatas ? <Divider /> : ""}
|
||||
</Grid> */}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import { Box, Paper, Stack, Text, Title } from "@mantine/core";
|
||||
import ComponentColab_HeaderTamplate from "../../component/header_tamplate";
|
||||
import { MODEL_COLLABORATION_ROOM_CHAT } from "../../model/interface";
|
||||
import ComponentColab_DetailData from "../../component/detail/detail_data";
|
||||
import ComponentColab_AuthorNameOnListPartisipan from "../../component/detail/header_author_list_partisipan";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_AvatarAndUsername, ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { Box, Paper, Stack, Title } from "@mantine/core";
|
||||
import ComponentColab_DetailData from "../../component/detail/detail_data";
|
||||
import { MODEL_COLLABORATION_ROOM_CHAT } from "../../model/interface";
|
||||
|
||||
export default function Colab_DetailInfoGrup({
|
||||
dataRoom,
|
||||
@@ -20,7 +18,7 @@ export default function Colab_DetailInfoGrup({
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={<UIGlobal_LayoutHeaderTamplate title="Info Grup" />}
|
||||
>
|
||||
{<InfoGroup dataRoom={dataRoom} />}
|
||||
<InfoGroup dataRoom={dataRoom} />
|
||||
</UIGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
@@ -29,42 +27,30 @@ export default function Colab_DetailInfoGrup({
|
||||
function InfoGroup({ dataRoom }: { dataRoom: MODEL_COLLABORATION_ROOM_CHAT }) {
|
||||
return (
|
||||
<>
|
||||
<Stack
|
||||
px={"xs"}
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
color: "white",
|
||||
borderRadius: "10px",
|
||||
marginBottom: "20px",
|
||||
padding: "15px",
|
||||
}}
|
||||
>
|
||||
<ComponentColab_DetailData data={dataRoom.ProjectCollaboration} />
|
||||
<Paper
|
||||
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.softblue}`,
|
||||
backgroundColor: AccentColor.blue,
|
||||
color: "white",
|
||||
borderRadius: "10px",
|
||||
marginBottom: "20px",
|
||||
padding: "15px",
|
||||
}}
|
||||
>
|
||||
<Stack>
|
||||
<Title order={6}>Anggota Grup</Title>
|
||||
{dataRoom.ProjectCollaboration_AnggotaRoomChat.map((e, i) => (
|
||||
<Box key={i}>
|
||||
<ComponentColab_AuthorNameOnListPartisipan
|
||||
author={e.User}
|
||||
// isPembatas={true}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Stack>
|
||||
<ComponentGlobal_CardStyles>
|
||||
<Stack>
|
||||
<ComponentColab_DetailData data={dataRoom.ProjectCollaboration} />
|
||||
<Paper
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.softblue}`,
|
||||
backgroundColor: AccentColor.blue,
|
||||
color: "white",
|
||||
borderRadius: "10px",
|
||||
padding: "15px",
|
||||
}}
|
||||
>
|
||||
<Stack>
|
||||
<Title order={6}>Anggota Grup</Title>
|
||||
{dataRoom.ProjectCollaboration_AnggotaRoomChat.map((e, i) => (
|
||||
<Box key={i}>
|
||||
|
||||
<ComponentGlobal_AvatarAndUsername profile={e.User.Profile as any}/>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Stack>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import {
|
||||
Stack
|
||||
} from "@mantine/core";
|
||||
import { Stack } from "@mantine/core";
|
||||
import ComponentColab_DetailData from "../../component/detail/detail_data";
|
||||
import ComponentColab_DetailListPartisipasiUser from "../../component/detail/list_partisipasi_user";
|
||||
import ComponentColab_AuthorNameOnHeader from "../../component/header_author_name";
|
||||
import { MODEL_COLLABORATION } from "../../model/interface";
|
||||
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||
|
||||
export default function Colab_MainDetail({
|
||||
dataColab,
|
||||
@@ -18,37 +17,26 @@ export default function Colab_MainDetail({
|
||||
dataColab?: MODEL_COLLABORATION;
|
||||
userLoginId?: string;
|
||||
listPartisipan?: any[];
|
||||
cekPartisipan: boolean
|
||||
cekPartisipan: boolean;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack
|
||||
px={5}
|
||||
spacing={"xl"}
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
color: "white",
|
||||
borderRadius: "10px",
|
||||
marginBottom: "20px",
|
||||
padding: "15px",
|
||||
}}
|
||||
>
|
||||
<ComponentColab_AuthorNameOnHeader
|
||||
tglPublish={new Date()}
|
||||
authorName={dataColab?.Author?.Profile?.name}
|
||||
imagesId={dataColab?.Author?.Profile?.imagesId}
|
||||
profileId={dataColab?.Author?.Profile?.id}
|
||||
/>
|
||||
<ComponentColab_DetailData data={dataColab} />
|
||||
<ComponentColab_DetailListPartisipasiUser
|
||||
listPartisipan={listPartisipan}
|
||||
userLoginId={userLoginId}
|
||||
authorId={dataColab?.Author.id}
|
||||
colabId={dataColab?.id}
|
||||
cekPartisipan={cekPartisipan}
|
||||
/>
|
||||
</Stack>
|
||||
<ComponentGlobal_CardStyles>
|
||||
<Stack>
|
||||
<ComponentColab_AuthorNameOnHeader
|
||||
tglPublish={new Date()}
|
||||
profile={dataColab?.Author?.Profile as any}
|
||||
/>
|
||||
<ComponentColab_DetailData data={dataColab} />
|
||||
<ComponentColab_DetailListPartisipasiUser
|
||||
listPartisipan={listPartisipan}
|
||||
userLoginId={userLoginId}
|
||||
authorId={dataColab?.Author.id}
|
||||
colabId={dataColab?.id}
|
||||
cekPartisipan={cekPartisipan}
|
||||
/>
|
||||
</Stack>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentColab_HeaderTamplate from "../../component/header_tamplate";
|
||||
import { Center, Stack } from "@mantine/core";
|
||||
import { MODEL_COLLABORATION_NOTIFIKSI } from "../../model/interface";
|
||||
import ComponentColab_NotedBox from "../../component/noted_box";
|
||||
import ComponentColab_DetailData from "../../component/detail/detail_data";
|
||||
|
||||
export default function Colab_DetailNotifikasi({
|
||||
data,
|
||||
}: {
|
||||
data: MODEL_COLLABORATION_NOTIFIKSI;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={<ComponentColab_HeaderTamplate title="Detail Notifikasi" />}
|
||||
>
|
||||
<DetailNotif data={data} />
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function DetailNotif({ data }: { data?: MODEL_COLLABORATION_NOTIFIKSI }) {
|
||||
return (
|
||||
<>
|
||||
<Stack px={"sm"}>
|
||||
<ComponentColab_NotedBox
|
||||
informasi={data?.ProjectCollaboration.report as any}
|
||||
/>
|
||||
<ComponentColab_DetailData data={data?.ProjectCollaboration} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +1,14 @@
|
||||
"use client";
|
||||
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||
import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data";
|
||||
import ComponentColab_DetailListPartisipasiUser from "@/app_modules/colab/component/detail/list_partisipasi_user";
|
||||
import ComponentColab_AuthorNameOnHeader from "@/app_modules/colab/component/header_author_name";
|
||||
import { MODEL_COLLABORATION, MODEL_COLLABORATION_PARTISIPASI } from "@/app_modules/colab/model/interface";
|
||||
import {
|
||||
MODEL_COLLABORATION,
|
||||
MODEL_COLLABORATION_PARTISIPASI,
|
||||
} from "@/app_modules/colab/model/interface";
|
||||
import { Stack, Text } from "@mantine/core";
|
||||
|
||||
export default function Colab_DetailPartisipasiProyek({
|
||||
@@ -12,34 +16,21 @@ export default function Colab_DetailPartisipasiProyek({
|
||||
listPartisipan,
|
||||
}: {
|
||||
dataColab: MODEL_COLLABORATION;
|
||||
listPartisipan: MODEL_COLLABORATION_PARTISIPASI[]
|
||||
listPartisipan: MODEL_COLLABORATION_PARTISIPASI[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack
|
||||
px={5}
|
||||
spacing={"xl"}
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
color: "white",
|
||||
borderRadius: "10px",
|
||||
marginBottom: "20px",
|
||||
padding: "15px",
|
||||
}}
|
||||
>
|
||||
{/* <pre>{JSON.stringify(dataColab, null,2)}</pre> */}
|
||||
<ComponentColab_AuthorNameOnHeader
|
||||
authorName={dataColab?.Author.Profile.name}
|
||||
profileId={dataColab?.Author.Profile.id}
|
||||
imagesId={dataColab?.Author.Profile.imagesId}
|
||||
tglPublish={dataColab?.createdAt}
|
||||
/>
|
||||
<ComponentColab_DetailData data={dataColab} />
|
||||
<ComponentColab_DetailListPartisipasiUser
|
||||
listPartisipan={listPartisipan}
|
||||
/>
|
||||
</Stack>
|
||||
<ComponentGlobal_CardStyles>
|
||||
<Stack>
|
||||
<ComponentColab_AuthorNameOnHeader
|
||||
profile={dataColab.Author.Profile}
|
||||
/>
|
||||
<ComponentColab_DetailData data={dataColab} />
|
||||
<ComponentColab_DetailListPartisipasiUser
|
||||
listPartisipan={listPartisipan}
|
||||
/>
|
||||
</Stack>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
@@ -17,7 +18,7 @@ import {
|
||||
MODEL_COLLABORATION,
|
||||
MODEL_COLLABORATION_PARTISIPASI,
|
||||
} from "@/app_modules/colab/model/interface";
|
||||
import { notifikasiToUser_CreateGroupCollaboration } from "@/app_modules/notifikasi/fun/create/create_notif_to_user_collaboration";
|
||||
import mqtt_client from "@/util/mqtt_client";
|
||||
import {
|
||||
ActionIcon,
|
||||
Button,
|
||||
@@ -38,8 +39,6 @@ import { useAtom } from "jotai";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import mqtt_client from "@/util/mqtt_client";
|
||||
|
||||
|
||||
export default function Colab_DetailProyekSaya({
|
||||
dataColab,
|
||||
@@ -50,24 +49,15 @@ export default function Colab_DetailProyekSaya({
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack
|
||||
px={5}
|
||||
spacing={"xl"}
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
color: "white",
|
||||
borderRadius: "10px",
|
||||
marginBottom: "20px",
|
||||
padding: "15px",
|
||||
}}
|
||||
>
|
||||
<ComponentColab_DetailData data={dataColab} />
|
||||
<CheckBoxPartisipan
|
||||
listPartisipan={listPartisipan}
|
||||
colabId={dataColab.id}
|
||||
/>
|
||||
</Stack>
|
||||
<ComponentGlobal_CardStyles marginBottom={"15px"}>
|
||||
<Stack>
|
||||
<ComponentColab_DetailData data={dataColab} />
|
||||
<CheckBoxPartisipan
|
||||
listPartisipan={listPartisipan}
|
||||
colabId={dataColab.id}
|
||||
/>
|
||||
</Stack>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -119,8 +109,8 @@ function CheckBoxPartisipan({
|
||||
) : (
|
||||
listPartisipan.map((e, i) => (
|
||||
<Grid key={i} align="center">
|
||||
<Grid.Col span={"content"}>
|
||||
<Checkbox value={e?.User?.id} />
|
||||
<Grid.Col span={2}>
|
||||
<Checkbox color={"yellow"} value={e?.User?.id} />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<ComponentColab_AuthorNameOnListPartisipan
|
||||
|
||||
@@ -16,7 +16,7 @@ export default function LayoutColab_DetailProyekSaya({
|
||||
colabId,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
colabId: string
|
||||
colabId: string;
|
||||
}) {
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
const listPage = [
|
||||
@@ -38,10 +38,8 @@ export default function LayoutColab_DetailProyekSaya({
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
onClick={() => setOpenDrawer(true)}
|
||||
|
||||
|
||||
>
|
||||
<IconDotsVertical />
|
||||
<IconDotsVertical color="white" />
|
||||
</ActionIcon>
|
||||
}
|
||||
/>
|
||||
@@ -51,10 +49,9 @@ export default function LayoutColab_DetailProyekSaya({
|
||||
</UIGlobal_LayoutTamplate>
|
||||
|
||||
<UIGlobal_Drawer
|
||||
opened={openDrawer}
|
||||
close={() => setOpenDrawer(false)}
|
||||
component={listPage}
|
||||
|
||||
opened={openDrawer}
|
||||
close={() => setOpenDrawer(false)}
|
||||
component={listPage}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data";
|
||||
import ComponentColab_AuthorNameOnHeader from "@/app_modules/colab/component/header_author_name";
|
||||
import { gs_colab_hot_menu } from "@/app_modules/colab/global_state";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import {
|
||||
Button,
|
||||
Checkbox,
|
||||
Drawer,
|
||||
Grid,
|
||||
Group,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { useAtom } from "jotai";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function Colab_DetailStatusPublish() {
|
||||
return (
|
||||
<>
|
||||
<Stack px={5} spacing={"xl"}>
|
||||
<ComponentColab_DetailData />
|
||||
<CheckBoxPartisipan />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function CheckBoxPartisipan() {
|
||||
const router = useRouter();
|
||||
const [value, setValue] = useState<string[]>([]);
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_colab_hot_menu);
|
||||
|
||||
const listCheck = [
|
||||
{
|
||||
id: 1,
|
||||
value: "satu",
|
||||
label: "Satu",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: "dua",
|
||||
label: "Dua",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: "tiga",
|
||||
label: "Tiga",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
value: "empat",
|
||||
label: "Empat",
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
value: "lima",
|
||||
label: "Lima",
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
value: "enam",
|
||||
label: "Enam",
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
value: "tujuh",
|
||||
label: "Tujuh",
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
value: "delapan",
|
||||
label: "Delapan",
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
value: "sembilan",
|
||||
label: "Sembilan",
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
value: "sepuluh",
|
||||
label: "Sepuluh",
|
||||
},
|
||||
];
|
||||
|
||||
async function onSave() {
|
||||
close();
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Membuat Grup");
|
||||
setHotMenu(4);
|
||||
router.push(RouterColab.grup_diskusi);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<Paper withBorder shadow="lg" p={"sm"}>
|
||||
<Text c={"red"} fz={10}>
|
||||
*
|
||||
<Text px={"xs"} span inherit c={"gray"}>
|
||||
Pilih user yang akan menjadi tim proyek anda
|
||||
</Text>
|
||||
</Text>
|
||||
<ScrollArea h={400}>
|
||||
<Checkbox.Group value={value} onChange={setValue}>
|
||||
<Stack mt="xs">
|
||||
{listCheck.map((e, i) => (
|
||||
<Grid key={e.id} align="center">
|
||||
<Grid.Col span={"content"}>
|
||||
<Checkbox value={e.value} />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<ComponentColab_AuthorNameOnHeader isPembatas={true} />
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
))}
|
||||
</Stack>
|
||||
</Checkbox.Group>
|
||||
</ScrollArea>
|
||||
</Paper>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
disabled={_.isEmpty(value) ? true : false}
|
||||
onClick={() => {
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Buat Ruang Diskusi{" "}
|
||||
</Button>
|
||||
</Stack>
|
||||
|
||||
<Drawer
|
||||
opened={opened}
|
||||
onClose={close}
|
||||
position="bottom"
|
||||
size={150}
|
||||
withCloseButton={false}
|
||||
>
|
||||
<Stack>
|
||||
<Title order={6}>Nama Grup Diskusi</Title>
|
||||
<TextInput placeholder="Masukan nama grup diskusi .." radius={"xl"} />
|
||||
<Group grow>
|
||||
<Button radius={"xl"} onClick={close}>
|
||||
Batal
|
||||
</Button>
|
||||
<Button radius={"xl"} color="green" onClick={() => onSave()}>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Drawer>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import ComponentColab_HeaderTamplate from "@/app_modules/colab/component/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutColab_DetailStatusPublish({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<ComponentColab_HeaderTamplate title="Proyek Saya" />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import ComponentColab_NotedBox from "@/app_modules/colab/component/noted_box";
|
||||
import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data";
|
||||
import { Button, Group, Modal, Stack, Title } from "@mantine/core";
|
||||
import { IconCheck, IconTrash, IconX } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { gs_colab_status } from "@/app_modules/colab/global_state";
|
||||
import { useAtom } from "jotai";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
|
||||
export default function Colab_DetailStatusReject() {
|
||||
return (
|
||||
<>
|
||||
<Stack px={"xs"} spacing={"xl"}>
|
||||
<ComponentColab_NotedBox informasi="Alasan penolakan" />
|
||||
<ComponentColab_DetailData />
|
||||
<ButtonAction />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction() {
|
||||
const router = useRouter();
|
||||
const [tabsStatus, setTabsStatus] = useAtom(gs_colab_status);
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
|
||||
async function onAjukan() {
|
||||
setTabsStatus("Review");
|
||||
ComponentGlobal_NotifikasiBerhasil("Ajukan Review Berhasil");
|
||||
router.back();
|
||||
}
|
||||
|
||||
async function onDelete() {
|
||||
router.back();
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Dihapus");
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Group grow>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
leftIcon={<IconCheck size={15} />}
|
||||
onClick={() => onAjukan()}
|
||||
>
|
||||
Ajukan Review
|
||||
</Button>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
leftIcon={<IconTrash size={15} />}
|
||||
color="red"
|
||||
onClick={() => open()}
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
</Group>
|
||||
|
||||
<Modal opened={opened} onClose={close} centered withCloseButton={false}>
|
||||
<Stack>
|
||||
<Title order={6}>Yakin menghapus proyek ini ?</Title>
|
||||
<Group position="center">
|
||||
<Button
|
||||
radius={"xl"}
|
||||
leftIcon={<IconX size={15} />}
|
||||
onClick={close}
|
||||
>
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
leftIcon={<IconTrash size={15} />}
|
||||
color="red"
|
||||
onClick={() => onDelete()}
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import ComponentColab_HeaderTamplate from "@/app_modules/colab/component/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import { IconEdit } from "@tabler/icons-react";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutColab_DetailStatusReject({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
header={
|
||||
<ComponentColab_HeaderTamplate
|
||||
title="Detail Reject"
|
||||
icon={<IconEdit />}
|
||||
route2={RouterColab.edit + 1}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data";
|
||||
import ComponentColab_AuthorNameOnHeader from "@/app_modules/colab/component/header_author_name";
|
||||
import { gs_colab_status } from "@/app_modules/colab/global_state";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { Button, Stack } from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function Colab_DetailStatusReview() {
|
||||
return (
|
||||
<>
|
||||
<Stack px={"xs"} spacing={"xl"}>
|
||||
<ComponentColab_DetailData />
|
||||
<ButtonAction />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction() {
|
||||
const router = useRouter();
|
||||
const [tabsStatus, setTabsStatus] = useAtom(gs_colab_status);
|
||||
|
||||
async function onClick() {
|
||||
setTabsStatus("Reject");
|
||||
router.back();
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Dibatalkan");
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button radius={"xl"} onClick={() => onClick()}>
|
||||
Batalkan Review
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import ComponentColab_HeaderTamplate from "@/app_modules/colab/component/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutColab_DetailStatusReview({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
header={<ComponentColab_HeaderTamplate title="Detail Review" />}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -31,7 +31,7 @@ export default async function colab_getListAnggotaByRoomId(roomId: string) {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
imagesId: true
|
||||
imageId: true
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -3,27 +3,18 @@ import LayoutColab_Main from "./main/layout";
|
||||
import Colab_Splash from "./splash";
|
||||
import Colab_Create from "./create";
|
||||
import LayoutColab_Create from "./create/layout";
|
||||
import Colab_Status from "./main/status";
|
||||
import Colab_MainDetail from "./detail/main_detail";
|
||||
import LayoutColab_MainDetail from "./detail/main_detail/layout";
|
||||
import Colab_DetailStatusReview from "./detail/status/review";
|
||||
import LayoutColab_DetailStatusReview from "./detail/status/review/layout";
|
||||
import Colab_DetailStatusReject from "./detail/status/reject";
|
||||
import LayoutColab_DetailStatusReject from "./detail/status/reject/layout";
|
||||
import Colab_Proyek from "./main/proyek";
|
||||
import Colab_DetailStatusPublish from "./detail/status/publish";
|
||||
import LayoutColab_DetailStatusPublish from "./detail/status/publish/layout";
|
||||
import Colab_Edit from "./edit";
|
||||
import LayoutColab_Edit from "./edit/layout";
|
||||
import Colab_DetailPartisipasiProyek from "./detail/proyek/partisipasi";
|
||||
import LayoutColab_DetailPartisipasiProyek from "./detail/proyek/partisipasi/layout";
|
||||
import Colab_GrupDiskus from "./main/grup";
|
||||
import Colab_DetailGrupDiskusi from "./detail/grup";
|
||||
import Colab_NotifikasiView from "./main/pemberitahuan";
|
||||
import Colab_DetailProyekSaya from "./detail/proyek/saya";
|
||||
import LayoutColab_DetailProyekSaya from "./detail/proyek/saya/layout";
|
||||
import Colab_DetailInfoGrup from "./detail/info_grup";
|
||||
import Colab_DetailNotifikasi from "./detail/notifikasi";
|
||||
import Colab_GroupChatView from "./detail/group";
|
||||
|
||||
export {
|
||||
@@ -32,26 +23,17 @@ export {
|
||||
Colab_Splash,
|
||||
Colab_Create,
|
||||
LayoutColab_Create,
|
||||
Colab_Status,
|
||||
Colab_MainDetail,
|
||||
LayoutColab_MainDetail,
|
||||
Colab_DetailStatusReview,
|
||||
LayoutColab_DetailStatusReview,
|
||||
Colab_DetailStatusReject,
|
||||
LayoutColab_DetailStatusReject,
|
||||
Colab_Proyek,
|
||||
Colab_DetailStatusPublish,
|
||||
LayoutColab_DetailStatusPublish,
|
||||
Colab_Edit,
|
||||
LayoutColab_Edit,
|
||||
Colab_DetailPartisipasiProyek,
|
||||
LayoutColab_DetailPartisipasiProyek,
|
||||
Colab_GrupDiskus,
|
||||
Colab_DetailGrupDiskusi,
|
||||
Colab_NotifikasiView,
|
||||
Colab_DetailProyekSaya,
|
||||
LayoutColab_DetailProyekSaya,
|
||||
Colab_DetailInfoGrup,
|
||||
Colab_DetailNotifikasi,
|
||||
Colab_GroupChatView,
|
||||
};
|
||||
|
||||
@@ -30,38 +30,18 @@ export default function LayoutColab_Main({
|
||||
path: RouterColab.beranda,
|
||||
icon: <IconHome />,
|
||||
},
|
||||
|
||||
// {
|
||||
// id: 2,
|
||||
// name: "Status",
|
||||
// path: RouterColab.status,
|
||||
// icon: <IconReservedLine />,
|
||||
// },
|
||||
|
||||
{
|
||||
id: 3,
|
||||
id: 2,
|
||||
name: "Partisipasi",
|
||||
path: RouterColab.proyek,
|
||||
icon: <IconUsersGroup />,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
id: 3,
|
||||
name: "Grup Diskusi",
|
||||
path: RouterColab.grup_diskusi,
|
||||
icon: <IconMessages />,
|
||||
},
|
||||
// {
|
||||
// id: 5,
|
||||
// name: "Notifikasi",
|
||||
// path: RouterColab.notifikasi,
|
||||
// icon: cekNotif ? (
|
||||
// <Indicator processing color="orange">
|
||||
// <IconBell />
|
||||
// </Indicator>
|
||||
// ) : (
|
||||
// <IconBell />
|
||||
// ),
|
||||
// },
|
||||
];
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
ActionIcon,
|
||||
Center,
|
||||
Group,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import ComponentColab_IsEmptyData from "../../component/is_empty_data";
|
||||
import _ from "lodash";
|
||||
import { MODEL_COLLABORATION_NOTIFIKSI } from "../../model/interface";
|
||||
import { IconChevronRight } from "@tabler/icons-react";
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import colab_funUpdateIsReadByNotifId from "../../fun/edit/fun_is_read_by_id";
|
||||
|
||||
export default function Colab_NotifikasiView({
|
||||
listNotifikasi,
|
||||
}: {
|
||||
listNotifikasi?: MODEL_COLLABORATION_NOTIFIKSI[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [notifId, setNotifId] = useState("");
|
||||
|
||||
if (_.isEmpty(listNotifikasi))
|
||||
return <ComponentColab_IsEmptyData text="Tidak ada data" />;
|
||||
|
||||
async function onRead(notifId: string) {
|
||||
await colab_funUpdateIsReadByNotifId(notifId).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setNotifId(notifId);
|
||||
router.push(RouterColab.detail_notifikasi + notifId);
|
||||
} else {
|
||||
console.log(``);
|
||||
}
|
||||
});
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{listNotifikasi?.map((e, i) => (
|
||||
<Paper
|
||||
key={i}
|
||||
bg={e?.isRead ? "gray.1" : "gray.4"}
|
||||
p={"md"}
|
||||
onClick={() => {
|
||||
onRead(e?.id);
|
||||
}}
|
||||
>
|
||||
<Group position="apart">
|
||||
<Stack spacing={0} w={"80%"}>
|
||||
<Text fw={"bold"} fz={"xs"} lineClamp={1}>
|
||||
{e.note}
|
||||
</Text>
|
||||
<Text lineClamp={1}>{e.ProjectCollaboration.report}</Text>
|
||||
</Stack>
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
loading={e?.id === notifId ? true : false}
|
||||
>
|
||||
<IconChevronRight />
|
||||
</ActionIcon>
|
||||
</Group>
|
||||
</Paper>
|
||||
))}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,19 +1,14 @@
|
||||
"use client";
|
||||
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import { Box, Card, Center, Loader, Stack } from "@mantine/core";
|
||||
import ComponentColab_CardSectionData from "../../component/card_view/card_section_data";
|
||||
import ComponentColab_CardSectionHeaderAuthorName from "../../component/card_view/card_section_header_author_name";
|
||||
import ComponentColab_JumlahPartisipan from "../../component/card_view/card_section_jumlah_partisipan";
|
||||
import { MODEL_COLLABORATION } from "../../model/interface";
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import { Box, Center, Loader } from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
import ComponentColab_IsEmptyData from "../../component/is_empty_data";
|
||||
import { ScrollOnly } from "next-scroll-loader";
|
||||
import { useState } from "react";
|
||||
import { ComponentColab_CardProyekSaya } from "../../component/card_view/card_proyek_saya";
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import { event_getAllDraft } from "@/app_modules/event/fun/get/status/get_all_draft";
|
||||
import { ScrollOnly } from "next-scroll-loader";
|
||||
import colab_getListAllProyekSayaByAuthorId from "../../fun/get/pasrtisipan/get_list_proyek_saya_by_author_id";
|
||||
import { MODEL_COLLABORATION } from "../../model/interface";
|
||||
|
||||
export default function Colab_ProyekSaya({
|
||||
listProyekSaya,
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Tabs, Stack, Paper } from "@mantine/core";
|
||||
import { useState } from "react";
|
||||
import Colab_StatusPublish from "./publish";
|
||||
import Colab_StatusReject from "./reject";
|
||||
import Colab_StatusReview from "./review";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_colab_status } from "../../global_state";
|
||||
|
||||
export default function Colab_Status({
|
||||
listPublish,
|
||||
listReview,
|
||||
listReject,
|
||||
}: {
|
||||
listPublish: any[];
|
||||
listReview: any[];
|
||||
listReject: any[];
|
||||
}) {
|
||||
const [tabsStatus, setTabsStatus] = useAtom(gs_colab_status);
|
||||
const [colorTab, setColorTab] = useState<string | null>("");
|
||||
|
||||
const listTabs = [
|
||||
{
|
||||
id: 1,
|
||||
path: <Colab_StatusPublish listPublish={listPublish as any} />,
|
||||
value: "Publish",
|
||||
bg: "green",
|
||||
},
|
||||
// {
|
||||
// id: 2,
|
||||
// path: <Colab_StatusReview />,
|
||||
// value: "Review",
|
||||
// bg: "orange",
|
||||
// },
|
||||
{
|
||||
id: 3,
|
||||
path: <Colab_StatusReject />,
|
||||
value: "Reject",
|
||||
bg: "red",
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tabs
|
||||
color={
|
||||
"blue"
|
||||
// colorTab === "Publish"
|
||||
// ? "green"
|
||||
// : colorTab === "Review"
|
||||
// ? "orange"
|
||||
// : "red"
|
||||
}
|
||||
variant="pills"
|
||||
radius={"xl"}
|
||||
defaultValue={"Publish"}
|
||||
value={tabsStatus}
|
||||
onTabChange={(val) => {
|
||||
setTabsStatus(val);
|
||||
// setColorTab(val);
|
||||
}}
|
||||
>
|
||||
<Stack>
|
||||
<Tabs.List grow>
|
||||
{listTabs.map((e) => (
|
||||
<Tabs.Tab
|
||||
key={e.id}
|
||||
value={e.value}
|
||||
bg={tabsStatus === e.value ? "cyan" : "gray.2"}
|
||||
fw={tabsStatus === e.value ? "bold" : "normal"}
|
||||
>
|
||||
{e.value}
|
||||
</Tabs.Tab>
|
||||
))}
|
||||
</Tabs.List>
|
||||
{listTabs.map((e) => (
|
||||
<Tabs.Panel key={e.id} value={e.value}>
|
||||
{e.path}
|
||||
</Tabs.Panel>
|
||||
))}
|
||||
</Stack>
|
||||
</Tabs>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
||||
import { Card, Stack, Grid, Text, Divider, Center, Box } from "@mantine/core";
|
||||
import ComponentColab_CardSectionData from "../../component/card_view/card_section_data";
|
||||
import ComponentColab_AuthorNameOnHeader from "../../component/header_author_name";
|
||||
import ComponentColab_CardSectionHeaderAuthorName from "../../component/card_view/card_section_header_author_name";
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import ComponentColab_JumlahPartisipan from "../../component/card_view/card_section_jumlah_partisipan";
|
||||
import { MODEL_COLLABORATION } from "../../model/interface";
|
||||
|
||||
export default function Colab_StatusPublish({
|
||||
listPublish,
|
||||
}: {
|
||||
listPublish: MODEL_COLLABORATION[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
{listPublish.map((e, i) => (
|
||||
<Card
|
||||
key={i}
|
||||
withBorder
|
||||
shadow="lg"
|
||||
mb={"lg"}
|
||||
radius={"md"}
|
||||
// bg={"green.0.5"}
|
||||
style={{ borderColor: "green", borderWidth: "0.5px" }}
|
||||
>
|
||||
<Stack>
|
||||
<ComponentColab_CardSectionData
|
||||
colabId={e.id}
|
||||
path={RouterColab.status_publish}
|
||||
data={e}
|
||||
/>
|
||||
<ComponentColab_JumlahPartisipan jumlah={e.ProjectCollaboration_Partisipasi} />
|
||||
</Stack>
|
||||
</Card>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Card } from "@mantine/core";
|
||||
import ComponentColab_CardSectionData from "../../component/card_view/card_section_data";
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
|
||||
export default function Colab_StatusReject() {
|
||||
return (
|
||||
<>
|
||||
{Array(5)
|
||||
.fill(0)
|
||||
.map((e, i) => (
|
||||
<Card
|
||||
key={i}
|
||||
withBorder
|
||||
shadow="lg"
|
||||
mb={"lg"}
|
||||
radius={"md"}
|
||||
// bg={"red.1"}
|
||||
|
||||
style={{ borderColor: "red", borderWidth: "0.5px" }}
|
||||
>
|
||||
<ComponentColab_CardSectionData
|
||||
colabId={i}
|
||||
path={RouterColab.status_reject}
|
||||
/>
|
||||
</Card>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Card } from "@mantine/core";
|
||||
import ComponentColab_CardSectionData from "../../component/card_view/card_section_data";
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
|
||||
export default function Colab_StatusReview() {
|
||||
return (
|
||||
<>
|
||||
{Array(5)
|
||||
.fill(0)
|
||||
.map((e, i) => (
|
||||
<Card
|
||||
key={i}
|
||||
withBorder
|
||||
shadow="lg"
|
||||
mb={"lg"}
|
||||
radius={"md"}
|
||||
// bg={"orange.0.5"}
|
||||
style={{ borderColor: "orange", borderWidth: "0.5px" }}
|
||||
>
|
||||
<ComponentColab_CardSectionData colabId={i} path={RouterColab.status_review} />
|
||||
</Card>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user