[QUDO-98] feat:emergency issue
This commit is contained in:
parent
78b633d337
commit
82cccdf94f
|
|
@ -43,7 +43,7 @@ const columns: ColumnDef<any>[] = [
|
||||||
accessorKey: "type",
|
accessorKey: "type",
|
||||||
header: "Channel",
|
header: "Channel",
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const type = row.original.type; // Akses properti category
|
const type = row.original.type;
|
||||||
return <span className="normal-case">{type?.name || "N/A"}</span>;
|
return <span className="normal-case">{type?.name || "N/A"}</span>;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -67,11 +67,11 @@ const columns: ColumnDef<any>[] = [
|
||||||
accessorKey: "isActive",
|
accessorKey: "isActive",
|
||||||
header: "Status",
|
header: "Status",
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const isActive = row.getValue("isActive") as boolean; // Ambil nilai isActive
|
const isActive = row.getValue("isActive") as boolean;
|
||||||
const status = isActive ? "Open" : "Closed"; // Tentukan teks berdasarkan isActive
|
const status = isActive ? "Open" : "Closed";
|
||||||
const statusStyles = isActive
|
const statusStyles = isActive
|
||||||
? "bg-green-100 text-green-600" // Gaya untuk "Open"
|
? "bg-green-100 text-green-600"
|
||||||
: "bg-red-100 text-red-600"; // Gaya untuk "Closed"
|
: "bg-red-100 text-red-600";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Badge className={`rounded-full px-5 ${statusStyles}`}>{status}</Badge>
|
<Badge className={`rounded-full px-5 ${statusStyles}`}>{status}</Badge>
|
||||||
|
|
|
||||||
|
|
@ -193,8 +193,8 @@ export default function FormQuestionsReply() {
|
||||||
|
|
||||||
console.log("Berhasil kirim balasan:", res?.data);
|
console.log("Berhasil kirim balasan:", res?.data);
|
||||||
setReplyText("");
|
setReplyText("");
|
||||||
setReplyValue(0); // tutup form setelah kirim
|
setReplyValue(0);
|
||||||
getTicketReply(); // refresh balasan
|
getTicketReply();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Gagal kirim balasan:", err);
|
console.error("Gagal kirim balasan:", err);
|
||||||
}
|
}
|
||||||
|
|
@ -242,7 +242,6 @@ export default function FormQuestionsReply() {
|
||||||
try {
|
try {
|
||||||
const response = await saveTicketReply(data);
|
const response = await saveTicketReply(data);
|
||||||
|
|
||||||
// Tambahkan balasan baru ke daftar balasan
|
|
||||||
const newReply: replyDetail = {
|
const newReply: replyDetail = {
|
||||||
id: response?.data?.id,
|
id: response?.data?.id,
|
||||||
comments: replyMessage,
|
comments: replyMessage,
|
||||||
|
|
@ -259,7 +258,6 @@ export default function FormQuestionsReply() {
|
||||||
icon: "success",
|
icon: "success",
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reset input dan sembunyikan form balasan
|
|
||||||
setReplyMessage("");
|
setReplyMessage("");
|
||||||
setReplyVisible(false);
|
setReplyVisible(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -293,7 +291,6 @@ export default function FormQuestionsReply() {
|
||||||
icon: "success",
|
icon: "success",
|
||||||
});
|
});
|
||||||
|
|
||||||
// Refresh data jika perlu
|
|
||||||
getTicketReply();
|
getTicketReply();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Gagal update:", error);
|
console.error("Gagal update:", error);
|
||||||
|
|
|
||||||
|
|
@ -164,15 +164,14 @@ export default function FormDetailTicketing() {
|
||||||
const optionArr = rawUser?.map((option: any) => ({
|
const optionArr = rawUser?.map((option: any) => ({
|
||||||
id: option.id,
|
id: option.id,
|
||||||
label: option.fullName,
|
label: option.fullName,
|
||||||
value: option.id.toString(), // pastikan string
|
value: option.id.toString(),
|
||||||
}));
|
}));
|
||||||
setOperatorOpt(optionArr);
|
setOperatorOpt(optionArr);
|
||||||
|
|
||||||
// 👇 Parse `assignedTeams` ke dalam array string
|
|
||||||
if (detailTickets?.assignedTeams) {
|
if (detailTickets?.assignedTeams) {
|
||||||
const assigned = detailTickets.assignedTeams
|
const assigned = detailTickets.assignedTeams
|
||||||
.split(":")
|
.split(":")
|
||||||
.filter((id: string) => id); // hapus string kosong
|
.filter((id: string) => id);
|
||||||
setSelectedOperator(assigned);
|
setSelectedOperator(assigned);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -201,8 +200,8 @@ export default function FormDetailTicketing() {
|
||||||
|
|
||||||
console.log("Berhasil kirim balasan:", res?.data);
|
console.log("Berhasil kirim balasan:", res?.data);
|
||||||
setReplyText("");
|
setReplyText("");
|
||||||
setReplyValue(0); // tutup form setelah kirim
|
setReplyValue(0);
|
||||||
getTicketReply(); // refresh balasan
|
getTicketReply();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Gagal kirim balasan:", err);
|
console.error("Gagal kirim balasan:", err);
|
||||||
}
|
}
|
||||||
|
|
@ -233,7 +232,6 @@ export default function FormDetailTicketing() {
|
||||||
try {
|
try {
|
||||||
const response = await saveTicketReply(data);
|
const response = await saveTicketReply(data);
|
||||||
|
|
||||||
// Tambahkan balasan baru ke daftar balasan
|
|
||||||
const newReply: replyDetail = {
|
const newReply: replyDetail = {
|
||||||
id: response?.data?.id,
|
id: response?.data?.id,
|
||||||
comments: replyMessage,
|
comments: replyMessage,
|
||||||
|
|
@ -250,7 +248,6 @@ export default function FormDetailTicketing() {
|
||||||
icon: "success",
|
icon: "success",
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reset input dan sembunyikan form balasan
|
|
||||||
setReplyMessage("");
|
setReplyMessage("");
|
||||||
setReplyVisible(false);
|
setReplyVisible(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
|
|
@ -174,15 +174,14 @@ export default function FormUpdateTicketing() {
|
||||||
const optionArr = rawUser?.map((option: any) => ({
|
const optionArr = rawUser?.map((option: any) => ({
|
||||||
id: option.id,
|
id: option.id,
|
||||||
label: option.fullName,
|
label: option.fullName,
|
||||||
value: option.id.toString(), // pastikan string
|
value: option.id.toString(),
|
||||||
}));
|
}));
|
||||||
setOperatorOpt(optionArr);
|
setOperatorOpt(optionArr);
|
||||||
|
|
||||||
// 👇 Parse `assignedTeams` ke dalam array string
|
|
||||||
if (detailTickets?.assignedTeams) {
|
if (detailTickets?.assignedTeams) {
|
||||||
const assigned = detailTickets.assignedTeams
|
const assigned = detailTickets.assignedTeams
|
||||||
.split(":")
|
.split(":")
|
||||||
.filter((id: string) => id); // hapus string kosong
|
.filter((id: string) => id);
|
||||||
setSelectedOperator(assigned);
|
setSelectedOperator(assigned);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -199,7 +198,7 @@ export default function FormUpdateTicketing() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleReply = () => {
|
const handleReply = () => {
|
||||||
setReplyVisible((prev) => !prev); // Toggle visibility
|
setReplyVisible((prev) => !prev);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSendReply = async () => {
|
const handleSendReply = async () => {
|
||||||
|
|
@ -220,7 +219,6 @@ export default function FormUpdateTicketing() {
|
||||||
try {
|
try {
|
||||||
const response = await saveTicketReply(data);
|
const response = await saveTicketReply(data);
|
||||||
|
|
||||||
// Tambahkan balasan baru ke daftar balasan
|
|
||||||
const newReply: replyDetail = {
|
const newReply: replyDetail = {
|
||||||
id: response?.data?.id,
|
id: response?.data?.id,
|
||||||
comments: replyMessage,
|
comments: replyMessage,
|
||||||
|
|
@ -237,7 +235,6 @@ export default function FormUpdateTicketing() {
|
||||||
icon: "success",
|
icon: "success",
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reset input dan sembunyikan form balasan
|
|
||||||
setReplyMessage("");
|
setReplyMessage("");
|
||||||
setReplyVisible(false);
|
setReplyVisible(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -293,7 +290,7 @@ export default function FormUpdateTicketing() {
|
||||||
description: data.description,
|
description: data.description,
|
||||||
priority: data.priority,
|
priority: data.priority,
|
||||||
status: data.status,
|
status: data.status,
|
||||||
operatorTeam: selectedOperator.join(","), // Gunakan selectedOperator yang sudah ada
|
operatorTeam: selectedOperator.join(","),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (id) {
|
if (id) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue