This commit is contained in:
Sabda Yagra 2025-08-22 00:12:01 +07:00
parent 0c866f9363
commit 5c3eb2aefa
4 changed files with 65 additions and 31 deletions

View File

@ -54,8 +54,15 @@ interface Option {
userLevelId: string; userLevelId: string;
} }
// const taskSchema = z.object({
// title: z.string().optional(),
// description: z.string().min(2, {
// message: "Narasi Penugasan harus lebih dari 2 karakter.",
// }),
// });
const taskSchema = z.object({ const taskSchema = z.object({
title: z.string().min(1, { message: "Judul diperlukan" }), title: z.string().optional(),
description: z.string().min(2, { description: z.string().min(2, {
message: "Narasi Penugasan harus lebih dari 2 karakter.", message: "Narasi Penugasan harus lebih dari 2 karakter.",
}), }),
@ -89,13 +96,11 @@ type OptionType = {
export default function FormQuestionsForward() { export default function FormQuestionsForward() {
const MySwal = withReactContent(Swal); const MySwal = withReactContent(Swal);
const { id } = useParams() as { id: string }; const { id } = useParams() as { id: string };
const [detail, setDetail] = useState<any>(); const [detail, setDetail] = useState<any>();
const [ticketReply, setTicketReply] = useState<replyDetail[]>([]); const [ticketReply, setTicketReply] = useState<replyDetail[]>([]);
const [replyVisible, setReplyVisible] = useState(false); const [replyVisible, setReplyVisible] = useState(false);
const [listDiscussion, setListDiscussion] = useState(); const [listDiscussion, setListDiscussion] = useState();
const [message, setMessage] = useState(""); const [message, setMessage] = useState("");
const [detailTickets, setDetailTickets] = useState<DetailTicket | null>(null); const [detailTickets, setDetailTickets] = useState<DetailTicket | null>(null);
// const [selectedPriority, setSelectedPriority] = useState(""); // const [selectedPriority, setSelectedPriority] = useState("");
const [selectedPriority, setSelectedPriority] = useState<OptionType | null>( const [selectedPriority, setSelectedPriority] = useState<OptionType | null>(
@ -202,6 +207,8 @@ export default function FormQuestionsForward() {
title: "Sukses", title: "Sukses",
text: "Data berhasil diperbarui.", text: "Data berhasil diperbarui.",
icon: "success", icon: "success",
}).then(() => {
window.location.href = "/in/supervisor/communications/questions/all";
}); });
getTicketReply(); getTicketReply();
@ -262,7 +269,7 @@ export default function FormQuestionsForward() {
const newReply = { const newReply = {
id: replies.length + 1, id: replies.length + 1,
name: "Mabes Polri - Approver", // Sesuaikan dengan data dinamis jika ada name: "Mabes Polri - Approver",
message: replyMessage, message: replyMessage,
timestamp: new Date().toISOString().slice(0, 19).replace("T", " "), timestamp: new Date().toISOString().slice(0, 19).replace("T", " "),
}; };

View File

@ -465,9 +465,9 @@ export default function FormImageDetail() {
console.log("getPlaa", filePlacements); console.log("getPlaa", filePlacements);
const temp = []; const temp = [];
for (let i = 0; i < filePlacements?.length; i++) { for (let i = 0; i < filePlacements?.length; i++) {
if (filePlacements[i].length !== 0) { if (filePlacements[i]?.length !== 0) {
const now = filePlacements[i].filter((a) => a !== "all"); const now = filePlacements[i]?.filter((a) => a !== "all");
const data = { mediaFileId: files[i].id, placements: now.join(",") }; const data = { mediaFileId: files[i]?.id, placements: now?.join(",") };
temp.push(data); temp.push(data);
} }
} }
@ -522,8 +522,8 @@ export default function FormImageDetail() {
} else { } else {
const now = temp[index]; const now = temp[index];
now?.push(placement); now?.push(placement);
if (now.length === 3 && !now.includes("all")) { if (now?.length === 3 && !now?.includes("all")) {
now.push("all"); now?.push("all");
} }
temp[index] = now; temp[index] = now;
} }
@ -531,11 +531,11 @@ export default function FormImageDetail() {
if (placement === "all") { if (placement === "all") {
temp[index] = []; temp[index] = [];
} else { } else {
const now = temp[index].filter((a) => a !== placement); const now = temp[index]?.filter((a) => a !== placement);
console.log("now", now); console.log("now", now);
temp[index] = now; temp[index] = now;
if (now.length === 3 && now.includes("all")) { if (now?.length === 3 && now?.includes("all")) {
const newData = now.filter((b) => b !== "all"); const newData = now?.filter((b) => b !== "all");
temp[index] = newData; temp[index] = newData;
} }
} }

View File

@ -170,7 +170,6 @@ export default function FormConvertSPIT() {
const { id } = useParams() as { id: string }; const { id } = useParams() as { id: string };
const [isAlreadySaved, setIsAlreadySaved] = useState(false); const [isAlreadySaved, setIsAlreadySaved] = useState(false);
// Form state
const { const {
control, control,
handleSubmit, handleSubmit,
@ -584,10 +583,10 @@ export default function FormConvertSPIT() {
return false; return false;
} }
if (!checkPlacement(filePlacements)) { // if (!checkPlacement(filePlacements)) {
error("Select File Placement"); // error("Select File Placement");
return false; // return false;
} // }
if (!selectedCategoryId) { if (!selectedCategoryId) {
error("Select a category"); error("Select a category");

View File

@ -2151,6 +2151,20 @@ export function getMenuList(pathname: string, t: any): Group[] {
}, },
], ],
}, },
{
groupLabel: "",
id: "curatedcontent",
menus: [
{
id: "curatedcontent",
href: "/shared/curated-content",
label: t("curated-content"),
active: pathname.includes("/curated-content"),
icon: "pixelarticons:calendar-text",
submenus: [],
},
],
},
{ {
groupLabel: "", groupLabel: "",
id: "communication", id: "communication",
@ -2996,25 +3010,39 @@ export function getMenuList(pathname: string, t: any): Group[] {
active: pathname.includes("/schedule"), active: pathname.includes("/schedule"),
icon: "uil:schedule", icon: "uil:schedule",
submenus: [ submenus: [
// {
// href: "/contributor/schedule/press-conference",
// label: t("press-conference"),
// active: pathname.includes("/schedule/press-conference"),
// icon: "heroicons:arrow-trending-up",
// children: [],
// },
// {
// href: "/contributor/schedule/event",
// label: t("event"),
// active: pathname.includes("/schedule/event"),
// icon: "heroicons:shopping-cart",
// children: [],
// },
// {
// href: "/contributor/schedule/press-release",
// label: t("press-release"),
// active: pathname.includes("/schedule/press-release"),
// icon: "heroicons:shopping-cart",
// children: [],
// },
{ {
href: "/contributor/schedule/press-conference", href: "/contributor/schedule/live-report",
label: t("press-conference"), label: t("live-report"),
active: pathname.includes("/schedule/press-conference"), active: pathname.includes("/schedule/live-report"),
icon: "heroicons:arrow-trending-up", icon: "heroicons:arrow-trending-up",
children: [], children: [],
}, },
{ {
href: "/contributor/schedule/event", href: "/contributor/schedule/calendar-polri",
label: t("event"), label: t("calendar-polri"),
active: pathname.includes("/schedule/event"), active: pathname.includes("/schedule/calendar-polri"),
icon: "heroicons:shopping-cart", icon: "heroicons:arrow-trending-up",
children: [],
},
{
href: "/contributor/schedule/press-release",
label: t("press-release"),
active: pathname.includes("/schedule/press-release"),
icon: "heroicons:shopping-cart",
children: [], children: [],
}, },
], ],