From 5acd31dbfcdabdbe755bcc05bd33b2a96fa1a152 Mon Sep 17 00:00:00 2001 From: Sabda Yagra Date: Thu, 11 Dec 2025 11:45:26 +0700 Subject: [PATCH] fix: change url jenkins in gitlab.ci --- .gitlab-ci.yml | 2 +- .../(admin)/admin/schedule/create/page.tsx | 306 +++++++++ .../(admin)/admin/schedule/edit/[id]/page.tsx | 2 +- app/[locale]/(admin)/admin/schedule/page.tsx | 2 +- .../content/text/comment/[id]/page.tsx | 4 +- components/landing-page/navbar.tsx | 51 +- components/landing-page/schedule.tsx | 172 ++--- components/main/comment-detail-text.tsx | 409 ++++++++++++ components/main/comment-detail-video.tsx | 628 ++++++++++++++---- components/main/content/document-detail.tsx | 2 +- lib/menus.ts | 2 +- .../http-config/http-interceptor-service.ts | 1 - service/landing/landing.ts | 4 - 13 files changed, 1384 insertions(+), 201 deletions(-) create mode 100644 components/main/comment-detail-text.tsx diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37b130a..909582e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,4 +26,4 @@ auto-deploy: services: - docker:dind script: - - curl --user admin:$JENKINS_PWD http://38.47.180.165:8080/job/auto-deploy-new-netidhub-public/build?token=autodeploynetidhub + - curl --user admin:$JENKINS_PWD http://103.31.38.120:8080/job/auto-deploy-new-netidhub-public/build?token=autodeploynetidhub diff --git a/app/[locale]/(admin)/admin/schedule/create/page.tsx b/app/[locale]/(admin)/admin/schedule/create/page.tsx index 9461226..afe6f55 100644 --- a/app/[locale]/(admin)/admin/schedule/create/page.tsx +++ b/app/[locale]/(admin)/admin/schedule/create/page.tsx @@ -1,3 +1,309 @@ +// "use client"; + +// import { useEffect, useState } from "react"; +// import { Input } from "@/components/ui/input"; +// import { Textarea } from "@/components/ui/textarea"; +// import { Button } from "@/components/ui/button"; +// import { Label } from "@/components/ui/label"; +// import { Switch } from "@/components/ui/switch"; +// import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +// import { useRouter } from "next/navigation"; +// import Swal from "sweetalert2"; +// import withReactContent from "sweetalert2-react-content"; +// import { createSchedule } from "@/service/landing/landing"; +// import Cookies from "js-cookie"; + +// const MySwal = withReactContent(Swal); + +// export default function CreateSchedulePage() { +// const router = useRouter(); + +// const [formData, setFormData] = useState({ +// createdById: 0, +// typeId: 1, +// clientName: "", +// clientSlug: "", +// description: "", +// endDate: "", +// endTime: "", +// isLiveStreaming: false, +// location: "", +// speakers: "", +// startDate: "", +// startTime: "", +// title: "", +// liveStreamingUrl: "", +// posterImagePath: "", +// }); + +// const [loading, setLoading] = useState(false); + +// // 🔹 Ambil data user dari cookie login +// useEffect(() => { +// try { +// const userInfo = Cookies.get("uinfo"); +// if (userInfo) { +// const parsed = JSON.parse(userInfo); + +// const workflowName = +// parsed?.approvalWorkflowInfo?.defaultWorkflowName || ""; +// const cleanName = workflowName.replace(/WORKFLOW/gi, "").trim(); + +// const slug = +// cleanName?.toLowerCase()?.replace(/\s+/g, "-") || "general"; + +// setFormData((prev) => ({ +// ...prev, +// createdById: parsed?.id || 0, +// typeId: parsed?.userLevelId || 1, +// clientName: cleanName, +// clientSlug: slug, +// })); + +// console.log("✅ Auto-filled user info:", { +// createdById: parsed?.id, +// typeId: parsed?.userLevelId, +// clientName: cleanName, +// clientSlug: slug, +// }); +// } +// } catch (err) { +// console.warn("⚠️ Gagal parse cookie user info:", err); +// } +// }, []); + +// const handleChange = ( +// e: React.ChangeEvent +// ) => { +// const { name, value } = e.target; +// setFormData((prev) => ({ ...prev, [name]: value })); +// }; + +// const handleToggle = (checked: boolean) => { +// setFormData((prev) => ({ ...prev, isLiveStreaming: checked })); +// }; + +// const handleSubmit = async (e: React.FormEvent) => { +// e.preventDefault(); +// setLoading(true); + +// try { +// // 🔸 Format tanggal + kirim semua field +// const payload = { +// createdById: Number(formData.createdById) || 1, +// typeId: Number(formData.typeId) || 1, +// title: formData.title, +// description: formData.description, +// location: formData.location, +// speakers: formData.speakers, +// startDate: `${formData.startDate}T${formData.startTime}:00Z`, +// endDate: `${formData.endDate}T${formData.endTime}:00Z`, +// startTime: formData.startTime, +// endTime: formData.endTime, +// isLiveStreaming: formData.isLiveStreaming, +// liveStreamingUrl: formData.liveStreamingUrl, +// posterImagePath: formData.posterImagePath, +// clientName: formData.clientName, +// clientSlug: formData.clientSlug, +// }; + +// console.log("📦 Payload dikirim ke backend:", payload); + +// const res = await createSchedule(payload); + +// if (!res?.error) { +// MySwal.fire({ +// icon: "success", +// title: "Berhasil!", +// text: "Schedule berhasil dibuat.", +// timer: 2000, +// showConfirmButton: false, +// }); +// setTimeout(() => router.push("/admin/schedule"), 2000); +// } else { +// MySwal.fire({ +// icon: "error", +// title: "Gagal!", +// text: res?.message || "Gagal membuat schedule.", +// }); +// } +// } catch (error) { +// console.error("❌ Error:", error); +// MySwal.fire({ +// icon: "error", +// title: "Error", +// text: "Terjadi kesalahan pada sistem.", +// }); +// } finally { +// setLoading(false); +// } +// }; + +// return ( +//
+// +// +// +// Buat Jadwal Baru +// +// + +// +//
+// {/* 🔹 Info otomatis dari cookie */} +//
+//

+// Client: {formData.clientName || "-"} ( +// {formData.clientSlug || "-"}) +//

+//

+// createdById: {formData.createdById} | typeId:{" "} +// {formData.typeId} +//

+//
+ +//
+// +// +//
+ +//
+// +//