Merge branch 'main' of https://gitlab.com/hanifsalafi/mediahub_redesign into prod
This commit is contained in:
commit
fd61c5311b
|
|
@ -23,7 +23,7 @@ import Swal from "sweetalert2";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
const useTableColumns = () => {
|
const useTableColumns = () => {
|
||||||
const t = useTranslations("Table"); // Panggil di dalam hook
|
const t = useTranslations("Table");
|
||||||
const columns: ColumnDef<any>[] = [
|
const columns: ColumnDef<any>[] = [
|
||||||
{
|
{
|
||||||
accessorKey: "no",
|
accessorKey: "no",
|
||||||
|
|
@ -124,6 +124,85 @@ const useTableColumns = () => {
|
||||||
accessorKey: "action",
|
accessorKey: "action",
|
||||||
header: t("action", { defaultValue: "Action" }),
|
header: t("action", { defaultValue: "Action" }),
|
||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
|
// cell: ({ row }) => {
|
||||||
|
// const router = useRouter();
|
||||||
|
// const MySwal = withReactContent(Swal);
|
||||||
|
|
||||||
|
// async function deleteProcess(id: any) {
|
||||||
|
// loading();
|
||||||
|
// const resDelete = await deleteTask(id);
|
||||||
|
|
||||||
|
// if (resDelete?.error) {
|
||||||
|
// error(resDelete.message);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// success();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// function success() {
|
||||||
|
// MySwal.fire({
|
||||||
|
// title: "Sukses",
|
||||||
|
// icon: "success",
|
||||||
|
// confirmButtonColor: "#3085d6",
|
||||||
|
// confirmButtonText: "OK",
|
||||||
|
// }).then((result) => {
|
||||||
|
// if (result.isConfirmed) {
|
||||||
|
// window.location.reload();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// const TaskDelete = (id: any) => {
|
||||||
|
// MySwal.fire({
|
||||||
|
// title: "Hapus Data",
|
||||||
|
// text: "",
|
||||||
|
// icon: "warning",
|
||||||
|
// showCancelButton: true,
|
||||||
|
// cancelButtonColor: "#3085d6",
|
||||||
|
// confirmButtonColor: "#d33",
|
||||||
|
// confirmButtonText: "Hapus",
|
||||||
|
// }).then((result) => {
|
||||||
|
// if (result.isConfirmed) {
|
||||||
|
// deleteProcess(id);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
|
||||||
|
// return (
|
||||||
|
// <DropdownMenu>
|
||||||
|
// <DropdownMenuTrigger asChild>
|
||||||
|
// <Button
|
||||||
|
// size="icon"
|
||||||
|
// className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||||
|
// >
|
||||||
|
// <span className="sr-only">Open menu</span>
|
||||||
|
// <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 border-b 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>
|
||||||
|
// <Link href={`/contributor/task/update/${row.original.id}`}>
|
||||||
|
// <DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
// <SquarePen className="w-4 h-4 me-1.5" />
|
||||||
|
// Edit
|
||||||
|
// </DropdownMenuItem>
|
||||||
|
// </Link>
|
||||||
|
// <DropdownMenuItem
|
||||||
|
// onClick={() => TaskDelete(row.original.id)}
|
||||||
|
// className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none"
|
||||||
|
// >
|
||||||
|
// <Trash2 className="w-4 h-4 me-1.5" />
|
||||||
|
// Delete
|
||||||
|
// </DropdownMenuItem>
|
||||||
|
// </DropdownMenuContent>
|
||||||
|
// </DropdownMenu>
|
||||||
|
// );
|
||||||
|
// },
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const MySwal = withReactContent(Swal);
|
const MySwal = withReactContent(Swal);
|
||||||
|
|
@ -168,6 +247,8 @@ const useTableColumns = () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isDone = row.original.isDone;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
|
|
@ -186,6 +267,9 @@ const useTableColumns = () => {
|
||||||
View
|
View
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
|
{!isDone && (
|
||||||
|
<>
|
||||||
<Link href={`/contributor/task/update/${row.original.id}`}>
|
<Link href={`/contributor/task/update/${row.original.id}`}>
|
||||||
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
<SquarePen className="w-4 h-4 me-1.5" />
|
<SquarePen className="w-4 h-4 me-1.5" />
|
||||||
|
|
@ -199,6 +283,8 @@ const useTableColumns = () => {
|
||||||
<Trash2 className="w-4 h-4 me-1.5" />
|
<Trash2 className="w-4 h-4 me-1.5" />
|
||||||
Delete
|
Delete
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ const TaskPage = () => {
|
||||||
const t = useTranslations("AnalyticsDashboard");
|
const t = useTranslations("AnalyticsDashboard");
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function initState() {
|
function initState() {
|
||||||
checkAuthorization("admin"); // Specify the page, e.g., "admin" or another value
|
checkAuthorization("admin");
|
||||||
checkLoginSession();
|
checkLoginSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1027,7 +1027,7 @@ export default function FormTaskDetail() {
|
||||||
<div className="mt-6 space-y-2">
|
<div className="mt-6 space-y-2">
|
||||||
<Label>{t("type-task", { defaultValue: "Type Task" })}</Label>
|
<Label>{t("type-task", { defaultValue: "Type Task" })}</Label>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
value={detail.assignmentMainType.id.toString()}
|
value={detail?.assignmentMainType?.id?.toString()}
|
||||||
onValueChange={(value) => setMainType(value)}
|
onValueChange={(value) => setMainType(value)}
|
||||||
// value={String(mainType)}
|
// value={String(mainType)}
|
||||||
// onValueChange={(value) => setMainType(Number(value))}
|
// onValueChange={(value) => setMainType(Number(value))}
|
||||||
|
|
|
||||||
|
|
@ -468,10 +468,21 @@ const DetailVideo = () => {
|
||||||
<div className="rounded-md overflow-hidden md:flex">
|
<div className="rounded-md overflow-hidden md:flex">
|
||||||
{/* Bagian Kiri */}
|
{/* Bagian Kiri */}
|
||||||
<div className="md:w-3/4">
|
<div className="md:w-3/4">
|
||||||
<div className="relative">
|
{/* <div className="relative">
|
||||||
<VideoPlayer url={detailDataVideo?.files[selectedVideo]?.url} />
|
<VideoPlayer url={detailDataVideo?.files[selectedVideo]?.url} />
|
||||||
<div className="absolute top-4 left-4"></div>
|
<div className="absolute top-4 left-4"></div>
|
||||||
|
</div> */}
|
||||||
|
<div className="relative max-h-screen overflow-hidden">
|
||||||
|
<div className="w-full max-h-screen aspect-video">
|
||||||
|
<div className="w-full h-full">
|
||||||
|
<VideoPlayer
|
||||||
|
url={detailDataVideo?.files[selectedVideo]?.url}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="absolute top-4 left-4"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="py-4 flex flex-row gap-3">
|
<div className="py-4 flex flex-row gap-3">
|
||||||
{detailDataVideo?.files?.map((file: any, index: number) => (
|
{detailDataVideo?.files?.map((file: any, index: number) => (
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue