diff --git a/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx b/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx index 50a4f638..7a63a970 100644 --- a/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx +++ b/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx @@ -594,7 +594,7 @@ const CalendarView = ({ categories }: CalendarViewProps) => { {roleId === 3 && userLevelId === 216 ? ( ) : null} diff --git a/app/[locale]/(protected)/contributor/blog/components/blog-table.tsx b/app/[locale]/(protected)/contributor/blog/components/blog-table.tsx index 8d87a921..631e5baa 100644 --- a/app/[locale]/(protected)/contributor/blog/components/blog-table.tsx +++ b/app/[locale]/(protected)/contributor/blog/components/blog-table.tsx @@ -186,7 +186,7 @@ const BlogTable = () => {
diff --git a/app/[locale]/(protected)/contributor/content/audio/page.tsx b/app/[locale]/(protected)/contributor/content/audio/page.tsx index 5702e0e6..b54ddf00 100644 --- a/app/[locale]/(protected)/contributor/content/audio/page.tsx +++ b/app/[locale]/(protected)/contributor/content/audio/page.tsx @@ -63,7 +63,7 @@ const ReactTableAudioPage = () => {
diff --git a/app/[locale]/(protected)/contributor/content/image/page.tsx b/app/[locale]/(protected)/contributor/content/image/page.tsx index 9c688060..1628f7f8 100644 --- a/app/[locale]/(protected)/contributor/content/image/page.tsx +++ b/app/[locale]/(protected)/contributor/content/image/page.tsx @@ -63,7 +63,7 @@ const ReactTableImagePage = () => {
diff --git a/app/[locale]/(protected)/contributor/content/teks/page.tsx b/app/[locale]/(protected)/contributor/content/teks/page.tsx index 56bf11b5..903fdf34 100644 --- a/app/[locale]/(protected)/contributor/content/teks/page.tsx +++ b/app/[locale]/(protected)/contributor/content/teks/page.tsx @@ -66,7 +66,7 @@ const ReactTableTeksPage = () => {
diff --git a/app/[locale]/(protected)/contributor/content/video/page.tsx b/app/[locale]/(protected)/contributor/content/video/page.tsx index d879b272..dcc8e747 100644 --- a/app/[locale]/(protected)/contributor/content/video/page.tsx +++ b/app/[locale]/(protected)/contributor/content/video/page.tsx @@ -64,7 +64,7 @@ const ReactTableVideoPage = () => {
diff --git a/app/[locale]/(protected)/contributor/schedule/event/components/event-table.tsx b/app/[locale]/(protected)/contributor/schedule/event/components/event-table.tsx index 92c27732..2400e864 100644 --- a/app/[locale]/(protected)/contributor/schedule/event/components/event-table.tsx +++ b/app/[locale]/(protected)/contributor/schedule/event/components/event-table.tsx @@ -132,7 +132,7 @@ const EventTable = () => {
diff --git a/app/[locale]/(protected)/contributor/schedule/press-conference/components/presscon-table.tsx b/app/[locale]/(protected)/contributor/schedule/press-conference/components/presscon-table.tsx index 6e17551e..dac07d26 100644 --- a/app/[locale]/(protected)/contributor/schedule/press-conference/components/presscon-table.tsx +++ b/app/[locale]/(protected)/contributor/schedule/press-conference/components/presscon-table.tsx @@ -145,7 +145,7 @@ const PressConferenceTable = () => {
diff --git a/app/[locale]/(protected)/contributor/schedule/press-release/components/pressrilis-table.tsx b/app/[locale]/(protected)/contributor/schedule/press-release/components/pressrilis-table.tsx index 6c1e8ee5..97bdafb7 100644 --- a/app/[locale]/(protected)/contributor/schedule/press-release/components/pressrilis-table.tsx +++ b/app/[locale]/(protected)/contributor/schedule/press-release/components/pressrilis-table.tsx @@ -146,7 +146,7 @@ const PressReleaseTable = () => {
diff --git a/app/[locale]/(protected)/contributor/task/page.tsx b/app/[locale]/(protected)/contributor/task/page.tsx index d79c2c21..1b999fed 100644 --- a/app/[locale]/(protected)/contributor/task/page.tsx +++ b/app/[locale]/(protected)/contributor/task/page.tsx @@ -34,7 +34,7 @@ const TaskPage = () => {
diff --git a/app/[locale]/(protected)/shared/communication/page.tsx b/app/[locale]/(protected)/shared/communication/page.tsx index 000228d0..ae1ec63a 100644 --- a/app/[locale]/(protected)/shared/communication/page.tsx +++ b/app/[locale]/(protected)/shared/communication/page.tsx @@ -24,7 +24,7 @@ const CommunicationPage = () => { {tab === "Pertanyaan Internal" && ( @@ -32,7 +32,7 @@ const CommunicationPage = () => { {tab === "Kolaborasi" && ( diff --git a/app/[locale]/(protected)/shared/contest/page.tsx b/app/[locale]/(protected)/shared/contest/page.tsx index dfde87ae..10dcbfbf 100644 --- a/app/[locale]/(protected)/shared/contest/page.tsx +++ b/app/[locale]/(protected)/shared/contest/page.tsx @@ -31,7 +31,7 @@ const ContestPage = () => {
diff --git a/app/[locale]/(protected)/shared/curated-content/page.tsx b/app/[locale]/(protected)/shared/curated-content/page.tsx index 03d2c871..4fc82841 100644 --- a/app/[locale]/(protected)/shared/curated-content/page.tsx +++ b/app/[locale]/(protected)/shared/curated-content/page.tsx @@ -113,19 +113,18 @@ const CuratedContentPage = () => {
-
- +
- +
- +
diff --git a/components/form/communication/collaboration-form.tsx b/components/form/communication/collaboration-form.tsx index e0d49e42..7f1ccbce 100644 --- a/components/form/communication/collaboration-form.tsx +++ b/components/form/communication/collaboration-form.tsx @@ -26,6 +26,7 @@ import { SelectItem, } from "@radix-ui/react-select"; import { SelectGroup } from "@/components/ui/select"; +import dynamic from "next/dynamic"; const taskSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), @@ -43,6 +44,13 @@ interface Option { userLevelId: string; } +const CustomEditor = dynamic( + () => { + return import("@/components/editor/custom-editor"); + }, + { ssr: false } +); + export default function FormCollaboration() { const MySwal = withReactContent(Swal); const router = useRouter(); @@ -257,12 +265,7 @@ export default function FormCollaboration() { control={control} name="naration" render={({ field: { onChange, value } }) => ( - + )} /> {errors.naration?.message && ( diff --git a/components/form/communication/internal-form.tsx b/components/form/communication/internal-form.tsx index 613d5bf8..1189600f 100644 --- a/components/form/communication/internal-form.tsx +++ b/components/form/communication/internal-form.tsx @@ -26,6 +26,7 @@ import { SelectItem, } from "@radix-ui/react-select"; import { SelectGroup } from "@/components/ui/select"; +import dynamic from "next/dynamic"; const taskSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), @@ -43,6 +44,13 @@ interface Option { userLevelId: string; } +const CustomEditor = dynamic( + () => { + return import("@/components/editor/custom-editor"); + }, + { ssr: false } +); + export default function FormInternal() { const MySwal = withReactContent(Swal); const router = useRouter(); @@ -253,12 +261,7 @@ export default function FormInternal() { control={control} name="naration" render={({ field: { onChange, value } }) => ( - + )} /> {errors.naration?.message && ( diff --git a/components/form/content/audio-update-form.tsx b/components/form/content/audio-update-form.tsx index c79fc23d..20af4402 100644 --- a/components/form/content/audio-update-form.tsx +++ b/components/form/content/audio-update-form.tsx @@ -49,6 +49,7 @@ import { error } from "@/lib/swal"; import { getCsrfToken } from "@/service/auth"; import { Upload } from "tus-js-client"; import { useTranslations } from "next-intl"; +import dynamic from "next/dynamic"; const audioSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), @@ -88,6 +89,13 @@ type Option = { name: string; }; +const CustomEditor = dynamic( + () => { + return import("@/components/editor/custom-editor"); + }, + { ssr: false } +); + export default function FormAudioUpdate() { const MySwal = withReactContent(Swal); const router = useRouter(); @@ -646,11 +654,9 @@ export default function FormAudioUpdate() { control={control} name="description" render={({ field: { onChange, value } }) => ( - )} /> diff --git a/components/form/content/spit-convert-form.tsx b/components/form/content/spit-convert-form.tsx index 3ce17175..40f96b6f 100644 --- a/components/form/content/spit-convert-form.tsx +++ b/components/form/content/spit-convert-form.tsx @@ -815,7 +815,7 @@ export default function FormConvertSPIT() {
{files?.length > 1 && ( -
+
diff --git a/components/form/content/teks-update-form.tsx b/components/form/content/teks-update-form.tsx index c7a9f3f7..77b7c0aa 100644 --- a/components/form/content/teks-update-form.tsx +++ b/components/form/content/teks-update-form.tsx @@ -45,6 +45,7 @@ import { error, loading } from "@/lib/swal"; import { Upload } from "tus-js-client"; import { getCsrfToken } from "@/service/auth"; import { useTranslations } from "next-intl"; +import dynamic from "next/dynamic"; const teksSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), @@ -88,6 +89,13 @@ type Option = { label: string; }; +const CustomEditor = dynamic( + () => { + return import("@/components/editor/custom-editor"); + }, + { ssr: false } +); + export default function FormTeksUpdate() { const MySwal = withReactContent(Swal); const router = useRouter(); @@ -610,11 +618,9 @@ export default function FormTeksUpdate() { control={control} name="description" render={({ field: { onChange, value } }) => ( - )} /> diff --git a/components/form/content/video-update-form.tsx b/components/form/content/video-update-form.tsx index b91569b3..d697e8ca 100644 --- a/components/form/content/video-update-form.tsx +++ b/components/form/content/video-update-form.tsx @@ -56,6 +56,7 @@ import { Upload } from "tus-js-client"; import { getCsrfToken } from "@/service/auth"; import { error, loading } from "@/lib/swal"; import { useTranslations } from "next-intl"; +import dynamic from "next/dynamic"; const videoSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), @@ -95,6 +96,13 @@ type Option = { name: string; }; +const CustomEditor = dynamic( + () => { + return import("@/components/editor/custom-editor"); + }, + { ssr: false } +); + export default function FormVideoUpdate() { const MySwal = withReactContent(Swal); const router = useRouter(); @@ -665,11 +673,9 @@ export default function FormVideoUpdate() { control={control} name="description" render={({ field: { onChange, value } }) => ( - )} /> diff --git a/components/form/contest/contest-detail-form.tsx b/components/form/contest/contest-detail-form.tsx index e2aa75bc..3800ed80 100644 --- a/components/form/contest/contest-detail-form.tsx +++ b/components/form/contest/contest-detail-form.tsx @@ -33,7 +33,7 @@ import { PopoverTrigger, } from "@/components/ui/popover"; import { cn, getCookiesDecrypt } from "@/lib/utils"; -import { CalendarIcon, ChevronDown, ChevronUp } from "lucide-react"; +import { CalendarIcon, ChevronDown, ChevronUp, Trash2 } from "lucide-react"; import { format, parseISO } from "date-fns"; import { Calendar } from "@/components/ui/calendar"; import { DateRange } from "react-day-picker"; @@ -898,10 +898,10 @@ export default function FormContestDetail() { {isRecording &&

Recording... {timer} seconds remaining

}{" "} {/* Display remaining time */}
-

Link Berita

+ {links.map((link, index) => (
- handleRemoveRow(index)} > - Hapus + )}
))} - +
diff --git a/components/form/planning/mediahub-publish.tsx b/components/form/planning/mediahub-publish.tsx index e7e0675e..d973236e 100644 --- a/components/form/planning/mediahub-publish.tsx +++ b/components/form/planning/mediahub-publish.tsx @@ -38,6 +38,7 @@ import { import { AlertDialogHeader } from "@/components/ui/alert-dialog"; import { Description } from "@radix-ui/react-toast"; import { useTranslations } from "next-intl"; +import dynamic from "next/dynamic"; const taskSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), @@ -62,6 +63,13 @@ export type mediahubDetail = { is_active: string; }; +const CustomEditor = dynamic( + () => { + return import("@/components/editor/custom-editor"); + }, + { ssr: false } +); + export default function PublishMediahub() { const MySwal = withReactContent(Swal); const router = useRouter(); @@ -503,11 +511,9 @@ export default function PublishMediahub() { control={control} name="description" render={({ field: { onChange, value } }) => ( - )} /> diff --git a/components/form/planning/medsos-publish.tsx b/components/form/planning/medsos-publish.tsx index ebdaac60..76420e47 100644 --- a/components/form/planning/medsos-publish.tsx +++ b/components/form/planning/medsos-publish.tsx @@ -34,6 +34,7 @@ import { DialogTrigger, } from "@/components/ui/dialog"; import { useTranslations } from "next-intl"; +import dynamic from "next/dynamic"; const taskSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), @@ -56,6 +57,13 @@ export type medsosDetail = { is_active: string; }; +const CustomEditor = dynamic( + () => { + return import("@/components/editor/custom-editor"); + }, + { ssr: false } +); + export default function PublishMedsos() { const MySwal = withReactContent(Swal); const router = useRouter(); @@ -496,11 +504,9 @@ export default function PublishMedsos() { control={control} name="description" render={({ field: { onChange, value } }) => ( - )} /> diff --git a/components/form/schedule/event-detail-form.tsx b/components/form/schedule/event-detail-form.tsx index 509edf46..e0cd6c55 100644 --- a/components/form/schedule/event-detail-form.tsx +++ b/components/form/schedule/event-detail-form.tsx @@ -237,7 +237,7 @@ export default function FormEventDetail() { )}
-
+
@@ -245,11 +245,11 @@ export default function FormEventDetail() { id="date" variant={"outline"} className={cn( - "w-[280px] lg:w-[300px] justify-start text-left font-normal", + "w-[280px] lg:w-[250px] justify-start text-left font-normal px-0 md:px-0 lg:px-4", !date && "text-muted-foreground" )} > - + {date?.from ? ( date.to ? ( <> @@ -276,7 +276,7 @@ export default function FormEventDetail() {
-
+
@@ -326,7 +326,7 @@ export default function FormEventDetail() { DI SAMPAIKAN OLEH

-
+
-
+
-
+
@@ -242,11 +242,11 @@ export default function FormEvent() { id="date" variant={"outline"} className={cn( - "w-[280px] lg:w-[300px] justify-start text-left font-normal", + "w-[280px] lg:w-[250px] justify-start text-left font-normal px-0 md:px-0 lg:px-4", !date && "text-muted-foreground" )} > - + {date?.from ? ( date.to ? ( <> @@ -273,7 +273,7 @@ export default function FormEvent() {
-
+
@@ -321,7 +321,7 @@ export default function FormEvent() {

DI SAMPAIKAN OLEH

-
+
-
+
-
+
@@ -258,11 +258,11 @@ export default function FormEventUpdate() { id="date" variant={"outline"} className={cn( - "w-[280px] lg:w-[300px] justify-start text-left font-normal", + "w-[280px] lg:w-[250px] justify-start text-left font-normal px-0 md:px-0 lg:px-4", !date && "text-muted-foreground" )} > - + {date?.from ? ( date.to ? ( <> @@ -289,7 +289,7 @@ export default function FormEventUpdate() {
-
+
@@ -337,7 +337,7 @@ export default function FormEventUpdate() {

DI SAMPAIKAN OLEH

-
+
-
+
-
+
@@ -255,11 +255,11 @@ export default function FormDetailPressRillis() { id="date" variant={"outline"} className={cn( - "w-[280px] lg:w-[300px] justify-start text-left font-normal", + "w-[280px] lg:w-[250px] justify-start text-left font-normal px-0 md:px-0 lg:px-4", !date && "text-muted-foreground" )} > - + {date?.from ? ( date.to ? ( <> @@ -286,7 +286,7 @@ export default function FormDetailPressRillis() {
-
+
@@ -332,7 +332,7 @@ export default function FormDetailPressRillis() { {errors.location?.message}
-
+
@@ -361,7 +361,7 @@ export default function FormUpdatePressRelease() {

DI SAMPAIKAN OLEH

-
+
-
+
-
+
@@ -242,11 +242,11 @@ export default function FormPressRelease() { id="date" variant={"outline"} className={cn( - "w-[280px] lg:w-[300px] justify-start text-left font-normal", + "w-[280px] lg:w-[250px] justify-start text-left font-normal px-0 md:px-0 lg:px-4", !date && "text-muted-foreground" )} > - + {date?.from ? ( date.to ? ( <> @@ -273,7 +273,7 @@ export default function FormPressRelease() {
-
+
@@ -319,7 +319,7 @@ export default function FormPressRelease() { {errors.location?.message}
-
+
-
+
{Object.keys(unitSelection).map((key) => (
- setUnitSelection({ ...unitSelection, [key]: value }) + handleUnitChange( + key as keyof typeof unitSelection, + value as boolean + ) } />
))}
-
+
-
- +
+ setMainType(value)} @@ -777,8 +847,8 @@ export default function FormTaskEdit() {
-
- +
+ setTaskType(String(value))} @@ -791,8 +861,8 @@ export default function FormTaskEdit() {
{/* RadioGroup Assignment Category */} -
- +
+ setType(value)} // Mengubah nilai state ketika pilihan berubah @@ -812,16 +882,19 @@ export default function FormTaskEdit() {
-
- -
+
+ +
{Object.keys(taskOutput).map((key) => (
- setTaskOutput({ ...taskOutput, [key]: value }) + handleTaskOutputChange( + key as keyof typeof taskOutput, + value as boolean + ) } />
-
- +
+ ( - )} /> @@ -851,11 +922,11 @@ export default function FormTaskEdit() {

)}
-
- +
+
-
- +
+ ))}
-
- +
+ ))}
-
- +
+ ))}
-
- +
+ {audioFile && (
-

Voice Note

+

{t("voice-note")}

diff --git a/components/form/task/task-form.tsx b/components/form/task/task-form.tsx index 3e64611d..ace2e83c 100644 --- a/components/form/task/task-form.tsx +++ b/components/form/task/task-form.tsx @@ -32,7 +32,7 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { ChevronDown, ChevronUp } from "lucide-react"; +import { ChevronDown, ChevronUp, Trash2 } from "lucide-react"; import { AudioRecorder } from "react-audio-voice-recorder"; import FileUploader from "@/components/form/shared/file-uploader"; import { Upload } from "tus-js-client"; @@ -40,6 +40,7 @@ import { error } from "@/config/swal"; import { getCsrfToken } from "@/service/auth"; import { loading } from "@/lib/swal"; import { useTranslations } from "next-intl"; +import dynamic from "next/dynamic"; const taskSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), @@ -74,6 +75,13 @@ export type taskDetail = { is_active: string; }; +const CustomEditor = dynamic( + () => { + return import("@/components/editor/custom-editor"); + }, + { ssr: false } +); + export default function FormTask() { const MySwal = withReactContent(Swal); const router = useRouter(); @@ -188,6 +196,63 @@ export default function FormTask() { return Array.from(checkedLevels).join(","); // Mengonversi Set ke string }; + const handleUnitChange = ( + key: keyof typeof unitSelection, + value: boolean + ) => { + if (key === "allUnit") { + const newState = { + allUnit: value, + mabes: value, + polda: value, + polres: value, + satker: value, + }; + setUnitSelection(newState); + } else { + const updatedSelection = { + ...unitSelection, + [key]: value, + }; + + const allChecked = ["mabes", "polda", "polres", "satker"].every( + (k) => updatedSelection[k as keyof typeof unitSelection] + ); + + updatedSelection.allUnit = allChecked; + + setUnitSelection(updatedSelection); + } + }; + + const handleTaskOutputChange = ( + key: keyof typeof taskOutput, + value: boolean + ) => { + if (key === "all") { + const newState = { + all: value, + video: value, + audio: value, + image: value, + text: value, + }; + setTaskOutput(newState); + } else { + const updated = { + ...taskOutput, + [key]: value, + }; + + const allChecked = ["video", "audio", "image", "text"].every( + (k) => updated[k as keyof typeof taskOutput] + ); + + updated.all = allChecked; + setTaskOutput(updated); + } + }; + const save = async (data: TaskSchema) => { const fileTypeMapping = { all: "1", @@ -518,14 +583,17 @@ export default function FormTask() {
-
+
{Object.keys(unitSelection).map((key) => (
- setUnitSelection({ ...unitSelection, [key]: value }) + handleUnitChange( + key as keyof typeof unitSelection, + value as boolean + ) } />
))}
-
+
-
+
{Object.keys(taskOutput).map((key) => (
- setTaskOutput({ ...taskOutput, [key]: value }) + handleTaskOutputChange( + key as keyof typeof taskOutput, + value as boolean + ) } />
{errors.password?.message && (
diff --git a/lib/menus.ts b/lib/menus.ts index 8cf7137d..58530779 100644 --- a/lib/menus.ts +++ b/lib/menus.ts @@ -3679,34 +3679,34 @@ export function getMenuList(pathname: string, t: any): Group[] { icon: "heroicons:arrow-trending-up", children: [], }, - { - href: "/admin/settings/feedback", - label: "Feedback", - active: pathname === "/admin/settings/feedback", - icon: "heroicons:arrow-trending-up", - children: [], - }, - { - href: "/admin/settings/faq", - label: "FAQ", - active: pathname === "/admin/settings/faq", - icon: "heroicons:arrow-trending-up", - children: [], - }, - { - href: "https://nat-mediahub.polri.go.id/", - label: "Mediahub 2022", - active: pathname === "/admin/settings/mediahub-2022", - icon: "heroicons:arrow-trending-up", - children: [], - }, - { - href: "/admin/settings/privacy", - label: t("privacy"), - active: pathname === "/admin/settings/privacy", - icon: "heroicons:arrow-trending-up", - children: [], - }, + // { + // href: "/admin/settings/feedback", + // label: "Feedback", + // active: pathname === "/admin/settings/feedback", + // icon: "heroicons:arrow-trending-up", + // children: [], + // }, + // { + // href: "/admin/settings/faq", + // label: "FAQ", + // active: pathname === "/admin/settings/faq", + // icon: "heroicons:arrow-trending-up", + // children: [], + // }, + // { + // href: "https://nat-mediahub.polri.go.id/", + // label: "Mediahub 2022", + // active: pathname === "/admin/settings/mediahub-2022", + // icon: "heroicons:arrow-trending-up", + // children: [], + // }, + // { + // href: "/admin/settings/privacy", + // label: t("privacy"), + // active: pathname === "/admin/settings/privacy", + // icon: "heroicons:arrow-trending-up", + // children: [], + // }, ], }, ],