Create Proyek Kolaborasi
# feat - Create proyek - Edit proyek - User lain join proyek - Buat gruo diskusi ## No issue
@@ -12,33 +12,35 @@ datasource db {
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
username String @unique
|
||||
nomor String @unique
|
||||
active Boolean @default(true)
|
||||
createdAt DateTime? @default(now())
|
||||
updatedAt DateTime? @updatedAt
|
||||
MasterUserRole MasterUserRole @relation(fields: [masterUserRoleId], references: [id])
|
||||
masterUserRoleId String @default("1")
|
||||
UserSession UserSession?
|
||||
Profile Profile?
|
||||
Investasi Investasi[]
|
||||
TransaksiInvestasi TransaksiInvestasi[]
|
||||
Donasi Donasi[]
|
||||
Donasi_Invoice Donasi_Invoice[]
|
||||
Donasi_Notif Donasi_Notif[]
|
||||
Event Event[]
|
||||
Event_Peserta Event_Peserta[]
|
||||
Voting Voting[]
|
||||
Voting_Kontributor Voting_Kontributor[]
|
||||
Job Job[]
|
||||
Forum_Posting Forum_Posting[]
|
||||
Forum_Komentar Forum_Komentar[]
|
||||
Forum_ReportPosting Forum_ReportPosting[]
|
||||
Forum_ReportKomentar Forum_ReportKomentar[]
|
||||
ProjectCollaboration ProjectCollaboration[]
|
||||
ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi[]
|
||||
ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat[]
|
||||
id String @id @default(cuid())
|
||||
username String @unique
|
||||
nomor String @unique
|
||||
active Boolean @default(true)
|
||||
createdAt DateTime? @default(now())
|
||||
updatedAt DateTime? @updatedAt
|
||||
MasterUserRole MasterUserRole @relation(fields: [masterUserRoleId], references: [id])
|
||||
masterUserRoleId String @default("1")
|
||||
UserSession UserSession?
|
||||
Profile Profile?
|
||||
Investasi Investasi[]
|
||||
TransaksiInvestasi TransaksiInvestasi[]
|
||||
Donasi Donasi[]
|
||||
Donasi_Invoice Donasi_Invoice[]
|
||||
Donasi_Notif Donasi_Notif[]
|
||||
Event Event[]
|
||||
Event_Peserta Event_Peserta[]
|
||||
Voting Voting[]
|
||||
Voting_Kontributor Voting_Kontributor[]
|
||||
Job Job[]
|
||||
Forum_Posting Forum_Posting[]
|
||||
Forum_Komentar Forum_Komentar[]
|
||||
Forum_ReportPosting Forum_ReportPosting[]
|
||||
Forum_ReportKomentar Forum_ReportKomentar[]
|
||||
ProjectCollaboration ProjectCollaboration[]
|
||||
ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi[]
|
||||
ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat[]
|
||||
ProjectCollaboration_AnggotaRoomChat ProjectCollaboration_AnggotaRoomChat[]
|
||||
ProjectCollaboration_Message ProjectCollaboration_Message[]
|
||||
}
|
||||
|
||||
model MasterUserRole {
|
||||
@@ -735,6 +737,7 @@ model ProjectCollaboration {
|
||||
lokasi String
|
||||
purpose String @db.Text
|
||||
benefit String? @db.Text
|
||||
// jumlah_partisipan Int @default(0)
|
||||
|
||||
ProjectCollaborationMaster_Industri ProjectCollaborationMaster_Industri? @relation(fields: [projectCollaborationMaster_IndustriId], references: [id])
|
||||
projectCollaborationMaster_IndustriId Int?
|
||||
@@ -743,6 +746,7 @@ model ProjectCollaboration {
|
||||
ProjectCollaborationMaster_Status ProjectCollaborationMaster_Status? @relation(fields: [projectCollaborationMaster_StatusId], references: [id])
|
||||
projectCollaborationMaster_StatusId Int? @default(1)
|
||||
ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi[]
|
||||
ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat[]
|
||||
}
|
||||
|
||||
model ProjectCollaborationMaster_Industri {
|
||||
@@ -766,24 +770,75 @@ model ProjectCollaborationMaster_Status {
|
||||
}
|
||||
|
||||
model ProjectCollaboration_Partisipasi {
|
||||
id String @id @default(cuid())
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
User User? @relation(fields: [userId], references: [id])
|
||||
userId String?
|
||||
ProjectCollaboration ProjectCollaboration? @relation(fields: [projectCollaborationId], references: [id])
|
||||
projectCollaborationId String?
|
||||
deskripsi_diri String
|
||||
}
|
||||
|
||||
model ProjectCollaboration_RoomChat {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
Author User? @relation(fields: [userId], references: [id])
|
||||
userId String?
|
||||
|
||||
ProjectCollaboration ProjectCollaboration? @relation(fields: [projectCollaborationId], references: [id])
|
||||
projectCollaborationId String?
|
||||
ProjectCollaboration_AnggotaRoomChat ProjectCollaboration_AnggotaRoomChat[]
|
||||
ProjectCollaboration_Message ProjectCollaboration_Message[]
|
||||
}
|
||||
|
||||
model ProjectCollaboration_AnggotaRoomChat {
|
||||
id String @id @default(cuid())
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
User User? @relation(fields: [userId], references: [id])
|
||||
userId String?
|
||||
ProjectCollaboration ProjectCollaboration? @relation(fields: [projectCollaborationId], references: [id])
|
||||
projectCollaborationId String?
|
||||
User User @relation(fields: [userId], references: [id])
|
||||
userId String
|
||||
ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat? @relation(fields: [projectCollaboration_RoomChatId], references: [id])
|
||||
projectCollaboration_RoomChatId String?
|
||||
}
|
||||
|
||||
model ProjectCollaboration_RoomChat {
|
||||
id String @id @default(cuid())
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
Author User? @relation(fields: [userId], references: [id])
|
||||
userId String?
|
||||
ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi[]
|
||||
model ProjectCollaboration_Message {
|
||||
id String @id @default(cuid())
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
message String
|
||||
isFile Boolean? @default(false)
|
||||
User User? @relation(fields: [userId], references: [id])
|
||||
userId String?
|
||||
ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat? @relation(fields: [projectCollaboration_RoomChatId], references: [id])
|
||||
projectCollaboration_RoomChatId String?
|
||||
}
|
||||
|
||||
// jumlah yg belom ke read oleh user yang login
|
||||
// find many ProjectCollaboration_AnggotaRoomChat where iduser login and is active = true,
|
||||
// select nya relasi ke table chat
|
||||
// count table message where idroomchat - count read message where idroomchat && iduser login
|
||||
|
||||
// TABLE MESSAGE
|
||||
// id
|
||||
// idroomchat
|
||||
// iduser (yg ngesend)
|
||||
// chat
|
||||
// isFile def false
|
||||
// time
|
||||
// isActive def true
|
||||
|
||||
// find many where idroomchat order by time
|
||||
// if iduser == user yg login >> posisi di kanan
|
||||
|
||||
// TABLE READ MESSAGE
|
||||
// id
|
||||
// idroomchat
|
||||
// idmessage
|
||||
// iduser (yg ngeread)
|
||||
|
||||
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
BIN
public/profile/foto/0ebe8c38-ded7-4faa-b944-769e6bb254a6.jpeg
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
public/profile/foto/2d677fbd-29dd-4930-a112-82c4e111e5dc.jpeg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
public/profile/foto/bfd2132b-493e-4d1e-bc4b-808937ac4b7e.jpeg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
public/profile/foto/d40b5363-d94b-4cf0-8190-2426124a694f.jpeg
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
@@ -23,6 +23,8 @@ import forum_kategori_report from "../../../bin/seeder/forum/master_report.json"
|
||||
import forum_status_posting from "../../../bin/seeder/forum/master_status.json";
|
||||
import collaboration_industri from "../../../bin/seeder/colab/master_industri.json";
|
||||
import collaboration_status from "../../../bin/seeder/colab/master_status.json";
|
||||
import collaboration_jumlah_minimal_room from "../../../bin/seeder/colab/jumlah_minimal_room.json";
|
||||
import { randomId } from "@mantine/hooks";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
const dev = new URL(req.url).searchParams.get("dev");
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { LayoutColab_DetailGrupDiskusi } from "@/app_modules/colab";
|
||||
import colab_getListAnggotaByRoomId from "@/app_modules/colab/fun/get/room_chat/get_list_anggota_by_room_id";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: { id: string };
|
||||
}) {
|
||||
let roomId = params.id;
|
||||
// const listAnggota = await colab_getListAnggotaByRoomId(roomId);
|
||||
|
||||
return (
|
||||
<>
|
||||
<LayoutColab_DetailGrupDiskusi>{children}</LayoutColab_DetailGrupDiskusi>
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
import { Colab_DetailGrupDiskusi } from "@/app_modules/colab";
|
||||
import colab_getMessageByRoomId from "@/app_modules/colab/fun/get/room_chat/get_message_by_room_id";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page() {
|
||||
return<>
|
||||
<Colab_DetailGrupDiskusi/>
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let roomId = params.id;
|
||||
const listMsg = await colab_getMessageByRoomId(roomId);
|
||||
const userLoginId = await user_getOneUserId()
|
||||
|
||||
return (
|
||||
<>
|
||||
<Colab_DetailGrupDiskusi roomId={roomId} listMsg={listMsg} userLoginId={userLoginId}/>
|
||||
</>
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { LayoutColab_MainDetail } from "@/app_modules/colab";
|
||||
import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
@@ -9,9 +11,15 @@ export default async function Layout({
|
||||
params: { id: string };
|
||||
}) {
|
||||
const colabId = params.id;
|
||||
const dataColab = await colab_getOneCollaborationById(colabId);
|
||||
const authorId = dataColab?.Author?.id;
|
||||
const userLoginId = await user_getOneUserId()
|
||||
console.log(authorId)
|
||||
console.log(userLoginId)
|
||||
|
||||
return (
|
||||
<>
|
||||
<LayoutColab_MainDetail colabId={colabId}>
|
||||
<LayoutColab_MainDetail colabId={colabId} isAuthor={authorId === userLoginId ? true : false}>
|
||||
{children}
|
||||
</LayoutColab_MainDetail>
|
||||
</>
|
||||
|
||||
@@ -8,9 +8,8 @@ export default async function Page({ params }: { params: { id: string } }) {
|
||||
let colabId = params.id;
|
||||
const userLoginId = await user_getOneUserId();
|
||||
const dataColab = await colab_getOneCollaborationById(colabId);
|
||||
const listPartisipan = await colab_getListPartisipanById(colabId)
|
||||
const cekPartisipan = await colab_funCekPartisipasiById(colabId)
|
||||
|
||||
const listPartisipan = await colab_getListPartisipanById(colabId);
|
||||
const cekPartisipan = await colab_funCekPartisipasiById(colabId);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
import { LayoutColab_DetailProyekSaya } from "@/app_modules/colab";
|
||||
import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: { id: string };
|
||||
}) {
|
||||
let colabId = params.id;
|
||||
const dataColab = await colab_getOneCollaborationById(colabId)
|
||||
|
||||
return (
|
||||
<>
|
||||
<LayoutColab_DetailProyekSaya>{children}</LayoutColab_DetailProyekSaya>
|
||||
<LayoutColab_DetailProyekSaya dataColab={dataColab as any}>
|
||||
{children}
|
||||
</LayoutColab_DetailProyekSaya>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,14 +3,13 @@ import colab_getListPartisipanById from "@/app_modules/colab/fun/get/get_list_pa
|
||||
import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const colabId = params.id
|
||||
const dataColab = await colab_getOneCollaborationById(colabId)
|
||||
const colabId = params.id;
|
||||
const dataColab = await colab_getOneCollaborationById(colabId);
|
||||
const listPartisipan = await colab_getListPartisipanById(colabId);
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(listPartisipan, null,2)}</pre> */}
|
||||
{/* <pre>{JSON.stringify(listPartisipan, null,2)}</pre> */}
|
||||
<Colab_DetailProyekSaya
|
||||
dataColab={dataColab as any}
|
||||
listPartisipan={listPartisipan as any}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import colab_getListRoomChatByAuthorId from "@/app_modules/colab/fun/get/room_chat/get_list_room_by_author_id";
|
||||
import Colab_GrupDiskus from "@/app_modules/colab/main/grup";
|
||||
|
||||
export default async function Page() {
|
||||
const listRoom = await colab_getListRoomChatByAuthorId();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Colab_GrupDiskus />
|
||||
<Colab_GrupDiskus listRoom={listRoom as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Colab_Proyek } from "@/app_modules/colab";
|
||||
import colab_getListPartisipasiByAuthorId from "@/app_modules/colab/fun/get/get_list_partisipasi_by_author_id";
|
||||
import colab_getListAllProyekByAuthorId from "@/app_modules/colab/fun/get/get_list_proyek_by_author_id";
|
||||
import colab_getListAllProyekSayaByAuthorId from "@/app_modules/colab/fun/get/get_list_proyek_saya_by_author_id";
|
||||
|
||||
export default async function Page() {
|
||||
const listPartisipasiUser = (await colab_getListPartisipasiByAuthorId()).data;
|
||||
const listProyekSaya = (await colab_getListAllProyekByAuthorId()).data;
|
||||
const listProyekSaya = (await colab_getListAllProyekSayaByAuthorId()).data;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
MediaQuery,
|
||||
NavLink,
|
||||
Navbar,
|
||||
ScrollArea,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
@@ -220,7 +221,10 @@ export default function AdminLayout({
|
||||
navbarOffsetBreakpoint="md"
|
||||
asideOffsetBreakpoint="sm"
|
||||
navbar={
|
||||
<MediaQuery smallerThan={"md"} styles={{ display: "none" }}>
|
||||
<MediaQuery
|
||||
smallerThan={"md"}
|
||||
styles={{ display: "none", }}
|
||||
>
|
||||
<Navbar
|
||||
width={{ lg: 200, md: 200, sm: 200, base: 200 }}
|
||||
hiddenBreakpoint="md"
|
||||
@@ -228,12 +232,14 @@ export default function AdminLayout({
|
||||
p="xs"
|
||||
bg={"gray.2"}
|
||||
>
|
||||
<Navbar.Section>
|
||||
<Stack>
|
||||
{userRole === "3" ? navbarItems : notAdminDev}
|
||||
{/* <NavLink icon={<IconCheck />} label="Create Admin" /> */}
|
||||
</Stack>
|
||||
</Navbar.Section>
|
||||
<ScrollArea h={"100vh"} scrollbarSize={2}>
|
||||
<Navbar.Section>
|
||||
<Stack>
|
||||
{userRole === "3" ? navbarItems : notAdminDev}
|
||||
{/* <NavLink icon={<IconCheck />} label="Create Admin" /> */}
|
||||
</Stack>
|
||||
</Navbar.Section>
|
||||
</ScrollArea>
|
||||
</Navbar>
|
||||
</MediaQuery>
|
||||
}
|
||||
@@ -250,7 +256,7 @@ export default function AdminLayout({
|
||||
mr="xl"
|
||||
/>
|
||||
<Title order={6}>Dashboard Admin</Title>
|
||||
<Admin_Logout/>
|
||||
<Admin_Logout />
|
||||
</Group>
|
||||
</MediaQuery>
|
||||
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import {
|
||||
Stack,
|
||||
Grid,
|
||||
Avatar,
|
||||
Divider,
|
||||
Text,
|
||||
Group,
|
||||
ActionIcon,
|
||||
Drawer,
|
||||
ScrollArea,
|
||||
Title,
|
||||
Paper,
|
||||
Button,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import moment from "moment";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||
import { IconEyeCheck, IconZoomCheck } from "@tabler/icons-react";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
|
||||
export default function ComponentColab_AuthorNameOnListPartisipan({
|
||||
author,
|
||||
isPembatas,
|
||||
deskripsi,
|
||||
}: {
|
||||
author?: MODEL_USER;
|
||||
isPembatas?: boolean;
|
||||
deskripsi?: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Drawer
|
||||
opened={opened}
|
||||
onClose={close}
|
||||
position="bottom"
|
||||
size={"40vh"}
|
||||
withCloseButton={false}
|
||||
>
|
||||
<Stack>
|
||||
<Title order={6}>Deskripsi Diri</Title>
|
||||
<Paper withBorder p={"xs"}>
|
||||
<ScrollArea h={"20vh"} scrollbarSize={2}>
|
||||
<Text>{deskripsi}</Text>
|
||||
</ScrollArea>
|
||||
</Paper>
|
||||
<Button radius={"xl"} onClick={close}>
|
||||
Tutup
|
||||
</Button>
|
||||
</Stack>
|
||||
</Drawer>
|
||||
|
||||
<Stack spacing={"xs"}>
|
||||
<Grid>
|
||||
<Grid.Col
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
if (author?.Profile.id) {
|
||||
router.push(RouterProfile.katalog + author?.Profile.id);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
size={30}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
author?.Profile.imagesId
|
||||
? RouterProfile.api_foto_profile + author?.Profile.imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Stack justify="center" h={"100%"}>
|
||||
<Text lineClamp={1} fz={"sm"} fw={"bold"}>
|
||||
{author?.Profile.name ? author?.Profile.name : "Nama author"}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"content"}>
|
||||
<Stack justify="center" h={"100%"}>
|
||||
{deskripsi ? (
|
||||
<ActionIcon
|
||||
onClick={() => open()}
|
||||
radius={"xl"}
|
||||
variant="transparent"
|
||||
>
|
||||
<IconZoomCheck />
|
||||
</ActionIcon>
|
||||
) : (
|
||||
"Invalid Data"
|
||||
)}
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
{isPembatas ? <Divider /> : ""}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -10,6 +10,9 @@ import {
|
||||
Text,
|
||||
Divider,
|
||||
Button,
|
||||
Drawer,
|
||||
Textarea,
|
||||
Group,
|
||||
} from "@mantine/core";
|
||||
import ComponentColab_AuthorNameOnHeader from "../header_author_name";
|
||||
import {
|
||||
@@ -22,6 +25,8 @@ import colab_funCreatePartisipan from "../../fun/create/fun_create_partisipan_by
|
||||
import colab_getListPartisipanById from "../../fun/get/get_list_partisipan_by_id";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import ComponentColab_AuthorNameOnListPartisipan from "./header_author_list_partisipan";
|
||||
|
||||
export default function ComponentColab_DetailListPartisipasiUser({
|
||||
listPartisipan,
|
||||
@@ -38,26 +43,57 @@ export default function ComponentColab_DetailListPartisipasiUser({
|
||||
}) {
|
||||
const [apply, setApply] = useState(false);
|
||||
const [data, setData] = useState(listPartisipan);
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [deskripsi, setDeskripsi] = useState("");
|
||||
|
||||
async function onJoin() {
|
||||
await colab_funCreatePartisipan(colabId as any, userLoginId as any).then(
|
||||
async (res) => {
|
||||
if (res.status === 201) {
|
||||
await colab_getListPartisipanById(colabId as any).then((val) => {
|
||||
setApply(true);
|
||||
setData(val as any);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
await colab_funCreatePartisipan(
|
||||
colabId as any,
|
||||
userLoginId as any,
|
||||
deskripsi
|
||||
).then(async (res) => {
|
||||
if (res.status === 201) {
|
||||
await colab_getListPartisipanById(colabId as any).then((val) => {
|
||||
setApply(true);
|
||||
close();
|
||||
setData(val as any);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
<Drawer
|
||||
opened={opened}
|
||||
onClose={close}
|
||||
position="bottom"
|
||||
size={"30vh"}
|
||||
withCloseButton={false}
|
||||
>
|
||||
<Stack>
|
||||
<Textarea
|
||||
label="Deskripsi Diri"
|
||||
placeholder="Deskripsikan diri anda yang sesuai dengan proyek ini.."
|
||||
minRows={4}
|
||||
onChange={(val) => {
|
||||
setDeskripsi(val.currentTarget.value);
|
||||
}}
|
||||
/>
|
||||
<Group position="center">
|
||||
<Button radius={"xl"} onClick={() => close()}>
|
||||
Batal
|
||||
</Button>
|
||||
<Button radius={"xl"} color="green" onClick={() => onJoin()}>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Drawer>
|
||||
|
||||
<Stack>
|
||||
{userLoginId !== authorId ? (
|
||||
<Center>
|
||||
@@ -66,7 +102,8 @@ export default function ComponentColab_DetailListPartisipasiUser({
|
||||
disabled={cekPartisipan ? true : false}
|
||||
color={cekPartisipan ? "green" : "blue"}
|
||||
onClick={() => {
|
||||
onJoin();
|
||||
// onJoin();
|
||||
open();
|
||||
}}
|
||||
>
|
||||
{cekPartisipan ? "Telah Berpartisipasi" : "Partisipasi"}
|
||||
@@ -93,11 +130,10 @@ export default function ComponentColab_DetailListPartisipasiUser({
|
||||
) : (
|
||||
data?.map((e, i) => (
|
||||
<Box key={i}>
|
||||
<ComponentColab_AuthorNameOnHeader
|
||||
<ComponentColab_AuthorNameOnListPartisipan
|
||||
isPembatas={true}
|
||||
authorName={e?.User.Profile.name}
|
||||
imagesId={e?.User?.Profile?.imagesId}
|
||||
profileId={e?.User?.Profile?.id}
|
||||
author={e.User}
|
||||
deskripsi={e.deskripsi_diri}
|
||||
/>
|
||||
</Box>
|
||||
))
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function ComponentColab_HeaderTamplate({
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false);
|
||||
if (loading) return <ComponentGlobal_V2_LoadingPage />;
|
||||
// if (loading) return <ComponentGlobal_V2_LoadingPage />;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -47,6 +47,7 @@ export default function ComponentColab_HeaderTamplate({
|
||||
<ActionIcon variant="transparent" disabled></ActionIcon>
|
||||
) : (
|
||||
<ActionIcon
|
||||
loading={loading ? true : false}
|
||||
variant="transparent"
|
||||
onClick={() => {
|
||||
setLoading(true);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Center } from "@mantine/core";
|
||||
export default function ComponentColab_IsEmptyData({ text }: { text: string }) {
|
||||
return (
|
||||
<>
|
||||
<Center h={"50vh"} fz={"sm"} c="gray" fw={"bold"}>
|
||||
<Center h={"50vh"} fz={"sm"} c="gray" fw={"bold"} style={{zIndex: 1}}>
|
||||
{text}
|
||||
</Center>
|
||||
</>
|
||||
|
||||
0
src/app_modules/colab/create/create_room/index.tsx
Normal file
@@ -1,7 +1,15 @@
|
||||
"use client";
|
||||
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import { Button, Select, Stack, TextInput, Textarea } from "@mantine/core";
|
||||
import {
|
||||
Button,
|
||||
NumberInput,
|
||||
Select,
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
Textarea,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import {
|
||||
@@ -25,6 +33,7 @@ export default function Colab_Create({
|
||||
purpose: "",
|
||||
benefit: "",
|
||||
projectCollaborationMaster_IndustriId: 0,
|
||||
// jumlah_partisipan: 0,
|
||||
});
|
||||
return (
|
||||
<>
|
||||
@@ -69,6 +78,24 @@ export default function Colab_Create({
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* <TextInput
|
||||
description={
|
||||
<Text fz={10}>
|
||||
minimal partisipan yang akan di pilih untuk mendiskusikan proyek
|
||||
</Text>
|
||||
}
|
||||
type="number"
|
||||
withAsterisk
|
||||
label="Jumlah Partisipan"
|
||||
placeholder={"2"}
|
||||
onChange={(val) => {
|
||||
setValue({
|
||||
...value,
|
||||
jumlah_partisipan: val.currentTarget.value as any,
|
||||
});
|
||||
}}
|
||||
/> */}
|
||||
|
||||
<Textarea
|
||||
label="Tujuan Proyek"
|
||||
placeholder="Masukan tujuan proyek"
|
||||
@@ -104,6 +131,7 @@ function ButtonAction({ value }: { value: any }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
async function onSave() {
|
||||
// console.log(value.jumlah_partisipan);
|
||||
if (value.title === "")
|
||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||
if (value.lokasi === "")
|
||||
@@ -112,6 +140,8 @@ function ButtonAction({ value }: { value: any }) {
|
||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||
if (value.projectCollaborationMaster_IndustriId === 0)
|
||||
return ComponentGlobal_NotifikasiPeringatan("Pilih Industri");
|
||||
// if (value.jumlah_partisipan < 2)
|
||||
// return ComponentGlobal_NotifikasiPeringatan("Minimal Ada 2 Partisipan");
|
||||
|
||||
await colab_funCreateProyek(value).then((res) => {
|
||||
if (res.status === 201) {
|
||||
|
||||
@@ -6,8 +6,11 @@ import {
|
||||
Box,
|
||||
Button,
|
||||
Grid,
|
||||
Group,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
Textarea,
|
||||
Transition,
|
||||
@@ -18,22 +21,91 @@ import { useAtom } from "jotai";
|
||||
import { useState } from "react";
|
||||
import { gs_colab_pesan } from "../../global_state";
|
||||
import { IconArrowUp, IconSend } from "@tabler/icons-react";
|
||||
import colab_funCreateMessageByUserId from "../../fun/create/room/fun_create_message_by_user_id";
|
||||
import _ from "lodash";
|
||||
import ComponentColab_IsEmptyData from "../../component/is_empty_data";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import colab_getMessageByRoomId from "../../fun/get/room_chat/get_message_by_room_id";
|
||||
|
||||
export default function Colab_DetailGrupDiskusi() {
|
||||
export default function Colab_DetailGrupDiskusi({
|
||||
roomId,
|
||||
listMsg,
|
||||
userLoginId,
|
||||
}: {
|
||||
roomId: string;
|
||||
listMsg: any[];
|
||||
userLoginId: string;
|
||||
}) {
|
||||
const [pesan, setPesan] = useState("");
|
||||
const [obrolan, setObrolan] = useState<string[]>([]);
|
||||
const [obrolan, setObrolan] = useState<any[]>(listMsg);
|
||||
const [scroll, scrollTo] = useWindowScroll();
|
||||
|
||||
async function onSend() {
|
||||
// setObrolan(pesan);
|
||||
setPesan("")
|
||||
scrollTo({ y: -0 });
|
||||
|
||||
// await colab_funCreateMessageByUserId(pesan, roomId).then(async (res) => {
|
||||
// if (res.status === 200) {
|
||||
// await colab_getMessageByRoomId(roomId).then((val) => setObrolan(val));
|
||||
// setPesan("");
|
||||
// } else {
|
||||
// ComponentGlobal_NotifikasiGagal(res.message);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
// if (_.isEmpty(listMsg))
|
||||
// return <ComponentColab_IsEmptyData text="Belum Ada Pesan" />;
|
||||
|
||||
return (
|
||||
<>
|
||||
<ScrollArea>{obrolan}</ScrollArea>
|
||||
<Box h={"78vh"}>
|
||||
<ScrollArea h={"78vh"} scrollbarSize={2}>
|
||||
<Box>
|
||||
{_.isEmpty(obrolan) ? (
|
||||
<ComponentColab_IsEmptyData text="Belum Ada Pesan" />
|
||||
) : (
|
||||
<Stack>
|
||||
{obrolan.map((e) => (
|
||||
<Box key={e.id}>
|
||||
{e?.User.id === userLoginId ? (
|
||||
<Group position="right">
|
||||
<Paper key={e.id} bg={"blue.2"} p={"sm"}>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"} fz={"xs"}>
|
||||
{e.User.Profile.name}
|
||||
</Text>
|
||||
<Text>{e.message}</Text>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Group>
|
||||
) : (
|
||||
<Group position="left">
|
||||
<Paper key={e.id} bg={"cyan.2"} p={"sm"} mr={"lg"}>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"} fz={"xs"}>
|
||||
{e.User.Profile.name}
|
||||
</Text>
|
||||
<Text>{e.message}</Text>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Group>
|
||||
)}
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
)}
|
||||
</Box>
|
||||
</ScrollArea>
|
||||
</Box>
|
||||
|
||||
<Affix position={{ bottom: rem(10) }} w={"100%"}>
|
||||
<Affix
|
||||
bg={"gray.2"}
|
||||
h={"10vh"}
|
||||
position={{ bottom: rem(0) }}
|
||||
w={"100%"}
|
||||
zIndex={99}
|
||||
p={"xs"}
|
||||
>
|
||||
<Stack justify="center" h={"100%"} px={"sm"}>
|
||||
<Grid align="center">
|
||||
<Grid.Col span={"auto"}>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
AppShell,
|
||||
Box,
|
||||
Center,
|
||||
Footer,
|
||||
Grid,
|
||||
@@ -16,50 +17,47 @@ import ComponentColab_HeaderTamplate from "../../component/header_tamplate";
|
||||
import { IconPlane, IconSend } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_colab_pesan } from "../../global_state";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
|
||||
export default function LayoutColab_DetailGrupDiskusi({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const [pesan, setPesan] = useState("");
|
||||
|
||||
async function onSend() {
|
||||
console.log(pesan);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
header={<ComponentColab_HeaderTamplate title="Nama Grup Diskusi" />}
|
||||
// footer={
|
||||
// <Footer height={60}>
|
||||
// <Stack justify="center" h={"100%"} px={"sm"}>
|
||||
// <Grid align="center">
|
||||
// <Grid.Col span={"auto"}>
|
||||
// <Textarea
|
||||
// minRows={1}
|
||||
// radius={"md"}
|
||||
// placeholder="Pesan..."
|
||||
// onChange={(val) => setPesan(val.currentTarget.value)}
|
||||
// />
|
||||
// </Grid.Col>
|
||||
// <Grid.Col span={"content"}>
|
||||
// <ActionIcon
|
||||
// variant="outline"
|
||||
// radius={"xl"}
|
||||
// size={"lg"}
|
||||
// onClick={() => onSend()}
|
||||
// >
|
||||
// <IconSend size={20} />
|
||||
// </ActionIcon>
|
||||
// </Grid.Col>
|
||||
// </Grid>
|
||||
// </Stack>
|
||||
// </Footer>
|
||||
// }
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
<Box>
|
||||
{/* Header */}
|
||||
<Box
|
||||
style={{
|
||||
zIndex: 99,
|
||||
}}
|
||||
w={"100%"}
|
||||
bg={"black"}
|
||||
pos={"fixed"}
|
||||
top={0}
|
||||
h={50}
|
||||
>
|
||||
<ComponentColab_HeaderTamplate title="Room Chat" bg={"gray.2"} />
|
||||
</Box>
|
||||
|
||||
{/* Children */}
|
||||
<Box p={"sm"} pos={"static"} h={"80vh"}>
|
||||
<Box
|
||||
style={{
|
||||
height: 50,
|
||||
}}
|
||||
></Box>
|
||||
<Stack>
|
||||
{children}
|
||||
<Box
|
||||
style={{
|
||||
height: "10vh",
|
||||
}}
|
||||
></Box>
|
||||
</Stack>
|
||||
</Box>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,9 +9,11 @@ import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
export default function LayoutColab_MainDetail({
|
||||
children,
|
||||
colabId,
|
||||
isAuthor,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
colabId: string;
|
||||
isAuthor: boolean;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
@@ -19,8 +21,8 @@ export default function LayoutColab_MainDetail({
|
||||
header={
|
||||
<ComponentColab_HeaderTamplate
|
||||
title="Detail"
|
||||
icon={<IconEdit />}
|
||||
route2={RouterColab.edit + colabId}
|
||||
icon={isAuthor ? <IconEdit /> : ""}
|
||||
route2={isAuthor ? RouterColab.edit + colabId : ""}
|
||||
/>
|
||||
}
|
||||
>
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data";
|
||||
import ComponentColab_AuthorNameOnListPartisipan from "@/app_modules/colab/component/detail/header_author_list_partisipan";
|
||||
import ComponentColab_AuthorNameOnHeader from "@/app_modules/colab/component/header_author_name";
|
||||
import colab_funCreateRoomChat from "@/app_modules/colab/fun/create/fun_create_room_chat";
|
||||
import { gs_colab_hot_menu } from "@/app_modules/colab/global_state";
|
||||
import {
|
||||
MODEL_COLLABORATION,
|
||||
MODEL_COLLABORATION_PARTISIPASI,
|
||||
} from "@/app_modules/colab/model/interface";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import {
|
||||
Button,
|
||||
Checkbox,
|
||||
@@ -39,7 +42,10 @@ export default function Colab_DetailProyekSaya({
|
||||
<>
|
||||
<Stack px={5} spacing={"xl"}>
|
||||
<ComponentColab_DetailData data={dataColab} />
|
||||
<CheckBoxPartisipan listPartisipan={listPartisipan} />
|
||||
<CheckBoxPartisipan
|
||||
listPartisipan={listPartisipan}
|
||||
colabId={dataColab.id}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
@@ -47,13 +53,12 @@ export default function Colab_DetailProyekSaya({
|
||||
|
||||
function CheckBoxPartisipan({
|
||||
listPartisipan,
|
||||
colabId,
|
||||
}: {
|
||||
listPartisipan: MODEL_COLLABORATION_PARTISIPASI[];
|
||||
colabId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [value, setValue] = useState<string[]>([]);
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_colab_hot_menu);
|
||||
|
||||
const listCheck = [
|
||||
{
|
||||
@@ -108,56 +113,94 @@ function CheckBoxPartisipan({
|
||||
},
|
||||
];
|
||||
|
||||
async function onSave() {
|
||||
close();
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Membuat Grup");
|
||||
setHotMenu(4);
|
||||
router.push(RouterColab.grup_diskusi);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{/* <pre>{JSON.stringify(listPartisipan,null,2)}</pre> */}
|
||||
<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">
|
||||
{listPartisipan.map((e, i) => (
|
||||
<Grid key={e.id} align="center">
|
||||
<Grid.Col span={"content"}>
|
||||
<Checkbox value={e.id.toString()} />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<ComponentColab_AuthorNameOnHeader
|
||||
isPembatas={true}
|
||||
authorName={e?.User.Profile.name}
|
||||
profileId={e?.User.Profile.id}
|
||||
imagesId={e?.User.Profile.imagesId}
|
||||
/>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
))}
|
||||
</Stack>
|
||||
</Checkbox.Group>
|
||||
</ScrollArea>
|
||||
{/* {JSON.stringify(value, null, 2)} */}
|
||||
<Stack>
|
||||
<Stack spacing={5}>
|
||||
<Text c={"red"} fz={10}>
|
||||
*
|
||||
<Text px={"xs"} span inherit c={"gray"}>
|
||||
Pilih user yang akan menjadi tim proyek anda
|
||||
</Text>
|
||||
</Text>
|
||||
<Text c={"red"} fz={10}>
|
||||
*
|
||||
<Text px={"xs"} span inherit c={"gray"}>
|
||||
Room chat dapat dibentuk jika ada 2 user yang dipilih
|
||||
</Text>
|
||||
</Text>
|
||||
</Stack>
|
||||
<ScrollArea h={400} offsetScrollbars>
|
||||
<Checkbox.Group value={value} onChange={setValue}>
|
||||
<Stack mt="xs">
|
||||
{listPartisipan.map((e, i) => (
|
||||
<Grid key={e.id} align="center">
|
||||
<Grid.Col span={"content"}>
|
||||
<Checkbox value={e.User.id} />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<ComponentColab_AuthorNameOnListPartisipan
|
||||
isPembatas={true}
|
||||
author={e.User}
|
||||
deskripsi={e.deskripsi_diri}
|
||||
/>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
))}
|
||||
</Stack>
|
||||
</Checkbox.Group>
|
||||
</ScrollArea>
|
||||
</Stack>
|
||||
</Paper>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
disabled={_.isEmpty(value) ? true : false}
|
||||
onClick={() => {
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Buat Ruang Diskusi{" "}
|
||||
</Button>
|
||||
<ButtonAction value={value} colabId={colabId} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({
|
||||
value,
|
||||
colabId,
|
||||
}: {
|
||||
value: string[];
|
||||
colabId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_colab_hot_menu);
|
||||
const [nameRoom, setNameRoom] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
async function onSave() {
|
||||
await colab_funCreateRoomChat(nameRoom, value, colabId).then((res) => {
|
||||
console.log(res);
|
||||
if (res.status === 201) {
|
||||
setLoading(true);
|
||||
close();
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Membuat Grup");
|
||||
setHotMenu(4);
|
||||
router.push(RouterColab.grup_diskusi);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal("Gagal Membuat Grup")
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
// disabled={value.length >= 2 ? false : true}
|
||||
onClick={() => {
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Buat Ruang Diskusi{" "}
|
||||
</Button>
|
||||
|
||||
<Drawer
|
||||
opened={opened}
|
||||
@@ -168,12 +211,24 @@ function CheckBoxPartisipan({
|
||||
>
|
||||
<Stack>
|
||||
<Title order={6}>Nama Grup Diskusi</Title>
|
||||
<TextInput placeholder="Masukan nama grup diskusi .." radius={"xl"} />
|
||||
<TextInput
|
||||
placeholder="Masukan nama grup diskusi .."
|
||||
radius={"xl"}
|
||||
onChange={(val) => {
|
||||
setNameRoom(val.currentTarget.value);
|
||||
}}
|
||||
/>
|
||||
<Group grow>
|
||||
<Button radius={"xl"} onClick={close}>
|
||||
Batal
|
||||
</Button>
|
||||
<Button radius={"xl"} color="green" onClick={() => onSave()}>
|
||||
<Button
|
||||
loaderPosition="center"
|
||||
loading={loading ? true : false}
|
||||
radius={"xl"}
|
||||
color="green"
|
||||
onClick={() => onSave()}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
"use client";
|
||||
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import ComponentColab_HeaderTamplate from "@/app_modules/colab/component/header_tamplate";
|
||||
import { MODEL_COLLABORATION } from "@/app_modules/colab/model/interface";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import { IconEdit } from "@tabler/icons-react";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutColab_DetailProyekSaya({
|
||||
children,
|
||||
dataColab,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
dataColab: MODEL_COLLABORATION;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<ComponentColab_HeaderTamplate title="Proyek Saya" />}>
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={
|
||||
<ComponentColab_HeaderTamplate
|
||||
title="Proyek Saya"
|
||||
icon={<IconEdit />}
|
||||
route2={RouterColab.edit + dataColab?.id}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { Stack, TextInput, Select, Textarea, Button } from "@mantine/core";
|
||||
import {
|
||||
Stack,
|
||||
TextInput,
|
||||
Select,
|
||||
Textarea,
|
||||
Button,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React, { useState } from "react";
|
||||
import {
|
||||
@@ -10,6 +17,7 @@ import {
|
||||
import colab_funEditById from "../fun/edit/fun_edit_by_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
|
||||
export default function Colab_Edit({
|
||||
selectedData,
|
||||
@@ -70,6 +78,25 @@ export default function Colab_Edit({
|
||||
}
|
||||
/>
|
||||
|
||||
{/* <TextInput
|
||||
description={
|
||||
<Text fz={10}>
|
||||
minimal partisipan yang akan di pilih untuk mendiskusikan proyek
|
||||
</Text>
|
||||
}
|
||||
type="number"
|
||||
withAsterisk
|
||||
label="Jumlah Partisipan"
|
||||
placeholder={"2"}
|
||||
value={value.jumlah_partisipan ? value.jumlah_partisipan : ""}
|
||||
onChange={(val) => {
|
||||
setValue({
|
||||
...value,
|
||||
jumlah_partisipan: + val.currentTarget.value
|
||||
});
|
||||
}}
|
||||
/> */}
|
||||
|
||||
<Textarea
|
||||
label="Tujuan Proyek"
|
||||
placeholder="Masukan tujuan proyek"
|
||||
@@ -103,11 +130,22 @@ export default function Colab_Edit({
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({ value }: { value: React.ReactNode }) {
|
||||
function ButtonAction({ value }: { value: any }) {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
async function onUpdate() {
|
||||
if (value.title === "")
|
||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||
if (value.lokasi === "")
|
||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||
if (value.purpose === "")
|
||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||
if (value.projectCollaborationMaster_IndustriId === 0)
|
||||
return ComponentGlobal_NotifikasiPeringatan("Pilih Industri");
|
||||
// if (value.jumlah_partisipan < 2)
|
||||
// return ComponentGlobal_NotifikasiPeringatan("Minimal Ada 2 Partisipan");
|
||||
|
||||
await colab_funEditById(value as any).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setLoading(true);
|
||||
|
||||
@@ -6,16 +6,18 @@ import { revalidatePath } from "next/cache";
|
||||
|
||||
export default async function colab_funCreatePartisipan(
|
||||
colabId: string,
|
||||
userId: string
|
||||
userId: string,
|
||||
deskripsi: string
|
||||
) {
|
||||
const create = await prisma.projectCollaboration_Partisipasi.create({
|
||||
data: {
|
||||
projectCollaborationId: colabId,
|
||||
userId: userId,
|
||||
deskripsi_diri: deskripsi
|
||||
},
|
||||
});
|
||||
|
||||
if (!create) return { status: 400, message: "Gagal menambahkan partisipan" };
|
||||
revalidatePath(RouterColab.main_detail + colabId);
|
||||
return { status: 201, message: "Berhasil menambahkan partisipan" };
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import { MODEL_COLLABORATION } from "../../model/interface";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import _ from "lodash";
|
||||
|
||||
export default async function colab_funCreateProyek(
|
||||
value: MODEL_COLLABORATION
|
||||
@@ -19,11 +20,12 @@ export default async function colab_funCreateProyek(
|
||||
benefit: value.benefit,
|
||||
projectCollaborationMaster_IndustriId:
|
||||
value.projectCollaborationMaster_IndustriId,
|
||||
userId: AuthorId
|
||||
userId: AuthorId,
|
||||
// jumlah_partisipan: + value.jumlah_partisipan,
|
||||
},
|
||||
});
|
||||
|
||||
if (!create) return { status: 400, message: "Gagal Membuat Proyek" };
|
||||
revalidatePath(RouterColab.beranda)
|
||||
revalidatePath(RouterColab.beranda);
|
||||
return { status: 201, message: "Berhasil Membuar Proyek" };
|
||||
}
|
||||
|
||||
60
src/app_modules/colab/fun/create/fun_create_room_chat.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function colab_funCreateRoomChat(
|
||||
nameRoom: string,
|
||||
value: any[],
|
||||
colabId: string
|
||||
) {
|
||||
const authorId = await user_getOneUserId();
|
||||
|
||||
const createRoom = await prisma.projectCollaboration_RoomChat.create({
|
||||
data: {
|
||||
name: nameRoom,
|
||||
userId: authorId,
|
||||
projectCollaborationId: colabId,
|
||||
},
|
||||
});
|
||||
|
||||
if (!createRoom) return { status: 400, message: "Gagal Membuat Room" };
|
||||
|
||||
for (let v of value) {
|
||||
// console.log(v);
|
||||
const createAnggota =
|
||||
await prisma.projectCollaboration_AnggotaRoomChat.create({
|
||||
data: {
|
||||
userId: v,
|
||||
projectCollaboration_RoomChatId: createRoom.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (!createAnggota)
|
||||
return { status: 400, message: "Gagal Menambah Anggota" };
|
||||
}
|
||||
|
||||
const createForAuthor =
|
||||
await prisma.projectCollaboration_AnggotaRoomChat.create({
|
||||
data: {
|
||||
userId: authorId,
|
||||
projectCollaboration_RoomChatId: createRoom.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (!createForAuthor)
|
||||
return { status: 400, message: "Gagal Menambahkan Author" };
|
||||
|
||||
// const hideProyek = await prisma.projectCollaboration.update({
|
||||
// where: {
|
||||
// id: colabId,
|
||||
// },
|
||||
// data: {
|
||||
// isActive: false,
|
||||
// },
|
||||
// });
|
||||
|
||||
// if (!hideProyek) return { status: 400, message: "Gagal Menyimpan Proyek" };
|
||||
|
||||
return { status: 201, message: "Berhasil Membuat Room" };
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function colab_funCreateMessageByUserId(
|
||||
message: string,
|
||||
roomId: string
|
||||
) {
|
||||
const userLoginId = await user_getOneUserId();
|
||||
const msg = await prisma.projectCollaboration_Message.create({
|
||||
data: {
|
||||
userId: userLoginId,
|
||||
message: message,
|
||||
projectCollaboration_RoomChatId: roomId,
|
||||
},
|
||||
});
|
||||
|
||||
if (!msg) return { status: 400, message: "Pesan Gagal Dikirim" };
|
||||
return { status: 200, message: "Pesan Berhasil Dikirim" };
|
||||
}
|
||||
@@ -16,6 +16,7 @@ export default async function colab_funEditById(value: MODEL_COLLABORATION) {
|
||||
lokasi: value.lokasi,
|
||||
purpose: value.purpose,
|
||||
benefit: value.benefit,
|
||||
// jumlah_partisipan: value.jumlah_partisipan,
|
||||
projectCollaborationMaster_IndustriId: value
|
||||
.ProjectCollaborationMaster_Industri.id as any,
|
||||
},
|
||||
@@ -23,6 +24,6 @@ export default async function colab_funEditById(value: MODEL_COLLABORATION) {
|
||||
|
||||
if (!updt) return { status: 400, message: "Gagal update" };
|
||||
revalidatePath(RouterColab.beranda);
|
||||
revalidatePath(RouterColab.main_detail)
|
||||
revalidatePath(RouterColab.main_detail);
|
||||
return { status: 200, message: "Berhasil update" };
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import prisma from "@/app/lib/prisma";
|
||||
export default async function colab_getListAllProyek() {
|
||||
const data = await prisma.projectCollaboration.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
projectCollaborationMaster_StatusId: 1,
|
||||
@@ -33,6 +33,5 @@ export default async function colab_getListAllProyek() {
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ export default async function colab_getListPartisipanById(colabId: string) {
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
deskripsi_diri: true
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ export default async function colab_getListPartisipasiByAuthorId() {
|
||||
const AuthorId = await user_getOneUserId();
|
||||
|
||||
const get = await prisma.projectCollaboration_Partisipasi.findMany({
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
userId: AuthorId,
|
||||
isActive: true,
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function colab_getListAllProyekByAuthorId() {
|
||||
export default async function colab_getListAllProyekSayaByAuthorId() {
|
||||
const AuthorId = await user_getOneUserId();
|
||||
const get = await prisma.projectCollaboration.findMany({
|
||||
orderBy: { createdAt: "desc" },
|
||||
where: { userId: AuthorId, isActive: true },
|
||||
select: {
|
||||
id: true,
|
||||
@@ -14,6 +15,7 @@ export default async function colab_getListAllProyekByAuthorId() {
|
||||
lokasi: true,
|
||||
purpose: true,
|
||||
benefit: true,
|
||||
// jumlah_partisipan: true,
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
@@ -15,6 +15,7 @@ export default async function colab_getOneCollaborationById(colabId: string) {
|
||||
purpose: true,
|
||||
benefit: true,
|
||||
createdAt: true,
|
||||
// jumlah_partisipan: true,
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export default async function colab_getListAnggotaByRoomId(roomId: string) {
|
||||
const get = await prisma.projectCollaboration_RoomChat.findMany({
|
||||
where: {
|
||||
id: roomId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
ProjectCollaboration: true,
|
||||
ProjectCollaboration_AnggotaRoomChat: {
|
||||
select: {
|
||||
User: {
|
||||
select: {
|
||||
Profile: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return get;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function colab_getListRoomChatByAuthorId() {
|
||||
const userLoginId = await user_getOneUserId();
|
||||
|
||||
const listRoom = await prisma.projectCollaboration_AnggotaRoomChat.findMany({
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
userId: userLoginId,
|
||||
},
|
||||
select: {
|
||||
ProjectCollaboration_RoomChat: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
isActive: true,
|
||||
ProjectCollaboration_AnggotaRoomChat: {
|
||||
select: {
|
||||
User: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// console.log(listRoom);
|
||||
|
||||
return listRoom;
|
||||
// const get = await prisma.projectCollaboration_RoomChat.findMany({
|
||||
// where: {
|
||||
// userId: userLoginId,
|
||||
// AND: [
|
||||
// {
|
||||
// ProjectCollaboration_AnggotaRoomChat: {
|
||||
// every: {
|
||||
// userId: userLoginId,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// select: {
|
||||
// id: true,
|
||||
// name: true,
|
||||
// // isActive: true,
|
||||
// // Author: true,
|
||||
// // userId: true,
|
||||
// // ProjectCollaboration: true,
|
||||
// // projectCollaborationId: true,
|
||||
// ProjectCollaboration_AnggotaRoomChat: {
|
||||
// select: {
|
||||
// userId: true,
|
||||
// User: true,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// });
|
||||
// return get;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export default async function colab_getMessageByRoomId(roomId: string) {
|
||||
const getList = await prisma.projectCollaboration_Message.findMany({
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
where: {
|
||||
projectCollaboration_RoomChatId: roomId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
createdAt: true,
|
||||
isActive: true,
|
||||
message: true,
|
||||
isFile: true,
|
||||
User: {
|
||||
select: {
|
||||
id: true,
|
||||
Profile: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return getList;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export default function Colab_Beranda({
|
||||
|
||||
return (
|
||||
<>
|
||||
<Affix position={{ bottom: rem(100), right: rem(30) }}>
|
||||
<Affix position={{ bottom: rem(150), right: rem(30) }}>
|
||||
<ActionIcon
|
||||
loading={loadingCreate ? true : false}
|
||||
opacity={scroll.y > 0 ? 0.5 : ""}
|
||||
@@ -63,7 +63,7 @@ export default function Colab_Beranda({
|
||||
{/* <pre>{JSON.stringify(listData, null, 2)}</pre> */}
|
||||
|
||||
{listData.map((e, i) => (
|
||||
<Card key={e.id} withBorder shadow="lg" mb={"lg"} radius={"md"}>
|
||||
<Card key={e.id} withBorder shadow="lg" mb={"sm"} radius={"md"}>
|
||||
<Stack>
|
||||
<ComponentColab_CardSectionHeaderAuthorName
|
||||
authorName={e?.Author?.Profile?.name}
|
||||
|
||||
@@ -1,40 +1,81 @@
|
||||
"use client";
|
||||
|
||||
import { Center, Grid, Group, Paper, Stack, Text, Title } from "@mantine/core";
|
||||
import {
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Loader,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import ComponentColab_AuthorNameOnHeader from "../../component/header_author_name";
|
||||
import { IconChevronCompactRight, IconChevronRight } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import {
|
||||
MODEL_COLLABORATION_ANGGOTA_ROOM_CHAT,
|
||||
MODEL_COLLABORATION_ROOM_CHAT,
|
||||
} from "../../model/interface";
|
||||
import { useState } from "react";
|
||||
import _ from "lodash";
|
||||
import ComponentColab_IsEmptyData from "../../component/is_empty_data";
|
||||
|
||||
export default function Colab_GrupDiskus() {
|
||||
export default function Colab_GrupDiskus({
|
||||
listRoom,
|
||||
}: {
|
||||
listRoom?: MODEL_COLLABORATION_ANGGOTA_ROOM_CHAT[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
if (_.isEmpty(listRoom))
|
||||
return <ComponentColab_IsEmptyData text="Tidak Ada Data" />;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{Array(10)
|
||||
.fill(0)
|
||||
.map((e, i) => (
|
||||
<Paper
|
||||
key={i}
|
||||
withBorder
|
||||
shadow="lg"
|
||||
p={"md"}
|
||||
onClick={() => {
|
||||
router.push(RouterColab.detail_grup + i);
|
||||
}}
|
||||
>
|
||||
<Grid align="center" h={"100%"}>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Title order={6}>Nama Grup Diskusi</Title>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"content"}>
|
||||
<Center>
|
||||
{listRoom?.map((e, i) => (
|
||||
<Paper
|
||||
key={i}
|
||||
withBorder
|
||||
shadow="lg"
|
||||
p={"md"}
|
||||
onClick={() => {
|
||||
router.push(
|
||||
RouterColab.detail_grup + e?.ProjectCollaboration_RoomChat.id
|
||||
);
|
||||
setLoading(true);
|
||||
}}
|
||||
>
|
||||
<Grid align="center" h={"100%"}>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"} lineClamp={1}>
|
||||
{e.ProjectCollaboration_RoomChat.name}
|
||||
</Text>
|
||||
<Text fz={"xs"} c={"gray"}>
|
||||
{
|
||||
e.ProjectCollaboration_RoomChat
|
||||
.ProjectCollaboration_AnggotaRoomChat.length
|
||||
}{" "}
|
||||
Anggota
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"content"}>
|
||||
<Center>
|
||||
{loading ? (
|
||||
<Loader color="gray" size={20} />
|
||||
) : (
|
||||
<IconChevronRight color="gray" />
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
))}
|
||||
)}
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
))}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
AppShell,
|
||||
Box,
|
||||
Center,
|
||||
Footer,
|
||||
Grid,
|
||||
Loader,
|
||||
Stack,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
@@ -25,6 +27,8 @@ import { useRouter } from "next/navigation";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_colab_hot_menu } from "../global_state";
|
||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||
import { useTimeout } from "@mantine/hooks";
|
||||
|
||||
export default function LayoutColab_Main({
|
||||
children,
|
||||
@@ -72,7 +76,7 @@ export default function LayoutColab_Main({
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={
|
||||
<ComponentColab_HeaderTamplate
|
||||
title="Project Collaboration"
|
||||
@@ -82,39 +86,41 @@ export default function LayoutColab_Main({
|
||||
/>
|
||||
}
|
||||
footer={
|
||||
<Footer height={70} bg={"dark"}>
|
||||
<Grid>
|
||||
{listFooter.map((e) => (
|
||||
<Grid.Col
|
||||
key={e.id}
|
||||
span={"auto"}
|
||||
pt={"md"}
|
||||
onClick={() => {
|
||||
router.replace(e.path);
|
||||
setHotMenu(e.id);
|
||||
}}
|
||||
>
|
||||
<Center>
|
||||
<Stack align="center" spacing={0}>
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
c={hotMenu === e.id ? "blue" : "white"}
|
||||
<Footer height={"10vh"} bg={"black"}>
|
||||
{/* {value} */}
|
||||
<Stack justify="center" h={"100%"}>
|
||||
<Grid>
|
||||
{listFooter.map((e) => (
|
||||
<Grid.Col key={e.id} span={"auto"} pt={"md"}>
|
||||
<Center>
|
||||
<Stack
|
||||
align="center"
|
||||
spacing={0}
|
||||
onClick={() => {
|
||||
router.replace(e.path);
|
||||
setHotMenu(e.id);
|
||||
}}
|
||||
>
|
||||
{e.icon}
|
||||
</ActionIcon>
|
||||
<Text fz={10} c={hotMenu === e.id ? "blue" : "white"}>
|
||||
{e.name}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
c={hotMenu === e.id ? "blue" : "white"}
|
||||
>
|
||||
{e.icon}
|
||||
</ActionIcon>
|
||||
<Text fz={10} c={hotMenu === e.id ? "blue" : "white"}>
|
||||
{e.name}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Footer>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ export interface MODEL_COLLABORATION {
|
||||
lokasi: string;
|
||||
purpose: string;
|
||||
benefit: string;
|
||||
jumlah_partisipan: number;
|
||||
ProjectCollaborationMaster_Industri: MODEL_COLLABORATION_MASTER;
|
||||
projectCollaborationMaster_IndustriId: number;
|
||||
Author: MODEL_USER;
|
||||
@@ -28,12 +29,33 @@ export interface MODEL_COLLABORATION {
|
||||
|
||||
export interface MODEL_COLLABORATION_PARTISIPASI {
|
||||
id: string;
|
||||
deskripsi_diri: string;
|
||||
isActive: boolean;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
userId: string;
|
||||
User: MODEL_USER;
|
||||
projectCollaborationId: string;
|
||||
projectCollaboration_RoomChatId: string;
|
||||
ProjectCollaboration: MODEL_COLLABORATION;
|
||||
}
|
||||
|
||||
export interface MODEL_COLLABORATION_ROOM_CHAT {
|
||||
id: string;
|
||||
name: string;
|
||||
isActive: true;
|
||||
Author: MODEL_USER;
|
||||
userId: string;
|
||||
ProjectCollaboration: MODEL_COLLABORATION;
|
||||
ProjectCollaboration_AnggotaRoomChat: MODEL_COLLABORATION_ANGGOTA_ROOM_CHAT[];
|
||||
}
|
||||
|
||||
export interface MODEL_COLLABORATION_ANGGOTA_ROOM_CHAT {
|
||||
id: string;
|
||||
isActive: boolean;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
userId: string;
|
||||
User: MODEL_USER;
|
||||
ProjectCollaboration_RoomChat: MODEL_COLLABORATION_ROOM_CHAT;
|
||||
projectCollaboration_RoomChatId: string;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ export default function HomeView({ dataUser }: { dataUser: MODEL_USER }) {
|
||||
id: 5,
|
||||
name: "Project Collaboration",
|
||||
icon: <IconAffiliate size={50} />,
|
||||
link: "",
|
||||
link: RouterColab.splash,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
|
||||
@@ -33,6 +33,7 @@ import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||
import { useForm } from "@mantine/form";
|
||||
import { useTimeout } from "@mantine/hooks";
|
||||
|
||||
export default function CreateProfile({ userId }: { userId: any }) {
|
||||
const [filePP, setFilePP] = useState<File | null>(null);
|
||||
@@ -302,7 +303,7 @@ function ButtonAction({
|
||||
if (res.status === 201) {
|
||||
setLoading(true);
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Membuat Profile", 3000);
|
||||
router.push(RouterHome.main_home);
|
||||
setTimeout(() => router.push(RouterHome.main_home), 2000);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
|
||||
5
src/bin/seeder/colab/jumlah_minimal_room.json
Normal file
@@ -0,0 +1,5 @@
|
||||
[
|
||||
{
|
||||
"value": 5
|
||||
}
|
||||
]
|
||||