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 {
|
model User {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
username String @unique
|
username String @unique
|
||||||
nomor String @unique
|
nomor String @unique
|
||||||
active Boolean @default(true)
|
active Boolean @default(true)
|
||||||
createdAt DateTime? @default(now())
|
createdAt DateTime? @default(now())
|
||||||
updatedAt DateTime? @updatedAt
|
updatedAt DateTime? @updatedAt
|
||||||
MasterUserRole MasterUserRole @relation(fields: [masterUserRoleId], references: [id])
|
MasterUserRole MasterUserRole @relation(fields: [masterUserRoleId], references: [id])
|
||||||
masterUserRoleId String @default("1")
|
masterUserRoleId String @default("1")
|
||||||
UserSession UserSession?
|
UserSession UserSession?
|
||||||
Profile Profile?
|
Profile Profile?
|
||||||
Investasi Investasi[]
|
Investasi Investasi[]
|
||||||
TransaksiInvestasi TransaksiInvestasi[]
|
TransaksiInvestasi TransaksiInvestasi[]
|
||||||
Donasi Donasi[]
|
Donasi Donasi[]
|
||||||
Donasi_Invoice Donasi_Invoice[]
|
Donasi_Invoice Donasi_Invoice[]
|
||||||
Donasi_Notif Donasi_Notif[]
|
Donasi_Notif Donasi_Notif[]
|
||||||
Event Event[]
|
Event Event[]
|
||||||
Event_Peserta Event_Peserta[]
|
Event_Peserta Event_Peserta[]
|
||||||
Voting Voting[]
|
Voting Voting[]
|
||||||
Voting_Kontributor Voting_Kontributor[]
|
Voting_Kontributor Voting_Kontributor[]
|
||||||
Job Job[]
|
Job Job[]
|
||||||
Forum_Posting Forum_Posting[]
|
Forum_Posting Forum_Posting[]
|
||||||
Forum_Komentar Forum_Komentar[]
|
Forum_Komentar Forum_Komentar[]
|
||||||
Forum_ReportPosting Forum_ReportPosting[]
|
Forum_ReportPosting Forum_ReportPosting[]
|
||||||
Forum_ReportKomentar Forum_ReportKomentar[]
|
Forum_ReportKomentar Forum_ReportKomentar[]
|
||||||
ProjectCollaboration ProjectCollaboration[]
|
ProjectCollaboration ProjectCollaboration[]
|
||||||
ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi[]
|
ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi[]
|
||||||
ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat[]
|
ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat[]
|
||||||
|
ProjectCollaboration_AnggotaRoomChat ProjectCollaboration_AnggotaRoomChat[]
|
||||||
|
ProjectCollaboration_Message ProjectCollaboration_Message[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model MasterUserRole {
|
model MasterUserRole {
|
||||||
@@ -735,6 +737,7 @@ model ProjectCollaboration {
|
|||||||
lokasi String
|
lokasi String
|
||||||
purpose String @db.Text
|
purpose String @db.Text
|
||||||
benefit String? @db.Text
|
benefit String? @db.Text
|
||||||
|
// jumlah_partisipan Int @default(0)
|
||||||
|
|
||||||
ProjectCollaborationMaster_Industri ProjectCollaborationMaster_Industri? @relation(fields: [projectCollaborationMaster_IndustriId], references: [id])
|
ProjectCollaborationMaster_Industri ProjectCollaborationMaster_Industri? @relation(fields: [projectCollaborationMaster_IndustriId], references: [id])
|
||||||
projectCollaborationMaster_IndustriId Int?
|
projectCollaborationMaster_IndustriId Int?
|
||||||
@@ -743,6 +746,7 @@ model ProjectCollaboration {
|
|||||||
ProjectCollaborationMaster_Status ProjectCollaborationMaster_Status? @relation(fields: [projectCollaborationMaster_StatusId], references: [id])
|
ProjectCollaborationMaster_Status ProjectCollaborationMaster_Status? @relation(fields: [projectCollaborationMaster_StatusId], references: [id])
|
||||||
projectCollaborationMaster_StatusId Int? @default(1)
|
projectCollaborationMaster_StatusId Int? @default(1)
|
||||||
ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi[]
|
ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi[]
|
||||||
|
ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model ProjectCollaborationMaster_Industri {
|
model ProjectCollaborationMaster_Industri {
|
||||||
@@ -766,24 +770,75 @@ model ProjectCollaborationMaster_Status {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model ProjectCollaboration_Partisipasi {
|
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())
|
id String @id @default(cuid())
|
||||||
isActive Boolean @default(true)
|
isActive Boolean @default(true)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
User User? @relation(fields: [userId], references: [id])
|
User User @relation(fields: [userId], references: [id])
|
||||||
userId String?
|
userId String
|
||||||
ProjectCollaboration ProjectCollaboration? @relation(fields: [projectCollaborationId], references: [id])
|
|
||||||
projectCollaborationId String?
|
|
||||||
ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat? @relation(fields: [projectCollaboration_RoomChatId], references: [id])
|
ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat? @relation(fields: [projectCollaboration_RoomChatId], references: [id])
|
||||||
projectCollaboration_RoomChatId String?
|
projectCollaboration_RoomChatId String?
|
||||||
}
|
}
|
||||||
|
|
||||||
model ProjectCollaboration_RoomChat {
|
model ProjectCollaboration_Message {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
isActive Boolean @default(true)
|
isActive Boolean @default(true)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
Author User? @relation(fields: [userId], references: [id])
|
message String
|
||||||
userId String?
|
isFile Boolean? @default(false)
|
||||||
ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi[]
|
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 forum_status_posting from "../../../bin/seeder/forum/master_status.json";
|
||||||
import collaboration_industri from "../../../bin/seeder/colab/master_industri.json";
|
import collaboration_industri from "../../../bin/seeder/colab/master_industri.json";
|
||||||
import collaboration_status from "../../../bin/seeder/colab/master_status.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) {
|
export async function GET(req: Request) {
|
||||||
const dev = new URL(req.url).searchParams.get("dev");
|
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 { 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";
|
import React from "react";
|
||||||
|
|
||||||
export default async function Layout({
|
export default async function Layout({
|
||||||
children,
|
children,
|
||||||
|
params,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
params: { id: string };
|
||||||
}) {
|
}) {
|
||||||
|
let roomId = params.id;
|
||||||
|
// const listAnggota = await colab_getListAnggotaByRoomId(roomId);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LayoutColab_DetailGrupDiskusi>{children}</LayoutColab_DetailGrupDiskusi>
|
<LayoutColab_DetailGrupDiskusi>{children}</LayoutColab_DetailGrupDiskusi>
|
||||||
|
|||||||
@@ -1,7 +1,15 @@
|
|||||||
import { Colab_DetailGrupDiskusi } from "@/app_modules/colab";
|
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() {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
return<>
|
let roomId = params.id;
|
||||||
<Colab_DetailGrupDiskusi/>
|
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 { 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";
|
import React from "react";
|
||||||
|
|
||||||
export default async function Layout({
|
export default async function Layout({
|
||||||
@@ -9,9 +11,15 @@ export default async function Layout({
|
|||||||
params: { id: string };
|
params: { id: string };
|
||||||
}) {
|
}) {
|
||||||
const colabId = params.id;
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<LayoutColab_MainDetail colabId={colabId}>
|
<LayoutColab_MainDetail colabId={colabId} isAuthor={authorId === userLoginId ? true : false}>
|
||||||
{children}
|
{children}
|
||||||
</LayoutColab_MainDetail>
|
</LayoutColab_MainDetail>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
let colabId = params.id;
|
let colabId = params.id;
|
||||||
const userLoginId = await user_getOneUserId();
|
const userLoginId = await user_getOneUserId();
|
||||||
const dataColab = await colab_getOneCollaborationById(colabId);
|
const dataColab = await colab_getOneCollaborationById(colabId);
|
||||||
const listPartisipan = await colab_getListPartisipanById(colabId)
|
const listPartisipan = await colab_getListPartisipanById(colabId);
|
||||||
const cekPartisipan = await colab_funCekPartisipasiById(colabId)
|
const cekPartisipan = await colab_funCekPartisipasiById(colabId);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,14 +1,23 @@
|
|||||||
import { LayoutColab_DetailProyekSaya } from "@/app_modules/colab";
|
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";
|
import React from "react";
|
||||||
|
|
||||||
export default async function Layout({
|
export default async function Layout({
|
||||||
children,
|
children,
|
||||||
|
params,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
params: { id: string };
|
||||||
}) {
|
}) {
|
||||||
|
let colabId = params.id;
|
||||||
|
const dataColab = await colab_getOneCollaborationById(colabId)
|
||||||
|
|
||||||
return (
|
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";
|
import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const colabId = params.id
|
const colabId = params.id;
|
||||||
const dataColab = await colab_getOneCollaborationById(colabId)
|
const dataColab = await colab_getOneCollaborationById(colabId);
|
||||||
const listPartisipan = await colab_getListPartisipanById(colabId);
|
const listPartisipan = await colab_getListPartisipanById(colabId);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(listPartisipan, null,2)}</pre> */}
|
{/* <pre>{JSON.stringify(listPartisipan, null,2)}</pre> */}
|
||||||
<Colab_DetailProyekSaya
|
<Colab_DetailProyekSaya
|
||||||
dataColab={dataColab as any}
|
dataColab={dataColab as any}
|
||||||
listPartisipan={listPartisipan 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";
|
import Colab_GrupDiskus from "@/app_modules/colab/main/grup";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
|
const listRoom = await colab_getListRoomChatByAuthorId();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Colab_GrupDiskus />
|
<Colab_GrupDiskus listRoom={listRoom as any} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { Colab_Proyek } from "@/app_modules/colab";
|
import { Colab_Proyek } from "@/app_modules/colab";
|
||||||
import colab_getListPartisipasiByAuthorId from "@/app_modules/colab/fun/get/get_list_partisipasi_by_author_id";
|
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() {
|
export default async function Page() {
|
||||||
const listPartisipasiUser = (await colab_getListPartisipasiByAuthorId()).data;
|
const listPartisipasiUser = (await colab_getListPartisipasiByAuthorId()).data;
|
||||||
const listProyekSaya = (await colab_getListAllProyekByAuthorId()).data;
|
const listProyekSaya = (await colab_getListAllProyekSayaByAuthorId()).data;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
MediaQuery,
|
MediaQuery,
|
||||||
NavLink,
|
NavLink,
|
||||||
Navbar,
|
Navbar,
|
||||||
|
ScrollArea,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
Title,
|
Title,
|
||||||
@@ -220,7 +221,10 @@ export default function AdminLayout({
|
|||||||
navbarOffsetBreakpoint="md"
|
navbarOffsetBreakpoint="md"
|
||||||
asideOffsetBreakpoint="sm"
|
asideOffsetBreakpoint="sm"
|
||||||
navbar={
|
navbar={
|
||||||
<MediaQuery smallerThan={"md"} styles={{ display: "none" }}>
|
<MediaQuery
|
||||||
|
smallerThan={"md"}
|
||||||
|
styles={{ display: "none", }}
|
||||||
|
>
|
||||||
<Navbar
|
<Navbar
|
||||||
width={{ lg: 200, md: 200, sm: 200, base: 200 }}
|
width={{ lg: 200, md: 200, sm: 200, base: 200 }}
|
||||||
hiddenBreakpoint="md"
|
hiddenBreakpoint="md"
|
||||||
@@ -228,12 +232,14 @@ export default function AdminLayout({
|
|||||||
p="xs"
|
p="xs"
|
||||||
bg={"gray.2"}
|
bg={"gray.2"}
|
||||||
>
|
>
|
||||||
<Navbar.Section>
|
<ScrollArea h={"100vh"} scrollbarSize={2}>
|
||||||
<Stack>
|
<Navbar.Section>
|
||||||
{userRole === "3" ? navbarItems : notAdminDev}
|
<Stack>
|
||||||
{/* <NavLink icon={<IconCheck />} label="Create Admin" /> */}
|
{userRole === "3" ? navbarItems : notAdminDev}
|
||||||
</Stack>
|
{/* <NavLink icon={<IconCheck />} label="Create Admin" /> */}
|
||||||
</Navbar.Section>
|
</Stack>
|
||||||
|
</Navbar.Section>
|
||||||
|
</ScrollArea>
|
||||||
</Navbar>
|
</Navbar>
|
||||||
</MediaQuery>
|
</MediaQuery>
|
||||||
}
|
}
|
||||||
@@ -250,7 +256,7 @@ export default function AdminLayout({
|
|||||||
mr="xl"
|
mr="xl"
|
||||||
/>
|
/>
|
||||||
<Title order={6}>Dashboard Admin</Title>
|
<Title order={6}>Dashboard Admin</Title>
|
||||||
<Admin_Logout/>
|
<Admin_Logout />
|
||||||
</Group>
|
</Group>
|
||||||
</MediaQuery>
|
</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,
|
Text,
|
||||||
Divider,
|
Divider,
|
||||||
Button,
|
Button,
|
||||||
|
Drawer,
|
||||||
|
Textarea,
|
||||||
|
Group,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import ComponentColab_AuthorNameOnHeader from "../header_author_name";
|
import ComponentColab_AuthorNameOnHeader from "../header_author_name";
|
||||||
import {
|
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 colab_getListPartisipanById from "../../fun/get/get_list_partisipan_by_id";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
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 { 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({
|
export default function ComponentColab_DetailListPartisipasiUser({
|
||||||
listPartisipan,
|
listPartisipan,
|
||||||
@@ -38,26 +43,57 @@ export default function ComponentColab_DetailListPartisipasiUser({
|
|||||||
}) {
|
}) {
|
||||||
const [apply, setApply] = useState(false);
|
const [apply, setApply] = useState(false);
|
||||||
const [data, setData] = useState(listPartisipan);
|
const [data, setData] = useState(listPartisipan);
|
||||||
|
const [opened, { open, close }] = useDisclosure(false);
|
||||||
|
const [deskripsi, setDeskripsi] = useState("");
|
||||||
|
|
||||||
async function onJoin() {
|
async function onJoin() {
|
||||||
await colab_funCreatePartisipan(colabId as any, userLoginId as any).then(
|
await colab_funCreatePartisipan(
|
||||||
async (res) => {
|
colabId as any,
|
||||||
if (res.status === 201) {
|
userLoginId as any,
|
||||||
await colab_getListPartisipanById(colabId as any).then((val) => {
|
deskripsi
|
||||||
setApply(true);
|
).then(async (res) => {
|
||||||
setData(val as any);
|
if (res.status === 201) {
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
await colab_getListPartisipanById(colabId as any).then((val) => {
|
||||||
});
|
setApply(true);
|
||||||
} else {
|
close();
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
setData(val as any);
|
||||||
}
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
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>
|
<Stack>
|
||||||
{userLoginId !== authorId ? (
|
{userLoginId !== authorId ? (
|
||||||
<Center>
|
<Center>
|
||||||
@@ -66,7 +102,8 @@ export default function ComponentColab_DetailListPartisipasiUser({
|
|||||||
disabled={cekPartisipan ? true : false}
|
disabled={cekPartisipan ? true : false}
|
||||||
color={cekPartisipan ? "green" : "blue"}
|
color={cekPartisipan ? "green" : "blue"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onJoin();
|
// onJoin();
|
||||||
|
open();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{cekPartisipan ? "Telah Berpartisipasi" : "Partisipasi"}
|
{cekPartisipan ? "Telah Berpartisipasi" : "Partisipasi"}
|
||||||
@@ -93,11 +130,10 @@ export default function ComponentColab_DetailListPartisipasiUser({
|
|||||||
) : (
|
) : (
|
||||||
data?.map((e, i) => (
|
data?.map((e, i) => (
|
||||||
<Box key={i}>
|
<Box key={i}>
|
||||||
<ComponentColab_AuthorNameOnHeader
|
<ComponentColab_AuthorNameOnListPartisipan
|
||||||
isPembatas={true}
|
isPembatas={true}
|
||||||
authorName={e?.User.Profile.name}
|
author={e.User}
|
||||||
imagesId={e?.User?.Profile?.imagesId}
|
deskripsi={e.deskripsi_diri}
|
||||||
profileId={e?.User?.Profile?.id}
|
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export default function ComponentColab_HeaderTamplate({
|
|||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
if (loading) return <ComponentGlobal_V2_LoadingPage />;
|
// if (loading) return <ComponentGlobal_V2_LoadingPage />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -47,6 +47,7 @@ export default function ComponentColab_HeaderTamplate({
|
|||||||
<ActionIcon variant="transparent" disabled></ActionIcon>
|
<ActionIcon variant="transparent" disabled></ActionIcon>
|
||||||
) : (
|
) : (
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
|
loading={loading ? true : false}
|
||||||
variant="transparent"
|
variant="transparent"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Center } from "@mantine/core";
|
|||||||
export default function ComponentColab_IsEmptyData({ text }: { text: string }) {
|
export default function ComponentColab_IsEmptyData({ text }: { text: string }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Center h={"50vh"} fz={"sm"} c="gray" fw={"bold"}>
|
<Center h={"50vh"} fz={"sm"} c="gray" fw={"bold"} style={{zIndex: 1}}>
|
||||||
{text}
|
{text}
|
||||||
</Center>
|
</Center>
|
||||||
</>
|
</>
|
||||||
|
|||||||
0
src/app_modules/colab/create/create_room/index.tsx
Normal file
@@ -1,7 +1,15 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
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 { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import {
|
import {
|
||||||
@@ -25,6 +33,7 @@ export default function Colab_Create({
|
|||||||
purpose: "",
|
purpose: "",
|
||||||
benefit: "",
|
benefit: "",
|
||||||
projectCollaborationMaster_IndustriId: 0,
|
projectCollaborationMaster_IndustriId: 0,
|
||||||
|
// jumlah_partisipan: 0,
|
||||||
});
|
});
|
||||||
return (
|
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
|
<Textarea
|
||||||
label="Tujuan Proyek"
|
label="Tujuan Proyek"
|
||||||
placeholder="Masukan tujuan proyek"
|
placeholder="Masukan tujuan proyek"
|
||||||
@@ -104,6 +131,7 @@ function ButtonAction({ value }: { value: any }) {
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
async function onSave() {
|
async function onSave() {
|
||||||
|
// console.log(value.jumlah_partisipan);
|
||||||
if (value.title === "")
|
if (value.title === "")
|
||||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||||
if (value.lokasi === "")
|
if (value.lokasi === "")
|
||||||
@@ -112,6 +140,8 @@ function ButtonAction({ value }: { value: any }) {
|
|||||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||||
if (value.projectCollaborationMaster_IndustriId === 0)
|
if (value.projectCollaborationMaster_IndustriId === 0)
|
||||||
return ComponentGlobal_NotifikasiPeringatan("Pilih Industri");
|
return ComponentGlobal_NotifikasiPeringatan("Pilih Industri");
|
||||||
|
// if (value.jumlah_partisipan < 2)
|
||||||
|
// return ComponentGlobal_NotifikasiPeringatan("Minimal Ada 2 Partisipan");
|
||||||
|
|
||||||
await colab_funCreateProyek(value).then((res) => {
|
await colab_funCreateProyek(value).then((res) => {
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
|
|||||||
@@ -6,8 +6,11 @@ import {
|
|||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Grid,
|
Grid,
|
||||||
|
Group,
|
||||||
|
Paper,
|
||||||
ScrollArea,
|
ScrollArea,
|
||||||
Stack,
|
Stack,
|
||||||
|
Text,
|
||||||
TextInput,
|
TextInput,
|
||||||
Textarea,
|
Textarea,
|
||||||
Transition,
|
Transition,
|
||||||
@@ -18,22 +21,91 @@ import { useAtom } from "jotai";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { gs_colab_pesan } from "../../global_state";
|
import { gs_colab_pesan } from "../../global_state";
|
||||||
import { IconArrowUp, IconSend } from "@tabler/icons-react";
|
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 [pesan, setPesan] = useState("");
|
||||||
const [obrolan, setObrolan] = useState<string[]>([]);
|
const [obrolan, setObrolan] = useState<any[]>(listMsg);
|
||||||
const [scroll, scrollTo] = useWindowScroll();
|
const [scroll, scrollTo] = useWindowScroll();
|
||||||
|
|
||||||
async function onSend() {
|
async function onSend() {
|
||||||
// setObrolan(pesan);
|
scrollTo({ y: -0 });
|
||||||
setPesan("")
|
|
||||||
|
// 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 (
|
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"}>
|
<Stack justify="center" h={"100%"} px={"sm"}>
|
||||||
<Grid align="center">
|
<Grid align="center">
|
||||||
<Grid.Col span={"auto"}>
|
<Grid.Col span={"auto"}>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
AppShell,
|
AppShell,
|
||||||
|
Box,
|
||||||
Center,
|
Center,
|
||||||
Footer,
|
Footer,
|
||||||
Grid,
|
Grid,
|
||||||
@@ -16,50 +17,47 @@ import ComponentColab_HeaderTamplate from "../../component/header_tamplate";
|
|||||||
import { IconPlane, IconSend } from "@tabler/icons-react";
|
import { IconPlane, IconSend } from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { gs_colab_pesan } from "../../global_state";
|
import { gs_colab_pesan } from "../../global_state";
|
||||||
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
|
||||||
|
|
||||||
export default function LayoutColab_DetailGrupDiskusi({
|
export default function LayoutColab_DetailGrupDiskusi({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const [pesan, setPesan] = useState("");
|
|
||||||
|
|
||||||
async function onSend() {
|
|
||||||
console.log(pesan);
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppShell
|
<Box>
|
||||||
header={<ComponentColab_HeaderTamplate title="Nama Grup Diskusi" />}
|
{/* Header */}
|
||||||
// footer={
|
<Box
|
||||||
// <Footer height={60}>
|
style={{
|
||||||
// <Stack justify="center" h={"100%"} px={"sm"}>
|
zIndex: 99,
|
||||||
// <Grid align="center">
|
}}
|
||||||
// <Grid.Col span={"auto"}>
|
w={"100%"}
|
||||||
// <Textarea
|
bg={"black"}
|
||||||
// minRows={1}
|
pos={"fixed"}
|
||||||
// radius={"md"}
|
top={0}
|
||||||
// placeholder="Pesan..."
|
h={50}
|
||||||
// onChange={(val) => setPesan(val.currentTarget.value)}
|
>
|
||||||
// />
|
<ComponentColab_HeaderTamplate title="Room Chat" bg={"gray.2"} />
|
||||||
// </Grid.Col>
|
</Box>
|
||||||
// <Grid.Col span={"content"}>
|
|
||||||
// <ActionIcon
|
{/* Children */}
|
||||||
// variant="outline"
|
<Box p={"sm"} pos={"static"} h={"80vh"}>
|
||||||
// radius={"xl"}
|
<Box
|
||||||
// size={"lg"}
|
style={{
|
||||||
// onClick={() => onSend()}
|
height: 50,
|
||||||
// >
|
}}
|
||||||
// <IconSend size={20} />
|
></Box>
|
||||||
// </ActionIcon>
|
<Stack>
|
||||||
// </Grid.Col>
|
{children}
|
||||||
// </Grid>
|
<Box
|
||||||
// </Stack>
|
style={{
|
||||||
// </Footer>
|
height: "10vh",
|
||||||
// }
|
}}
|
||||||
>
|
></Box>
|
||||||
{children}
|
</Stack>
|
||||||
</AppShell>
|
</Box>
|
||||||
|
</Box>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,9 +9,11 @@ import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
|||||||
export default function LayoutColab_MainDetail({
|
export default function LayoutColab_MainDetail({
|
||||||
children,
|
children,
|
||||||
colabId,
|
colabId,
|
||||||
|
isAuthor,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
colabId: string;
|
colabId: string;
|
||||||
|
isAuthor: boolean;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -19,8 +21,8 @@ export default function LayoutColab_MainDetail({
|
|||||||
header={
|
header={
|
||||||
<ComponentColab_HeaderTamplate
|
<ComponentColab_HeaderTamplate
|
||||||
title="Detail"
|
title="Detail"
|
||||||
icon={<IconEdit />}
|
icon={isAuthor ? <IconEdit /> : ""}
|
||||||
route2={RouterColab.edit + colabId}
|
route2={isAuthor ? RouterColab.edit + colabId : ""}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -2,13 +2,16 @@
|
|||||||
|
|
||||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||||
import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data";
|
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 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 { gs_colab_hot_menu } from "@/app_modules/colab/global_state";
|
||||||
import {
|
import {
|
||||||
MODEL_COLLABORATION,
|
MODEL_COLLABORATION,
|
||||||
MODEL_COLLABORATION_PARTISIPASI,
|
MODEL_COLLABORATION_PARTISIPASI,
|
||||||
} from "@/app_modules/colab/model/interface";
|
} from "@/app_modules/colab/model/interface";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
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 {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
@@ -39,7 +42,10 @@ export default function Colab_DetailProyekSaya({
|
|||||||
<>
|
<>
|
||||||
<Stack px={5} spacing={"xl"}>
|
<Stack px={5} spacing={"xl"}>
|
||||||
<ComponentColab_DetailData data={dataColab} />
|
<ComponentColab_DetailData data={dataColab} />
|
||||||
<CheckBoxPartisipan listPartisipan={listPartisipan} />
|
<CheckBoxPartisipan
|
||||||
|
listPartisipan={listPartisipan}
|
||||||
|
colabId={dataColab.id}
|
||||||
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -47,13 +53,12 @@ export default function Colab_DetailProyekSaya({
|
|||||||
|
|
||||||
function CheckBoxPartisipan({
|
function CheckBoxPartisipan({
|
||||||
listPartisipan,
|
listPartisipan,
|
||||||
|
colabId,
|
||||||
}: {
|
}: {
|
||||||
listPartisipan: MODEL_COLLABORATION_PARTISIPASI[];
|
listPartisipan: MODEL_COLLABORATION_PARTISIPASI[];
|
||||||
|
colabId: string;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
|
||||||
const [value, setValue] = useState<string[]>([]);
|
const [value, setValue] = useState<string[]>([]);
|
||||||
const [opened, { open, close }] = useDisclosure(false);
|
|
||||||
const [hotMenu, setHotMenu] = useAtom(gs_colab_hot_menu);
|
|
||||||
|
|
||||||
const listCheck = [
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
{/* <pre>{JSON.stringify(listPartisipan,null,2)}</pre> */}
|
{/* <pre>{JSON.stringify(listPartisipan,null,2)}</pre> */}
|
||||||
<Paper withBorder shadow="lg" p={"sm"}>
|
<Paper withBorder shadow="lg" p={"sm"}>
|
||||||
<Text c={"red"} fz={10}>
|
{/* {JSON.stringify(value, null, 2)} */}
|
||||||
*
|
<Stack>
|
||||||
<Text px={"xs"} span inherit c={"gray"}>
|
<Stack spacing={5}>
|
||||||
Pilih user yang akan menjadi tim proyek anda
|
<Text c={"red"} fz={10}>
|
||||||
</Text>
|
*
|
||||||
</Text>
|
<Text px={"xs"} span inherit c={"gray"}>
|
||||||
<ScrollArea h={400}>
|
Pilih user yang akan menjadi tim proyek anda
|
||||||
<Checkbox.Group value={value} onChange={setValue}>
|
</Text>
|
||||||
<Stack mt="xs">
|
</Text>
|
||||||
{listPartisipan.map((e, i) => (
|
<Text c={"red"} fz={10}>
|
||||||
<Grid key={e.id} align="center">
|
*
|
||||||
<Grid.Col span={"content"}>
|
<Text px={"xs"} span inherit c={"gray"}>
|
||||||
<Checkbox value={e.id.toString()} />
|
Room chat dapat dibentuk jika ada 2 user yang dipilih
|
||||||
</Grid.Col>
|
</Text>
|
||||||
<Grid.Col span={"auto"}>
|
</Text>
|
||||||
<ComponentColab_AuthorNameOnHeader
|
</Stack>
|
||||||
isPembatas={true}
|
<ScrollArea h={400} offsetScrollbars>
|
||||||
authorName={e?.User.Profile.name}
|
<Checkbox.Group value={value} onChange={setValue}>
|
||||||
profileId={e?.User.Profile.id}
|
<Stack mt="xs">
|
||||||
imagesId={e?.User.Profile.imagesId}
|
{listPartisipan.map((e, i) => (
|
||||||
/>
|
<Grid key={e.id} align="center">
|
||||||
</Grid.Col>
|
<Grid.Col span={"content"}>
|
||||||
</Grid>
|
<Checkbox value={e.User.id} />
|
||||||
))}
|
</Grid.Col>
|
||||||
</Stack>
|
<Grid.Col span={"auto"}>
|
||||||
</Checkbox.Group>
|
<ComponentColab_AuthorNameOnListPartisipan
|
||||||
</ScrollArea>
|
isPembatas={true}
|
||||||
|
author={e.User}
|
||||||
|
deskripsi={e.deskripsi_diri}
|
||||||
|
/>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
</Checkbox.Group>
|
||||||
|
</ScrollArea>
|
||||||
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
<Button
|
<ButtonAction value={value} colabId={colabId} />
|
||||||
radius={"xl"}
|
|
||||||
disabled={_.isEmpty(value) ? true : false}
|
|
||||||
onClick={() => {
|
|
||||||
open();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Buat Ruang Diskusi{" "}
|
|
||||||
</Button>
|
|
||||||
</Stack>
|
</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
|
<Drawer
|
||||||
opened={opened}
|
opened={opened}
|
||||||
@@ -168,12 +211,24 @@ function CheckBoxPartisipan({
|
|||||||
>
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Title order={6}>Nama Grup Diskusi</Title>
|
<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>
|
<Group grow>
|
||||||
<Button radius={"xl"} onClick={close}>
|
<Button radius={"xl"} onClick={close}>
|
||||||
Batal
|
Batal
|
||||||
</Button>
|
</Button>
|
||||||
<Button radius={"xl"} color="green" onClick={() => onSave()}>
|
<Button
|
||||||
|
loaderPosition="center"
|
||||||
|
loading={loading ? true : false}
|
||||||
|
radius={"xl"}
|
||||||
|
color="green"
|
||||||
|
onClick={() => onSave()}
|
||||||
|
>
|
||||||
Simpan
|
Simpan
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -1,20 +1,33 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||||
import ComponentColab_HeaderTamplate from "@/app_modules/colab/component/header_tamplate";
|
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 { AppShell } from "@mantine/core";
|
||||||
import { IconEdit } from "@tabler/icons-react";
|
import { IconEdit } from "@tabler/icons-react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function LayoutColab_DetailProyekSaya({
|
export default function LayoutColab_DetailProyekSaya({
|
||||||
children,
|
children,
|
||||||
|
dataColab,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
dataColab: MODEL_COLLABORATION;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppShell header={<ComponentColab_HeaderTamplate title="Proyek Saya" />}>
|
<AppComponentGlobal_LayoutTamplate
|
||||||
|
header={
|
||||||
|
<ComponentColab_HeaderTamplate
|
||||||
|
title="Proyek Saya"
|
||||||
|
icon={<IconEdit />}
|
||||||
|
route2={RouterColab.edit + dataColab?.id}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppShell>
|
</AppComponentGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
"use client";
|
"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 { useRouter } from "next/navigation";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import {
|
import {
|
||||||
@@ -10,6 +17,7 @@ import {
|
|||||||
import colab_funEditById from "../fun/edit/fun_edit_by_id";
|
import colab_funEditById from "../fun/edit/fun_edit_by_id";
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
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_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({
|
export default function Colab_Edit({
|
||||||
selectedData,
|
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
|
<Textarea
|
||||||
label="Tujuan Proyek"
|
label="Tujuan Proyek"
|
||||||
placeholder="Masukan 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 router = useRouter();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
async function onUpdate() {
|
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) => {
|
await colab_funEditById(value as any).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ import { revalidatePath } from "next/cache";
|
|||||||
|
|
||||||
export default async function colab_funCreatePartisipan(
|
export default async function colab_funCreatePartisipan(
|
||||||
colabId: string,
|
colabId: string,
|
||||||
userId: string
|
userId: string,
|
||||||
|
deskripsi: string
|
||||||
) {
|
) {
|
||||||
const create = await prisma.projectCollaboration_Partisipasi.create({
|
const create = await prisma.projectCollaboration_Partisipasi.create({
|
||||||
data: {
|
data: {
|
||||||
projectCollaborationId: colabId,
|
projectCollaborationId: colabId,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
|
deskripsi_diri: deskripsi
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { MODEL_COLLABORATION } from "../../model/interface";
|
|||||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
export default async function colab_funCreateProyek(
|
export default async function colab_funCreateProyek(
|
||||||
value: MODEL_COLLABORATION
|
value: MODEL_COLLABORATION
|
||||||
@@ -19,11 +20,12 @@ export default async function colab_funCreateProyek(
|
|||||||
benefit: value.benefit,
|
benefit: value.benefit,
|
||||||
projectCollaborationMaster_IndustriId:
|
projectCollaborationMaster_IndustriId:
|
||||||
value.projectCollaborationMaster_IndustriId,
|
value.projectCollaborationMaster_IndustriId,
|
||||||
userId: AuthorId
|
userId: AuthorId,
|
||||||
|
// jumlah_partisipan: + value.jumlah_partisipan,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!create) return { status: 400, message: "Gagal Membuat Proyek" };
|
if (!create) return { status: 400, message: "Gagal Membuat Proyek" };
|
||||||
revalidatePath(RouterColab.beranda)
|
revalidatePath(RouterColab.beranda);
|
||||||
return { status: 201, message: "Berhasil Membuar Proyek" };
|
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,
|
lokasi: value.lokasi,
|
||||||
purpose: value.purpose,
|
purpose: value.purpose,
|
||||||
benefit: value.benefit,
|
benefit: value.benefit,
|
||||||
|
// jumlah_partisipan: value.jumlah_partisipan,
|
||||||
projectCollaborationMaster_IndustriId: value
|
projectCollaborationMaster_IndustriId: value
|
||||||
.ProjectCollaborationMaster_Industri.id as any,
|
.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" };
|
if (!updt) return { status: 400, message: "Gagal update" };
|
||||||
revalidatePath(RouterColab.beranda);
|
revalidatePath(RouterColab.beranda);
|
||||||
revalidatePath(RouterColab.main_detail)
|
revalidatePath(RouterColab.main_detail);
|
||||||
return { status: 200, message: "Berhasil update" };
|
return { status: 200, message: "Berhasil update" };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import prisma from "@/app/lib/prisma";
|
|||||||
export default async function colab_getListAllProyek() {
|
export default async function colab_getListAllProyek() {
|
||||||
const data = await prisma.projectCollaboration.findMany({
|
const data = await prisma.projectCollaboration.findMany({
|
||||||
orderBy: {
|
orderBy: {
|
||||||
updatedAt: "desc",
|
createdAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
projectCollaborationMaster_StatusId: 1,
|
projectCollaborationMaster_StatusId: 1,
|
||||||
@@ -33,6 +33,5 @@ export default async function colab_getListAllProyek() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export default async function colab_getListPartisipanById(colabId: string) {
|
|||||||
Profile: true,
|
Profile: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
deskripsi_diri: true
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ export default async function colab_getListPartisipasiByAuthorId() {
|
|||||||
const AuthorId = await user_getOneUserId();
|
const AuthorId = await user_getOneUserId();
|
||||||
|
|
||||||
const get = await prisma.projectCollaboration_Partisipasi.findMany({
|
const get = await prisma.projectCollaboration_Partisipasi.findMany({
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
where: {
|
where: {
|
||||||
userId: AuthorId,
|
userId: AuthorId,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
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 AuthorId = await user_getOneUserId();
|
||||||
const get = await prisma.projectCollaboration.findMany({
|
const get = await prisma.projectCollaboration.findMany({
|
||||||
|
orderBy: { createdAt: "desc" },
|
||||||
where: { userId: AuthorId, isActive: true },
|
where: { userId: AuthorId, isActive: true },
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
@@ -14,6 +15,7 @@ export default async function colab_getListAllProyekByAuthorId() {
|
|||||||
lokasi: true,
|
lokasi: true,
|
||||||
purpose: true,
|
purpose: true,
|
||||||
benefit: true,
|
benefit: true,
|
||||||
|
// jumlah_partisipan: true,
|
||||||
Author: {
|
Author: {
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
@@ -15,6 +15,7 @@ export default async function colab_getOneCollaborationById(colabId: string) {
|
|||||||
purpose: true,
|
purpose: true,
|
||||||
benefit: true,
|
benefit: true,
|
||||||
createdAt: true,
|
createdAt: true,
|
||||||
|
// jumlah_partisipan: true,
|
||||||
Author: {
|
Author: {
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<Affix position={{ bottom: rem(100), right: rem(30) }}>
|
<Affix position={{ bottom: rem(150), right: rem(30) }}>
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
loading={loadingCreate ? true : false}
|
loading={loadingCreate ? true : false}
|
||||||
opacity={scroll.y > 0 ? 0.5 : ""}
|
opacity={scroll.y > 0 ? 0.5 : ""}
|
||||||
@@ -63,7 +63,7 @@ export default function Colab_Beranda({
|
|||||||
{/* <pre>{JSON.stringify(listData, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(listData, null, 2)}</pre> */}
|
||||||
|
|
||||||
{listData.map((e, i) => (
|
{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>
|
<Stack>
|
||||||
<ComponentColab_CardSectionHeaderAuthorName
|
<ComponentColab_CardSectionHeaderAuthorName
|
||||||
authorName={e?.Author?.Profile?.name}
|
authorName={e?.Author?.Profile?.name}
|
||||||
|
|||||||
@@ -1,40 +1,81 @@
|
|||||||
"use client";
|
"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 ComponentColab_AuthorNameOnHeader from "../../component/header_author_name";
|
||||||
import { IconChevronCompactRight, IconChevronRight } from "@tabler/icons-react";
|
import { IconChevronCompactRight, IconChevronRight } from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
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 router = useRouter();
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
if (_.isEmpty(listRoom))
|
||||||
|
return <ComponentColab_IsEmptyData text="Tidak Ada Data" />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
{Array(10)
|
{listRoom?.map((e, i) => (
|
||||||
.fill(0)
|
<Paper
|
||||||
.map((e, i) => (
|
key={i}
|
||||||
<Paper
|
withBorder
|
||||||
key={i}
|
shadow="lg"
|
||||||
withBorder
|
p={"md"}
|
||||||
shadow="lg"
|
onClick={() => {
|
||||||
p={"md"}
|
router.push(
|
||||||
onClick={() => {
|
RouterColab.detail_grup + e?.ProjectCollaboration_RoomChat.id
|
||||||
router.push(RouterColab.detail_grup + i);
|
);
|
||||||
}}
|
setLoading(true);
|
||||||
>
|
}}
|
||||||
<Grid align="center" h={"100%"}>
|
>
|
||||||
<Grid.Col span={"auto"}>
|
<Grid align="center" h={"100%"}>
|
||||||
<Title order={6}>Nama Grup Diskusi</Title>
|
<Grid.Col span={"auto"}>
|
||||||
</Grid.Col>
|
<Stack spacing={0}>
|
||||||
<Grid.Col span={"content"}>
|
<Text fw={"bold"} lineClamp={1}>
|
||||||
<Center>
|
{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" />
|
<IconChevronRight color="gray" />
|
||||||
</Center>
|
)}
|
||||||
</Grid.Col>
|
</Center>
|
||||||
</Grid>
|
</Grid.Col>
|
||||||
</Paper>
|
</Grid>
|
||||||
))}
|
</Paper>
|
||||||
|
))}
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
AppShell,
|
AppShell,
|
||||||
|
Box,
|
||||||
Center,
|
Center,
|
||||||
Footer,
|
Footer,
|
||||||
Grid,
|
Grid,
|
||||||
|
Loader,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
@@ -25,6 +27,8 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { gs_colab_hot_menu } from "../global_state";
|
import { gs_colab_hot_menu } from "../global_state";
|
||||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
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({
|
export default function LayoutColab_Main({
|
||||||
children,
|
children,
|
||||||
@@ -72,7 +76,7 @@ export default function LayoutColab_Main({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppShell
|
<AppComponentGlobal_LayoutTamplate
|
||||||
header={
|
header={
|
||||||
<ComponentColab_HeaderTamplate
|
<ComponentColab_HeaderTamplate
|
||||||
title="Project Collaboration"
|
title="Project Collaboration"
|
||||||
@@ -82,39 +86,41 @@ export default function LayoutColab_Main({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
footer={
|
footer={
|
||||||
<Footer height={70} bg={"dark"}>
|
<Footer height={"10vh"} bg={"black"}>
|
||||||
<Grid>
|
{/* {value} */}
|
||||||
{listFooter.map((e) => (
|
<Stack justify="center" h={"100%"}>
|
||||||
<Grid.Col
|
<Grid>
|
||||||
key={e.id}
|
{listFooter.map((e) => (
|
||||||
span={"auto"}
|
<Grid.Col key={e.id} span={"auto"} pt={"md"}>
|
||||||
pt={"md"}
|
<Center>
|
||||||
onClick={() => {
|
<Stack
|
||||||
router.replace(e.path);
|
align="center"
|
||||||
setHotMenu(e.id);
|
spacing={0}
|
||||||
}}
|
onClick={() => {
|
||||||
>
|
router.replace(e.path);
|
||||||
<Center>
|
setHotMenu(e.id);
|
||||||
<Stack align="center" spacing={0}>
|
}}
|
||||||
<ActionIcon
|
|
||||||
variant="transparent"
|
|
||||||
c={hotMenu === e.id ? "blue" : "white"}
|
|
||||||
>
|
>
|
||||||
{e.icon}
|
<ActionIcon
|
||||||
</ActionIcon>
|
variant="transparent"
|
||||||
<Text fz={10} c={hotMenu === e.id ? "blue" : "white"}>
|
c={hotMenu === e.id ? "blue" : "white"}
|
||||||
{e.name}
|
>
|
||||||
</Text>
|
{e.icon}
|
||||||
</Stack>
|
</ActionIcon>
|
||||||
</Center>
|
<Text fz={10} c={hotMenu === e.id ? "blue" : "white"}>
|
||||||
</Grid.Col>
|
{e.name}
|
||||||
))}
|
</Text>
|
||||||
</Grid>
|
</Stack>
|
||||||
|
</Center>
|
||||||
|
</Grid.Col>
|
||||||
|
))}
|
||||||
|
</Grid>
|
||||||
|
</Stack>
|
||||||
</Footer>
|
</Footer>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppShell>
|
</AppComponentGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export interface MODEL_COLLABORATION {
|
|||||||
lokasi: string;
|
lokasi: string;
|
||||||
purpose: string;
|
purpose: string;
|
||||||
benefit: string;
|
benefit: string;
|
||||||
|
jumlah_partisipan: number;
|
||||||
ProjectCollaborationMaster_Industri: MODEL_COLLABORATION_MASTER;
|
ProjectCollaborationMaster_Industri: MODEL_COLLABORATION_MASTER;
|
||||||
projectCollaborationMaster_IndustriId: number;
|
projectCollaborationMaster_IndustriId: number;
|
||||||
Author: MODEL_USER;
|
Author: MODEL_USER;
|
||||||
@@ -28,12 +29,33 @@ export interface MODEL_COLLABORATION {
|
|||||||
|
|
||||||
export interface MODEL_COLLABORATION_PARTISIPASI {
|
export interface MODEL_COLLABORATION_PARTISIPASI {
|
||||||
id: string;
|
id: string;
|
||||||
|
deskripsi_diri: string;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
userId: string;
|
userId: string;
|
||||||
User: MODEL_USER;
|
User: MODEL_USER;
|
||||||
projectCollaborationId: string;
|
projectCollaborationId: string;
|
||||||
projectCollaboration_RoomChatId: string;
|
|
||||||
ProjectCollaboration: MODEL_COLLABORATION;
|
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,
|
id: 5,
|
||||||
name: "Project Collaboration",
|
name: "Project Collaboration",
|
||||||
icon: <IconAffiliate size={50} />,
|
icon: <IconAffiliate size={50} />,
|
||||||
link: "",
|
link: RouterColab.splash,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 6,
|
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 { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||||
import { useForm } from "@mantine/form";
|
import { useForm } from "@mantine/form";
|
||||||
|
import { useTimeout } from "@mantine/hooks";
|
||||||
|
|
||||||
export default function CreateProfile({ userId }: { userId: any }) {
|
export default function CreateProfile({ userId }: { userId: any }) {
|
||||||
const [filePP, setFilePP] = useState<File | null>(null);
|
const [filePP, setFilePP] = useState<File | null>(null);
|
||||||
@@ -302,7 +303,7 @@ function ButtonAction({
|
|||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Membuat Profile", 3000);
|
ComponentGlobal_NotifikasiBerhasil("Berhasil Membuat Profile", 3000);
|
||||||
router.push(RouterHome.main_home);
|
setTimeout(() => router.push(RouterHome.main_home), 2000);
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
5
src/bin/seeder/colab/jumlah_minimal_room.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"value": 5
|
||||||
|
}
|
||||||
|
]
|
||||||