feat:update form agenda
This commit is contained in:
commit
01b70c708f
|
|
@ -494,7 +494,7 @@ const CalendarView = ({ categories }: CalendarViewProps) => {
|
||||||
<Card className="col-span-12 lg:col-span-4 2xl:col-span-3 pb-5">
|
<Card className="col-span-12 lg:col-span-4 2xl:col-span-3 pb-5">
|
||||||
<CardContent className="p-0">
|
<CardContent className="p-0">
|
||||||
<CardHeader className="border-none mb-2 pt-5">
|
<CardHeader className="border-none mb-2 pt-5">
|
||||||
{roleId == 10 || roleId == 11 ?
|
{roleId == 11 || roleId == 12 ?
|
||||||
<Button
|
<Button
|
||||||
onClick={handleDateClick}
|
onClick={handleDateClick}
|
||||||
className="dark:bg-background dark:text-foreground"
|
className="dark:bg-background dark:text-foreground"
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ const page = () => {
|
||||||
<WelcomePolda />
|
<WelcomePolda />
|
||||||
<NewContent group="polda" type="latest" />
|
<NewContent group="polda" type="latest" />
|
||||||
<NewContent group="polda" type="popular" />
|
<NewContent group="polda" type="popular" />
|
||||||
<ContentCategory />
|
<ContentCategory group="polda" />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ const page = () => {
|
||||||
<WelcomeSatker />
|
<WelcomeSatker />
|
||||||
<NewContent group="satker" type="latest" />
|
<NewContent group="satker" type="latest" />
|
||||||
<NewContent group="satker" type="popular" />
|
<NewContent group="satker" type="popular" />
|
||||||
<ContentCategory />
|
<ContentCategory group="satker" />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -285,8 +285,9 @@ const FilterPage = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initFetch();
|
initFetch();
|
||||||
}, [page]);
|
}, [page]);
|
||||||
|
|
||||||
const initFetch = async () => {
|
const initFetch = async () => {
|
||||||
const response = await getListContent({ page: page - 1, size: 6, sortBy: "createdAt", contentTypeId: "3" });
|
const response = await getListContent({ page: page - 1, size: 6, sortBy: "createdAt", contentTypeId: "3", isInt: locale == "en" ? true : false });
|
||||||
console.log(response);
|
console.log(response);
|
||||||
setDocumentData(response?.data?.data?.content);
|
setDocumentData(response?.data?.data?.content);
|
||||||
const data = response?.data?.data;
|
const data = response?.data?.data;
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import ReactDatePicker from "react-datepicker";
|
||||||
import "react-datepicker/dist/react-datepicker.css";
|
import "react-datepicker/dist/react-datepicker.css";
|
||||||
import { close, loading } from "@/config/swal";
|
import { close, loading } from "@/config/swal";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import ImageBlurry from "@/components/ui/image-blurry";
|
||||||
|
|
||||||
const columns: ColumnDef<any>[] = [
|
const columns: ColumnDef<any>[] = [
|
||||||
{
|
{
|
||||||
|
|
@ -154,7 +155,8 @@ const FilterPage = () => {
|
||||||
startDateString,
|
startDateString,
|
||||||
endDateString,
|
endDateString,
|
||||||
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]?.replace("", "") : "",
|
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]?.replace("", "") : "",
|
||||||
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[1] : ""
|
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[1] : "",
|
||||||
|
locale == "en" ? true : false,
|
||||||
);
|
);
|
||||||
close();
|
close();
|
||||||
// setGetTotalPage(response?.data?.data?.totalPages);
|
// setGetTotalPage(response?.data?.data?.totalPages);
|
||||||
|
|
@ -186,7 +188,8 @@ const FilterPage = () => {
|
||||||
startDateString,
|
startDateString,
|
||||||
endDateString,
|
endDateString,
|
||||||
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]?.replace("", "") : "",
|
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]?.replace("", "") : "",
|
||||||
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[1] : ""
|
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[1] : "",
|
||||||
|
locale == "en" ? true : false,
|
||||||
);
|
);
|
||||||
close();
|
close();
|
||||||
// setGetTotalPage(response?.data?.data?.totalPages);
|
// setGetTotalPage(response?.data?.data?.totalPages);
|
||||||
|
|
@ -368,7 +371,7 @@ const FilterPage = () => {
|
||||||
|
|
||||||
{/* Left */}
|
{/* Left */}
|
||||||
<div className="flex flex-col lg:flex-row gap-6 p-4">
|
<div className="flex flex-col lg:flex-row gap-6 p-4">
|
||||||
<div className="lg:w-[25%] h-fit w-full bg-[#f7f7f7] dark:bg-black p-4 rounded-lg shadow-md">
|
<div className="lg:w-96 h-fit w-full bg-[#f7f7f7] dark:bg-black p-4 rounded-lg shadow-md">
|
||||||
<h2 className="text-lg font-semibold mb-4 flex items-center gap-1">
|
<h2 className="text-lg font-semibold mb-4 flex items-center gap-1">
|
||||||
<Icon icon="stash:filter-light" fontSize={30} />
|
<Icon icon="stash:filter-light" fontSize={30} />
|
||||||
Filter
|
Filter
|
||||||
|
|
@ -470,8 +473,9 @@ const FilterPage = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Konten Kanan */}
|
{/* Konten Kanan */}
|
||||||
|
<div className="w-full">
|
||||||
<Reveal>
|
<Reveal>
|
||||||
<div className="flex-1">
|
<div className="w-full">
|
||||||
<div className="flex flex-col items-end mb-4">
|
<div className="flex flex-col items-end mb-4">
|
||||||
<h2 className="text-lg font-semibold">{t("sortBy")}</h2>
|
<h2 className="text-lg font-semibold">{t("sortBy")}</h2>
|
||||||
<select defaultValue={sortBy == "popular" ? "terpopuler" : "terbaru"} onChange={(e) => handleSorting(e)} className="border rounded-md py-2 px-3 focus:ring-red-500 focus:border-red-500">
|
<select defaultValue={sortBy == "popular" ? "terpopuler" : "terbaru"} onChange={(e) => handleSorting(e)} className="border rounded-md py-2 px-3 focus:ring-red-500 focus:border-red-500">
|
||||||
|
|
@ -483,11 +487,20 @@ const FilterPage = () => {
|
||||||
{imageData?.length > 0 ? (
|
{imageData?.length > 0 ? (
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
{imageData?.map((image: any) => (
|
{imageData?.map((image: any) => (
|
||||||
<Card key={image?.id} className="hover:scale-110 transition-transform duration-300">
|
<Card key={image?.id} className="hover:scale-105 transition-transform duration-300">
|
||||||
<CardContent className="flex flex-col text-xs lg:text-sm w-full p-0">
|
<CardContent className="flex flex-col text-xs lg:text-sm w-full p-0">
|
||||||
<Link href={`/image/detail/${image?.slug}`}>
|
<Link href={`/image/detail/${image?.slug}`}>
|
||||||
<img src={image?.thumbnailLink} className="h-60 object-cover items-center justify-center cursor-pointer rounded-lg" />
|
{/* <img src={image?.thumbnailLink} className="h-60 object-cover items-center justify-center cursor-pointer rounded-lg" /> */}
|
||||||
<div className="flex flex-row items-center gap-2 text-[10px] mx-2">
|
<div
|
||||||
|
className="img-container h-60 bg-[#e9e9e9] cursor-pointer rounded-lg"
|
||||||
|
>
|
||||||
|
<ImageBlurry
|
||||||
|
src={image?.thumbnailLink}
|
||||||
|
alt={image?.title}
|
||||||
|
style={{ objectFit: "contain", width: "100%", height: "100%" }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-row items-center gap-2 text-[10px] mx-2 mt-2">
|
||||||
{formatDateToIndonesian(new Date(image?.createdAt))} {image?.timezone ? image?.timezone : "WIB"}| <Icon icon="formkit:eye" width="15" height="15" />
|
{formatDateToIndonesian(new Date(image?.createdAt))} {image?.timezone ? image?.timezone : "WIB"}| <Icon icon="formkit:eye" width="15" height="15" />
|
||||||
{image?.clickCount}{" "}
|
{image?.clickCount}{" "}
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">
|
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">
|
||||||
|
|
@ -509,11 +522,12 @@ const FilterPage = () => {
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<LandingPagination table={table} totalData={totalData} totalPage={totalPage} />
|
{totalData > 1 && <LandingPagination table={table} totalData={totalData} totalPage={totalPage} />}
|
||||||
</div>
|
</div>
|
||||||
</Reveal>
|
</Reveal>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -289,6 +289,7 @@ const FilterPage = () => {
|
||||||
size: 6,
|
size: 6,
|
||||||
sortBy: "createdAt",
|
sortBy: "createdAt",
|
||||||
contentTypeId: "2",
|
contentTypeId: "2",
|
||||||
|
isInt: locale == "en" ? true : false,
|
||||||
});
|
});
|
||||||
console.log(response);
|
console.log(response);
|
||||||
setVideoData(response?.data?.data?.content);
|
setVideoData(response?.data?.data?.content);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ const Home = ({ params: { locale } }: { params: { locale: string } }) => {
|
||||||
<NewContent group="mabes" type="latest" />
|
<NewContent group="mabes" type="latest" />
|
||||||
<NewContent group="mabes" type="popular" />
|
<NewContent group="mabes" type="popular" />
|
||||||
{/* <PopularContent /> */}
|
{/* <PopularContent /> */}
|
||||||
<ContentCategory />
|
<ContentCategory group="mabes" />
|
||||||
<Coverage />
|
<Coverage />
|
||||||
<Division />
|
<Division />
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|
|
||||||
|
|
@ -1156,7 +1156,26 @@ export default function FormTaskDetail() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row justify-end gap-3 my-3">
|
<div className="flex flex-row justify-between gap-3 my-3">
|
||||||
|
<div className="px-1">
|
||||||
|
{detail?.isDone !== true &&
|
||||||
|
(Number(userLevelNumber) !== 3 ||
|
||||||
|
Number(userLevelNumber) == 2) ? (
|
||||||
|
<Button
|
||||||
|
color="primary"
|
||||||
|
variant={"outline"}
|
||||||
|
type="button"
|
||||||
|
className="btn btn-outline-primary ml-3"
|
||||||
|
onClick={() => handleForward()}
|
||||||
|
>
|
||||||
|
Forward
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div className="flex gap-2">
|
||||||
<div className="">
|
<div className="">
|
||||||
<Button
|
<Button
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
@ -1170,7 +1189,7 @@ export default function FormTaskDetail() {
|
||||||
<Button
|
<Button
|
||||||
className="btn btn-primary ml-3 mr-3"
|
className="btn btn-primary ml-3 mr-3"
|
||||||
style={
|
style={
|
||||||
statusAcceptance || detail?.createdBy?.id == Number(userId)
|
statusAcceptance || detail?.createdBy?.id !== Number(userId)
|
||||||
? {
|
? {
|
||||||
display: "none",
|
display: "none",
|
||||||
}
|
}
|
||||||
|
|
@ -1183,23 +1202,24 @@ export default function FormTaskDetail() {
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="task-response w-100 px-3 "
|
className="task-response w-100 px-3 "
|
||||||
style={
|
// style={
|
||||||
isSentResult || detail?.createdBy?.id == Number(userId)
|
// Number(detail?.createdBy?.id) == Number(userId)
|
||||||
? {}
|
// ? {}
|
||||||
: {
|
// : {
|
||||||
display: "none",
|
// display: "none",
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
color="primary"
|
color="primary"
|
||||||
variant={"default"}
|
variant={"default"}
|
||||||
onClick={() => setIsTableResult(!isTableResult)}
|
onClick={() => setIsTableResult(!isTableResult)}
|
||||||
>
|
>
|
||||||
Hasil Upload
|
Hasil Upload {Number(userId)}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{isTableResult && (
|
{isTableResult && (
|
||||||
<table className="w-full border-collapse border border-gray-300">
|
<table className="w-full border-collapse border border-gray-300">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
@ -1223,6 +1243,7 @@ export default function FormTaskDetail() {
|
||||||
</table>
|
</table>
|
||||||
)}
|
)}
|
||||||
{showInput && (
|
{showInput && (
|
||||||
|
<>
|
||||||
<div className="mt-4 border p-4 rounded bg-gray-50">
|
<div className="mt-4 border p-4 rounded bg-gray-50">
|
||||||
<Textarea
|
<Textarea
|
||||||
placeholder="Tulis tanggapan Anda di sini..."
|
placeholder="Tulis tanggapan Anda di sini..."
|
||||||
|
|
@ -1239,7 +1260,6 @@ export default function FormTaskDetail() {
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
<div className="mt-6">
|
<div className="mt-6">
|
||||||
<h3 className="text-lg font-bold text-center">Tanggapan</h3>
|
<h3 className="text-lg font-bold text-center">Tanggapan</h3>
|
||||||
{listData?.map((item: any) => (
|
{listData?.map((item: any) => (
|
||||||
|
|
@ -1401,6 +1421,8 @@ export default function FormTaskDetail() {
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<div className="flex justify-center mt-4">
|
<div className="flex justify-center mt-4">
|
||||||
{detail?.createdBy?.id == Number(userId) &&
|
{detail?.createdBy?.id == Number(userId) &&
|
||||||
detail?.isDone !== true ? (
|
detail?.isDone !== true ? (
|
||||||
|
|
@ -1427,21 +1449,6 @@ export default function FormTaskDetail() {
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
{detail?.isDone !== true &&
|
|
||||||
(Number(userLevelNumber) !== 3 ||
|
|
||||||
Number(userLevelNumber) == 2) ? (
|
|
||||||
<Button
|
|
||||||
color="primary"
|
|
||||||
variant={"outline"}
|
|
||||||
type="button"
|
|
||||||
className="btn btn-outline-primary ml-3"
|
|
||||||
onClick={() => handleForward()}
|
|
||||||
>
|
|
||||||
Forward
|
|
||||||
</Button>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,31 @@
|
||||||
import { getCategoryData } from "@/service/landing/landing";
|
import { getCategoryData, getPublicCategoryData } from "@/service/landing/landing";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Button } from "../ui/button";
|
import { Button } from "../ui/button";
|
||||||
import { Reveal } from "./Reveal";
|
import { Reveal } from "./Reveal";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
|
import { useParams } from "next/navigation";
|
||||||
|
|
||||||
const ContentCategory = () => {
|
const ContentCategory = (props: { group?: string }) => {
|
||||||
const [categories, setCategories] = useState<any>();
|
const [categories, setCategories] = useState<any>();
|
||||||
const t = useTranslations("LandingPage");
|
const t = useTranslations("LandingPage");
|
||||||
|
const params = useParams();
|
||||||
|
const locale = params?.locale;
|
||||||
|
const poldaName = params?.polda_name;
|
||||||
|
const satkerName = params?.satker_name;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initFetch();
|
initFetch();
|
||||||
}, []);
|
}, []);
|
||||||
const initFetch = async () => {
|
const initFetch = async () => {
|
||||||
const response = await getCategoryData();
|
const response = await getPublicCategoryData(
|
||||||
|
props.group == "mabes" ? "" :
|
||||||
|
props.group == "polda" && poldaName && String(poldaName)?.length > 1 ? poldaName :
|
||||||
|
props.group == "satker" && satkerName && String(satkerName)?.length > 1 ? "satker-"+satkerName : "",
|
||||||
|
"",
|
||||||
|
locale == "en" ? true : false
|
||||||
|
);
|
||||||
console.log("category", response);
|
console.log("category", response);
|
||||||
setCategories(response?.data?.data?.content);
|
setCategories(response?.data?.data?.content);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ const NewContent = (props: { group: string, type: string }) => {
|
||||||
group: props.group == "mabes" ? "" :
|
group: props.group == "mabes" ? "" :
|
||||||
props.group == "polda" && poldaName && String(poldaName)?.length > 1 ? poldaName :
|
props.group == "polda" && poldaName && String(poldaName)?.length > 1 ? poldaName :
|
||||||
props.group == "satker" && satkerName && String(satkerName)?.length > 1 ? "satker-"+satkerName : "",
|
props.group == "satker" && satkerName && String(satkerName)?.length > 1 ? "satker-"+satkerName : "",
|
||||||
|
isInt: locale == "en" ? true : false
|
||||||
};
|
};
|
||||||
const response = await getListContent(request);
|
const response = await getListContent(request);
|
||||||
console.log("category", response);
|
console.log("category", response);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
interface ImageBlurryProps {
|
||||||
|
src: string;
|
||||||
|
alt?: string;
|
||||||
|
classname?: string;
|
||||||
|
key?: string | number;
|
||||||
|
style?: React.CSSProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ImageBlurry: React.FC<ImageBlurryProps> = (props) => {
|
||||||
|
const { src, alt, classname, key, style } = props;
|
||||||
|
|
||||||
|
const [imgSrc, setImgSrc] = useState<string>(src);
|
||||||
|
const [isError, setIsError] = useState<boolean>(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setImgSrc(src);
|
||||||
|
}, [src]);
|
||||||
|
|
||||||
|
const handleImage = () => {
|
||||||
|
const pics = document.querySelectorAll<HTMLImageElement>('img');
|
||||||
|
pics.forEach((pic) => {
|
||||||
|
if (pic.complete) {
|
||||||
|
checkImage(pic);
|
||||||
|
} else {
|
||||||
|
pic.addEventListener('load', function () {
|
||||||
|
checkImage(this);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const checkImage = (img: HTMLImageElement) => {
|
||||||
|
if (img.naturalHeight > img.naturalWidth) {
|
||||||
|
img.classList.add('portrait');
|
||||||
|
} else if (Math.abs(img.naturalHeight - img.naturalWidth) < 10) {
|
||||||
|
img.classList.add('square');
|
||||||
|
} else {
|
||||||
|
img.classList.add('landscape');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onLoad = () => {
|
||||||
|
console.log('Image loaded:', src);
|
||||||
|
handleImage();
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
// <div className="relative overflow-hidden bg-[#e9e9e9] blurry-wrapper">
|
||||||
|
// <div className="absolute -top-6 -bottom-6 left-0 -right-6 bg-[#e9e9e9] blur-[8px] scale-[1.8] bg-center bg-no-repeat bg-contain blur-bg" style={{ backgroundImage: `url(${imgSrc})` }}></div>
|
||||||
|
// <div className="absolute inset-0 bg-transparent bg-center bg-no-repeat bg-contain image-bg" style={{ backgroundImage: `url(${imgSrc})` }}></div>
|
||||||
|
// </div>
|
||||||
|
<div className="blurry-wrapper relative overflow-hidden bg-[#e9e9e9] rounded-lg" key={key} style={style}>
|
||||||
|
<div className="absolute -top-6 -bottom-6 -left-0 -right-6 bg-[#e9e9e9] blur-[8px] scale-[1.8] bg-center bg-no-repeat bg-contain blur-bg" style={{ backgroundImage: `url(${imgSrc})` }}></div>
|
||||||
|
<div className="absolute inset-0 bg-transparent bg-center bg-no-repeat bg-contain image-bg" style={{ backgroundImage: `url(${imgSrc})` }}></div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ImageBlurry;
|
||||||
147
lib/menus.ts
147
lib/menus.ts
|
|
@ -2403,6 +2403,7 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
} else if (Number(roleId) === 2) {
|
} else if (Number(roleId) === 2) {
|
||||||
|
if (Number(levelNumber) == 1) {
|
||||||
menusSelected = [
|
menusSelected = [
|
||||||
{
|
{
|
||||||
groupLabel: t("apps"),
|
groupLabel: t("apps"),
|
||||||
|
|
@ -2711,6 +2712,152 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
} else {
|
||||||
|
menusSelected = [
|
||||||
|
{
|
||||||
|
groupLabel: t("apps"),
|
||||||
|
id: "dashboard",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "dashboard",
|
||||||
|
href: "/dashboard",
|
||||||
|
label: t("dashboard"),
|
||||||
|
active: pathname.includes("/dashboard"),
|
||||||
|
icon: "material-symbols:dashboard",
|
||||||
|
submenus: [
|
||||||
|
{
|
||||||
|
href: "/dashboard",
|
||||||
|
label: "Breakdown",
|
||||||
|
active: pathname === "/dashboard",
|
||||||
|
icon: "heroicons:arrow-trending-up",
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: "/dashboard/executive",
|
||||||
|
label: "Executive",
|
||||||
|
active: pathname === "/dashboard/executive",
|
||||||
|
icon: "heroicons:arrow-trending-up",
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "agenda-setting",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "agenda-setting",
|
||||||
|
href: "/contributor/agenda-setting",
|
||||||
|
label: t("agenda-setting"),
|
||||||
|
active: pathname.includes("/agenda-setting"),
|
||||||
|
icon: "iconoir:journal-page",
|
||||||
|
submenus: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "management-user",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "management-user-menu",
|
||||||
|
href: "/admin/management-user",
|
||||||
|
label: "Management User",
|
||||||
|
active: pathname.includes("/management-user"),
|
||||||
|
icon: "clarity:users-solid",
|
||||||
|
submenus: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "content-production",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "content-production",
|
||||||
|
href: "/curator/content-production",
|
||||||
|
label: t("content-production"),
|
||||||
|
active: pathname.includes("/content-production"),
|
||||||
|
icon: "fluent:content-view-gallery-16-regular",
|
||||||
|
submenus: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "pattern-relation",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "pattern-relation",
|
||||||
|
href: "/curator/pattern-relation",
|
||||||
|
label: t("pattern-relation"),
|
||||||
|
active: pathname.includes("/pattern-relation"),
|
||||||
|
icon: "oui:app-index-pattern",
|
||||||
|
submenus: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "performance-polda",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "performance-polda",
|
||||||
|
href: "/admin/performance-polda",
|
||||||
|
label: t("performance-polda"),
|
||||||
|
active: pathname.includes("/admin/performance-polda"),
|
||||||
|
icon: "ant-design:signal-filled",
|
||||||
|
submenus: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "communication",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "communication",
|
||||||
|
href: "/shared/communication",
|
||||||
|
label: t("communication"),
|
||||||
|
active: pathname.includes("/communication"),
|
||||||
|
icon: "token:chat",
|
||||||
|
submenus: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "settings",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "settings",
|
||||||
|
href: "/admin/settings",
|
||||||
|
label: t("settings"),
|
||||||
|
active: pathname.includes("/settinng"),
|
||||||
|
icon: "material-symbols:settings",
|
||||||
|
submenus: [
|
||||||
|
{
|
||||||
|
href: "/admin/settings/category",
|
||||||
|
label: t("category"),
|
||||||
|
active: pathname === "/admin/settings/category",
|
||||||
|
icon: "heroicons:arrow-trending-up",
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: "/admin/settings/tag",
|
||||||
|
label: "Tag",
|
||||||
|
active: pathname === "/admin/settings/tag",
|
||||||
|
icon: "heroicons:arrow-trending-up",
|
||||||
|
children: [],
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return menusSelected;
|
return menusSelected;
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ export async function uploadThumbnail(id: any, data: any) {
|
||||||
const headers = {
|
const headers = {
|
||||||
"Content-Type": "multipart/form-data",
|
"Content-Type": "multipart/form-data",
|
||||||
};
|
};
|
||||||
return httpPostInterceptor(url, data, { headers });
|
return httpPostInterceptor(url, data, headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function detailSPIT(id: any) {
|
export async function detailSPIT(id: any) {
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,17 @@ export async function getHeroData() {
|
||||||
return await httpGetInterceptor(`media/public/list?enablePage=1&sort=desc&sortBy=createdAt&size=5&page=0&typeId=1&title=&categoryId=&fileFormats=&tags=&group=&startDate=&endDate=&month=&year=`);
|
return await httpGetInterceptor(`media/public/list?enablePage=1&sort=desc&sortBy=createdAt&size=5&page=0&typeId=1&title=&categoryId=&fileFormats=&tags=&group=&startDate=&endDate=&month=&year=`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getPublicCategoryData(group: any = "", type: string = "", isInt: Boolean = false) {
|
||||||
|
return await httpGetInterceptor(`media/categories/list/publish?enablePage=0&group=${group}&type=${type}&isInt=${isInt}`);
|
||||||
|
}
|
||||||
|
|
||||||
export async function getCategoryData() {
|
export async function getCategoryData() {
|
||||||
return await httpGetInterceptor(`media/categories/list/publish?enablePage=1&sort=desc&sortBy=updatedAt&size=12&type=`);
|
return await httpGetInterceptor(`media/categories/list/publish?enablePage=1&sort=desc&sortBy=updatedAt&size=12&type=`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getListContent(props: any) {
|
export async function getListContent(props: any) {
|
||||||
return await httpGetInterceptor(
|
return await httpGetInterceptor(
|
||||||
`media/public/list?enablePage=1&sort=desc&sortBy=${props.sortBy}&size=${props.size}&page=${props.page}&typeId=${props.contentTypeId}&title=${props.title}&group=${props.group}&categoryId=&fileFormats=&tags=&startDate=&endDate=&month=&year=`
|
`media/public/list?enablePage=1&sort=desc&sortBy=${props.sortBy}&size=${props.size}&isInt=${props.isInt}&typeId=${props.contentTypeId}&title=${props.title}&group=${props.group}&categoryId=&fileFormats=&tags=&startDate=&endDate=&month=&year=`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,9 +51,9 @@ export async function publicDetailBlog(slug: any) {
|
||||||
return await httpGetInterceptor(`blog/public/read/${slug}`);
|
return await httpGetInterceptor(`blog/public/read/${slug}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function listData(type: string, search: string, category: string, size = 10, page = 0, sortBy = "createdAt", format = "", tag = "", group = "", startDate = "", endDate = "", month = "", year = "") {
|
export async function listData(type: string, search: string, category: string, size = 10, page = 0, sortBy = "createdAt", format = "", tag = "", group = "", startDate = "", endDate = "", month = "", year = "", isInt = false) {
|
||||||
return await httpGetInterceptor(
|
return await httpGetInterceptor(
|
||||||
`media/public/list?enablePage=1&sort=desc&sortBy=${sortBy}&size=${size}&page=${page}&typeId=${type}&title=${search}&categoryId=${category}&fileFormats=${format}&tags=${tag}&group=${group}&startDate=${startDate}&endDate=${endDate}&month=${month}&year=${year}`
|
`media/public/list?enablePage=1&sort=desc&sortBy=${sortBy}&size=${size}&page=${page}&typeId=${type}&title=${search}&categoryId=${category}&fileFormats=${format}&tags=${tag}&group=${group}&startDate=${startDate}&endDate=${endDate}&month=${month}&year=${year}&isInt=${isInt}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ export async function postCategory(data: any) {
|
||||||
const headers = {
|
const headers = {
|
||||||
"Content-Type": "multipart/form-data",
|
"Content-Type": "multipart/form-data",
|
||||||
};
|
};
|
||||||
return httpPostInterceptor(url, data, { headers });
|
return httpPostInterceptor(url, data, headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getPrivacy(id: string) {
|
export async function getPrivacy(id: string) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue