# fix
- Create dan edit
- Bagikam WA
- Loading
## No isssue
This commit is contained in:
2024-05-22 14:08:17 +08:00
parent ce35aa8f51
commit 68e0a9a237
20 changed files with 2967 additions and 227 deletions

210
gen_api.ts Normal file
View File

@@ -0,0 +1,210 @@
import app_config from "@/util/app_config";
export const gen_api = {
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/test-scroll/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/test-scroll/route.ts)
*/
testScroll : async ({isServer}: {isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/test-scroll/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/seeder/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/seeder/route.ts)
*/
seeder : async ({isServer}: {isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/seeder/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/url_foto/[url]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/url_foto/[url]/route.ts)
*/
profileUrl_fotoUrlByUrl : async ({url, isServer}: {url: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/profile/url_foto/${url}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/url_background/[url]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/url_background/[url]/route.ts)
*/
profileUrl_backgroundUrlByUrl : async ({url, isServer}: {url: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/profile/url_background/${url}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/foto/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/foto/[id]/route.ts)
*/
profileFotoIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/profile/foto/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/background/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/background/[id]/route.ts)
*/
profileBackgroundIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/profile/background/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/portofolio/logo/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/portofolio/logo/[id]/route.ts)
*/
portofolioLogoIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/portofolio/logo/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/job/gambar/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/job/gambar/[id]/route.ts)
*/
jobGambarIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/job/gambar/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/prospektus/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/prospektus/[id]/route.ts)
*/
investasiProspektusIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/investasi/prospektus/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/midtrans/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/midtrans/[id]/route.ts)
*/
investasiMidtransIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/investasi/midtrans/${id}/`, { method: 'POST', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/gambar/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/gambar/[id]/route.ts)
*/
investasiGambarIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/investasi/gambar/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/dokumen/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/dokumen/[id]/route.ts)
*/
investasiDokumenIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/investasi/dokumen/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/image_cerita/[url]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/image_cerita/[url]/route.ts)
*/
donasiImage_ceritaUrlByUrl : async ({url, isServer}: {url: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/image_cerita/${url}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/image/[url]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/image/[url]/route.ts)
*/
donasiImageUrlByUrl : async ({url, isServer}: {url: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/image/${url}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_pencairan/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_pencairan/[id]/route.ts)
*/
donasiGambar_pencairanIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_pencairan/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_kabar/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_kabar/[id]/route.ts)
*/
donasiGambar_kabarIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_kabar/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_cerita/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_cerita/[id]/route.ts)
*/
donasiGambar_ceritaIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_cerita/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_bukti_transfer/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_bukti_transfer/[id]/route.ts)
*/
donasiGambar_bukti_transferIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_bukti_transfer/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar/[id]/route.ts)
*/
donasiGambarIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar/${id}/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/validasi/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/validasi/route.ts)
*/
authValidasi : async ({isServer}: {isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/auth/validasi/`, { method: 'POST', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/register/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/register/route.ts)
*/
authRegister : async ({isServer}: {isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/auth/register/`, { method: 'POST', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/logout/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/logout/route.ts)
*/
authLogout : async ({isServer}: {isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/auth/logout/`, { method: 'GET', cache: 'no-cache' })
.then(res => res.json());
}
,
/**
* [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/login/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/login/route.ts)
*/
authLogin : async ({isServer}: {isServer?: boolean}) => {
return fetch(`${isServer && app_config.host || ''}/api/auth/login/`, { method: 'POST', cache: 'no-cache' })
.then(res => res.json());
}
};

