fix: adjust branch to prod
This commit is contained in:
parent
f9417b63ae
commit
80d07d358f
|
|
@ -22,7 +22,7 @@ import withReactContent from "sweetalert2-react-content";
|
|||
import Swal from "sweetalert2";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
const useTableColumns = () => {
|
||||
const useTableColumns = (activeTab: "ta" | "daily" | "special") => {
|
||||
const t = useTranslations("Table");
|
||||
const columns: ColumnDef<any>[] = [
|
||||
{
|
||||
|
|
@ -113,6 +113,31 @@ const useTableColumns = () => {
|
|||
const MySwal = withReactContent(Swal);
|
||||
const roleId = Number(getCookiesDecrypt("urie")) || 0;
|
||||
|
||||
// ❗ jika tab = "special"
|
||||
if (activeTab === "special") {
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
size="icon"
|
||||
className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||
>
|
||||
<MoreVertical className="h-4 w-4 text-default-800" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
<DropdownMenuContent className="p-0" align="end">
|
||||
<Link href={`/contributor/task/detail/${row.original.id}`}>
|
||||
<DropdownMenuItem className="p-2 text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||
<Eye className="w-4 h-4 me-1.5" />
|
||||
View
|
||||
</DropdownMenuItem>
|
||||
</Link>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
);
|
||||
}
|
||||
|
||||
async function deleteProcess(id: any) {
|
||||
loading();
|
||||
const resDelete = await deleteTaskTa(id);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ const TaskTaTable = () => {
|
|||
const [limit, setLimit] = React.useState(10);
|
||||
const [isSpecificAttention, setIsSpecificAttention] = React.useState(true);
|
||||
const [search, setSearch] = React.useState<string>("");
|
||||
const columns = useTableColumns();
|
||||
const columns = useTableColumns(activeTab);
|
||||
const table = useReactTable({
|
||||
data: dataTable,
|
||||
columns,
|
||||
|
|
|
|||
|
|
@ -338,22 +338,48 @@ export default function FormTask() {
|
|||
.map((key) => fileTypeMapping[key as keyof typeof fileTypeMapping])
|
||||
.join(",");
|
||||
|
||||
let roleTargets = selectedTarget
|
||||
? selectedTarget.split(",").map((x) => Number(x))
|
||||
: [];
|
||||
|
||||
if (!roleTargets.includes(11)) {
|
||||
roleTargets.push(11);
|
||||
}
|
||||
|
||||
const finalAssignedToRole = roleTargets.join(",");
|
||||
|
||||
const requestData = {
|
||||
...data,
|
||||
assignedToRole: finalAssignedToRole,
|
||||
assignedToLevel: handlePoldaPolresChange(),
|
||||
assignmentPurpose: assignmentPurposeString,
|
||||
assignedToRole: selectedTarget,
|
||||
taskType,
|
||||
broadcastType,
|
||||
assignmentMainTypeId: mainType,
|
||||
assignmentTypeId: type,
|
||||
fileTypeOutput: selectedOutputs,
|
||||
assignmentTypeId: type,
|
||||
narration: data.naration,
|
||||
platformType: "",
|
||||
title: data.title,
|
||||
attachmentUrl: links,
|
||||
platformType: "",
|
||||
};
|
||||
|
||||
// const requestData = {
|
||||
// ...data,
|
||||
// assignedToLevel: handlePoldaPolresChange(),
|
||||
// assignmentPurpose: assignmentPurposeString,
|
||||
// assignedToRole: selectedTarget,
|
||||
// taskType,
|
||||
// broadcastType,
|
||||
// assignmentMainTypeId: mainType,
|
||||
// assignmentTypeId: type,
|
||||
// fileTypeOutput: selectedOutputs,
|
||||
// narration: data.naration,
|
||||
// platformType: "",
|
||||
// title: data.title,
|
||||
// attachmentUrl: links,
|
||||
// };
|
||||
|
||||
const response = await createTask(requestData);
|
||||
const id = response?.data?.data.id;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue