fixing
This commit is contained in:
parent
0c866f9363
commit
5c3eb2aefa
|
|
@ -54,8 +54,15 @@ interface Option {
|
|||
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({
|
||||
title: z.string().min(1, { message: "Judul diperlukan" }),
|
||||
title: z.string().optional(),
|
||||
description: z.string().min(2, {
|
||||
message: "Narasi Penugasan harus lebih dari 2 karakter.",
|
||||
}),
|
||||
|
|
@ -89,13 +96,11 @@ type OptionType = {
|
|||
export default function FormQuestionsForward() {
|
||||
const MySwal = withReactContent(Swal);
|
||||
const { id } = useParams() as { id: string };
|
||||
|
||||
const [detail, setDetail] = useState<any>();
|
||||
const [ticketReply, setTicketReply] = useState<replyDetail[]>([]);
|
||||
const [replyVisible, setReplyVisible] = useState(false);
|
||||
const [listDiscussion, setListDiscussion] = useState();
|
||||
const [message, setMessage] = useState("");
|
||||
|
||||
const [detailTickets, setDetailTickets] = useState<DetailTicket | null>(null);
|
||||
// const [selectedPriority, setSelectedPriority] = useState("");
|
||||
const [selectedPriority, setSelectedPriority] = useState<OptionType | null>(
|
||||
|
|
@ -202,6 +207,8 @@ export default function FormQuestionsForward() {
|
|||
title: "Sukses",
|
||||
text: "Data berhasil diperbarui.",
|
||||
icon: "success",
|
||||
}).then(() => {
|
||||
window.location.href = "/in/supervisor/communications/questions/all";
|
||||
});
|
||||
|
||||
getTicketReply();
|
||||
|
|
@ -262,7 +269,7 @@ export default function FormQuestionsForward() {
|
|||
|
||||
const newReply = {
|
||||
id: replies.length + 1,
|
||||
name: "Mabes Polri - Approver", // Sesuaikan dengan data dinamis jika ada
|
||||
name: "Mabes Polri - Approver",
|
||||
message: replyMessage,
|
||||
timestamp: new Date().toISOString().slice(0, 19).replace("T", " "),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -465,9 +465,9 @@ export default function FormImageDetail() {
|
|||
console.log("getPlaa", filePlacements);
|
||||
const temp = [];
|
||||
for (let i = 0; i < filePlacements?.length; i++) {
|
||||
if (filePlacements[i].length !== 0) {
|
||||
const now = filePlacements[i].filter((a) => a !== "all");
|
||||
const data = { mediaFileId: files[i].id, placements: now.join(",") };
|
||||
if (filePlacements[i]?.length !== 0) {
|
||||
const now = filePlacements[i]?.filter((a) => a !== "all");
|
||||
const data = { mediaFileId: files[i]?.id, placements: now?.join(",") };
|
||||
temp.push(data);
|
||||
}
|
||||
}
|
||||
|
|
@ -522,8 +522,8 @@ export default function FormImageDetail() {
|
|||
} else {
|
||||
const now = temp[index];
|
||||
now?.push(placement);
|
||||
if (now.length === 3 && !now.includes("all")) {
|
||||
now.push("all");
|
||||
if (now?.length === 3 && !now?.includes("all")) {
|
||||
now?.push("all");
|
||||
}
|
||||
temp[index] = now;
|
||||
}
|
||||
|
|
@ -531,11 +531,11 @@ export default function FormImageDetail() {
|
|||
if (placement === "all") {
|
||||
temp[index] = [];
|
||||
} else {
|
||||
const now = temp[index].filter((a) => a !== placement);
|
||||
const now = temp[index]?.filter((a) => a !== placement);
|
||||
console.log("now", now);
|
||||
temp[index] = now;
|
||||
if (now.length === 3 && now.includes("all")) {
|
||||
const newData = now.filter((b) => b !== "all");
|
||||
if (now?.length === 3 && now?.includes("all")) {
|
||||
const newData = now?.filter((b) => b !== "all");
|
||||
temp[index] = newData;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ export default function FormConvertSPIT() {
|
|||
const { id } = useParams() as { id: string };
|
||||
const [isAlreadySaved, setIsAlreadySaved] = useState(false);
|
||||
|
||||
// Form state
|
||||
const {
|
||||
control,
|
||||
handleSubmit,
|
||||
|
|
@ -584,10 +583,10 @@ export default function FormConvertSPIT() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!checkPlacement(filePlacements)) {
|
||||
error("Select File Placement");
|
||||
return false;
|
||||
}
|
||||
// if (!checkPlacement(filePlacements)) {
|
||||
// error("Select File Placement");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if (!selectedCategoryId) {
|
||||
error("Select a category");
|
||||
|
|
|
|||
56
lib/menus.ts
56
lib/menus.ts
|
|
@ -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: "",
|
||||
id: "communication",
|
||||
|
|
@ -2996,25 +3010,39 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
|||
active: pathname.includes("/schedule"),
|
||||
icon: "uil:schedule",
|
||||
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",
|
||||
label: t("press-conference"),
|
||||
active: pathname.includes("/schedule/press-conference"),
|
||||
href: "/contributor/schedule/live-report",
|
||||
label: t("live-report"),
|
||||
active: pathname.includes("/schedule/live-report"),
|
||||
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",
|
||||
href: "/contributor/schedule/calendar-polri",
|
||||
label: t("calendar-polri"),
|
||||
active: pathname.includes("/schedule/calendar-polri"),
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in New Issue