2431
gen_page.tsx Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,7 @@
"@tiptap/pm": "^2.2.3",
"@tiptap/react": "^2.2.3",
"@tiptap/starter-kit": "^2.2.3",
"@types/lodash": "^4.14.199",
"@types/lodash": "^4.17.4",
"@types/node": "20.4.5",
"@types/react": "18.2.17",
"@types/react-dom": "18.2.7",

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -1,6 +1,8 @@
import { Admin_Award } from "@/app_modules/admin/award";
import { gen_api } from "../../../../../../gen_api";
export default async function Page() {
return (
<>
<Admin_Award />

View File

@@ -1,13 +1,15 @@
"use server";
import { Job_MainDetail } from "@/app_modules/job";
import { Job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
import app_config from "@/util/app_config";
export default async function Page({ params }: { params: { id: string } }) {
const jobId = params.id;
const dataJob = await Job_getOneById(jobId)
const idJob = params.id;
const dataJob = await Job_getOneById(idJob);
return (
<>
<Job_MainDetail dataJob={dataJob as any} />
<Job_MainDetail dataJob={dataJob as any} hostName={app_config.host} />
</>
);
}

View File

@@ -1,10 +1,16 @@
"use server";
import { Job_NonUserView } from "@/app_modules/job";
import { Job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
import os from "os";
export default async function Page({ params }: { params: { id: string } }) {
let jobId = params.id;
const dataJob = await Job_getOneById(jobId);
// const platform = os.platform();
// const hostName =
// platform === "darwin"
// ? "http://localhost:3000"
// : "https://test-hipmi.wibudev.com";
return (
<>
<Job_NonUserView data={dataJob as any} />

View File

@@ -1,10 +1,21 @@
"use client";
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
import { Stack, Grid, Avatar, Divider, Text, Group } from "@mantine/core";
import {
Stack,
Grid,
Avatar,
Divider,
Text,
Group,
Loader,
Overlay,
Center,
} from "@mantine/core";
import { useRouter } from "next/navigation";
import { ComponentGlobal_NotifikasiPeringatan } from "./notif_global/notifikasi_peringatan";
import moment from "moment";
import { useState } from "react";
export default function ComponentGlobal_AuthorNameOnHeader({
profileId,
@@ -21,6 +32,8 @@ export default function ComponentGlobal_AuthorNameOnHeader({
}) {
const router = useRouter();
const skrng = new Date();
const [visible, setVisible] = useState(false);
return (
<>
<Stack spacing={"xs"}>
@@ -29,23 +42,39 @@ export default function ComponentGlobal_AuthorNameOnHeader({
span={"content"}
onClick={() => {
if (profileId) {
setVisible(true);
router.push(RouterProfile.katalog + profileId);
} else {
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
}
}}
>
<Avatar
size={30}
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
radius={"xl"}
bg={"gray.1"}
src={
imagesId
? RouterProfile.api_foto_profile + imagesId
: "/aset/global/avatar.png"
}
/>
{visible ? (
<Avatar
size={30}
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
radius={"xl"}
bg={"gray.1"}
>
<Overlay opacity={0.1}>
<Center h={"100%"}>
<Loader color="gray" size={20} />
</Center>
</Overlay>
</Avatar>
) : (
<Avatar
size={30}
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
radius={"xl"}
bg={"gray.1"}
src={
imagesId
? RouterProfile.api_foto_profile + imagesId
: "/aset/global/avatar.png"
}
/>
)}
</Grid.Col>
<Grid.Col span={"auto"}>
<Stack justify="center" h={"100%"}>

View File

@@ -0,0 +1,24 @@
export let defaultSyarat = `
<p><strong>Syarat &amp; Ketentuan :</strong></p>
<p><i>* Tuliskan sesuai kebutuhan</i></p>
`;
export let defaultDeskripsi = `
<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>
`;

View File

@@ -23,6 +23,8 @@ export default function ComponentJob_HeaderTamplate({
bg?: any;
}) {
const router = useRouter();
const [isLoading, setLoading] = useState(false);
const [isRightLoading, setRightLoading] = useState(false);
return (
<>
<Header
@@ -35,8 +37,10 @@ export default function ComponentJob_HeaderTamplate({
<ActionIcon variant="transparent" disabled></ActionIcon>
) : (
<ActionIcon
loading={isLoading ? true : false}
variant="transparent"
onClick={() => {
setLoading(true);
if (route === null || route === undefined) {
return router.back();
} else {
@@ -54,8 +58,12 @@ export default function ComponentJob_HeaderTamplate({
} else {
return (
<ActionIcon
loading={isRightLoading ? true : false}
variant="transparent"
onClick={() => router.push(route2)}
onClick={() => {
setRightLoading(true);
router.push(route2);
}}
>
{icon}
</ActionIcon>

View File

@@ -5,7 +5,7 @@ import { Center } from "@mantine/core";
export default function ComponentJob_IsEmptyData({ text }: { text: string }) {
return (
<>
<Center h={"50vh"} fz={"sm"} fw={"bold"}>
<Center h={"50vh"} fz={"sm"} fw={"bold"} c={"gray"}>
{text}
</Center>
</>

View File

@@ -21,12 +21,19 @@ import { IconCamera, IconUpload } from "@tabler/icons-react";
import { useAtom } from "jotai";
import _ from "lodash";
import { useRouter } from "next/navigation";
import { useState } from "react";
import React, { 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";
const ReactQuill = dynamic(
() => {
return import("react-quill");
},
{ ssr: false }
);
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";
@@ -34,12 +41,9 @@ import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/
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 }
);
import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
import { defaultDeskripsi, defaultSyarat } from "../component/default_value";
import ComponentGlobal_InputCountDown from "@/app_modules/component_global/input_countdown";
export default function Job_Create() {
const [value, setValue] = useState({
@@ -59,7 +63,7 @@ export default function Job_Create() {
return (
<>
<Center h={"50vh"}>
<Loader />
<ComponentGlobal_V2_LoadingPage />
</Center>
</>
);
@@ -92,9 +96,9 @@ export default function Job_Create() {
const buffer = URL.createObjectURL(
new Blob([new Uint8Array(await files.arrayBuffer())])
);
if (files.size > 20000) {
if (files.size > 200000) {
ComponentGlobal_NotifikasiPeringatan(
"Maaf, Ukuran file terlalu besar, maximum 20Mb",
"Maaf, Ukuran file terlalu besar, maksimal 2mb",
3000
);
} else {
@@ -128,6 +132,7 @@ export default function Job_Create() {
withAsterisk
label="Judul"
placeholder="Masukan judul lowongan kerja"
maxLength={100}
onChange={(val) => {
setValue({
...value,
@@ -144,33 +149,32 @@ export default function Job_Create() {
*
</Text>
</Text>
<ReactQuill
defaultValue={`
<p><strong>Syarat &amp; 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 spacing={5}>
<ReactQuill
defaultValue={defaultSyarat}
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,
});
}}
/>
<ComponentGlobal_InputCountDown
maxInput={500}
lengthInput={value.content.length}
/>
</Stack>
</Stack>
<Stack spacing={3}>
<Text fz={"sm"}>
@@ -180,43 +184,31 @@ export default function Job_Create() {
*
</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 spacing={5}>
<ReactQuill
defaultValue={defaultDeskripsi}
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,
});
}}
/>
<ComponentGlobal_InputCountDown
maxInput={500}
lengthInput={value.deskripsi.length}
/>
</Stack>
</Stack>
</Stack>
@@ -229,6 +221,8 @@ export default function Job_Create() {
function ButtonAction({ value, file }: { value: MODEL_JOB; file: FormData }) {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
const [hotMenu, setHotMenu] = useAtom(gs_job_hot_menu);
const [status, setStatus] = useAtom(gs_job_status);
const [preview, setPreview] = useToggle();
@@ -237,13 +231,14 @@ function ButtonAction({ value, file }: { value: MODEL_JOB; file: FormData }) {
const gambar = new FormData();
gambar.append("file", file as any);
// console.log(value)
// console.log(value);
await Job_funCreate(value as any, gambar).then((res) => {
if (res.status === 201) {
setHotMenu(2);
setStatus("Review");
router.replace(RouterJob.status);
setIsLoading(true);
ComponentGlobal_NotifikasiBerhasil("Tambah Lowongan Berhasil");
} else {
ComponentGlobal_NotifikasiGagal(res.message);
@@ -256,6 +251,22 @@ function ButtonAction({ value, file }: { value: MODEL_JOB; file: FormData }) {
<Stack>
<Group grow mt={"lg"} mb={70}>
<Button
style={{
transition: "0.5s",
}}
loaderPosition="center"
loading={isLoading ? true : false}
disabled={
value.title === "" ||
value.content === "" ||
value.content === "<p><br></p>" ||
value.content.length > 500 ||
value.deskripsi === "" ||
value.deskripsi === "<p><br></p>" ||
value.deskripsi.length > 500
? true
: false
}
w={"100%"}
radius={"xl"}
onClick={() => {

View File

@@ -4,34 +4,41 @@ 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 { Stack, Button, Center, Anchor } 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";
import { gen_page } from "../../../../../gen_page";
export default function Job_MainDetail({ dataJob }: { dataJob: MODEL_JOB }) {
export default function Job_MainDetail({
dataJob,
hostName,
}: {
dataJob: MODEL_JOB;
hostName: string;
}) {
return (
<>
<Stack>
{/* <Anchor href={gen_page.devForumMain()}>kesana</Anchor> */}
<ComponentJob_DetailData data={dataJob} />
<ButtonAction jobId={dataJob.id} />
<ButtonAction jobId={dataJob.id} hostName={hostName} />
</Stack>
</>
);
}
function ButtonAction({ jobId }: { jobId: string }) {
function ButtonAction({
jobId,
hostName,
}: {
jobId: string;
hostName: string;
}) {
const router = useRouter();
async function onAction() {
// router.push(RouterJob.arsip);
// setStatus("Publish");
// setHotMenu(3);
// ComponentGlobal_NotifikasiBerhasil("Berhasil Diarsipkan");
}
return (
<>
<Center>
@@ -40,15 +47,10 @@ function ButtonAction({ jobId }: { jobId: string }) {
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={`whatsapp://send?text=Job Vacancy HIPMI BADUNG : ${hostName}/dev/job/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

View File

@@ -11,7 +11,6 @@ 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 (
<>
@@ -42,7 +41,7 @@ function ButtonAction({ jobId }: { jobId: string }) {
<>
<Button
radius={"xl"}
color="red"
color="orange"
mb={50}
onClick={() => {
onAction();

View File

@@ -35,6 +35,7 @@ import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_gl
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";
import ComponentGlobal_InputCountDown from "@/app_modules/component_global/input_countdown";
const ReactQuill = dynamic(
() => {
return import("react-quill");
@@ -90,70 +91,7 @@ export default function Job_Edit({ dataJob }: { dataJob: MODEL_JOB }) {
</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) => {
@@ -162,16 +100,16 @@ export default function Job_Edit({ dataJob }: { dataJob: MODEL_JOB }) {
new Blob([new Uint8Array(await files.arrayBuffer())])
);
if (files.size > 20000) {
if (files.size > 200000) {
// setMaxFile(true);
ComponentGlobal_NotifikasiPeringatan(
"File tidak lebih dari 20Mb",
"Maaf, Ukuran file terlalu besar, maksimal 2mb",
3000
);
} else {
// console.log(buffer, "ini buffer");
// console.log(files, " ini file");
// setMaxFile(false);
setImages(buffer);
setFile(files);
}
@@ -201,6 +139,7 @@ export default function Job_Edit({ dataJob }: { dataJob: MODEL_JOB }) {
label="Judul"
placeholder="Masukan judul lowongan kerja"
value={value.title}
maxLength={100}
onChange={(val) => {
setValue({
...value,
@@ -217,25 +156,31 @@ export default function Job_Edit({ dataJob }: { dataJob: MODEL_JOB }) {
*
</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 spacing={5}>
<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,
});
}}
/>
<ComponentGlobal_InputCountDown
maxInput={500}
lengthInput={value.content.length}
/>
</Stack>
</Stack>
<Stack spacing={3}>
<Text fz={"sm"}>
@@ -245,25 +190,31 @@ export default function Job_Edit({ dataJob }: { dataJob: MODEL_JOB }) {
*
</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 spacing={5}>
<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,
});
}}
/>
<ComponentGlobal_InputCountDown
maxInput={500}
lengthInput={value.deskripsi.length}
/>
</Stack>
</Stack>
</Stack>
@@ -276,6 +227,8 @@ export default function Job_Edit({ dataJob }: { dataJob: MODEL_JOB }) {
function ButtonAction({ value, file }: { value: MODEL_JOB; file: FormData }) {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
const [hotMenu, setHotMenu] = useAtom(gs_job_hot_menu);
const [status, setStatus] = useAtom(gs_job_status);
const [opened, { open, close }] = useDisclosure(false);
@@ -290,6 +243,7 @@ function ButtonAction({ value, file }: { value: MODEL_JOB; file: FormData }) {
setHotMenu(2);
setStatus("Draft");
ComponentGlobal_NotifikasiBerhasil(res.message);
setIsLoading(true);
router.back();
} else {
ComponentGlobal_NotifikasiGagal(res.message);
@@ -306,13 +260,33 @@ function ButtonAction({ value, file }: { value: MODEL_JOB; file: FormData }) {
<Button radius={"xl"} onClick={() => close()}>
Batal
</Button>
<Button color="teal" radius={"xl"} onClick={() => onUpdate()}>
<Button
loaderPosition="center"
loading={isLoading ? true : false}
color="teal"
radius={"xl"}
onClick={() => onUpdate()}
>
Simpan
</Button>
</Group>
</Stack>
</Modal>
<Button
style={{
transition: "0.5s",
}}
disabled={
value.title === "" ||
value.content === "" ||
value.content === "<p><br></p>" ||
value.content.length > 500 ||
value.deskripsi === "" ||
value.deskripsi === "<p><br></p>" ||
value.deskripsi.length > 500
? true
: false
}
color="teal"
radius={"xl"}
mt={"lg"}

View File

@@ -11,34 +11,49 @@ import {
Center,
Grid,
Image,
Loader,
Overlay,
Stack,
Text,
Title,
rem,
} from "@mantine/core";
import { IconCirclePlus } from "@tabler/icons-react";
import { IconCirclePlus, IconPencilPlus } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { MODEL_JOB } from "../model/interface";
import ComponentJob_DetailData from "../component/detail/detail_data";
import ComponentJob_CardViewStatus from "../component/card_view_status";
import _ from "lodash";
import ComponentJob_IsEmptyData from "../component/is_empty_data";
import { useState } from "react";
import { useWindowScroll } from "@mantine/hooks";
export default function Job_Beranda({ listJob }: { listJob: MODEL_JOB[] }) {
const router = useRouter();
const [isLoading, setLoading] = useState(false);
const [scroll, scrollTo] = useWindowScroll();
const [visible, setVisible] = useState(false);
const [jobId, setJobId] = useState("");
return (
<>
<Affix position={{ bottom: rem(150), right: rem(30) }}>
<ActionIcon
loading={isLoading ? true : false}
opacity={scroll.y > 0 ? 0.5 : ""}
style={{
transition: "0.5s",
}}
size={"xl"}
radius={"xl"}
variant="transparent"
bg={"blue"}
onClick={() => {
setLoading(true);
router.push(RouterJob.create);
}}
>
<IconCirclePlus color="white" size={40} />
<IconPencilPlus color="white" />
</ActionIcon>
</Affix>
@@ -48,15 +63,20 @@ export default function Job_Beranda({ listJob }: { listJob: MODEL_JOB[] }) {
<Stack>
{listJob.map((e, i) => (
<Card key={i} shadow="lg" withBorder p={30} radius={"md"}>
<Card.Section>
<Card.Section style={{ zIndex: 99 }}>
<ComponentGlobal_AuthorNameOnHeader
authorName={e.Author.Profile.name}
imagesId={e.Author.Profile.imagesId}
profileId={e.Author.Profile.id}
isPembatas={true}
/>
</Card.Section>
<Card.Section
onClick={() => router.push(RouterJob.main_detail + e.id)}
onClick={() => {
setVisible(true);
setJobId(e.id);
router.push(RouterJob.main_detail + e.id);
}}
mt={"lg"}
>
<Grid>
@@ -69,6 +89,15 @@ export default function Job_Beranda({ listJob }: { listJob: MODEL_JOB[] }) {
</Grid.Col>
</Grid>
</Card.Section>
{visible && e.id === jobId ? (
<Overlay h={"100%"} opacity={0.1}>
<Center h={"100%"}>
<Loader color="gray" />
</Center>
</Overlay>
) : (
""
)}
</Card>
))}
</Stack>

13
src/util/app_config.ts Normal file
View File

@@ -0,0 +1,13 @@
import os from "os";
const app_config = {
title: "Example Title",
description: "Example Description",
host:
os.platform() === "darwin"
? "http://localhost:3000"
: "https://test-hipmi.wibudev.com",
isLocal: os.platform() === "darwin",
};
export default app_config;

View File

@@ -963,10 +963,10 @@
"@types/koa-compose" "*"
"@types/node" "*"
"@types/lodash@^4.14.199":
version "4.14.202"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.202.tgz#f09dbd2fb082d507178b2f2a5c7e74bd72ff98f8"
integrity sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==
"@types/lodash@^4.17.4":
version "4.17.4"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.4.tgz#0303b64958ee070059e3a7184048a55159fe20b7"
integrity sha512-wYCP26ZLxaT3R39kiN2+HcJ4kTd3U1waI/cY7ivWYqFP6pW3ZNpvi6Wd6PHZx7T/t8z0vlkXMg3QYLa7DZ/IJQ==
"@types/mime@*":
version "3.0.4"