diff --git a/app/[locale]/(protected)/admin/add-experts/component/column.tsx b/app/[locale]/(protected)/admin/add-experts/component/column.tsx index dad8eee6..641f4a22 100644 --- a/app/[locale]/(protected)/admin/add-experts/component/column.tsx +++ b/app/[locale]/(protected)/admin/add-experts/component/column.tsx @@ -89,15 +89,32 @@ const columns: ColumnDef[] = [ const MySwal = withReactContent(Swal); const router = useRouter(); const doDelete = async (id: number) => { + // Tampilkan loading + Swal.fire({ + title: "Menghapus user...", + text: "Mohon tunggu sebentar", + allowOutsideClick: false, + didOpen: () => { + Swal.showLoading(); + }, + }); + const response = await deleteUser(id); + if (response?.error) { + Swal.close(); + toast({ title: stringify(response?.message), variant: "destructive", }); + return; } + + Swal.close(); + toast({ - title: "Success delete", + title: "Berhasil menghapus user", }); router.push("?dataChange=true"); @@ -116,6 +133,35 @@ const columns: ColumnDef[] = [ } }); }; + + // const doDelete = async (id: number) => { + // const response = await deleteUser(id); + // if (response?.error) { + // toast({ + // title: stringify(response?.message), + // variant: "destructive", + // }); + // } + // toast({ + // title: "Success delete", + // }); + + // router.push("?dataChange=true"); + // }; + + // const handleDelete = (id: number) => { + // MySwal.fire({ + // title: "Apakah anda ingin menghapus data user?", + // showCancelButton: true, + // confirmButtonColor: "#dc3545", + // confirmButtonText: "Iya", + // cancelButtonText: "Tidak", + // }).then((result) => { + // if (result.isConfirmed) { + // doDelete(id); + // } + // }); + // }; return ( diff --git a/app/[locale]/(protected)/admin/add-experts/create/page.tsx b/app/[locale]/(protected)/admin/add-experts/create/page.tsx index 5ed4bfd1..d3a7fd90 100644 --- a/app/[locale]/(protected)/admin/add-experts/create/page.tsx +++ b/app/[locale]/(protected)/admin/add-experts/create/page.tsx @@ -35,32 +35,56 @@ import { import { error, loading } from "@/config/swal"; import { Eye, EyeOff } from "lucide-react"; -const FormSchema = z.object({ - name: z.string({ - required_error: "Required", - }), - username: z.string({ - required_error: "Required", - }), - password: z.string({ - required_error: "Required", - }), - phoneNumber: z.string({ - required_error: "Required", - }), - email: z.string({ - required_error: "Required", - }), - skills: z.string({ - required_error: "Required", - }), - experiences: z.string({ - required_error: "Required", - }), - company: z.string({ - required_error: "Required", - }), -}); +// const FormSchema = z.object({ +// name: z.string({ +// required_error: "Required", +// }), +// username: z.string({ +// required_error: "Required", +// }), +// password: z.string({ +// required_error: "Required", +// }), +// phoneNumber: z.string({ +// required_error: "Required", +// }), +// email: z.string({ +// required_error: "Required", +// }), +// skills: z.string({ +// required_error: "Required", +// }), +// experiences: z.string({ +// required_error: "Required", +// }), +// company: z.string({ +// required_error: "Required", +// }), +// }); + +const FormSchema = z + .object({ + name: z.string({ required_error: "Required" }), + username: z.string({ required_error: "Required" }), + password: z + .string({ required_error: "Required" }) + .min(8, "Minimal 8 karakter") + .regex(/[A-Z]/, "Harus mengandung huruf besar (A-Z)") + .regex(/[0-9]/, "Harus mengandung angka (0-9)") + .regex(/[^A-Za-z0-9]/, "Harus mengandung karakter spesial (!@#$%^&*)"), + + // confirmPassword: z.string({ required_error: "Required" }), + + phoneNumber: z.string({ required_error: "Required" }), + email: z.string({ required_error: "Required" }), + skills: z.string({ required_error: "Required" }), + experiences: z.string({ required_error: "Required" }), + company: z.string({ required_error: "Required" }), + }) + // .refine((data) => data.password === data.confirmPassword, { + // path: ["confirmPassword"], + // message: "Konfirmasi password tidak sama", + // }); export type Placements = { index: number; @@ -74,6 +98,7 @@ export default function AddExpertForm() { const form = useForm>({ resolver: zodResolver(FormSchema), }); + const [passwordStrength, setPasswordStrength] = useState(""); const [incrementId, setIncrementId] = useState(1); const [placementRows, setPlacementRows] = useState([ { index: 0, roleId: "", userLevelId: 0 }, @@ -135,7 +160,7 @@ export default function AddExpertForm() { }; loading(); - + // check availability first var placementArr: any[] = []; placementRows.forEach((row: any) => { @@ -261,6 +286,19 @@ export default function AddExpertForm() { } }; + const computeStrength = (password: string) => { + let score = 0; + if (password.length >= 8) score++; + if (/[A-Z]/.test(password)) score++; + if (/[0-9]/.test(password)) score++; + if (/[^A-Za-z0-9]/.test(password)) score++; + + if (score <= 1) return "weak"; + if (score === 2 || score === 3) return "medium"; + if (score === 4) return "strong"; + return ""; + }; + return (
@@ -349,6 +387,66 @@ export default function AddExpertForm() { )} /> ( + + Password +
+ { + field.onChange(e.target.value); + setPasswordStrength(computeStrength(e.target.value)); + }} + /> + + +
+ Password harus memiliki minimal 8 karakter, special karakter, angka dan huruf kapital + + {/* Strength meter */} + {field.value && ( +
+
+ +

+ {passwordStrength === "weak" && "Weak Password"} + {passwordStrength === "medium" && "Medium Password"} + {passwordStrength === "strong" && "Strong Password"} +

+
+ )} + + + + )} + /> + {/* ( @@ -373,7 +471,7 @@ export default function AddExpertForm() { )} - /> + /> */} [] = [ cell: ({ row }) => {row.getValue("title")}, }, { - accessorKey: "link", - header: "Jumlah Amplifikasi", - cell: ({ row }) => {row.getValue("resultTotal")}, + accessorKey: "resultTotal", + header: () =>
Jumlah Amplifikasi
, + cell: ({ row }) => { + const value = row.getValue("resultTotal") as number | string | null; + + const finalValue = + value === null || value === undefined || value === "" + ? 0 + : Number(value); + + return
{finalValue}
; + }, }, + // { // accessorKey: "status", // header: "Status", // cell: ({ row }) => {row.getValue("status")}, // }, + // { + // accessorKey: "isProcessing", + // header: () =>
Status
, + // cell: ({ row }) => { + // const raw = row.getValue("isProcessing"); + // var status = "Sedang Diproses" + // if (Boolean(raw) == true) { + // status = "Selesai Diproses"; + // } + // return
{status}
; + // }, + // }, { accessorKey: "isProcessing", header: () =>
Status
, cell: ({ row }) => { - const raw = row.getValue("isProcessing"); - var status = "Sedang Diproses" - if (Boolean(raw) == true) { - status = "Selesai Diproses"; - } - return
{status}
; + const raw = Boolean(row.getValue("isProcessing")); + + // KONDISI STATUS + const statusText = raw ? "Sedang Diproses" : "Sudah Selesai"; + + // WARNA STATUS + const colorClass = raw + ? "bg-yellow-100 text-yellow-700 border border-yellow-300" + : "bg-green-100 text-green-700 border border-green-300"; + + return ( +
+ + {statusText} + +
+ ); }, }, + { accessorKey: "createdAt", header: () =>
Tanggal Penarikan
, diff --git a/app/[locale]/(protected)/shared/communication/internal/components/columns.tsx b/app/[locale]/(protected)/shared/communication/internal/components/columns.tsx index 696c8377..5cdafde8 100644 --- a/app/[locale]/(protected)/shared/communication/internal/components/columns.tsx +++ b/app/[locale]/(protected)/shared/communication/internal/components/columns.tsx @@ -1,8 +1,6 @@ import * as React from "react"; import { ColumnDef } from "@tanstack/react-table"; - import { Eye, MoreVertical, SquarePen, Trash2 } from "lucide-react"; -import { cn } from "@/lib/utils"; import { DropdownMenu, DropdownMenuContent, @@ -10,13 +8,42 @@ import { DropdownMenuItem, } from "@/components/ui/dropdown-menu"; import { Button } from "@/components/ui/button"; -import { Badge } from "@/components/ui/badge"; import { format } from "date-fns"; import { Link } from "@/components/navigation"; +import { deleteTicketInternal } from "@/service/communication/communication"; +import withReactContent from "sweetalert2-react-content"; +import Swal from "sweetalert2"; import { useTranslations } from "next-intl"; -const useTableColumns = () => { - const t = useTranslations("Table"); // Panggil di dalam hook +const MySwal = withReactContent(Swal); + +const useTableColumns = (onDeleteSuccess?: () => void) => { + const t = useTranslations("Table"); + + const handleDelete = async (id: any) => { + MySwal.fire({ + title: "Delete Data?", + text: "Apakah Anda yakin ingin menghapus data ini?", + icon: "warning", + showCancelButton: true, + cancelButtonColor: "#d33", + confirmButtonColor: "#3085d6", + confirmButtonText: "Ya, hapus", + }).then(async (result) => { + if (result.isConfirmed) { + try { + await deleteTicketInternal(id); + + MySwal.fire("Sukses", "Data berhasil dihapus!", "success"); + + if (onDeleteSuccess) onDeleteSuccess(); + } catch (error) { + console.log(error); + MySwal.fire("Gagal", "Terjadi kesalahan saat menghapus", "error"); + } + } + }); + }; const columns: ColumnDef[] = [ { @@ -67,46 +94,46 @@ const useTableColumns = () => { }, { id: "actions", - accessorKey: "action", - header: t("action", { defaultValue: "Action" }), - enableHiding: false, - cell: ({ row }) => { - return ( - - - - - - - - - View - - - - - - Edit - - - - - Delete + header: t("action"), + cell: ({ row }) => ( + + + + + + {/* View */} + + + + View - - - ); - }, + + + {/* Edit */} + + + + Edit + + + + {/* Delete */} + handleDelete(row.original.id)} + > + + Delete + + + + ), }, ]; diff --git a/app/[locale]/(protected)/shared/communication/internal/components/internal-table.tsx b/app/[locale]/(protected)/shared/communication/internal/components/internal-table.tsx index d7656e7d..8ffc0b07 100644 --- a/app/[locale]/(protected)/shared/communication/internal/components/internal-table.tsx +++ b/app/[locale]/(protected)/shared/communication/internal/components/internal-table.tsx @@ -68,7 +68,6 @@ import useTableColumns from "./columns"; const InternalTable = () => { const router = useRouter(); const searchParams = useSearchParams(); - const [dataTable, setDataTable] = React.useState([]); const [totalData, setTotalData] = React.useState(1); const [sorting, setSorting] = React.useState([]); @@ -79,7 +78,6 @@ const InternalTable = () => { React.useState({}); const [rowSelection, setRowSelection] = React.useState({}); const [showData, setShowData] = React.useState("10"); - const [pagination, setPagination] = React.useState({ pageIndex: 0, pageSize: Number(showData), @@ -87,11 +85,7 @@ const InternalTable = () => { const [page, setPage] = React.useState(1); const [totalPage, setTotalPage] = React.useState(1); const [search, setSearch] = React.useState(""); - const userId = getCookiesDecrypt("uie"); - const userLevelId = getCookiesDecrypt("ulie"); - - const roleId = getCookiesDecrypt("urie"); - const columns = useTableColumns(); + const columns = useTableColumns(() => fetchData()); const table = useReactTable({ data: dataTable, columns, diff --git a/app/[locale]/(public)/content-management/download/page.tsx b/app/[locale]/(public)/content-management/download/page.tsx index 763f5385..6f1c37c9 100644 --- a/app/[locale]/(public)/content-management/download/page.tsx +++ b/app/[locale]/(public)/content-management/download/page.tsx @@ -290,25 +290,29 @@ const Galery = (props: any) => { // toast.success("Link Berhasil Di Copy"); }; - async function shareToEmail() { - if (Number(userRoleId) < 1 || userRoleId == undefined) { + async function shareToEmail(uploadId: any) { + if (!userRoleId) { router.push("/auth/login"); - } else { - const data = { - mediaUploadId: id?.split("-")?.[0], - email: emailShareList || [emailShareInput], - message: emailMessageInput, - url: window.location.href, - }; - loading(); - const res = await sendMediaUploadToEmail(data); - if (res?.error) { - error(res.message); - return false; - } - close(); - successCallback("Konten Telah Dikirim"); + return; } + + const data = { + mediaUploadId: uploadId, // ← FIX: ID valid dari response + email: emailShareList || [emailShareInput], + message: emailMessageInput, + url: window.location.href, + }; + + loading(); + const res = await sendMediaUploadToEmail(data); + + if (res?.error) { + error(res.message); + return; + } + + close(); + successCallback("Konten Telah Dikirim"); } const handleEmailList = (e: any) => { @@ -349,12 +353,18 @@ const Galery = (props: any) => { Saya */} {pathname?.split("/")[1] == "in" ? ( <> - {t("gallery", { defaultValue: "Gallery" })}  + + {t("gallery", { defaultValue: "Gallery" })} + +   {t("my", { defaultValue: "My" })} ) : ( <> - {t("my", { defaultValue: "My" })}  + + {t("my", { defaultValue: "My" })} + +   {t("gallery", { defaultValue: "Gallery" })} )} @@ -457,7 +467,9 @@ const Galery = (props: any) => { fontSize={25} />

- {t("save", { defaultValue: "Save" })}{" "} + {t("save", { + defaultValue: "Save", + })}{" "}

{ fontSize={20} />

- {t("share", { defaultValue: "Share" })}{" "} + {t("share", { + defaultValue: "Share", + })}{" "}

- {t("shareTo", { defaultValue: "Share To" })}{" "} + {t("shareTo", { + defaultValue: "Share To", + })}{" "}

- {t("destinationEmail", { defaultValue: "Destination Email" })} + {t("destinationEmail", { + defaultValue: + "Destination Email", + })}

{ } onKeyPress={handleEmailList} type="email" - placeholder={t("shareTo", { defaultValue: "Share To" })} + placeholder={t("shareTo", { + defaultValue: "Share To", + })} />
@@ -625,10 +652,16 @@ const Galery = (props: any) => {
-

{t("shareTo", { defaultValue: "Share To" })}

+

+ {t("shareTo", { + defaultValue: "Share To", + })} +

- {t("destinationEmail", { defaultValue: "Destination Email" })} + {t("destinationEmail", { + defaultValue: "Destination Email", + })}

{ } onKeyPress={handleEmailList} type="email" - placeholder={t("pressEnter", { defaultValue: "Press Enter" })} + placeholder={t("pressEnter", { + defaultValue: "Press Enter", + })} />
@@ -732,7 +769,9 @@ const Galery = (props: any) => { fontSize={25} />

- {t("save", { defaultValue: "Save" })}{" "} + {t("save", { + defaultValue: "Save", + })}{" "}

{ fontSize={20} />

- {t("share", { defaultValue: "Share" })}{" "} + {t("share", { + defaultValue: "Share", + })}{" "}

- {t("shareTo", { defaultValue: "Share To" })}{" "} + {t("shareTo", { + defaultValue: "Share To", + })}{" "}

- {t("destinationEmail", { defaultValue: "Destination Email" })} + {t("destinationEmail", { + defaultValue: + "Destination Email", + })}

{ } onKeyPress={handleEmailList} type="email" - placeholder={t("shareTo", { defaultValue: "Share To" })} + placeholder={t("shareTo", { + defaultValue: "Share To", + })} />
@@ -884,10 +938,14 @@ const Galery = (props: any) => {
-

{t("shareTo", { defaultValue: "Share To" })}

+

+ {t("shareTo", { defaultValue: "Share To" })} +

- {t("destinationEmail", { defaultValue: "Destination Email" })} + {t("destinationEmail", { + defaultValue: "Destination Email", + })}

{ } onKeyPress={handleEmailList} type="email" - placeholder={t("pressEnter", { defaultValue: "Press Enter" })} + placeholder={t("pressEnter", { + defaultValue: "Press Enter", + })} />
diff --git a/app/[locale]/(public)/content-management/galery/page.tsx b/app/[locale]/(public)/content-management/galery/page.tsx index 750123a7..f08b7863 100644 --- a/app/[locale]/(public)/content-management/galery/page.tsx +++ b/app/[locale]/(public)/content-management/galery/page.tsx @@ -1,7 +1,13 @@ "use client"; import { close, error, loading, successCallback } from "@/config/swal"; -import { checkWishlistStatus, deleteWishlist, getInfoProfile, mediaWishlist, saveWishlist } from "@/service/landing/landing"; +import { + checkWishlistStatus, + deleteWishlist, + getInfoProfile, + mediaWishlist, + saveWishlist, +} from "@/service/landing/landing"; import React, { useEffect, useState } from "react"; import { Link, useRouter } from "@/i18n/routing"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; @@ -13,8 +19,17 @@ import withReactContent from "sweetalert2-react-content"; import { getCookiesDecrypt } from "@/lib/utils"; import Swal from "sweetalert2"; import { useToast } from "@/components/ui/use-toast"; -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; -import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; import { Icon } from "@iconify/react/dist/iconify.js"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; @@ -61,11 +76,23 @@ const Galery = (props: any) => { }, [page, category, title]); async function getDataVideo() { - const filter = categoryFilter?.length > 0 ? categoryFilter?.sort().join(",") : category || ""; + const filter = + categoryFilter?.length > 0 + ? categoryFilter?.sort().join(",") + : category || ""; const name = title == undefined ? "" : title; const format = formatFilter == undefined ? "" : formatFilter?.join(","); - const response = await mediaWishlist("2", isInstitute ? instituteId : "", name, filter, "9", pages, sortBy, format); + const response = await mediaWishlist( + "2", + isInstitute ? instituteId : "", + name, + filter, + "9", + pages, + sortBy, + format + ); setGetTotalPage(response?.data?.data?.totalPages); setContentVideo(response?.data?.data?.content); @@ -94,12 +121,24 @@ const Galery = (props: any) => { }, [page, category, title]); async function getDataDocument() { - const filter = categoryFilter?.length > 0 ? categoryFilter?.sort().join(",") : category || ""; + const filter = + categoryFilter?.length > 0 + ? categoryFilter?.sort().join(",") + : category || ""; const name = title == undefined ? "" : title; const format = formatFilter == undefined ? "" : formatFilter?.join(","); - const response = await mediaWishlist("3", isInstitute ? instituteId : "", name, filter, "12", pages, sortBy, format); + const response = await mediaWishlist( + "3", + isInstitute ? instituteId : "", + name, + filter, + "12", + pages, + sortBy, + format + ); setGetTotalPage(response?.data?.data?.totalPages); setContentDocument(response?.data?.data?.content); @@ -119,12 +158,24 @@ const Galery = (props: any) => { }, [change, refresh]); async function getDataAudio() { - const filter = categoryFilter?.length > 0 ? categoryFilter?.sort().join(",") : category || ""; + const filter = + categoryFilter?.length > 0 + ? categoryFilter?.sort().join(",") + : category || ""; const name = title == undefined ? "" : title; const format = formatFilter == undefined ? "" : formatFilter?.join(","); - const response = await mediaWishlist("4", isInstitute ? instituteId : "", name, filter, "6", pages, sortBy, format); + const response = await mediaWishlist( + "4", + isInstitute ? instituteId : "", + name, + filter, + "6", + pages, + sortBy, + format + ); setGetTotalPage(response?.data?.data?.totalPages); setContentAudio(response?.data?.data?.content); @@ -140,12 +191,24 @@ const Galery = (props: any) => { }, [page, category, title, refresh]); async function getDataImage() { - const filter = categoryFilter?.length > 0 ? categoryFilter?.sort().join(",") : category || ""; + const filter = + categoryFilter?.length > 0 + ? categoryFilter?.sort().join(",") + : category || ""; const name = title == undefined ? "" : title; const format = formatFilter == undefined ? "" : formatFilter?.join(","); - const response = await mediaWishlist("1", isInstitute ? instituteId : "", name, filter, "12", pages, sortBy, format); + const response = await mediaWishlist( + "1", + isInstitute ? instituteId : "", + name, + filter, + "12", + pages, + sortBy, + format + ); setGetTotalPage(response?.data?.data?.totalPages); setContentImage(response?.data?.data?.content); @@ -227,7 +290,9 @@ const Galery = (props: any) => { }; const copyToClip = async (url: any) => { - await navigator.clipboard.writeText(`https://mediahub.polri.go.id/video/detail/${url}`); + await navigator.clipboard.writeText( + `https://mediahub.polri.go.id/video/detail/${url}` + ); setCopySuccess("Copied"); // toast.success("Link Berhasil Di Copy"); toast({ @@ -235,25 +300,29 @@ const Galery = (props: any) => { }); }; - async function shareToEmail() { - if (Number(userRoleId) < 1 || userRoleId == undefined) { + async function shareToEmail(uploadId: any) { + if (!userRoleId) { router.push("/auth/login"); - } else { - const data = { - mediaUploadId: id?.split("-")?.[0], - email: emailShareList || [emailShareInput], - message: emailMessageInput, - url: window.location.href, - }; - loading(); - const res = await sendMediaUploadToEmail(data); - if (res?.error) { - error(res.message); - return false; - } - close(); - successCallback("Konten Telah Dikirim"); + return; } + + const data = { + mediaUploadId: uploadId, // ← FIX: ID valid dari response + email: emailShareList || [emailShareInput], + message: emailMessageInput, + url: window.location.href, + }; + + loading(); + const res = await sendMediaUploadToEmail(data); + + if (res?.error) { + error(res.message); + return; + } + + close(); + successCallback("Konten Telah Dikirim"); } const handleEmailList = (e: any) => { @@ -290,7 +359,9 @@ const Galery = (props: any) => {

- {t("gallery", { defaultValue: "Gallery" })} + + {t("gallery", { defaultValue: "Gallery" })}{" "} + {profile?.institute?.name}

@@ -301,21 +372,27 @@ const Galery = (props: any) => { > {t("image", { defaultValue: "Image" })} -
|
+
+ | +
{t("video", { defaultValue: "Video" })} -
|
+
+ | +
{t("text", { defaultValue: "Text" })} -
|
+
+ | +
{ contentVideo?.length > 0 ? (
{contentVideo?.map((video: any) => ( - +
- +
- -

{video?.mediaUpload?.title}

+ +

+ {video?.mediaUpload?.title} +

- + - + -

handleSaveWishlist(video?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> - -

{t("save", { defaultValue: "Save" })}

+
+ handleSaveWishlist( + video?.mediaUpload?.id + ) + } + className="cursor-pointer flex flex-row gap-2 hover:text-red-800" + > + +

+ {t("save", { + defaultValue: "Save", + })}{" "} +

- - -

Content Rewrite

+ + +

+ Content Rewrite +

-

{t("shareTo", { defaultValue: "Share To" })}

+

+ {t("shareTo", { + defaultValue: "Share To", + })}{" "} +

-

{t("destinationEmail", { defaultValue: "Destination Email" })}

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("shareTo", { defaultValue: "Share To" })} /> +

+ {t("destinationEmail", { + defaultValue: + "Destination Email", + })} +

+ + setEmailShareInput( + event.target.value + ) + } + onKeyPress={handleEmailList} + type="email" + placeholder={t("shareTo", { + defaultValue: "Share To", + })} + />
- + + {/* */}
@@ -392,33 +559,64 @@ const Galery = (props: any) => {
) : (

- empty + empty

) ) : selectedTab == "audio" ? ( contentAudio?.length > 0 ? (
{contentAudio?.map((audio: any) => ( -
+
- +
- -
{audio?.mediaUpload?.title}
+ +
+ {audio?.mediaUpload?.title} +
- # -
{audio?.mediaUpload?.duration}
- + # +
+ {audio?.mediaUpload?.duration} +
+ {
- + - + -
handleSaveWishlist(audio?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> - -

{t("save", { defaultValue: "Save" })}

+
+ handleSaveWishlist(audio?.mediaUpload?.id) + } + className="cursor-pointer flex flex-row gap-2 hover:text-red-800" + > + +

+ {t("save", { defaultValue: "Save" })} +

- + -

Content Rewrite

+

+ Content Rewrite +

-

{t("shareTo", { defaultValue: "Share To" })}

+

+ {t("shareTo", { + defaultValue: "Share To", + })} +

-

{t("destinationEmail", { defaultValue: "Destination Email" })}

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter", { defaultValue: "Press Enter" })} /> +

+ {t("destinationEmail", { + defaultValue: "Destination Email", + })} +

+ + setEmailShareInput(event.target.value) + } + onKeyPress={handleEmailList} + type="email" + placeholder={t("pressEnter", { + defaultValue: "Press Enter", + })} + />
- + {/* */}
@@ -470,56 +722,148 @@ const Galery = (props: any) => {
) : (

- empty + empty

) ) : selectedTab == "image" ? ( contentImage?.length > 0 ? (
{contentImage?.map((image: any) => ( - +
- +
- -

{image?.mediaUpload?.title}

+ +

+ {image?.mediaUpload?.title} +

- + - + -

handleSaveWishlist(image?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> - -

{t("save", { defaultValue: "Save" })}

+
+ handleSaveWishlist( + image?.mediaUpload?.id + ) + } + className="cursor-pointer flex flex-row gap-2 hover:text-red-800" + > + +

+ {t("save", { + defaultValue: "Save", + })} +

- - -

Content Rewrite

+ + +

+ Content Rewrite +

-

{t("shareTo", { defaultValue: "Share To" })}

+

+ {t("shareTo", { + defaultValue: "Share To", + })} +

-

{t("destinationEmail", { defaultValue: "Destination Email" })}

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter", { defaultValue: "Press Enter" })} /> +

+ {t("destinationEmail", { + defaultValue: + "Destination Email", + })} +

+ + setEmailShareInput( + event.target.value + ) + } + onKeyPress={handleEmailList} + type="email" + placeholder={t( + "pressEnter", + { + defaultValue: + "Press Enter", + } + )} + />
-
@@ -538,15 +882,30 @@ const Galery = (props: any) => {
) : (

- empty + empty

) ) : contentDocument.length > 0 ? (
{contentDocument?.map((document: any) => ( -
+
- + {
- + {document?.mediaUpload?.title}
- - + + Download {t("document", { defaultValue: "Document" })}
- + - + -
handleSaveWishlist(document?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> - -

{t("save", { defaultValue: "Save" })}

+
+ handleSaveWishlist(document?.mediaUpload?.id) + } + className="cursor-pointer flex flex-row gap-2 hover:text-red-800" + > + +

+ {t("save", { defaultValue: "Save" })} +

- + -

Content Rewrite

+

+ Content Rewrite +

-

{t("shareTo", { defaultValue: "Share To" })}

+

+ {t("shareTo", { defaultValue: "Share To" })} +

-

{t("destinationEmail", { defaultValue: "Destination Email" })}

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter", { defaultValue: "Press Enter" })} /> +

+ {t("destinationEmail", { + defaultValue: "Destination Email", + })} +

+ + setEmailShareInput(event.target.value) + } + onKeyPress={handleEmailList} + type="email" + placeholder={t("pressEnter", { + defaultValue: "Press Enter", + })} + />
-
@@ -609,7 +1024,13 @@ const Galery = (props: any) => {
) : (

- empty + empty

)}
diff --git a/components/form/content/audio-form.tsx b/components/form/content/audio-form.tsx index e730e553..1f7efb1c 100644 --- a/components/form/content/audio-form.tsx +++ b/components/form/content/audio-form.tsx @@ -731,7 +731,7 @@ export default function FormAudio() { setIsStartUpload(true); setProgressList(progressInfoArr); - close(); + // close(); // showProgress(); files.map(async (item: any, index: number) => { await uploadResumableFile(index, String(id), item, "0"); @@ -841,6 +841,8 @@ export default function FormAudio() { } if (counter == progressInfo.length) { setIsStartUpload(false); + close(); + // hideProgress(); Cookies.remove("idCreate"); successSubmit("/in/contributor/content/audio"); diff --git a/components/form/content/image-form.tsx b/components/form/content/image-form.tsx index be778609..df4c45e2 100644 --- a/components/form/content/image-form.tsx +++ b/components/form/content/image-form.tsx @@ -684,7 +684,7 @@ export default function FormImage() { setIsStartUpload(true); setProgressList(progressInfoArr); - close(); + // close(); files.map(async (item: any, index: number) => { await uploadResumableFile( index, @@ -795,6 +795,7 @@ export default function FormImage() { } if (counter == progressInfo.length) { setIsStartUpload(false); + close(); // hideProgress(); Cookies.remove("idCreate"); successSubmit("/in/contributor/content/image"); diff --git a/components/form/content/teks-form.tsx b/components/form/content/teks-form.tsx index e0d23d65..35f8c069 100644 --- a/components/form/content/teks-form.tsx +++ b/components/form/content/teks-form.tsx @@ -749,7 +749,7 @@ export default function FormTeks() { setIsStartUpload(true); setProgressList(progressInfoArr); - close(); + // close(); files.map(async (item: any, index: number) => { await uploadResumableFile( index, @@ -861,6 +861,7 @@ export default function FormTeks() { } if (counter == progressInfo.length) { setIsStartUpload(false); + close(); // hideProgress(); Cookies.remove("idCreate"); successSubmit("/in/contributor/content/teks"); diff --git a/service/communication/communication.ts b/service/communication/communication.ts index 230ef583..20d108c5 100644 --- a/service/communication/communication.ts +++ b/service/communication/communication.ts @@ -3,7 +3,6 @@ import { httpGetInterceptor, httpPostInterceptor, } from "../http-config/http-interceptor-service"; -import { title } from "process"; export async function listTicketingInternal( page: number, @@ -16,6 +15,7 @@ export async function listTicketingInternal( ); } + export async function getTicketingEscalationPagination( page: number, size: any, @@ -64,6 +64,10 @@ export async function deleteTicket(id: any) { return httpDeleteInterceptor(url, id); } +export async function deleteTicketInternal(id: number | string) { + return await httpDeleteInterceptor(`ticketing/internal?id=${id}`); +} + export async function closeTicket(id: any) { const url = `ticketing/close?id=${id}`; return httpPostInterceptor(url, id);