11
package.json
@@ -18,8 +18,18 @@
|
||||
"@mantine/hooks": "^6.0.17",
|
||||
"@mantine/next": "^6.0.17",
|
||||
"@mantine/notifications": "^6.0.17",
|
||||
"@mantine/tiptap": "^7.5.3",
|
||||
"@prisma/client": "^5.0.0",
|
||||
"@tabler/icons-react": "^2.38.0",
|
||||
"@tiptap/extension-highlight": "^2.2.3",
|
||||
"@tiptap/extension-link": "^2.2.3",
|
||||
"@tiptap/extension-subscript": "^2.2.3",
|
||||
"@tiptap/extension-superscript": "^2.2.3",
|
||||
"@tiptap/extension-text-align": "^2.2.3",
|
||||
"@tiptap/extension-underline": "^2.2.3",
|
||||
"@tiptap/pm": "^2.2.3",
|
||||
"@tiptap/react": "^2.2.3",
|
||||
"@tiptap/starter-kit": "^2.2.3",
|
||||
"@types/lodash": "^4.14.199",
|
||||
"@types/node": "20.4.5",
|
||||
"@types/react": "18.2.17",
|
||||
@@ -43,6 +53,7 @@
|
||||
"react-countdown": "^2.3.5",
|
||||
"react-dom": "18.2.0",
|
||||
"react-fast-marquee": "^1.6.4",
|
||||
"react-quill": "^2.0.0",
|
||||
"react-responsive-carousel": "^3.2.23",
|
||||
"react-simple-toasts": "^5.10.0",
|
||||
"react-toastify": "^9.1.3",
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
provider = "prisma-client-js"
|
||||
engineType = "binary"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
@@ -29,7 +30,8 @@ model User {
|
||||
Event Event[]
|
||||
Event_Peserta Event_Peserta[]
|
||||
Voting Voting[]
|
||||
Voting_Kontributor Voting_Kontributor[]
|
||||
Voting_Kontributor Voting_Kontributor[]
|
||||
Job Job[]
|
||||
}
|
||||
|
||||
model MasterUserRole {
|
||||
@@ -87,6 +89,7 @@ model Images {
|
||||
Donasi_PencairanDana Donasi_PencairanDana[]
|
||||
Donasi_Invoice Donasi_Invoice[]
|
||||
Portofolio Portofolio[]
|
||||
Job Job[]
|
||||
}
|
||||
|
||||
model ImagesBackground {
|
||||
@@ -140,6 +143,15 @@ model MasterBidangBisnis {
|
||||
Portofolio Portofolio[]
|
||||
}
|
||||
|
||||
model MasterStatus {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
Job Job[]
|
||||
}
|
||||
|
||||
// -------------------- INVESTASI --------------------- //
|
||||
// Table investasi / saham
|
||||
model Investasi {
|
||||
@@ -554,7 +566,7 @@ model Voting {
|
||||
Voting_Status Voting_Status? @relation(fields: [voting_StatusId], references: [id])
|
||||
voting_StatusId String? @default("2")
|
||||
Voting_DaftarNamaVote Voting_DaftarNamaVote[]
|
||||
Voting_Kontributor Voting_Kontributor[]
|
||||
Voting_Kontributor Voting_Kontributor[]
|
||||
}
|
||||
|
||||
model Voting_Status {
|
||||
@@ -574,8 +586,8 @@ model Voting_DaftarNamaVote {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
Voting Voting? @relation(fields: [votingId], references: [id])
|
||||
votingId String?
|
||||
Voting Voting? @relation(fields: [votingId], references: [id])
|
||||
votingId String?
|
||||
Voting_Kontributor Voting_Kontributor[]
|
||||
}
|
||||
|
||||
@@ -591,5 +603,25 @@ model Voting_Kontributor {
|
||||
authorId String?
|
||||
Voting_DaftarNamaVote Voting_DaftarNamaVote? @relation(fields: [voting_DaftarNamaVoteId], references: [id])
|
||||
voting_DaftarNamaVoteId String?
|
||||
|
||||
}
|
||||
|
||||
// ========================================= JOB ========================================= //
|
||||
|
||||
model Job {
|
||||
id String @id @default(cuid())
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
isArsip Boolean @default(false)
|
||||
catatan String?
|
||||
|
||||
title String
|
||||
content String @db.Text
|
||||
deskripsi String @db.Text
|
||||
Images Images? @relation(fields: [imagesId], references: [id])
|
||||
imagesId String?
|
||||
Author User? @relation(fields: [authorId], references: [id])
|
||||
authorId String?
|
||||
MasterStatus MasterStatus? @relation(fields: [masterStatusId], references: [id])
|
||||
masterStatusId String? @default("2")
|
||||
}
|
||||
|
||||
BIN
public/aset/global/no-file.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 217 KiB |
|
Before Width: | Height: | Size: 263 KiB |
BIN
public/job/35733aba-3d3c-4353-84c3-ea8fd9a9cc85.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
public/job/38d9e62f-8364-45d7-a683-0883e56618fe.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
public/job/497395d9-6986-4d77-9f4d-2272b95e1f6f.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
public/job/5232ae23-c04c-4140-a1d2-ed3cd1377d13.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
public/job/6ac4c417-2362-4f40-b74e-67cd816f18e7.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
public/job/7d8ff008-d3a8-4039-8236-6ffee93f1a5f.jpg
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
public/job/cab9ad8e-afed-4b3c-953d-f84b67758dc9.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
public/job/f319201f-6ae7-4af9-b8a0-fafb552bcf5d.jpg
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 263 KiB After Width: | Height: | Size: 263 KiB |
BIN
public/profile/foto/92b9d5e1-7370-459f-abc5-bcd07bc3e41e.png
Normal file
|
After Width: | Height: | Size: 122 KiB |
BIN
public/profile/foto/ce6f7b64-5356-415e-b44f-03900401e72c.jpeg
Normal file
|
After Width: | Height: | Size: 108 KiB |
32
src/app/api/job/gambar/[id]/route.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import fs from "fs";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
) {
|
||||
const get = await prisma.images.findUnique({
|
||||
where: {
|
||||
id: params.id,
|
||||
},
|
||||
select: {
|
||||
url: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!fs.existsSync(`./public/job/${get?.url}`)) {
|
||||
const notFile = fs.readFileSync("./public/aset/global/no-file.png");
|
||||
return new NextResponse(notFile, {
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
},
|
||||
});
|
||||
}
|
||||
const file = fs.readFileSync(`./public/job/${get?.url}`);
|
||||
return new NextResponse(file, {
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import donasi_status_invoice from "../../../bin/seeder/donasi/master_status_invo
|
||||
import event_status from "../../../bin/seeder/event/master_status.json";
|
||||
import event_tipe_acara from "../../../bin/seeder/event/master_tipe_acara.json";
|
||||
import voting_status from "../../../bin/seeder/voting/master_status.json";
|
||||
import master_status from "../../../bin/seeder/master_status.json";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
const dev = new URL(req.url).searchParams.get("dev");
|
||||
@@ -312,6 +313,21 @@ export async function GET(req: Request) {
|
||||
});
|
||||
}
|
||||
|
||||
for (let m of master_status) {
|
||||
await prisma.masterStatus.upsert({
|
||||
where: {
|
||||
id: m.id,
|
||||
},
|
||||
create: {
|
||||
id: m.id,
|
||||
name: m.name,
|
||||
},
|
||||
update: {
|
||||
name: m.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return NextResponse.json({ success: true });
|
||||
}
|
||||
|
||||
|
||||
13
src/app/dev/admin/job/child/arsip/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import AdminJob_TableArsip from "@/app_modules/admin/job/child/arsip";
|
||||
import { AdminJob_getListTableByStatusId } from "@/app_modules/admin/job/fun/get/get_list_table_by_status_id";
|
||||
|
||||
|
||||
export default async function Page() {
|
||||
const dataJob = await AdminJob_getListTableByStatusId("0")
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminJob_TableArsip dataVote={dataJob} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
12
src/app/dev/admin/job/child/table_publish/page.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { AdminJob_TablePublish } from "@/app_modules/admin/job";
|
||||
import { AdminJob_getListTableByStatusId } from "@/app_modules/admin/job/fun/get/get_list_table_by_status_id";
|
||||
|
||||
export default async function Page() {
|
||||
const listPublish = await AdminJob_getListTableByStatusId("1")
|
||||
// console.log(listPublish)
|
||||
return (
|
||||
<>
|
||||
<AdminJob_TablePublish dataVote={listPublish} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
13
src/app/dev/admin/job/child/table_reject/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { AdminJob_TableReject } from "@/app_modules/admin/job";
|
||||
import { AdminJob_getListTableByStatusId } from "@/app_modules/admin/job/fun/get/get_list_table_by_status_id";
|
||||
|
||||
|
||||
export default async function Page() {
|
||||
const listReject = await AdminJob_getListTableByStatusId("4");
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminJob_TableReject dataVote={listReject} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
11
src/app/dev/admin/job/child/table_review/page.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { AdminJob_TableReview } from "@/app_modules/admin/job";
|
||||
import { AdminJob_getListTableByStatusId } from "@/app_modules/admin/job/fun/get/get_list_table_by_status_id";
|
||||
|
||||
export default async function Page() {
|
||||
const listReview = await AdminJob_getListTableByStatusId("2");
|
||||
return (
|
||||
<>
|
||||
<AdminJob_TableReview dataVote={listReview} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
23
src/app/dev/admin/job/main/page.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { AdminJob_Main } from "@/app_modules/admin/job";
|
||||
import { AdminJob_funCountStatusByStatusId } from "@/app_modules/admin/job/fun/count/fun_count_job_by_status_id";
|
||||
|
||||
export default async function Page() {
|
||||
const countPublish = await AdminJob_funCountStatusByStatusId("1")
|
||||
const countReview = await AdminJob_funCountStatusByStatusId("2");
|
||||
const countReject = await AdminJob_funCountStatusByStatusId("4");
|
||||
const countArsip = await AdminJob_funCountStatusByStatusId("0")
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminJob_Main
|
||||
countPublish={countPublish as number}
|
||||
countReview={countReview as number}
|
||||
countReject={countReject as number}
|
||||
countArsip={countArsip as number}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { HomeLayout } from "@/app_modules/home";
|
||||
import { User_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function Layout({ children }: { children: any }) {
|
||||
const userId = await User_getUserId();
|
||||
const dataUser = await User_getOneById(userId);
|
||||
|
||||
return (
|
||||
<>
|
||||
<HomeLayout dataUser={dataUser as any}>{children}</HomeLayout>
|
||||
|
||||
14
src/app/dev/job/create/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LayoutJob_Create } from "@/app_modules/job";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<LayoutJob_Create>{children}</LayoutJob_Create>
|
||||
</>
|
||||
);
|
||||
}
|
||||
9
src/app/dev/job/create/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Job_Create } from "@/app_modules/job";
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<Job_Create />
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/job/detail/arsip/[id]/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LayoutJob_DetailArsip } from "@/app_modules/job";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<LayoutJob_DetailArsip>{children}</LayoutJob_DetailArsip>
|
||||
</>
|
||||
);
|
||||
}
|
||||
12
src/app/dev/job/detail/arsip/[id]/page.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Job_DetailArsip } from "@/app_modules/job";
|
||||
import { Job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
|
||||
|
||||
export default async function Page({params}:{params: {id: string}}) {
|
||||
let jobId = params.id
|
||||
const dataJob = await Job_getOneById(jobId)
|
||||
return (
|
||||
<>
|
||||
<Job_DetailArsip dataJob={dataJob as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
17
src/app/dev/job/detail/draft/[id]/layout.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { LayoutJob_DetailDraft } from "@/app_modules/job";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
params
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: {id: string}
|
||||
}) {
|
||||
let jobId = params.id
|
||||
return (
|
||||
<>
|
||||
<LayoutJob_DetailDraft jobId={jobId}>{children}</LayoutJob_DetailDraft>
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/job/detail/draft/[id]/page.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import Job_DetailDraft from "@/app_modules/job/detail/draft/view";
|
||||
import { Job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
|
||||
|
||||
|
||||
export default async function Page({params}: {params: {id: string}}) {
|
||||
let jobId = params.id
|
||||
const dataJob = await Job_getOneById(jobId)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_DetailDraft dataJob={dataJob as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/job/detail/main/[id]/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LayoutJob_MainDetail } from "@/app_modules/job";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<LayoutJob_MainDetail>{children}</LayoutJob_MainDetail>
|
||||
</>
|
||||
);
|
||||
}
|
||||
13
src/app/dev/job/detail/main/[id]/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Job_MainDetail } from "@/app_modules/job";
|
||||
import { Job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const jobId = params.id;
|
||||
const dataJob = await Job_getOneById(jobId)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_MainDetail dataJob={dataJob as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/job/detail/publish/[id]/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LayoutJob_DetailPublish } from "@/app_modules/job";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<LayoutJob_DetailPublish>{children}</LayoutJob_DetailPublish>
|
||||
</>
|
||||
);
|
||||
}
|
||||
13
src/app/dev/job/detail/publish/[id]/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Job_DetailPublish } from "@/app_modules/job";
|
||||
import { Job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
|
||||
|
||||
export default async function Page({params}: {params: {id: string}}) {
|
||||
let jobId = params.id
|
||||
const dataJob = await Job_getOneById(jobId)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_DetailPublish dataJob={dataJob as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/job/detail/reject/[id]/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LayoutJob_DetailReject } from "@/app_modules/job";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<LayoutJob_DetailReject>{children}</LayoutJob_DetailReject>
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/job/detail/reject/[id]/page.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
import Job_DetailReject from "@/app_modules/job/detail/reject/view";
|
||||
import { Job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
|
||||
|
||||
export default async function Page({params}: {params: {id: string}}) {
|
||||
let jobId = params.id
|
||||
const dataJob = await Job_getOneById(jobId)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_DetailReject dataJob={dataJob as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/job/detail/review/[id]/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LayoutJob_DetailReview } from "@/app_modules/job";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<LayoutJob_DetailReview>{children}</LayoutJob_DetailReview>
|
||||
</>
|
||||
);
|
||||
}
|
||||
18
src/app/dev/job/detail/review/[id]/page.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import Job_DetailReview from "@/app_modules/job/detail/review/view";
|
||||
import { Job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
|
||||
import React from "react";
|
||||
|
||||
export default async function Page({
|
||||
params,
|
||||
}: {
|
||||
params: { id: React.ReactNode };
|
||||
}) {
|
||||
let jobId = params.id;
|
||||
const dataJob = await Job_getOneById(jobId)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_DetailReview dataJob={dataJob as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/job/edit/[id]/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LayoutJob_Edit } from "@/app_modules/job";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<LayoutJob_Edit>{children}</LayoutJob_Edit>
|
||||
</>
|
||||
);
|
||||
}
|
||||
13
src/app/dev/job/edit/[id]/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Job_Edit } from "@/app_modules/job";
|
||||
import { Job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let jobId = params.id;
|
||||
const dataJob = await Job_getOneById(jobId);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_Edit dataJob={dataJob as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
12
src/app/dev/job/main/arsip/page.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Job_Arsip } from "@/app_modules/job";
|
||||
import { Job_getListAllArsipById } from "@/app_modules/job/fun/get/get_list_all_arsip";
|
||||
|
||||
export default async function Page() {
|
||||
const dataJob = await Job_getListAllArsipById()
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_Arsip dataJob={dataJob as any}/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
12
src/app/dev/job/main/beranda/page.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Job_Beranda } from "@/app_modules/job";
|
||||
import { Job_getAllListPublish } from "@/app_modules/job/fun/get/get_list_all_publish";
|
||||
|
||||
export default async function Page() {
|
||||
const listJob = await Job_getAllListPublish();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_Beranda listJob={listJob as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/job/main/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LayoutJob_Main } from "@/app_modules/job";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<LayoutJob_Main>{children}</LayoutJob_Main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
22
src/app/dev/job/main/status/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Job_Status } from "@/app_modules/job";
|
||||
import { Job_getListStatusByStatusId } from "@/app_modules/job/fun/get/get_list_status_by_status_id";
|
||||
|
||||
export default async function Page() {
|
||||
const listPublish = await Job_getListStatusByStatusId("1");
|
||||
const listReview = await Job_getListStatusByStatusId("2");
|
||||
const listDraft = await Job_getListStatusByStatusId("3");
|
||||
const listReject = await Job_getListStatusByStatusId("4");
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_Status
|
||||
listDraft={listDraft as any}
|
||||
listPublish={listPublish as any}
|
||||
listReject={listReject as any}
|
||||
listReview={listReview as any}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/job/non_user_view/[id]/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LayoutJob_NonUserView } from "@/app_modules/job";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<LayoutJob_NonUserView>{children}</LayoutJob_NonUserView>
|
||||
</>
|
||||
);
|
||||
}
|
||||
13
src/app/dev/job/non_user_view/[id]/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Job_NonUserView } from "@/app_modules/job";
|
||||
import { Job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let jobId = params.id;
|
||||
const dataJob = await Job_getOneById(jobId);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_NonUserView data={dataJob as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
9
src/app/dev/job/splash/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Job_Splash } from "@/app_modules/job";
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<Job_Splash />
|
||||
</>
|
||||
);
|
||||
}
|
||||
7
src/app/lib/router_admin/router_admin_job.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const RouterAdminJob = {
|
||||
main: "/dev/admin/job/main",
|
||||
table_publish: "/dev/admin/job/child/table_publish",
|
||||
table_review: "/dev/admin/job/child/table_review",
|
||||
table_reject: "/dev/admin/job/child/table_reject",
|
||||
arsip: "/dev/admin/job/child/arsip",
|
||||
};
|
||||
27
src/app/lib/router_hipmi/router_job.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
export const RouterJob = {
|
||||
//api
|
||||
api_gambar: "/api/job/gambar/",
|
||||
|
||||
//spalsh
|
||||
spalsh: "/dev/job/splash",
|
||||
|
||||
// main
|
||||
beranda: "/dev/job/main/beranda",
|
||||
status: "/dev/job/main/status",
|
||||
arsip: "/dev/job/main/arsip",
|
||||
|
||||
// create & edit
|
||||
create: "/dev/job/create",
|
||||
edit: "/dev/job/edit/",
|
||||
|
||||
// detail
|
||||
main_detail: "/dev/job/detail/main/",
|
||||
detail_publish: "/dev/job/detail/publish/",
|
||||
detail_review: "/dev/job/detail/review/",
|
||||
detail_draft: "/dev/job/detail/draft/",
|
||||
detail_reject: "/dev/job/detail/reject/",
|
||||
detail_arsip: "/dev/job/detail/arsip/",
|
||||
|
||||
// non user
|
||||
non_user_view: "/dev/job/non_user_view/",
|
||||
};
|
||||
200
src/app_modules/admin/job/child/arsip/index.tsx
Normal file
@@ -0,0 +1,200 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
import {
|
||||
MODEL_EVENT,
|
||||
MODEL_EVENT_PESERTA,
|
||||
} from "@/app_modules/event/model/interface";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import {
|
||||
MODEL_VOTE_KONTRIBUTOR,
|
||||
MODEL_VOTING,
|
||||
MODEL_VOTING_DAFTAR_NAMA_VOTE,
|
||||
} from "@/app_modules/vote/model/interface";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Modal,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconEyeCheck, IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminJob_TableArsip({
|
||||
dataVote,
|
||||
}: {
|
||||
dataVote?: any;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Job Vacancy: Table Arsip" />
|
||||
<TableStatus listArsip={dataVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listArsip }: { listArsip: MODEL_JOB[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listArsip);
|
||||
const [img, setImg] = useState("");
|
||||
|
||||
const TableRows = data?.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Spoiler
|
||||
w={200}
|
||||
maxHeight={50}
|
||||
hideLabel="sembunyikan"
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.title}
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Center w={150}>
|
||||
{e.imagesId ? (
|
||||
<Button
|
||||
color="green"
|
||||
radius={"xl"}
|
||||
leftIcon={<IconEyeCheck />}
|
||||
onClick={() => {
|
||||
setImg(e.imagesId);
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Lihat
|
||||
</Button>
|
||||
) : (
|
||||
<Center w={150}>
|
||||
<Text fw={"bold"} fz={"xs"} fs={"italic"}>
|
||||
Tidak ada poster
|
||||
</Text>
|
||||
</Center>
|
||||
)}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.content }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.deskripsi }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
opened={opened}
|
||||
onClose={close}
|
||||
size={"xl"}
|
||||
withCloseButton={false}
|
||||
>
|
||||
{/* <ComponentAdminVote_DetailHasil
|
||||
hasil={hasil}
|
||||
kontributor={kontributor}
|
||||
/> */}
|
||||
</Modal>
|
||||
<Box>
|
||||
<Box bg={"gray.1"} p={"xs"}>
|
||||
<Title order={6} c={"gray"}>
|
||||
ARSIP
|
||||
</Title>
|
||||
</Box>
|
||||
<ScrollArea w={"100%"}>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Poster</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Syarat Ketentuan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
async function onList(
|
||||
voteId: string,
|
||||
setHasil: any,
|
||||
setKontributor: any,
|
||||
setLoading: any,
|
||||
open: any
|
||||
) {
|
||||
// await AdminVote_getHasilById(voteId).then((res) => {
|
||||
// setHasil(res);
|
||||
// setLoading(false);
|
||||
// });
|
||||
|
||||
// await AdminVote_getListKontributorById(voteId).then((res) => {
|
||||
// setKontributor(res);
|
||||
// setLoading(false);
|
||||
// });
|
||||
|
||||
open();
|
||||
}
|
||||
171
src/app_modules/admin/job/child/table_publish/index.tsx
Normal file
@@ -0,0 +1,171 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Modal,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconBan, IconEyeCheck, IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminJob_TablePublish({
|
||||
dataVote,
|
||||
}: {
|
||||
dataVote?: any;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Job Vacancy: Table Publish" />
|
||||
<TableStatus listReview={dataVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listReview }: { listReview: MODEL_JOB[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listReview);
|
||||
const [img, setImg] = useState("");
|
||||
|
||||
const TableRows = data?.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Spoiler
|
||||
w={200}
|
||||
maxHeight={50}
|
||||
hideLabel="sembunyikan"
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.title}
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Center w={150}>
|
||||
{e.imagesId ? (
|
||||
<Button
|
||||
color="green"
|
||||
radius={"xl"}
|
||||
leftIcon={<IconEyeCheck />}
|
||||
onClick={() => {
|
||||
setImg(e.imagesId);
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Lihat
|
||||
</Button>
|
||||
) : (
|
||||
<Center w={150}>
|
||||
<Text fw={"bold"} fz={"xs"} fs={"italic"}>
|
||||
Tidak ada poster
|
||||
</Text>
|
||||
</Center>
|
||||
)}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.content }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.deskripsi }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={close} withCloseButton={false} centered>
|
||||
<Center>
|
||||
<Image
|
||||
alt="Foto"
|
||||
src={RouterJob.api_gambar + img}
|
||||
mah={500}
|
||||
maw={300}
|
||||
/>
|
||||
</Center>
|
||||
</Modal>
|
||||
|
||||
<Box>
|
||||
<Box bg={"green.1"} p={"xs"}>
|
||||
<Title order={6} c={"green"}>
|
||||
PUBLISH
|
||||
</Title>
|
||||
</Box>
|
||||
<ScrollArea w={"100%"}>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Poster</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Syarat Ketentuan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
251
src/app_modules/admin/job/child/table_reject/index.tsx
Normal file
@@ -0,0 +1,251 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Modal,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
Textarea,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconBan, IconEyeCheck, IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { AdminJob_funEditCatatanById } from "../../fun/edit/fun_edit_catatan_by_id";
|
||||
import { AdminJob_getListTableByStatusId } from "../../fun/get/get_list_table_by_status_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";
|
||||
|
||||
export default function AdminJob_TableReject({ dataVote }: { dataVote?: any }) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Job Vacancy: Table Reject" />
|
||||
<TableStatus listReject={dataVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listReject }: { listReject: MODEL_JOB[] }) {
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listReject);
|
||||
const [reject, setReject] = useState(false);
|
||||
const [img, setImg] = useState("");
|
||||
const [jobId, setJobId] = useState("");
|
||||
const [catatan, setCatatan] = useState("");
|
||||
|
||||
const TableRows = data?.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Spoiler
|
||||
w={200}
|
||||
maxHeight={50}
|
||||
hideLabel="sembunyikan"
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.title}
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Center w={150}>
|
||||
{e.imagesId ? (
|
||||
<Button
|
||||
color="green"
|
||||
radius={"xl"}
|
||||
leftIcon={<IconEyeCheck />}
|
||||
onClick={() => {
|
||||
setImg(e.imagesId);
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Lihat
|
||||
</Button>
|
||||
) : (
|
||||
<Center w={150}>
|
||||
<Text fw={"bold"} fz={"xs"} fs={"italic"}>
|
||||
Tidak ada poster
|
||||
</Text>
|
||||
</Center>
|
||||
)}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
hideLabel="sembunyikan"
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.content }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.deskripsi }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.catatan}
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Button
|
||||
color={"red"}
|
||||
leftIcon={<IconBan />}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
setReject(true);
|
||||
setJobId(e.id);
|
||||
setCatatan(e.catatan);
|
||||
}}
|
||||
>
|
||||
Reject
|
||||
</Button>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={close} withCloseButton={false} centered>
|
||||
<Center>
|
||||
<Image
|
||||
alt="Foto"
|
||||
src={RouterJob.api_gambar + img}
|
||||
mah={500}
|
||||
maw={300}
|
||||
/>
|
||||
</Center>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
opened={reject}
|
||||
onClose={() => {
|
||||
setReject(false);
|
||||
}}
|
||||
withCloseButton={false}
|
||||
size={"lg"}
|
||||
centered
|
||||
>
|
||||
<Stack>
|
||||
<Textarea
|
||||
minRows={2}
|
||||
maxRows={5}
|
||||
maxLength={300}
|
||||
autosize
|
||||
label="Alasan Penolakan"
|
||||
placeholder="Masukkan alasan penolakan lowongan ini"
|
||||
value={catatan}
|
||||
onChange={(val) => setCatatan(val.currentTarget.value)}
|
||||
/>
|
||||
<Group position="right">
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onReject(jobId, catatan, setData);
|
||||
setReject(false);
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
<Box>
|
||||
<Box bg={"red.1"} p={"xs"}>
|
||||
<Title order={6} c={"red"}>
|
||||
REJECT
|
||||
</Title>
|
||||
</Box>
|
||||
<ScrollArea w={"100%"}>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Poster</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Syarat Ketentuan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Catatan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
async function onReject(jobId: string, catatan: string, setData: any) {
|
||||
await AdminJob_funEditCatatanById(jobId, catatan).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
await AdminJob_getListTableByStatusId("4").then((val) => {
|
||||
setData(val);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
263
src/app_modules/admin/job/child/table_review/index.tsx
Normal file
@@ -0,0 +1,263 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Modal,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
Textarea,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconBan, IconEyeCheck, IconEyeShare } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { AdminJob_funEditStatusPublishById } from "../../fun/edit/fun_edit_status_publish_by_id";
|
||||
import { AdminJob_getListTableByStatusId } from "../../fun/get/get_list_table_by_status_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 { AdminJob_funEditCatatanById } from "../../fun/edit/fun_edit_catatan_by_id";
|
||||
|
||||
export default function AdminJob_TableReview({ dataVote }: { dataVote?: any }) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Job Vacancy: Table Review" />
|
||||
<TableStatus listReview={dataVote} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function TableStatus({ listReview }: { listReview: MODEL_JOB[] }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState(listReview);
|
||||
const [reject, setReject] = useState(false);
|
||||
const [img, setImg] = useState("");
|
||||
const [jobId, setJobId] = useState("");
|
||||
const [catatan, setCatatan] = useState("");
|
||||
|
||||
const TableRows = data?.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Spoiler
|
||||
w={200}
|
||||
maxHeight={50}
|
||||
hideLabel="sembunyikan"
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
{e.title}
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Center w={150}>
|
||||
{e.imagesId ? (
|
||||
<Button
|
||||
color="green"
|
||||
radius={"xl"}
|
||||
leftIcon={<IconEyeCheck />}
|
||||
onClick={() => {
|
||||
setImg(e.imagesId);
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Lihat
|
||||
</Button>
|
||||
) : (
|
||||
<Center w={150}>
|
||||
<Text fw={"bold"} fz={"xs"} fs={"italic"}>
|
||||
Tidak ada poster
|
||||
</Text>
|
||||
</Center>
|
||||
)}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.content }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Spoiler
|
||||
hideLabel="sembunyikan"
|
||||
w={400}
|
||||
maxHeight={50}
|
||||
showLabel="tampilkan"
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.deskripsi }} />
|
||||
</Spoiler>
|
||||
</td>
|
||||
<td>
|
||||
<Stack>
|
||||
<Stack align="center">
|
||||
<Button
|
||||
color={"green"}
|
||||
leftIcon={<IconEyeShare />}
|
||||
radius={"xl"}
|
||||
onClick={() => onPublish(e.id, setData)}
|
||||
>
|
||||
Publish
|
||||
</Button>
|
||||
<Button
|
||||
color={"red"}
|
||||
leftIcon={<IconBan />}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
setReject(true);
|
||||
setJobId(e.id);
|
||||
}}
|
||||
>
|
||||
Reject
|
||||
</Button>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</td>
|
||||
</tr>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={close} withCloseButton={false} centered>
|
||||
<Center>
|
||||
<Image
|
||||
alt="Foto"
|
||||
src={RouterJob.api_gambar + img}
|
||||
mah={500}
|
||||
maw={300}
|
||||
/>
|
||||
</Center>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
opened={reject}
|
||||
onClose={() => {
|
||||
setReject(false);
|
||||
}}
|
||||
withCloseButton={false}
|
||||
size={"lg"}
|
||||
centered
|
||||
>
|
||||
<Stack>
|
||||
<Textarea
|
||||
minRows={2}
|
||||
maxRows={5}
|
||||
maxLength={300}
|
||||
autosize
|
||||
label="Alasan Penolakan"
|
||||
placeholder="Masukkan alasan penolakan lowongan ini"
|
||||
onChange={(val) => setCatatan(val.currentTarget.value)}
|
||||
/>
|
||||
<Group position="right">
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onReject(jobId, catatan, setData);
|
||||
setReject(false);
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
<Box>
|
||||
<Box bg={"orange.1"} p={"xs"}>
|
||||
<Title order={6} c={"orange"}>
|
||||
REVIEW
|
||||
</Title>
|
||||
</Box>
|
||||
<ScrollArea w={"100%"}>
|
||||
<Table
|
||||
withBorder
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"xl"}
|
||||
p={"md"}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Poster</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Syarat Ketentuan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{TableRows}</tbody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
<Center>
|
||||
{_.isEmpty(TableRows) ? (
|
||||
<Center h={"50vh"}>
|
||||
<Title order={6}>Tidak Ada Data</Title>
|
||||
</Center>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
async function onPublish(jobId: string, setData: any) {
|
||||
await AdminJob_funEditStatusPublishById(jobId).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
await AdminJob_getListTableByStatusId("2").then((res) => {
|
||||
setData(res);
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Update");
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function onReject(jobId: string, catatan: string, setData: any) {
|
||||
await AdminJob_funEditCatatanById(jobId, catatan).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
await AdminJob_getListTableByStatusId("2").then((val) => {
|
||||
setData(val);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function AdminJob_funCountStatusByStatusId(statusId: string) {
|
||||
if (statusId === "0") {
|
||||
const data = await prisma.job.count({
|
||||
where: {
|
||||
masterStatusId: "1",
|
||||
isArsip: true,
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
if (statusId === "1") {
|
||||
const data = await prisma.job.count({
|
||||
where: {
|
||||
masterStatusId: "1",
|
||||
isArsip: false,
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
if (statusId === "2") {
|
||||
const data = await prisma.job.count({
|
||||
where: {
|
||||
masterStatusId: "2",
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
if (statusId === "4") {
|
||||
const data = await prisma.job.count({
|
||||
where: {
|
||||
masterStatusId: "4",
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
23
src/app_modules/admin/job/fun/edit/fun_edit_catatan_by_id.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function AdminJob_funEditCatatanById(
|
||||
jobId: string,
|
||||
catatan: string
|
||||
) {
|
||||
const up = await prisma.job.update({
|
||||
where: {
|
||||
id: jobId,
|
||||
},
|
||||
data: {
|
||||
masterStatusId: "4",
|
||||
catatan: catatan,
|
||||
},
|
||||
});
|
||||
|
||||
if (!up) return { status: 400, message: "Gagal reject" };
|
||||
revalidatePath("/dev/admin/job/child/table_review");
|
||||
return { status: 200, message: "Berhasil reject" };
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function AdminJob_funEditStatusPublishById(jobId: string) {
|
||||
const updt = await prisma.job.update({
|
||||
where: {
|
||||
id: jobId,
|
||||
},
|
||||
data: {
|
||||
masterStatusId: "1",
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
if(!updt) return {status: 400, message: "Update Gagal"}
|
||||
revalidatePath("/dev/admin/job/child/table_review");
|
||||
return {status: 200, message: "Berhasil Update"}
|
||||
}
|
||||
114
src/app_modules/admin/job/fun/get/get_list_table_by_status_id.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function AdminJob_getListTableByStatusId(statusId: string) {
|
||||
if (statusId === "0") {
|
||||
const getData = await prisma.job.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
masterStatusId: "1",
|
||||
isActive: true,
|
||||
isArsip: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
isArsip: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
content: true,
|
||||
deskripsi: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
imagesId: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
if (statusId === "1") {
|
||||
const getData = await prisma.job.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
masterStatusId: "1",
|
||||
isActive: true,
|
||||
isArsip: false,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
content: true,
|
||||
deskripsi: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
imagesId: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
if (statusId === "2") {
|
||||
const getData = await prisma.job.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
masterStatusId: "2",
|
||||
isActive: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
content: true,
|
||||
deskripsi: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
imagesId: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
|
||||
if (statusId === "4") {
|
||||
const getData = await prisma.job.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
masterStatusId: "4",
|
||||
isActive: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
content: true,
|
||||
deskripsi: true,
|
||||
catatan: true,
|
||||
authorId: true,
|
||||
Author: true,
|
||||
imagesId: true,
|
||||
},
|
||||
});
|
||||
|
||||
return getData;
|
||||
}
|
||||
}
|
||||
6
src/app_modules/admin/job/index.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import AdminJob_Main from "./main";
|
||||
import AdminJob_TablePublish from "./child/table_publish";
|
||||
import AdminJob_TableReview from "./child/table_review";
|
||||
import AdminJob_TableReject from "./child/table_reject";
|
||||
|
||||
export { AdminJob_Main, AdminJob_TablePublish, AdminJob_TableReview, AdminJob_TableReject };
|
||||
80
src/app_modules/admin/job/main/index.tsx
Normal file
@@ -0,0 +1,80 @@
|
||||
"use client";
|
||||
|
||||
import { Group, Paper, SimpleGrid, Stack, Text, Title } from "@mantine/core";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "../../component/header_tamplate";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function AdminJob_Main({
|
||||
countPublish,
|
||||
countReview,
|
||||
countReject,
|
||||
countArsip,
|
||||
}: {
|
||||
countPublish: number;
|
||||
countReview: number;
|
||||
countReject: number;
|
||||
countArsip: number
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
const listStatus = [
|
||||
{
|
||||
id: 1,
|
||||
name: "Publish",
|
||||
jumlah: countPublish,
|
||||
color: "green",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "Review",
|
||||
jumlah: countReview,
|
||||
color: "orange",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Reject",
|
||||
jumlah: countReject,
|
||||
color: "red",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "Arsip",
|
||||
jumlah: countArsip,
|
||||
color: "gray",
|
||||
},
|
||||
];
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Job Vacancy" />
|
||||
<SimpleGrid
|
||||
cols={4}
|
||||
spacing="lg"
|
||||
breakpoints={[
|
||||
{ maxWidth: "62rem", cols: 4, spacing: "lg" },
|
||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||
]}
|
||||
>
|
||||
{listStatus.map((e, i) => (
|
||||
<Paper
|
||||
key={i}
|
||||
bg={`${e.color}.2`}
|
||||
shadow="md"
|
||||
radius="md"
|
||||
p="md"
|
||||
// sx={{ borderColor: e.color, borderStyle: "solid" }}
|
||||
>
|
||||
<Group position="center">
|
||||
<Stack align="center" spacing={0}>
|
||||
<Text>{e.name}</Text>
|
||||
<Title>{e.jumlah ? e.jumlah : 0}</Title>
|
||||
</Stack>
|
||||
</Group>
|
||||
</Paper>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
import React, { useState } from "react";
|
||||
import ComponentGlobal_HeaderTamplate from "../component_global/header_tamplate";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconLetterH, IconLogout } from "@tabler/icons-react";
|
||||
import { IconCircleDot, IconCircleDotFilled, IconHome, IconLetterH, IconLogout } from "@tabler/icons-react";
|
||||
import {
|
||||
RouterAdminAward,
|
||||
RouterAdminDashboard,
|
||||
@@ -38,6 +38,8 @@ import Admin_Logout from "./component/logout";
|
||||
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
||||
import _ from "lodash";
|
||||
import { listAdminPage } from "./list_page";
|
||||
import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote";
|
||||
import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job";
|
||||
|
||||
export default function AdminLayout({
|
||||
children,
|
||||
@@ -50,6 +52,8 @@ export default function AdminLayout({
|
||||
const [active, setActive] = useAtom(gs_admin_hotMenu);
|
||||
const [activeChild, setActiveChild] = useAtom(gs_admin_subMenu);
|
||||
|
||||
|
||||
|
||||
const navbarItems = listAdminPage.map((e, i) => (
|
||||
<Box key={e.id}>
|
||||
<NavLink
|
||||
@@ -59,7 +63,8 @@ export default function AdminLayout({
|
||||
},
|
||||
}}
|
||||
fw={active === e.id ? "bold" : "normal"}
|
||||
label={<Text size={"md"}>{e.name}</Text>}
|
||||
icon={e.icon}
|
||||
label={<Text size={"sm"}>{e.name}</Text>}
|
||||
onClick={() => {
|
||||
setActive(e.id);
|
||||
setActiveChild(null);
|
||||
@@ -81,6 +86,7 @@ export default function AdminLayout({
|
||||
}}
|
||||
fw={activeChild === v.id ? "bold" : "normal"}
|
||||
label={<Text>{v.name}</Text>}
|
||||
icon={activeChild === v.id ? <IconCircleDotFilled size={10}/> : <IconCircleDot size={10}/> }
|
||||
onClick={() => {
|
||||
setActive(e.id);
|
||||
setActiveChild(v.id);
|
||||
@@ -98,9 +104,10 @@ export default function AdminLayout({
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
padding="sm"
|
||||
padding="md"
|
||||
navbarOffsetBreakpoint="md"
|
||||
asideOffsetBreakpoint="sm"
|
||||
|
||||
navbar={
|
||||
<MediaQuery smallerThan={"md"} styles={{ display: "none" }}>
|
||||
<Navbar
|
||||
|
||||
@@ -1,34 +1,48 @@
|
||||
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
||||
import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job";
|
||||
import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote";
|
||||
import {
|
||||
RouterAdminDashboard,
|
||||
RouterAdminDonasi,
|
||||
RouterAdminInvestasi,
|
||||
} from "@/app/lib/router_hipmi/router_admin";
|
||||
import { IconBriefcase } from "@tabler/icons-react";
|
||||
import {
|
||||
IconHeartHandshake,
|
||||
IconHome,
|
||||
IconMoneybag,
|
||||
IconPackageImport,
|
||||
IconPresentation,
|
||||
} from "@tabler/icons-react";
|
||||
|
||||
export const listAdminPage = [
|
||||
{
|
||||
id: 1,
|
||||
name: "Main Dashboard",
|
||||
path: RouterAdminDashboard.main_admin,
|
||||
icon: <IconHome />,
|
||||
child: [],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "Investasi",
|
||||
path: RouterAdminInvestasi.main_investasi,
|
||||
icon: <IconMoneybag />,
|
||||
|
||||
child: [],
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Donasi",
|
||||
path: RouterAdminDonasi.main_donasi,
|
||||
icon: <IconHeartHandshake />,
|
||||
child: [],
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "Event",
|
||||
path: "",
|
||||
icon: <IconPresentation />,
|
||||
child: [
|
||||
{
|
||||
id: 41,
|
||||
@@ -66,6 +80,7 @@ export const listAdminPage = [
|
||||
id: 5,
|
||||
name: "Voting",
|
||||
path: "",
|
||||
icon: <IconPackageImport />,
|
||||
child: [
|
||||
{
|
||||
id: 51,
|
||||
@@ -94,4 +109,37 @@ export const listAdminPage = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: "Job Vacancy",
|
||||
path: "",
|
||||
icon: <IconBriefcase />,
|
||||
child: [
|
||||
{
|
||||
id: 61,
|
||||
name: "Dashboard",
|
||||
path: RouterAdminJob.main,
|
||||
},
|
||||
{
|
||||
id: 62,
|
||||
name: "Table Publish",
|
||||
path: RouterAdminJob.table_publish,
|
||||
},
|
||||
{
|
||||
id: 63,
|
||||
name: "Table Review",
|
||||
path: RouterAdminJob.table_review,
|
||||
},
|
||||
{
|
||||
id: 64,
|
||||
name: "Table Reject",
|
||||
path: RouterAdminJob.table_reject,
|
||||
},
|
||||
{
|
||||
id: 65,
|
||||
name: "Arsip",
|
||||
path: RouterAdminJob.arsip,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -79,15 +79,7 @@ export default function AdminVote_Main({
|
||||
</Paper>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
<SimpleGrid
|
||||
cols={4}
|
||||
spacing="lg"
|
||||
breakpoints={[
|
||||
{ maxWidth: "62rem", cols: 4, spacing: "lg" },
|
||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||
]}
|
||||
></SimpleGrid>
|
||||
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { notifications } from "@mantine/notifications";
|
||||
import { IconAlertTriangle } from "@tabler/icons-react";
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param text | masukan text untuk peringatan
|
||||
* @type string
|
||||
* @returns notifikasi peringatan
|
||||
@@ -18,13 +18,23 @@ export async function ComponentGlobal_NotifikasiPeringatan(
|
||||
<Text fw={"bold"}>{text}</Text>
|
||||
</Center>
|
||||
),
|
||||
color: "yellow.3",
|
||||
color: "yellow.1",
|
||||
radius: "md",
|
||||
autoClose: durasi ? durasi : 1000,
|
||||
style: {
|
||||
borderWidth: "0.5px",
|
||||
borderStyle: "solid",
|
||||
borderColor: "red"
|
||||
|
||||
|
||||
},
|
||||
|
||||
icon: (
|
||||
<ActionIcon radius={"xl"} bg={"white"} p={3}>
|
||||
<IconAlertTriangle color="red" />
|
||||
<ActionIcon variant="transparent" radius={"xl"} p={3}>
|
||||
<IconAlertTriangle
|
||||
color="red"
|
||||
style={{ backgroundColor: "transparent" }}
|
||||
/>
|
||||
</ActionIcon>
|
||||
),
|
||||
withCloseButton: false,
|
||||
@@ -32,7 +42,7 @@ export async function ComponentGlobal_NotifikasiPeringatan(
|
||||
styles: (theme) => ({
|
||||
description: { color: theme.white },
|
||||
root: {
|
||||
backgroundColor: theme.colors.yellow[7],
|
||||
backgroundColor: theme.colors.orange[5],
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -22,12 +22,9 @@ export default function Event_SplashScreen() {
|
||||
return (
|
||||
<>
|
||||
<Center h={"100vh"}>
|
||||
<Stack align="center" justify="center" p={"md"}>
|
||||
<Title c={"#002e59"}>Welcome to</Title>
|
||||
<Paper p={{ base: 50, md: 60, lg: 80 }}>
|
||||
<Image alt="event" src={"/aset/event/splash-event.png"} />
|
||||
</Paper>
|
||||
</Stack>
|
||||
<Paper p={{ base: 50, md: 60, lg: 80 }}>
|
||||
<Image alt="event" src={"/aset/event/splash-event.png"} />
|
||||
</Paper>
|
||||
</Center>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -82,11 +82,11 @@ export default function HomeLayout({
|
||||
<Grid.Col
|
||||
span={"auto"}
|
||||
onClick={() => {
|
||||
if (user.Profile === null) {
|
||||
if (user?.Profile === null) {
|
||||
ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile");
|
||||
} else {
|
||||
// router.push(RouterProfile.katalog + `${user.Profile.id}`);
|
||||
router.push(RouterUserSearch.main)
|
||||
router.push(RouterUserSearch.main);
|
||||
}
|
||||
}}
|
||||
>
|
||||
@@ -102,7 +102,7 @@ export default function HomeLayout({
|
||||
<Grid.Col
|
||||
span={"auto"}
|
||||
onClick={() => {
|
||||
if (user.Profile === null) {
|
||||
if (user?.Profile === null) {
|
||||
router.push(RouterProfile.create + `${user.id}`);
|
||||
} else {
|
||||
router.push(RouterProfile.katalog + `${user.Profile.id}`);
|
||||
@@ -111,7 +111,23 @@ export default function HomeLayout({
|
||||
>
|
||||
<Stack align="center" spacing={2}>
|
||||
<ActionIcon variant={"transparent"}>
|
||||
{user.Profile === null ? <IconUserCircle color="white" /> : <Avatar radius={"xl"} size={30} src={RouterProfile.api_foto_profile + `${user.Profile.imagesId}`}/>}
|
||||
{user?.Profile === null ? (
|
||||
<IconUserCircle color="white" />
|
||||
) : (
|
||||
<Avatar
|
||||
radius={"xl"}
|
||||
size={30}
|
||||
sx={{
|
||||
borderStyle: "solid",
|
||||
borderWidth: "0.5px",
|
||||
borderColor: "white",
|
||||
}}
|
||||
src={
|
||||
RouterProfile.api_foto_profile +
|
||||
`${user?.Profile.imagesId}`
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</ActionIcon>
|
||||
<Text fz={"xs"} c={"white"}>
|
||||
Profile
|
||||
@@ -122,7 +138,6 @@ export default function HomeLayout({
|
||||
</Footer>
|
||||
}
|
||||
>
|
||||
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
|
||||
@@ -34,6 +34,7 @@ import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import { MODEL_USER } from "./model/interface";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "../component_global/notif_global/notifikasi_peringatan";
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
|
||||
export default function HomeView({ dataUser }: { dataUser: MODEL_USER }) {
|
||||
const router = useRouter();
|
||||
@@ -62,7 +63,7 @@ export default function HomeView({ dataUser }: { dataUser: MODEL_USER }) {
|
||||
id: 4,
|
||||
name: "Job Vacancy",
|
||||
icon: <IconBriefcase size={50} />,
|
||||
link: "",
|
||||
link: RouterJob.spalsh,
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
40
src/app_modules/job/component/card_preview.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import { Card, Center, Grid, Image, Text } from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function ComponentJob_CardPreview({ path }: { path: string }) {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
shadow="lg"
|
||||
withBorder
|
||||
radius={"md"}
|
||||
p={20}
|
||||
onClick={() => {
|
||||
router.push(path);
|
||||
}}
|
||||
>
|
||||
<Card.Section px={"sm"}>
|
||||
<Grid>
|
||||
<Grid.Col span={"content"}>
|
||||
<Image
|
||||
height={100}
|
||||
width={80}
|
||||
alt="foto"
|
||||
src={"/aset/no-file.png"}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Center h={"100%"}>
|
||||
<Text fw={"bold"}>Judul Lowongan kerja</Text>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
63
src/app_modules/job/component/card_view_status.tsx
Normal file
@@ -0,0 +1,63 @@
|
||||
"use client";
|
||||
|
||||
import { Stack, Card, Grid, Image, Text, Center } from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
import ComponentJob_IsEmptyData from "./is_empty_data";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
import { MODEL_JOB } from "../model/interface";
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import { IconChevronRight } from "@tabler/icons-react";
|
||||
|
||||
export default function ComponentJob_CardViewStatus({
|
||||
listData,
|
||||
path,
|
||||
}: {
|
||||
listData?: MODEL_JOB[];
|
||||
path?: any;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
if (_.isEmpty(listData))
|
||||
return (
|
||||
<>
|
||||
<ComponentJob_IsEmptyData text="Data tidak ada" />
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{listData?.map((e, i) => (
|
||||
<Card
|
||||
key={i}
|
||||
shadow="lg"
|
||||
withBorder
|
||||
radius={"md"}
|
||||
p={20}
|
||||
onClick={() => {
|
||||
if (path === undefined) {
|
||||
return ComponentGlobal_NotifikasiPeringatan(
|
||||
"Path tidak ditemukan"
|
||||
);
|
||||
} else {
|
||||
router.push(path + e.id);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Card.Section px={"sm"}>
|
||||
<Grid>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Center h={"100%"}>
|
||||
<Text fw={"bold"} lineClamp={1}>
|
||||
{e.title}
|
||||
</Text>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
))}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
94
src/app_modules/job/component/detail/detail_data.tsx
Normal file
@@ -0,0 +1,94 @@
|
||||
"use client";
|
||||
|
||||
import { Card, Stack, Skeleton, Image, Text, Center } from "@mantine/core";
|
||||
import { MODEL_JOB } from "../../model/interface";
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
|
||||
export default function ComponentJob_DetailData({
|
||||
data,
|
||||
}: {
|
||||
data?: MODEL_JOB;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
{data ? (
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section px={"xs"} pb={"lg"}>
|
||||
<Stack spacing={"xl"}>
|
||||
{data.imagesId ? (
|
||||
<Stack align="center">
|
||||
<Image
|
||||
alt=""
|
||||
src={
|
||||
data.imagesId ? RouterJob.api_gambar + data.imagesId : ""
|
||||
}
|
||||
height={300}
|
||||
width={200}
|
||||
/>
|
||||
</Stack>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
|
||||
<Stack>
|
||||
<Center>
|
||||
<Text fz={20} fw={"bold"}>
|
||||
{data.title}
|
||||
</Text>
|
||||
</Center>
|
||||
<Stack spacing={0}>
|
||||
<Text>
|
||||
<div dangerouslySetInnerHTML={{ __html: data.content }} />
|
||||
</Text>
|
||||
<Text>
|
||||
<div dangerouslySetInnerHTML={{ __html: data.deskripsi }} />
|
||||
</Text>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
) : (
|
||||
<Card shadow="lg" withBorder p={30}>
|
||||
<Card.Section px={"xs"} pb={"lg"}>
|
||||
<Stack spacing={"xl"}>
|
||||
<Stack align="center">
|
||||
<Image alt="" src={"/aset/no-file.png"} mah={500} maw={200} />
|
||||
<Text fz={20} fw={"bold"}>
|
||||
Judul Lowongan Kerja
|
||||
</Text>
|
||||
</Stack>
|
||||
|
||||
<Stack>
|
||||
<Text fw={"bold"} fz={"xs"}>
|
||||
Syarat & Ketentuan :
|
||||
</Text>
|
||||
<Stack>
|
||||
{Array(5)
|
||||
.fill(0)
|
||||
.map((e, i) => (
|
||||
<Skeleton key={i} height={8} radius="xl" />
|
||||
))}
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<Stack>
|
||||
<Text fw={"bold"} fz={"xs"}>
|
||||
Deskripsi
|
||||
</Text>
|
||||
<Stack>
|
||||
{Array(5)
|
||||
.fill(0)
|
||||
.map((e, i) => (
|
||||
<Skeleton key={i} height={8} radius="xl" />
|
||||
))}
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
22
src/app_modules/job/component/detail/noted_box.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Center, Grid, Group, Paper, Text, Title } from "@mantine/core";
|
||||
|
||||
export default function ComponentJob_NotedBox({
|
||||
informasi,
|
||||
}: {
|
||||
informasi: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Paper bg={"blue.3"} p={10}>
|
||||
<Group>
|
||||
<Text fz={10} fs={"italic"}>
|
||||
<Text span inherit c={"red"}>
|
||||
*{" "}
|
||||
</Text>
|
||||
{informasi}
|
||||
</Text>
|
||||
</Group>
|
||||
</Paper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
69
src/app_modules/job/component/header_tamplate.tsx
Normal file
@@ -0,0 +1,69 @@
|
||||
"use client";
|
||||
|
||||
import { Header, Group, ActionIcon, Text, Title } from "@mantine/core";
|
||||
import { IconArrowLeft, IconChevronLeft } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function ComponentJob_HeaderTamplate({
|
||||
hideBack,
|
||||
changeIconBack,
|
||||
route,
|
||||
route2,
|
||||
title,
|
||||
icon,
|
||||
bg,
|
||||
}: {
|
||||
hideBack?: boolean;
|
||||
changeIconBack?: any;
|
||||
route?: any;
|
||||
route2?: any;
|
||||
title: string;
|
||||
icon?: any;
|
||||
bg?: any;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Header
|
||||
height={50}
|
||||
sx={{ borderStyle: "none" }}
|
||||
bg={bg === null ? "" : bg}
|
||||
>
|
||||
<Group h={50} position="apart" px={"md"}>
|
||||
{hideBack ? (
|
||||
<ActionIcon variant="transparent" disabled></ActionIcon>
|
||||
) : (
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
onClick={() => {
|
||||
if (route === null || route === undefined) {
|
||||
return router.back();
|
||||
} else {
|
||||
return router.push(route);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{changeIconBack ? changeIconBack : <IconChevronLeft />}
|
||||
</ActionIcon>
|
||||
)}
|
||||
<Title order={5}>{title}</Title>
|
||||
{(() => {
|
||||
if (route2 === null || route2 === undefined) {
|
||||
return <ActionIcon disabled variant="transparent"></ActionIcon>;
|
||||
} else {
|
||||
return (
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
onClick={() => router.push(route2)}
|
||||
>
|
||||
{icon}
|
||||
</ActionIcon>
|
||||
);
|
||||
}
|
||||
})()}
|
||||
</Group>
|
||||
</Header>
|
||||
</>
|
||||
);
|
||||
}
|
||||
13
src/app_modules/job/component/is_empty_data.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { Center } from "@mantine/core";
|
||||
|
||||
export default function ComponentJob_IsEmptyData({ text }: { text: string }) {
|
||||
return (
|
||||
<>
|
||||
<Center h={"50vh"} fz={"sm"} fw={"bold"}>
|
||||
{text}
|
||||
</Center>
|
||||
</>
|
||||
);
|
||||
}
|
||||
61
src/app_modules/job/create/TextEdit.tsx
Normal file
@@ -0,0 +1,61 @@
|
||||
"use client";
|
||||
|
||||
import { Center, Stack } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import dynamic from "next/dynamic";
|
||||
import React, { useState } from "react";
|
||||
const ReactQuill = dynamic(
|
||||
() => {
|
||||
return import("react-quill");
|
||||
},
|
||||
{ ssr: false }
|
||||
);
|
||||
import "react-quill/dist/quill.snow.css";
|
||||
|
||||
export default function Demo() {
|
||||
const [value, setValue] = useState("");
|
||||
const [udah, setUdah] = useState(false);
|
||||
|
||||
// useShallowEffect(() => {
|
||||
// if (window && window.document) setUdah(true);
|
||||
// }, []);
|
||||
|
||||
// if (!udah) return <><Center></Center></>;
|
||||
return (
|
||||
<Stack>
|
||||
<ReactQuill
|
||||
defaultValue={`<h2 ">Judul Lowongan Kerja</h2>
|
||||
<p "><br></p>
|
||||
<p><strong>Syarat & Ketentuan :</strong></p>
|
||||
<ol>
|
||||
<li>Minimal pendidika SMA / Sederajat</li>
|
||||
<li>Pasif berbahasa inggris </li>
|
||||
<li>Dll,.</li>
|
||||
</ol>
|
||||
<p></br></p>
|
||||
<p><strong>Deskripsi :</strong></p>
|
||||
<p>Jika berminat dapat menghubungi WA berikut</p>
|
||||
<p>+6281 xxx xxx xx</p>
|
||||
<p>Kirim CV anda melalui email berikut</p>
|
||||
<p>@test-hipmi.com</p>
|
||||
<p>Atau kunjungi website kami:</p>
|
||||
<p><a href="https://test-hipmi.wibudev.com/" rel="noopener noreferrer" target="_blank">https://test-hipmi.wibudev.com/</a></p>
|
||||
`}
|
||||
modules={{
|
||||
toolbar: [
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }],
|
||||
["bold", "italic", "underline", "link"],
|
||||
// [{ align: [] }],
|
||||
[{ list: "ordered" }, { list: "bullet" }],
|
||||
|
||||
["clean"],
|
||||
],
|
||||
}}
|
||||
theme="snow"
|
||||
onChange={setValue}
|
||||
/>
|
||||
{/* {value}
|
||||
<div dangerouslySetInnerHTML={{ __html: value }} /> */}
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
21
src/app_modules/job/create/layout.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentJob_HeaderTamplate from "../component/header_tamplate";
|
||||
|
||||
export default function LayoutJob_Create({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
header={<ComponentJob_HeaderTamplate title="Tambah Job" />}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
271
src/app_modules/job/create/view.tsx
Normal file
@@ -0,0 +1,271 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import {
|
||||
AspectRatio,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
FileButton,
|
||||
Flex,
|
||||
Group,
|
||||
Image,
|
||||
Loader,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
Textarea,
|
||||
} from "@mantine/core";
|
||||
import { IconCamera, IconUpload } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { gs_job_hot_menu, gs_job_status } from "../global_state";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
|
||||
import "react-quill/dist/quill.snow.css";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useShallowEffect, useToggle } from "@mantine/hooks";
|
||||
import { Job_funCreate } from "../fun/create/fun_create";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { MODEL_JOB } from "../model/interface";
|
||||
import toast from "react-simple-toasts";
|
||||
import ComponentJob_NotedBox from "../component/detail/noted_box";
|
||||
const ReactQuill = dynamic(
|
||||
() => {
|
||||
return import("react-quill");
|
||||
},
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
export default function Job_Create() {
|
||||
const [value, setValue] = useState({
|
||||
title: "",
|
||||
content: "",
|
||||
deskripsi: "",
|
||||
});
|
||||
const [reload, setReload] = useState(false);
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [images, setImages] = useState<any | null>();
|
||||
|
||||
useShallowEffect(() => {
|
||||
if (window && window.document) setReload(true);
|
||||
}, []);
|
||||
|
||||
if (!reload)
|
||||
return (
|
||||
<>
|
||||
<Center h={"50vh"}>
|
||||
<Loader />
|
||||
</Center>
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{!reload ? (
|
||||
<Center h={"50vh"}>
|
||||
<Loader />
|
||||
</Center>
|
||||
) : (
|
||||
<Stack px={"sm"} spacing={40}>
|
||||
<Stack align="center" spacing={"xs"}>
|
||||
{images ? (
|
||||
<Image alt="" src={images} height={300} width={200} />
|
||||
) : (
|
||||
<Paper h={300} w={200} withBorder shadow="lg" bg={"gray.1"}>
|
||||
<Stack justify="center" align="center" h={"100%"}>
|
||||
<IconUpload color="gray" />
|
||||
<Text fz={10} fs={"italic"} c={"gray"} fw={"bold"}>
|
||||
Upload Gambar
|
||||
</Text>
|
||||
</Stack>
|
||||
</Paper>
|
||||
)}
|
||||
|
||||
<FileButton
|
||||
onChange={async (files: any | null) => {
|
||||
try {
|
||||
const buffer = URL.createObjectURL(
|
||||
new Blob([new Uint8Array(await files.arrayBuffer())])
|
||||
);
|
||||
if (files.size > 20000) {
|
||||
ComponentGlobal_NotifikasiPeringatan(
|
||||
"Maaf, Ukuran file terlalu besar, maximum 20Mb",
|
||||
3000
|
||||
);
|
||||
} else {
|
||||
setImages(buffer);
|
||||
setFile(files);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}}
|
||||
accept="image/png,image/jpeg"
|
||||
>
|
||||
{(props) => (
|
||||
<Button
|
||||
compact
|
||||
{...props}
|
||||
radius={"xl"}
|
||||
variant="outline"
|
||||
w={150}
|
||||
>
|
||||
<IconCamera />
|
||||
</Button>
|
||||
)}
|
||||
</FileButton>
|
||||
</Stack>
|
||||
|
||||
<ComponentJob_NotedBox informasi="Poster atau Gambar tidak wajib untuk di upload. Upload lah jika dirasa perlu." />
|
||||
|
||||
<Stack spacing={"lg"}>
|
||||
<TextInput
|
||||
withAsterisk
|
||||
label="Judul"
|
||||
placeholder="Masukan judul lowongan kerja"
|
||||
onChange={(val) => {
|
||||
setValue({
|
||||
...value,
|
||||
title: val.currentTarget.value,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack spacing={3}>
|
||||
<Text fz={"sm"}>
|
||||
Syarat & Ketentuan
|
||||
<Text inherit span c={"red"}>
|
||||
{" "}
|
||||
*
|
||||
</Text>
|
||||
</Text>
|
||||
<ReactQuill
|
||||
defaultValue={`
|
||||
<p><strong>Syarat & Ketentuan :</strong></p>
|
||||
<ol>
|
||||
<li>Minimal pendidika SMA / Sederajat</li>
|
||||
<li>Pasif berbahasa inggris </li>
|
||||
<li>Dll,.</li>
|
||||
</ol>
|
||||
<p></br></p>
|
||||
`}
|
||||
modules={{
|
||||
toolbar: [
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }],
|
||||
["bold", "italic", "underline", "link"],
|
||||
// [{ align: [] }],
|
||||
[{ list: "ordered" }, { list: "bullet" }],
|
||||
["clean"],
|
||||
],
|
||||
}}
|
||||
theme="snow"
|
||||
onChange={(val) => {
|
||||
setValue({
|
||||
...value,
|
||||
content: val,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack spacing={3}>
|
||||
<Text fz={"sm"}>
|
||||
Deskripsi
|
||||
<Text inherit span c={"red"}>
|
||||
{" "}
|
||||
*
|
||||
</Text>
|
||||
</Text>
|
||||
<ReactQuill
|
||||
defaultValue={`
|
||||
<p>
|
||||
<strong>Deskripsi :</strong>
|
||||
</p>
|
||||
<p>Jika berminat dapat menghubungi WA berikut</p>
|
||||
<p>+6281 xxx xxx xx</p>
|
||||
<p>Kirim CV anda melalui email berikut</p>
|
||||
<p>test-email@gmail.com</p>
|
||||
<p>Atau kunjungi website kami:</p>
|
||||
<p>
|
||||
<a
|
||||
href="https://test-hipmi.wibudev.com/"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
https://test-hipmi.wibudev.com/
|
||||
</a>
|
||||
</p>
|
||||
`}
|
||||
modules={{
|
||||
toolbar: [
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }],
|
||||
["bold", "italic", "underline", "link"],
|
||||
// [{ align: [] }],
|
||||
[{ list: "ordered" }, { list: "bullet" }],
|
||||
["clean"],
|
||||
],
|
||||
}}
|
||||
theme="snow"
|
||||
onChange={(val) => {
|
||||
setValue({
|
||||
...value,
|
||||
deskripsi: val,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<ButtonAction value={value as any} file={file as any} />
|
||||
</Stack>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({ value, file }: { value: MODEL_JOB; file: FormData }) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_job_hot_menu);
|
||||
const [status, setStatus] = useAtom(gs_job_status);
|
||||
const [preview, setPreview] = useToggle();
|
||||
|
||||
async function onAction() {
|
||||
const gambar = new FormData();
|
||||
gambar.append("file", file as any);
|
||||
|
||||
// console.log(value)
|
||||
|
||||
await Job_funCreate(value as any, gambar).then((res) => {
|
||||
if (res.status === 201) {
|
||||
setHotMenu(2);
|
||||
setStatus("Review");
|
||||
router.replace(RouterJob.status);
|
||||
ComponentGlobal_NotifikasiBerhasil("Tambah Lowongan Berhasil");
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<Group grow mt={"lg"} mb={70}>
|
||||
<Button
|
||||
w={"100%"}
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onAction();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
19
src/app_modules/job/detail/arsip/layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentJob_HeaderTamplate from "../../component/header_tamplate";
|
||||
|
||||
export default function LayoutJob_DetailArsip({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<ComponentJob_HeaderTamplate title="Detail Arsip" />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
56
src/app_modules/job/detail/arsip/view.tsx
Normal file
@@ -0,0 +1,56 @@
|
||||
"use client";
|
||||
|
||||
import { Button, Stack } from "@mantine/core";
|
||||
import ComponentJob_DetailData from "../../component/detail/detail_data";
|
||||
import { MODEL_JOB } from "../../model/interface";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
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 { useAtom } from "jotai";
|
||||
import { Job_funEditArsipById } from "../../fun/edit/fun_edit_arsip_by_id";
|
||||
import { gs_job_status, gs_job_hot_menu } from "../../global_state";
|
||||
|
||||
export default function Job_DetailArsip({ dataJob }: { dataJob: MODEL_JOB }) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentJob_DetailData data={dataJob} />
|
||||
<ButtonAction jobId={dataJob.id} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({ jobId }: { jobId: string }) {
|
||||
const router = useRouter();
|
||||
const [status, setStatus] = useAtom(gs_job_status);
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_job_hot_menu);
|
||||
|
||||
async function onAction() {
|
||||
await Job_funEditArsipById(jobId, false).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setStatus("Publish");
|
||||
setHotMenu(1);
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Diarsipkan");
|
||||
router.replace(RouterJob.beranda);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="green"
|
||||
mb={30}
|
||||
onClick={() => {
|
||||
onAction();
|
||||
}}
|
||||
>
|
||||
Publish Lagi
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
31
src/app_modules/job/detail/draft/layout.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentJob_HeaderTamplate from "../../component/header_tamplate";
|
||||
import { IconEdit } from "@tabler/icons-react";
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
|
||||
export default function LayoutJob_DetailDraft({
|
||||
children,
|
||||
jobId,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
jobId: string
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
header={
|
||||
<ComponentJob_HeaderTamplate
|
||||
title="Detail Draft"
|
||||
icon={<IconEdit />}
|
||||
route2={RouterJob.edit + jobId}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
114
src/app_modules/job/detail/draft/view.tsx
Normal file
@@ -0,0 +1,114 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { Stack, Button, Group, Modal, Paper, Title } from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
|
||||
import ComponentJob_DetailData from "../../component/detail/detail_data";
|
||||
import { gs_job_status } from "../../global_state";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { Job_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_status_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { Job_funDeleteById } from "../../fun/delete/fun_delete_by_id";
|
||||
import ComponentJob_NotedBox from "../../component/detail/noted_box";
|
||||
import { MODEL_JOB } from "../../model/interface";
|
||||
|
||||
export default function Job_DetailDraft({ dataJob }: { dataJob: MODEL_JOB }) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{dataJob.catatan ? (
|
||||
<ComponentJob_NotedBox informasi={dataJob.catatan} />
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
<ComponentJob_DetailData data={dataJob} />
|
||||
<ButtonAction jobId={dataJob.id} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({ jobId }: { jobId: string }) {
|
||||
const router = useRouter();
|
||||
const [status, setStatus] = useAtom(gs_job_status);
|
||||
const [opened, { open, close }] = useDisclosure();
|
||||
|
||||
async function onAction() {
|
||||
await Job_funEditStatusByStatusId(jobId, "2").then((res) => {
|
||||
if (res.status === 200) {
|
||||
setStatus("Review");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Diajukan");
|
||||
router.push(RouterJob.status);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function onDelete() {
|
||||
await Job_funDeleteById(jobId).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setStatus("Draft");
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.push(RouterJob.status);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={close} centered withCloseButton={false}>
|
||||
<Paper px={"lg"}>
|
||||
<Stack>
|
||||
<Title order={6}>Yakin ingin menghapus ini ?</Title>
|
||||
<Group grow>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
close();
|
||||
}}
|
||||
>
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="red"
|
||||
onClick={() => {
|
||||
onDelete();
|
||||
}}
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Modal>
|
||||
|
||||
<Group grow mb={50}>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="yellow"
|
||||
onClick={() => {
|
||||
onAction();
|
||||
}}
|
||||
>
|
||||
Ajukan Review
|
||||
</Button>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="red"
|
||||
onClick={() => {
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
</Group>
|
||||
</>
|
||||
);
|
||||
}
|
||||
19
src/app_modules/job/detail/main/layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentJob_HeaderTamplate from "../../component/header_tamplate";
|
||||
|
||||
export default function LayoutJob_MainDetail({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<ComponentJob_HeaderTamplate title=" Detail Job" />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
60
src/app_modules/job/detail/main/view.tsx
Normal file
@@ -0,0 +1,60 @@
|
||||
"use client";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentJob_DetailData from "../../component/detail/detail_data";
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { Stack, Button, Center } from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_job_status, gs_job_hot_menu } from "../../global_state";
|
||||
import Link from "next/link";
|
||||
import { IconBrandWhatsapp } from "@tabler/icons-react";
|
||||
import { MODEL_JOB } from "../../model/interface";
|
||||
|
||||
export default function Job_MainDetail({ dataJob }: { dataJob: MODEL_JOB }) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentJob_DetailData data={dataJob} />
|
||||
<ButtonAction jobId={dataJob.id} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({ jobId }: { jobId: string }) {
|
||||
const router = useRouter();
|
||||
|
||||
async function onAction() {
|
||||
// router.push(RouterJob.arsip);
|
||||
// setStatus("Publish");
|
||||
// setHotMenu(3);
|
||||
// ComponentGlobal_NotifikasiBerhasil("Berhasil Diarsipkan");
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Center>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="teal"
|
||||
mb={30}
|
||||
leftIcon={<IconBrandWhatsapp />}
|
||||
// onClick={() => {
|
||||
// onAction();
|
||||
// }}
|
||||
>
|
||||
<Link
|
||||
style={{ textDecoration: "none", color: "white" }}
|
||||
href={`whatsapp://send?text=Job Vacancy HIPMI BADUNG : http://localhost:3000${
|
||||
RouterJob.non_user_view + jobId
|
||||
}`}
|
||||
// href={`https://t.me/share/url?url={${"http://localhost:3000/dev/job/non_user_view"}}&text={Lowongan Kerja Ini}`}
|
||||
>
|
||||
Bagikan ke WhatsApp
|
||||
</Link>
|
||||
</Button>
|
||||
</Center>
|
||||
</>
|
||||
);
|
||||
}
|
||||
19
src/app_modules/job/detail/publish/layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentJob_HeaderTamplate from "../../component/header_tamplate";
|
||||
|
||||
export default function LayoutJob_DetailPublish({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<ComponentJob_HeaderTamplate title="Detail Publish" />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
57
src/app_modules/job/detail/publish/view.tsx
Normal file
@@ -0,0 +1,57 @@
|
||||
"use client";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentJob_DetailData from "../../component/detail/detail_data";
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { Stack, Button } from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_job_hot_menu, gs_job_status } from "../../global_state";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
import { Job_funEditArsipById } from "../../fun/edit/fun_edit_arsip_by_id";
|
||||
import { MODEL_JOB } from "../../model/interface";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
|
||||
export default function Job_DetailPublish({ dataJob }: { dataJob: MODEL_JOB }) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentJob_DetailData data={dataJob as any} />
|
||||
<ButtonAction jobId={dataJob.id} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({ jobId }: { jobId: string }) {
|
||||
const router = useRouter();
|
||||
const [status, setStatus] = useAtom(gs_job_status);
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_job_hot_menu);
|
||||
|
||||
async function onAction() {
|
||||
await Job_funEditArsipById(jobId, true).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setStatus("Publish");
|
||||
setHotMenu(3);
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Diarsipkan");
|
||||
router.replace(RouterJob.arsip);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="green"
|
||||
mb={30}
|
||||
onClick={() => {
|
||||
onAction();
|
||||
}}
|
||||
>
|
||||
Arsipkan
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
19
src/app_modules/job/detail/reject/layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentJob_HeaderTamplate from "../../component/header_tamplate";
|
||||
|
||||
export default function LayoutJob_DetailReject({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<ComponentJob_HeaderTamplate title="Detail Reject" />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
110
src/app_modules/job/detail/reject/view.tsx
Normal file
@@ -0,0 +1,110 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { Stack, Button, Group, Modal, Paper, Title } from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
|
||||
import ComponentJob_DetailData from "../../component/detail/detail_data";
|
||||
import { gs_job_status } from "../../global_state";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import ComponentJob_NotedBox from "../../component/detail/noted_box";
|
||||
import { MODEL_JOB } from "../../model/interface";
|
||||
import { Job_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_status_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { Job_funDeleteById } from "../../fun/delete/fun_delete_by_id";
|
||||
|
||||
export default function Job_DetailReject({ dataJob }: { dataJob: MODEL_JOB }) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentJob_NotedBox informasi={dataJob.catatan} />
|
||||
<ComponentJob_DetailData data={dataJob} />
|
||||
<ButtonAction jobId={dataJob.id} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({ jobId }: { jobId: string }) {
|
||||
const router = useRouter();
|
||||
const [status, setStatus] = useAtom(gs_job_status);
|
||||
const [opened, { open, close }] = useDisclosure();
|
||||
|
||||
async function onAction() {
|
||||
await Job_funEditStatusByStatusId(jobId, "3").then((res) => {
|
||||
if (res.status === 200) {
|
||||
router.push(RouterJob.status);
|
||||
setStatus("Draft");
|
||||
ComponentGlobal_NotifikasiBerhasil("Masuk Draft");
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function onDelete() {
|
||||
await Job_funDeleteById(jobId).then((res) => {
|
||||
if (res.status === 200) {
|
||||
router.push(RouterJob.status);
|
||||
setStatus("Reject");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Job");
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={close} centered withCloseButton={false}>
|
||||
<Paper px={"lg"}>
|
||||
<Stack>
|
||||
<Title order={6}>Yakin ingin menghapus ini ?</Title>
|
||||
<Group grow>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
close();
|
||||
}}
|
||||
>
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="red"
|
||||
onClick={() => {
|
||||
onDelete();
|
||||
}}
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Modal>
|
||||
|
||||
<Group grow mb={50}>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="orange"
|
||||
onClick={() => {
|
||||
onAction();
|
||||
}}
|
||||
>
|
||||
Edit Kembali
|
||||
</Button>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="red"
|
||||
onClick={() => {
|
||||
open();
|
||||
}}
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
</Group>
|
||||
</>
|
||||
);
|
||||
}
|
||||
19
src/app_modules/job/detail/review/layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentJob_HeaderTamplate from "../../component/header_tamplate";
|
||||
|
||||
export default function LayoutJob_DetailReview({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<ComponentJob_HeaderTamplate title="Detail Review" />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
55
src/app_modules/job/detail/review/view.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
"use client";
|
||||
|
||||
import { Button, Card, Image, Skeleton, Stack, Text } from "@mantine/core";
|
||||
import ComponentJob_DetailData from "../../component/detail/detail_data";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_job_status } from "../../global_state";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { MODEL_JOB } from "../../model/interface";
|
||||
import { Job_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_status_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
|
||||
|
||||
export default function Job_DetailReview({ dataJob }: { dataJob: MODEL_JOB }) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentJob_DetailData data={dataJob} />
|
||||
<ButtonAction jobId={dataJob.id} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({ jobId }: { jobId: string }) {
|
||||
const router = useRouter();
|
||||
const [status, setStatus] = useAtom(gs_job_status);
|
||||
|
||||
async function onAction() {
|
||||
await Job_funEditStatusByStatusId(jobId, "3").then((res) => {
|
||||
if (res.status === 200) {
|
||||
setStatus("Draft");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Dibatalkan");
|
||||
router.push(RouterJob.status);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="red"
|
||||
mb={50}
|
||||
onClick={() => {
|
||||
onAction();
|
||||
}}
|
||||
>
|
||||
Batalkan Review
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
19
src/app_modules/job/edit/layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentJob_HeaderTamplate from "../component/header_tamplate";
|
||||
|
||||
export default function LayoutJob_Edit({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<ComponentJob_HeaderTamplate title="Edit Job" />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
329
src/app_modules/job/edit/view.tsx
Normal file
@@ -0,0 +1,329 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
FileButton,
|
||||
Group,
|
||||
Image,
|
||||
Loader,
|
||||
Modal,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
Textarea,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { IconCamera, IconUpload, IconXboxX } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { gs_job_hot_menu, gs_job_status } from "../global_state";
|
||||
import { MODEL_JOB } from "../model/interface";
|
||||
import {
|
||||
useDisclosure,
|
||||
useShallowEffect,
|
||||
useWindowScroll,
|
||||
} from "@mantine/hooks";
|
||||
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
import { Job_EditById } from "../fun/edit/fun_edit_by_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import dynamic from "next/dynamic";
|
||||
const ReactQuill = dynamic(
|
||||
() => {
|
||||
return import("react-quill");
|
||||
},
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
export default function Job_Edit({ dataJob }: { dataJob: MODEL_JOB }) {
|
||||
const [value, setValue] = useState(dataJob);
|
||||
|
||||
const [reload, setReload] = useState(false);
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [images, setImages] = useState<any | null>();
|
||||
const [maxFile, setMaxFile] = useState(false);
|
||||
|
||||
useShallowEffect(() => {
|
||||
if (window && window.document) setReload(true);
|
||||
}, []);
|
||||
|
||||
if (!reload)
|
||||
return (
|
||||
<>
|
||||
<Center h={"50vh"}>
|
||||
<Loader />
|
||||
</Center>
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{!reload ? (
|
||||
<Center h={"50vh"}>
|
||||
<Loader />
|
||||
</Center>
|
||||
) : (
|
||||
<Stack px={"sm"} spacing={40}>
|
||||
<Stack align="center">
|
||||
{images ? (
|
||||
<Image alt="" src={images} mah={500} maw={200} />
|
||||
) : value.imagesId ? (
|
||||
<Image
|
||||
height={300}
|
||||
width={200}
|
||||
alt="Foto"
|
||||
src={RouterJob.api_gambar + value.imagesId}
|
||||
/>
|
||||
) : (
|
||||
<Paper h={300} w={200} withBorder shadow="lg" bg={"gray.1"}>
|
||||
<Stack justify="center" align="center" h={"100%"}>
|
||||
<IconUpload color="gray" />
|
||||
<Text fz={10} fs={"italic"} c={"gray"} fw={"bold"}>
|
||||
Upload Gambar
|
||||
</Text>
|
||||
</Stack>
|
||||
</Paper>
|
||||
)
|
||||
|
||||
// <Box>
|
||||
// {value.imagesId ? (
|
||||
// <Image
|
||||
// height={300}
|
||||
// width={200}
|
||||
// alt="Foto"
|
||||
// src={RouterJob.api_gambar + value.imagesId}
|
||||
// />
|
||||
// ) : (
|
||||
// <Box>
|
||||
// {maxFile ? (
|
||||
// <Paper
|
||||
// h={300}
|
||||
// w={200}
|
||||
// withBorder
|
||||
// shadow="lg"
|
||||
// bg={"gray.1"}
|
||||
// >
|
||||
// <Stack justify="center" align="center" h={"100%"}>
|
||||
// <IconXboxX color="#ed5858" size={50} />
|
||||
// <Text
|
||||
// fz={10}
|
||||
// fs={"italic"}
|
||||
// c={"red.5"}
|
||||
// w={150}
|
||||
// fw={"bold"}
|
||||
// >
|
||||
// Maaf, Ukuran file terlalu besar, maximum 10mb
|
||||
// </Text>
|
||||
// </Stack>
|
||||
// </Paper>
|
||||
// ) : (
|
||||
// <Box>
|
||||
// {images ? (
|
||||
// <Image alt="" src={images} mah={300} maw={200} />
|
||||
// ) : (
|
||||
// <Paper
|
||||
// h={300}
|
||||
// w={200}
|
||||
// withBorder
|
||||
// shadow="lg"
|
||||
// bg={"gray.1"}
|
||||
// >
|
||||
// <Stack justify="center" align="center" h={"100%"}>
|
||||
// <IconUpload color="gray" />
|
||||
// <Text
|
||||
// fz={10}
|
||||
// fs={"italic"}
|
||||
// c={"gray"}
|
||||
// fw={"bold"}
|
||||
// >
|
||||
// Upload Gambar
|
||||
// </Text>
|
||||
// </Stack>
|
||||
// </Paper>
|
||||
// )}
|
||||
// </Box>
|
||||
// )}
|
||||
// </Box>
|
||||
// )}
|
||||
// </Box>
|
||||
}
|
||||
|
||||
<FileButton
|
||||
onChange={async (files: any | null) => {
|
||||
try {
|
||||
const buffer = URL.createObjectURL(
|
||||
new Blob([new Uint8Array(await files.arrayBuffer())])
|
||||
);
|
||||
|
||||
if (files.size > 20000) {
|
||||
// setMaxFile(true);
|
||||
ComponentGlobal_NotifikasiPeringatan(
|
||||
"File tidak lebih dari 20Mb",
|
||||
3000
|
||||
);
|
||||
} else {
|
||||
// console.log(buffer, "ini buffer");
|
||||
// console.log(files, " ini file");
|
||||
// setMaxFile(false);
|
||||
setImages(buffer);
|
||||
setFile(files);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}}
|
||||
accept="image/png,image/jpeg"
|
||||
>
|
||||
{(props) => (
|
||||
<Button
|
||||
compact
|
||||
{...props}
|
||||
radius={"xl"}
|
||||
variant="outline"
|
||||
w={150}
|
||||
>
|
||||
<IconCamera />
|
||||
</Button>
|
||||
)}
|
||||
</FileButton>
|
||||
</Stack>
|
||||
|
||||
<Stack spacing={"lg"}>
|
||||
<TextInput
|
||||
withAsterisk
|
||||
label="Judul"
|
||||
placeholder="Masukan judul lowongan kerja"
|
||||
value={value.title}
|
||||
onChange={(val) => {
|
||||
setValue({
|
||||
...value,
|
||||
title: val.currentTarget.value,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack spacing={3}>
|
||||
<Text fz={"sm"}>
|
||||
Syarat & Ketentuan
|
||||
<Text inherit span c={"red"}>
|
||||
{" "}
|
||||
*
|
||||
</Text>
|
||||
</Text>
|
||||
<ReactQuill
|
||||
modules={{
|
||||
toolbar: [
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }],
|
||||
["bold", "italic", "underline", "link"],
|
||||
// [{ align: [] }],
|
||||
[{ list: "ordered" }, { list: "bullet" }],
|
||||
["clean"],
|
||||
],
|
||||
}}
|
||||
theme="snow"
|
||||
value={value.content}
|
||||
onChange={(val) => {
|
||||
setValue({
|
||||
...value,
|
||||
content: val,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack spacing={3}>
|
||||
<Text fz={"sm"}>
|
||||
Deskripsi
|
||||
<Text inherit span c={"red"}>
|
||||
{" "}
|
||||
*
|
||||
</Text>
|
||||
</Text>
|
||||
<ReactQuill
|
||||
modules={{
|
||||
toolbar: [
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }],
|
||||
["bold", "italic", "underline", "link"],
|
||||
// [{ align: [] }],
|
||||
[{ list: "ordered" }, { list: "bullet" }],
|
||||
["clean"],
|
||||
],
|
||||
}}
|
||||
theme="snow"
|
||||
value={value.deskripsi}
|
||||
onChange={(val) => {
|
||||
setValue({
|
||||
...value,
|
||||
deskripsi: val,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<ButtonAction value={value as any} file={file as any} />
|
||||
</Stack>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({ value, file }: { value: MODEL_JOB; file: FormData }) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_job_hot_menu);
|
||||
const [status, setStatus] = useAtom(gs_job_status);
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [scroll, scrollTo] = useWindowScroll();
|
||||
|
||||
async function onUpdate() {
|
||||
const gambar = new FormData();
|
||||
gambar.append("file", file as any);
|
||||
|
||||
await Job_EditById(value, gambar).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setHotMenu(2);
|
||||
setStatus("Draft");
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.back();
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={close} centered withCloseButton={false}>
|
||||
<Stack>
|
||||
<Title order={6}>Anda yakin menyimpan data ini ?</Title>
|
||||
<Group position="center">
|
||||
<Button radius={"xl"} onClick={() => close()}>
|
||||
Batal
|
||||
</Button>
|
||||
<Button color="teal" radius={"xl"} onClick={() => onUpdate()}>
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
<Button
|
||||
color="teal"
|
||||
radius={"xl"}
|
||||
mt={"lg"}
|
||||
mb={70}
|
||||
onClick={() => {
|
||||
open();
|
||||
scrollTo({ y: 0 });
|
||||
}}
|
||||
>
|
||||
Update
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
67
src/app_modules/job/fun/create/fun_create.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import _ from "lodash";
|
||||
import { v4 } from "uuid";
|
||||
import fs from "fs";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { MODEL_JOB } from "../../model/interface";
|
||||
|
||||
export async function Job_funCreate(req: MODEL_JOB, file: FormData) {
|
||||
const authorId = await User_getUserId();
|
||||
|
||||
const dataImage: any = file.get("file");
|
||||
if (dataImage !== "null") {
|
||||
const fileName = dataImage.name;
|
||||
const fileExtension = _.lowerCase(dataImage.name.split(".").pop());
|
||||
const fRandomName = v4(fileName) + "." + fileExtension;
|
||||
|
||||
const upload = await prisma.images.create({
|
||||
data: {
|
||||
url: fRandomName,
|
||||
label: "JOB",
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
url: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!upload) return { status: 400, message: "Gagal upload gambar" };
|
||||
const uploadFolder = Buffer.from(await dataImage.arrayBuffer());
|
||||
fs.writeFileSync(`./public/job/${upload.url}`, uploadFolder);
|
||||
const create = await prisma.job.create({
|
||||
data: {
|
||||
title: req.title,
|
||||
content: req.content,
|
||||
deskripsi: req.deskripsi,
|
||||
authorId: authorId,
|
||||
imagesId: upload.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (!create) return { status: 400, message: "Gagal Disimpan" };
|
||||
revalidatePath("/dev/job/main/status");
|
||||
return {
|
||||
status: 201,
|
||||
message: "Berhasil Disimpan",
|
||||
};
|
||||
} else {
|
||||
const create = await prisma.job.create({
|
||||
data: {
|
||||
title: req.title,
|
||||
content: req.content,
|
||||
deskripsi: req.deskripsi,
|
||||
authorId: authorId,
|
||||
},
|
||||
});
|
||||
|
||||
if (!create) return { status: 400, message: "Gagal Disimpan" };
|
||||
revalidatePath("/dev/job/main/status");
|
||||
return {
|
||||
status: 201,
|
||||
message: "Berhasil Disimpan",
|
||||
};
|
||||
}
|
||||
}
|
||||
19
src/app_modules/job/fun/delete/fun_delete_by_id.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Job_funDeleteById(jobId: string) {
|
||||
const del = await prisma.job.update({
|
||||
where: {
|
||||
id: jobId,
|
||||
},
|
||||
data: {
|
||||
isActive: false,
|
||||
},
|
||||
});
|
||||
|
||||
if (!del) return { status: 400, message: "Gagal hapus" };
|
||||
revalidatePath("/dev/job/main/status");
|
||||
return { status: 200, message: "Berhasil hapus" };
|
||||
}
|
||||
21
src/app_modules/job/fun/edit/fun_edit_arsip_by_id.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Job_funEditArsipById(jobId: string, aktifasi: boolean) {
|
||||
const updt = await prisma.job.update({
|
||||
where: {
|
||||
id: jobId,
|
||||
},
|
||||
data: {
|
||||
isArsip: aktifasi,
|
||||
},
|
||||
});
|
||||
if (!updt) return { status: 400, message: "Gagal Arsip" };
|
||||
|
||||
revalidatePath("/dev/job/main/arsip");
|
||||
revalidatePath("/dev/job/main/status");
|
||||
revalidatePath("/dev/job/main/beranda");
|
||||
return { status: 200, message: "Berhasil Arsip" };
|
||||
}
|
||||
73
src/app_modules/job/fun/edit/fun_edit_by_id.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import _ from "lodash";
|
||||
import { v4 } from "uuid";
|
||||
import fs from "fs";
|
||||
import { MODEL_JOB } from "../../model/interface";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Job_EditById(req: MODEL_JOB, file: FormData) {
|
||||
// console.log(file);
|
||||
// console.log(req);
|
||||
// return { status: 200 };
|
||||
|
||||
const dataImage: any = file.get("file");
|
||||
if (dataImage !== "null") {
|
||||
const fileName = dataImage.name;
|
||||
const fileExtension = _.lowerCase(dataImage.name.split(".").pop());
|
||||
const fRandomName = v4(fileName) + "." + fileExtension;
|
||||
|
||||
const upload = await prisma.images.create({
|
||||
data: {
|
||||
url: fRandomName,
|
||||
label: "JOB",
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
url: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!upload) return { status: 400, message: "Gagal upload gambar" };
|
||||
const uploadFolder = Buffer.from(await dataImage.arrayBuffer());
|
||||
fs.writeFileSync(`./public/job/${upload.url}`, uploadFolder);
|
||||
|
||||
const updt = await prisma.job.update({
|
||||
where: {
|
||||
id: req.id,
|
||||
},
|
||||
data: {
|
||||
title: req.title,
|
||||
content: req.content,
|
||||
deskripsi: req.deskripsi,
|
||||
imagesId: upload.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updt) return { status: 400, message: "Gagal Update" };
|
||||
revalidatePath("/dev/job/detail/draft");
|
||||
return {
|
||||
status: 200,
|
||||
message: "Berhasil Disimpan",
|
||||
};
|
||||
} else {
|
||||
const updt = await prisma.job.update({
|
||||
where: {
|
||||
id: req.id,
|
||||
},
|
||||
data: {
|
||||
title: req.title,
|
||||
content: req.content,
|
||||
deskripsi: req.deskripsi,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updt) return { status: 400, message: "Gagal Update" };
|
||||
revalidatePath("/dev/job/detail/draft");
|
||||
return {
|
||||
status: 200,
|
||||
message: "Berhasil Disimpan",
|
||||
};
|
||||
}
|
||||
}
|
||||
22
src/app_modules/job/fun/edit/fun_edit_status_by_status_id.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Job_funEditStatusByStatusId(
|
||||
jobId: string,
|
||||
statusId: string
|
||||
) {
|
||||
const updt = await prisma.job.update({
|
||||
where: {
|
||||
id: jobId,
|
||||
},
|
||||
data: {
|
||||
masterStatusId: statusId,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updt) return { status: 400, message: "Gagal ganti status" };
|
||||
revalidatePath("/dev/job/main/status");
|
||||
return { status: 200, message: "Berhasil ganti status" };
|
||||
}
|
||||