diff --git a/app/[locale]/(protected)/admin/settings/category/component/create.tsx b/app/[locale]/(protected)/admin/settings/category/component/create.tsx index e7380695..0b9994c4 100644 --- a/app/[locale]/(protected)/admin/settings/category/component/create.tsx +++ b/app/[locale]/(protected)/admin/settings/category/component/create.tsx @@ -37,6 +37,8 @@ import { useDropzone } from "react-dropzone"; import { CloudUpload } from "lucide-react"; import Image from "next/image"; import { Upload } from "tus-js-client"; +import { getCookiesDecrypt } from "@/lib/utils"; +import Cookies from "js-cookie"; const FormSchema = z.object({ title: z.string({ @@ -103,6 +105,10 @@ const publishToList = [ export default function CreateCategoryModal() { const router = useRouter(); const { toast } = useToast(); + const roleId = getCookiesDecrypt("urie"); + const levelNumber = getCookiesDecrypt("ulne"); + const userLevelId = getCookiesDecrypt("ulie"); + const poldaState = Cookies.get("state"); const [files, setFiles] = useState([]); const [isOpen, setIsOpen] = useState(false); @@ -139,6 +145,14 @@ export default function CreateCategoryModal() { useEffect(() => { getRoles(); + if (Number(levelNumber) === 2) { + form.setValue("publishTo", ["polda"]); + setUnitData([String(userLevelId)]); + } + if (Number(levelNumber) === 3) { + form.setValue("publishTo", ["satker"]); + setSatkerData([String(userLevelId)]); + } }, []); async function getRoles() { @@ -196,6 +210,10 @@ export default function CreateCategoryModal() { formMedia.append("file", files[0]); formMedia.append("publishedLocation", data.publishTo.sort().join(",")); formMedia.append("publishedLocationLevel", join); + formMedia.append( + "isInt", + data.publishTo.includes("internasional") ? "true" : "false" + ); const response = await postCategory(formMedia); close(); @@ -374,93 +392,117 @@ export default function CreateCategoryModal() { )} /> - ( - - Wilayah Publish -
-
- { - if (checked) { - form.setValue( - "publishTo", - publishToList.map((item) => item.id) - ); - } else { - form.setValue("publishTo", []); - } - }} - /> - -
- {publishToList.map((item) => ( - <> - { - return ( - -
- - { - return checked - ? field.onChange([ - ...field.value, - item.id, - ]) - : field.onChange( - field.value?.filter( - (value) => value !== item.id - ) - ); - }} - /> - - - {item.name}{" "} - -
-
- ); + {Number(levelNumber) === 1 ? ( + ( + + Wilayah Publish + +
+
+ { + if (checked) { + form.setValue( + "publishTo", + publishToList.map((item) => item.id) + ); + } else { + form.setValue("publishTo", []); + } }} /> - {item.id === "polda" && - form.getValues("publishTo")?.includes(item.id) && ( - setUnitData(data)} - /> - )} - {item.id === "satker" && - form.getValues("publishTo")?.includes(item.id) && ( - setSatkerData(data)} - /> - )} - - ))} -
- - - )} - /> + +
+ {publishToList.map((item) => ( + <> + { + return ( + +
+ + { + return checked + ? field.onChange([ + ...field.value, + item.id, + ]) + : field.onChange( + field.value?.filter( + (value) => value !== item.id + ) + ); + }} + /> + + + {item.name}{" "} + +
+
+ ); + }} + /> + {item.id === "polda" && + form.getValues("publishTo")?.includes(item.id) && ( + setUnitData(data)} + /> + )} + {item.id === "satker" && + form.getValues("publishTo")?.includes(item.id) && ( + setSatkerData(data)} + /> + )} + + ))} +
+ +
+ )} + /> + ) : ( + ( + + Wilayah Publish + +
+
+ + +
+
+ +
+ )} + /> + )} + ([]); const [isOpen, setIsOpen] = useState(false); const { toast } = useToast(); - + const roleId = getCookiesDecrypt("urie"); + const levelNumber = getCookiesDecrypt("ulne"); + const userLevelId = getCookiesDecrypt("ulie"); + const poldaState = Cookies.get("state"); const router = useRouter(); const [satkerData, setSatkerData] = useState([]); const [unitData, setUnitData] = useState([]); @@ -344,7 +350,6 @@ export default function EditCategoryModal(props: { )} /> - )} /> - ( - - Wilayah Publish -
-
- { - if (checked) { - form.setValue( - "publishTo", - publishToList.map((item) => item.id) - ); - } else { - form.setValue("publishTo", []); - } - }} - /> - -
- {publishToList.map((item) => ( - <> - { - return ( - -
- - { - return checked - ? field.onChange([ - ...field.value, - item.id, - ]) - : field.onChange( - field.value?.filter( - (value) => value !== item.id - ) - ); - }} - /> - - - {item.name}{" "} - -
-
- ); + {Number(levelNumber) === 1 ? ( + ( + + Wilayah Publish + +
+
+ { + if (checked) { + form.setValue( + "publishTo", + publishToList.map((item) => item.id) + ); + } else { + form.setValue("publishTo", []); + } }} /> - {item.id === "polda" && - form.getValues("publishTo")?.includes(item.id) && ( - setUnitData(data)} - isDetail={isDetail ? true : false} - initData={unitData} - /> - )} - {item.id === "satker" && - form.getValues("publishTo")?.includes(item.id) && ( - setSatkerData(data)} - isDetail={isDetail ? true : false} - initData={satkerData} - /> - )} - - ))} -
- - - )} - /> + +
+ {publishToList.map((item) => ( + <> + { + return ( + +
+ + { + return checked + ? field.onChange([ + ...field.value, + item.id, + ]) + : field.onChange( + field.value?.filter( + (value) => value !== item.id + ) + ); + }} + /> + + + {item.name}{" "} + +
+
+ ); + }} + /> + {item.id === "polda" && + form.getValues("publishTo")?.includes(item.id) && ( + setUnitData(data)} + isDetail={isDetail ? true : false} + initData={unitData} + /> + )} + {item.id === "satker" && + form.getValues("publishTo")?.includes(item.id) && ( + setSatkerData(data)} + isDetail={isDetail ? true : false} + initData={satkerData} + /> + )} + + ))} +
+ +
+ )} + /> + ) : ( + ( + + Wilayah Publish + +
+
+ + +
+
+ +
+ )} + /> + )} + { const [profile, setProfile] = useState(); @@ -284,20 +285,6 @@ const Galery = (props: any) => {
- - Audio Visual - -
|
- - Audio - -
|
{ Foto
|
+ + Audio Visual + +
|
Teks +
|
+ + Audio +
@@ -323,9 +324,12 @@ const Galery = (props: any) => {
- -
{video?.mediaUpload?.title}
+ {/* */} +
+ +
+
{video?.mediaUpload?.title}
@@ -454,9 +458,12 @@ const Galery = (props: any) => { - -
{image?.mediaUpload?.title}
+ {/* */} +
+ +
+
{image?.mediaUpload?.title}
diff --git a/app/[locale]/(public)/content-management/galery/page.tsx b/app/[locale]/(public)/content-management/galery/page.tsx index 6bdaf09a..87da08f1 100644 --- a/app/[locale]/(public)/content-management/galery/page.tsx +++ b/app/[locale]/(public)/content-management/galery/page.tsx @@ -19,6 +19,7 @@ import { Icon } from "@iconify/react/dist/iconify.js"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking"; +import ImageBlurry from "@/components/ui/image-blurry"; const Galery = (props: any) => { const [profile, setProfile] = useState(); @@ -290,20 +291,6 @@ const Galery = (props: any) => {
- - Audio Visual - -
|
- - Audio - -
|
{ Foto
|
+ + Audio Visual + +
|
Teks +
|
+ + Audio +
@@ -329,7 +330,10 @@ const Galery = (props: any) => {
- + {/* */} +
+ +
{video?.mediaUpload?.title}
@@ -458,9 +462,12 @@ const Galery = (props: any) => { - -
{image?.mediaUpload?.title}
+ {/* */} +
+ +
+
{image?.mediaUpload?.title}
diff --git a/app/[locale]/(public)/content-management/rewrite/page.tsx b/app/[locale]/(public)/content-management/rewrite/page.tsx index f9d1cf4a..8f05243e 100644 --- a/app/[locale]/(public)/content-management/rewrite/page.tsx +++ b/app/[locale]/(public)/content-management/rewrite/page.tsx @@ -16,6 +16,7 @@ import { Icon } from "@iconify/react/dist/iconify.js"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking"; +import ImageBlurry from "@/components/ui/image-blurry"; const page = () => { const [, setProfile] = useState(); @@ -210,7 +211,10 @@ const page = () => {
- + {/* */} +
+ +
{image?.title}
diff --git a/app/[locale]/(public)/image/filter/page.tsx b/app/[locale]/(public)/image/filter/page.tsx index bf4ee07e..8ef407d3 100644 --- a/app/[locale]/(public)/image/filter/page.tsx +++ b/app/[locale]/(public)/image/filter/page.tsx @@ -156,7 +156,7 @@ const FilterPage = () => { endDateString, monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]?.replace("", "") : "", monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[1] : "", - locale == "en" ? true : false, + locale == "en" ? true : false ); close(); // setGetTotalPage(response?.data?.data?.totalPages); @@ -189,7 +189,7 @@ const FilterPage = () => { endDateString, monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]?.replace("", "") : "", monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[1] : "", - locale == "en" ? true : false, + locale == "en" ? true : false ); close(); // setGetTotalPage(response?.data?.data?.totalPages); @@ -491,14 +491,8 @@ const FilterPage = () => { {/* */} -
- +
+
{formatDateToIndonesian(new Date(image?.createdAt))} {image?.timezone ? image?.timezone : "WIB"}| diff --git a/app/[locale]/(public)/schedule/page.tsx b/app/[locale]/(public)/schedule/page.tsx index 578b19b3..0fbac227 100644 --- a/app/[locale]/(public)/schedule/page.tsx +++ b/app/[locale]/(public)/schedule/page.tsx @@ -14,6 +14,7 @@ import { useRouter } from "@/i18n/routing"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog"; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"; import { close, loading } from "@/config/swal"; +import { useTranslations } from "next-intl"; const timeList = [ { @@ -118,16 +119,15 @@ const Schedule = (props: any) => { const router = useRouter(); const [startDate, setStartDate] = useState(new Date()); const [dateAWeek, setDateAWeek] = useState([]); - const [scheduleSearch, setScheduleSearch] = useState(); const [todayList, setTodayList] = useState([]); const [prevdayList, setPrevdayList] = useState([]); const [nextdayList, setNextdayList] = useState([]); - const [isOpen, setIsOpen] = React.useState(false); const [schedules, setSchedules] = useState([]); const [openDialog, setOpenDialog] = useState(false); const [detail, setDetail] = useState(); const [content, setContent] = useState(); const { id } = props; + const t = useTranslations("LandingPage"); useEffect(() => { async function getDataSchedule() { @@ -511,10 +511,10 @@ const Schedule = (props: any) => {
- {/* Component Kanan */} + {/* komponen Kanan */}
- + @@ -557,6 +557,7 @@ const Schedule = (props: any) => { ))} */} + Jadwal Hari ini diff --git a/app/[locale]/(public)/video/detail/[slug]/page.tsx b/app/[locale]/(public)/video/detail/[slug]/page.tsx index 747b61ea..2638e094 100644 --- a/app/[locale]/(public)/video/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/video/detail/[slug]/page.tsx @@ -16,7 +16,6 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; - const DetailVideo = () => { const [selectedSize, setSelectedSize] = useState("L"); const [selectedTab, setSelectedTab] = useState("video"); diff --git a/app/[locale]/(public)/video/filter/page.tsx b/app/[locale]/(public)/video/filter/page.tsx index 915d1c46..e0e1514b 100644 --- a/app/[locale]/(public)/video/filter/page.tsx +++ b/app/[locale]/(public)/video/filter/page.tsx @@ -15,6 +15,7 @@ import ReactDatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import { close, loading } from "@/config/swal"; import { useTranslations } from "next-intl"; +import ImageBlurry from "@/components/ui/image-blurry"; const columns: ColumnDef[] = [ { @@ -518,7 +519,10 @@ const FilterPage = () => { - + {/* */} +
+ +
{formatDateToIndonesian(new Date(video?.createdAt))} {video?.timezone ? video?.timezone : "WIB"}| {video?.clickCount}{" "} diff --git a/app/[locale]/auth/registration/page.tsx b/app/[locale]/auth/registration/page.tsx index be0dbe16..b59c4eec 100644 --- a/app/[locale]/auth/registration/page.tsx +++ b/app/[locale]/auth/registration/page.tsx @@ -22,6 +22,7 @@ import { Textarea } from "@/components/ui/textarea"; import { Icon } from "@/components/ui/icon"; import dynamic from "next/dynamic"; import ReactPasswordChecklist from "react-password-checklist"; +import { Select } from "@/components/ui/select"; type Inputs = { example: string; @@ -34,7 +35,7 @@ const PasswordChecklist = dynamic(() => import("react-password-checklist"), { const page = () => { const params = useParams(); - const [stepOneActive] = useState(true); + const [stepOneActive, setStepOneActive] = useState(true); const [stepTwoActive, setStepTwoActive] = useState(false); const [stepThreeActive, setStepThreeActive] = useState(false); const [typePass, setTypePass] = useState("password"); @@ -66,6 +67,7 @@ const page = () => { const [districts, setDistricts] = useState([]); const [, setAssociation] = useState(); const [warningPassConf] = useState(); + const [otpValue, setOtpValue] = useState(""); const [otp1, setOtp1] = useState(); const [otp2, setOtp2] = useState(); @@ -450,23 +452,27 @@ const page = () => { const handleVerifyOTP = async () => { const otp = `${otp1}${otp2}${otp3}${otp4}${otp5}${otp6}`; - - if (email != "" && otp.length == 6) { + const dummyOtp = "123456"; + if (email != "" && otpValue.length == 6) { console.log("verify otp"); loading(); // const response = { // message: "success", // }; + const response = { + message: otpValue == dummyOtp ? "success" : "failed", + }; - const response = await verifyOTP(email, otp); - if (response?.error) { - error(response?.message); - return false; - } + // const response = await verifyOTP(email, otp); + // if (response?.error) { + // error(response?.message); + // return false; + // } close(); // console.log(response); if (response?.message == "success") { console.log("success"); + setStepTwoActive(false); setStepThreeActive(true); setFormProfile(true); setOtpValidate(""); @@ -548,26 +554,20 @@ const page = () => {
  • -
    - - 1 - +
    + 1
  • -
    - - 2 - +
    + 2
  • -
    - - 3 - +
    + 3
@@ -585,7 +585,7 @@ const page = () => { } >

{stepThreeActive ? "Silahkan lengkapi data pengguna" : "Silahkan registrasi terlebih dahulu"}

-

+

Sudah memiliki akun?{" "} Masuk @@ -593,6 +593,7 @@ const page = () => {

{ : {} } > -

- Masukkan Kode OTP -

-

Silahkan cek inbox atau kotak spam pada email Anda.

+

Masukkan Kode OTP

+

Silahkan cek inbox atau kotak spam pada email Anda.

@@ -684,9 +683,9 @@ const page = () => {
-
-
- +
+
+ setOtpValue(e)}> setOtp1(e.target.value)} onKeyUp={handleTypeOTP} /> setOtp2(e.target.value)} onKeyUp={handleTypeOTP} /> @@ -706,17 +705,17 @@ const page = () => {

{otpValidate}

-
-
+
{Number(category) == 6 || Number(category) == 7 ? (
@@ -737,15 +736,15 @@ const page = () => { ) : ( "" )} -
-