diff --git a/.env b/.env index dc12361..59f6f27 100644 --- a/.env +++ b/.env @@ -1,9 +1,9 @@ NODE_ENV="development" -NEXT_PUBLIC_SERVER_URL=http://192.168.1.100:32767 -NEXT_PUBLIC_PUBLIC_URL=http://192.168.1.100:32767 -NEXT_PUBLIC_API_URL=http://192.168.1.100:32767/api -NEXT_PUBLIC_VERSION=1.0.1.2 +NEXT_PUBLIC_SERVER_URL=http://192.168.1.10:32767 +NEXT_PUBLIC_PUBLIC_URL=http://192.168.1.10:32767 +NEXT_PUBLIC_API_URL=http://192.168.1.10:32767/api +# NEXT_PUBLIC_VERSION=1.0.1.2 # SECURE_LOCAL_STORAGE_HASH_KEY=f1da2b2c7a4c446934267fea631102ec389b5b99 # NEXT_PUBLIC_API_URL_IMAGE=https://192.168.88.12:49154/Files/ReportImages # NEXT_PUBLIC_API_URL_BackUp=https://192.168.88.12:49154/Files/BackUps @@ -17,6 +17,6 @@ NEXT_PUBLIC_VERSION=1.0.1.2 # NEXT_PUBLIC_SERVER_URL=https://api.brizco.io # NEXT_PUBLIC_PUBLIC_URL=https://api.brizco.io # NEXT_PUBLIC_API_URL=https://api.brizco.io/api -# NEXT_PUBLIC_VERSION=1.0.1.2 +# NEXT_PUBLIC_VERSION=1.0.3.4 # NEXT_PUBLIC_API_URL_IMAGE=https://api.macsonline.ir/Files/ReportImages -# NEXT_PUBLIC_API_URL_BackUp=https://api.macsonline.ir/Files/BackUps \ No newline at end of file +# NEXT_PUBLIC_API_URL_BackUp=https://api.macsonline.ir/Files/Back1.10 \ No newline at end of file diff --git a/.env.production b/.env.production index 5d011a0..6060884 100644 --- a/.env.production +++ b/.env.production @@ -2,4 +2,4 @@ NODE_ENV="production" NEXT_PUBLIC_SERVER_URL=https://api.brizco.io NEXT_PUBLIC_PUBLIC_URL=https://api.brizco.io NEXT_PUBLIC_API_URL=https://api.brizco.io/api -NEXT_PUBLIC_VERSION=1.0.1.2 \ No newline at end of file +NEXT_PUBLIC_VERSION=1.0.3.4 \ No newline at end of file diff --git a/Dockerfile.emergency b/Dockerfile.emergency index 29cde32..8f9c32f 100644 --- a/Dockerfile.emergency +++ b/Dockerfile.emergency @@ -14,5 +14,5 @@ CMD ["/app/node_modules/.bin/next", "start"] -# docker build -f Dockerfile.emergency -t registry.vnfco.ir/brizco/web:1.0.1.2 . -# docker push registry.vnfco.ir/brizco/web:1.0.1.2 \ No newline at end of file +# docker build -f Dockerfile.emergency -t registry.vnfco.ir/brizco/web:1.0.3.4 . +# docker push registry.vnfco.ir/brizco/web:1.0.3.4 \ No newline at end of file diff --git a/components/AppHeader/page.jsx b/components/AppHeader/page.jsx index 26cb5b8..9db6809 100644 --- a/components/AppHeader/page.jsx +++ b/components/AppHeader/page.jsx @@ -7,6 +7,8 @@ import React, { useContext } from "react"; import { useLongPress } from "@uidotdev/usehooks"; import { toast } from "react-toastify"; import AppContext from "@ctx/AppContext"; +import notifIcon from "@img/notif.png"; +import Image from "next/image"; const AppHeader = ({ title, @@ -26,9 +28,11 @@ const AppHeader = ({ userIconHref, userRole, logOut, + notif, }) => { const router = useRouter(); const CTX = useContext(AppContext); + const notifUnreadData = CTX.state.notifUnreadData; const handlelogOut = () => { CTX.setStepLogin(0); @@ -187,6 +191,18 @@ const AppHeader = ({ ) : ( "" )} + + {notif && ( + + {notifUnreadData > 0 && ( +
+
+
+ )} + + + + )} ) : (
{ + const CTX = useContext(AppContext); + const tasksData = CTX.state.tasksData; + const stopGetTasks = CTX.state.stopGetTasks; + const pageGetTasks = CTX.state.pageGetTasks; + const shiftsData = CTX.state.shiftsData; + const permissions = CTX.state.profile?.permissions; + + const [listTaskActive, setListTaskActive] = useState(-1); + + const handleInfiniteNextFetchTask = () => { + CTX.setPageGetTasks((e) => e + 1); + CTX.GetTasks(pageGetTasks + 1); + }; + + const handleListTaskActive = (id, index) => { + if (index == listTaskActive) { + setListTaskActive(-1); + } else { + setListTaskActive(index); + CTX.GetTasks(0, id); + } + }; + + return ( + <> + {shiftsData.length > 0 ? ( + <> + {shiftsData?.map((e, index) => ( + <> +
+
handleListTaskActive(e?.id, index)} + > +

{e?.title}

+ +
+ + + +
+
+
+ + {listTaskActive == index && ( +
+ {tasksData.length != 0 ? ( + + + + ) : ( + + )} +
+ )} + + ))} + + ) : ( + + )} + + ); +}; + +export default TasksEmployees; diff --git a/components/LoginComponents/LoginStep.jsx b/components/LoginComponents/LoginStep.jsx index 4de15b1..d2cdb77 100644 --- a/components/LoginComponents/LoginStep.jsx +++ b/components/LoginComponents/LoginStep.jsx @@ -25,6 +25,11 @@ const LoginStep = (props) => { closeOnClick: true, }); } else if (!roleCheckBox) { + toast.error(`برای ورود تایید قوانین الزامی است`, { + position: "bottom-right", + closeOnClick: true, + }); + setTimeout(() => { setAlertRolCheckBox(true); }, 100); diff --git a/components/NavBar/NavBAr.jsx b/components/NavBar/NavBAr.jsx index 6ffe936..9b3f517 100644 --- a/components/NavBar/NavBAr.jsx +++ b/components/NavBar/NavBAr.jsx @@ -5,12 +5,14 @@ import React, { useContext, useEffect, useState } from "react"; import { usePathname } from "next/navigation"; import Image from "next/image"; import logo from "@img/logo.png"; +import setting from "@img/setting.png"; import AppContext from "@ctx/AppContext"; import HasPermission from "plugins/HasPermission/page"; const NavBAr = (props) => { const usePath = usePathname(); const CTX = useContext(AppContext); + const notifUnreadData = CTX.state.notifUnreadData; const [profileFill, setProfileFill] = useState(false); const permissions = CTX.state.profile?.permissions; @@ -145,34 +147,16 @@ const NavBAr = (props) => { <> {usePath.includes("/employees") ? ( -
- - - +
+
+ +
) : (
- - - +
+ +
)} @@ -182,6 +166,13 @@ const NavBAr = (props) => { {HasPermission("ViewActivities", permissions) && ( <> + {notifUnreadData > 0 && ( +
+
+
+
+
+ )} {usePath.includes("/tasks") ? (
diff --git a/components/TaskPage/TasksCard/page.jsx b/components/TaskPage/TasksCard/page.jsx index af925c6..4012434 100644 --- a/components/TaskPage/TasksCard/page.jsx +++ b/components/TaskPage/TasksCard/page.jsx @@ -15,67 +15,111 @@ const TasksCard = ({ tasksData, permissions }) => { const goToEditTask = (id) => { if (!!HasPermission("ManageTasks", permissions)) { CTX.setGoToEditTask(true); - router.push("/tasks/add-task?new=false"); CTX.GetTask(id); CTX.setIdEditTask(id); + CTX.setBottomSheetCreateTaskOpen(true); } }; return ( -
+
{tasksData?.map((e, index) => ( -
{ - goToEditTask(e.id); - }} - > -
- {/*
+
+
+
+ {/*
*/} -
-
- {e?.scheduleType == 0 - ? "روزانه" - : e?.scheduleType == 1 - ? "هفتگی" - : e?.scheduleType == 2 - ? "مخصوص" - : ""} +
+
+ {e?.scheduleType == 0 + ? "روزانه" + : e?.scheduleType == 1 + ? "هفتگی" + : e?.scheduleType == 2 + ? "مخصوص" + : ""} +
+ +
+ +
+ {e?.shifts[0]} +
+ {e?.days?.length > 0 && ( + <> + {e?.days.map((s) => ( + <> +
+
+ {" "} + {s} +
+ + ))} + + )}
-
- {e?.shifts[0]} +
+ {" "} + {e?.positions[0]}
- {e?.days?.length > 0 && ( - <> - {e?.days.map((s) => ( - <> -
-
- {" "} - {s} -
- - ))} - - )} -
- -
- -
- {" "} - {e?.positions[0]}
+ {HasPermission("ManageShifts", permissions) && ( +
+
goToEditTask(e.id)} + > + + + + + + + + + + + + + + + +
+
+ )}
-

+

{e?.title}{" "}

diff --git a/plugins/BottomSheet/BottomFilterActivities.jsx b/plugins/BottomSheet/BottomFilterActivities.jsx index 1e3eb34..f1b572a 100644 --- a/plugins/BottomSheet/BottomFilterActivities.jsx +++ b/plugins/BottomSheet/BottomFilterActivities.jsx @@ -12,16 +12,22 @@ import moment from "jalali-moment"; import HasPermission from "plugins/HasPermission/page"; import PersianNumber from "plugins/PersianNumber"; -const BottomFilterActivities = (props) => { +const BottomFilterActivities = ({ + dateQueryFilterValue, + setActiveStaffIdValue, + activeStaffId, + setActiveStaff, +}) => { const CTX = useContext(AppContext); - const [typeFilter, setTypeFilter] = useState(0); const handleFilterActivity = (num) => { - setTypeFilter(num); + setActiveStaffIdValue(num); }; const handleChangeFilter = () => { - CTX.GetActivity(null, null, 0, typeFilter); + setActiveStaff(-1); + CTX.GetUserStaff(dateQueryFilterValue); + // CTX.GetActivity(null, null, 0, dateQueryFilterValue, activeStaffId); CTX.setBottomFilterActivitiesOpen(false); CTX.setStopGetActivities(false); CTX.setPageGetActivity(0); @@ -32,7 +38,7 @@ const BottomFilterActivities = (props) => { // onSpringStart={(e) => handleBottomSheetCreateRole(e)} open={CTX.state.BottomFilterActivitiesOpen} onDismiss={() => CTX.setBottomFilterActivitiesOpen(false)} - blocking={false} + blocking={true} >

@@ -43,9 +49,9 @@ const BottomFilterActivities = (props) => {

handleFilterActivity(3)} + onClick={() => handleFilterActivity(2)} >

اکتیویتی های دیروز @@ -63,9 +69,9 @@ const BottomFilterActivities = (props) => {

handleFilterActivity(0)} + onClick={() => handleFilterActivity(1)} >

اکتیویتی های امروز @@ -80,9 +86,9 @@ const BottomFilterActivities = (props) => {

handleFilterActivity(1)} + onClick={() => handleFilterActivity(3)} >

اکتیویتی های فردا @@ -100,9 +106,9 @@ const BottomFilterActivities = (props) => {

handleFilterActivity(2)} + onClick={() => handleFilterActivity(12)} >

اکتیویتی های هفته

diff --git a/plugins/BottomSheet/BottomManageShift.jsx b/plugins/BottomSheet/BottomManageShift.jsx index ccee12e..99e8b13 100644 --- a/plugins/BottomSheet/BottomManageShift.jsx +++ b/plugins/BottomSheet/BottomManageShift.jsx @@ -179,7 +179,7 @@ const BottomManageShift = (props) => { onSpringStart={(e) => handleBottomSheetCreateEmployeesOpen(e)} open={CTX.state.BottomManageShiftOpen} onDismiss={() => CTX.setBottomManageShiftOpen(false)} - blocking={false} + blocking={true} >

diff --git a/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx b/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx index eda286b..49621f9 100644 --- a/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx +++ b/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx @@ -39,7 +39,7 @@ const BottomSheetAddUserToPositionShiftPlan = ({ CTX.setBottomSheetAddUserToPositionShiftPlanOpen(false)} - blocking={false} + blocking={true} >

diff --git a/plugins/BottomSheet/BottomSheetChangeRole.jsx b/plugins/BottomSheet/BottomSheetChangeRole.jsx index 4029bae..dd1d2d7 100644 --- a/plugins/BottomSheet/BottomSheetChangeRole.jsx +++ b/plugins/BottomSheet/BottomSheetChangeRole.jsx @@ -24,7 +24,7 @@ const BottomSheetChangeRole = (props) => { CTX.setBottomSheetChangeRoleOpen(false)} - blocking={false} + blocking={true} >

diff --git a/plugins/BottomSheet/BottomSheetCreateEmployees.jsx b/plugins/BottomSheet/BottomSheetCreateEmployees.jsx index 6f9e492..a99efd2 100644 --- a/plugins/BottomSheet/BottomSheetCreateEmployees.jsx +++ b/plugins/BottomSheet/BottomSheetCreateEmployees.jsx @@ -195,7 +195,7 @@ const BottomSheetCreateEmployees = (props) => { onSpringStart={(e) => handleBottomSheetCreateEmployeesOpen(e)} open={CTX.state.BottomSheetCreateEmployeesOpen} onDismiss={() => CTX.setBottomSheetCreateEmployeesOpen(false)} - blocking={false} + blocking={true} >

diff --git a/plugins/BottomSheet/BottomSheetCreatePosition.jsx b/plugins/BottomSheet/BottomSheetCreatePosition.jsx index 5d5a2bf..b141eba 100644 --- a/plugins/BottomSheet/BottomSheetCreatePosition.jsx +++ b/plugins/BottomSheet/BottomSheetCreatePosition.jsx @@ -44,6 +44,7 @@ const BottomSheetCreatePosition = (props) => { description, title, sectionId, + permissions: [""], }; const bodyUpdate = { @@ -51,6 +52,7 @@ const BottomSheetCreatePosition = (props) => { title, sectionId, id: idEditPosition, + permissions: [""], }; const clear = () => { @@ -119,7 +121,7 @@ const BottomSheetCreatePosition = (props) => { onSpringStart={(e) => handleBottomSheetCreatePositionOpen(e)} open={CTX.state.BottomSheetCreatePositionOpen} onDismiss={() => CTX.setBottomSheetCreatePositionOpen(false)} - blocking={false} + blocking={true} >

diff --git a/plugins/BottomSheet/BottomSheetCreateRole.jsx b/plugins/BottomSheet/BottomSheetCreateRole.jsx index a7ecd84..aa5592c 100644 --- a/plugins/BottomSheet/BottomSheetCreateRole.jsx +++ b/plugins/BottomSheet/BottomSheetCreateRole.jsx @@ -109,7 +109,7 @@ const BottomSheetCreateRole = (props) => { onSpringStart={(e) => handleBottomSheetCreateRole(e)} open={CTX.state.BottomSheetCreateRoleOpen} onDismiss={() => CTX.setBottomSheetCreateRoleOpen(false)} - blocking={false} + blocking={true} >

افزودن نقش جدید

diff --git a/plugins/BottomSheet/BottomSheetCreateRoutine.jsx b/plugins/BottomSheet/BottomSheetCreateRoutine.jsx index 195393a..a148fa9 100644 --- a/plugins/BottomSheet/BottomSheetCreateRoutine.jsx +++ b/plugins/BottomSheet/BottomSheetCreateRoutine.jsx @@ -98,7 +98,7 @@ const BottomSheetCreateRoutine = (props) => { onSpringStart={(e) => handleBottomSheetCreateRoutineOpen(e)} open={CTX.state.BottomSheetCreateRoutineOpen} onDismiss={() => CTX.setBottomSheetCreateRoutineOpen(false)} - blocking={false} + blocking={true} >

diff --git a/plugins/BottomSheet/BottomSheetCreateSection.jsx b/plugins/BottomSheet/BottomSheetCreateSection.jsx index 77376d8..f61f338 100644 --- a/plugins/BottomSheet/BottomSheetCreateSection.jsx +++ b/plugins/BottomSheet/BottomSheetCreateSection.jsx @@ -98,7 +98,7 @@ const BottomSheetCreateSection = (props) => { onSpringStart={(e) => handleBottomSheetCreateSectionOpen(e)} open={CTX.state.BottomSheetCreateSectionOpen} onDismiss={() => CTX.setBottomSheetCreateSectionOpen(false)} - blocking={false} + blocking={true} >

diff --git a/plugins/BottomSheet/BottomSheetCreateShifts.jsx b/plugins/BottomSheet/BottomSheetCreateShifts.jsx index 7d908c3..0c7665e 100644 --- a/plugins/BottomSheet/BottomSheetCreateShifts.jsx +++ b/plugins/BottomSheet/BottomSheetCreateShifts.jsx @@ -149,7 +149,7 @@ const BottomSheetCreateShifts = (props) => { onSpringStart={(e) => handleBottomSheetCreateShift(e)} open={CTX.state.BottomSheetCreateShiftsOpen} onDismiss={() => CTX.setBottomSheetCreateShiftsOpen(false)} - blocking={false} + blocking={true} >

diff --git a/plugins/BottomSheet/BottomSheetCreateTask.jsx b/plugins/BottomSheet/BottomSheetCreateTask.jsx new file mode 100644 index 0000000..0e8dda2 --- /dev/null +++ b/plugins/BottomSheet/BottomSheetCreateTask.jsx @@ -0,0 +1,745 @@ +"use client"; + +import React, { useContext, useEffect, useRef, useState } from "react"; +import { BottomSheet } from "react-spring-bottom-sheet"; +import Input from "plugins/Input/page"; +import AppContext from "@ctx/AppContext"; +import SimpleReactValidator from "simple-react-validator"; +import { toast } from "react-toastify"; +import Buttonbriz from "plugins/Buttonbriz/page"; +import { useRouter } from "next/navigation"; +import DatePickerIran from "plugins/DatePickerIran/page"; +import moment from "jalali-moment"; +import Chapar from "plugins/Chapar"; + +const BottomSheetCreateTask = (props) => { + const CTX = useContext(AppContext); + + const router = useRouter(); + + const [routinesSelectData, setRoutinesSelectData] = useState([]); + const [routineForTaskCurrent, setRoutineForTaskCurrent] = useState([]); + + const [positionsSelectData, setPositionsSelectData] = useState([]); + const [positionsForTaskCurrent, setPositionsForTaskCurrent] = useState([]); + + const [shiftsSelectData, setShiftsSelectData] = useState([]); + const [shiftsForTaskCurrent, setShiftsForTaskCurrent] = useState([]); + + const [title, setTitle] = useState(""); + const [description, setDescription] = useState(""); + const [scheduleType, setScheduleType] = useState(1); + + const [birthDateTimeStamp, setBirthDateTimeStamp] = useState(0); + + const [shiftsDaysSelectData, setShiftsDaysSelectData] = useState(null); + const [shiftsDaysCurrent, setShiftsDaysCurrent] = useState(null); + + const [, forceUpdate] = useState(); + + const routinesData = CTX.state.routinesData; + const positionsData = CTX.state.positionsData; + const shiftsData = CTX.state.shiftsData; + const routineForTaskChoose = CTX.state.routineForTaskChoose; + const positionsForTaskChoose = CTX.state.positionsForTaskChoose; + const shiftsForTaskChoose = CTX.state.shiftsForTaskChoose; + const shiftsDaysChoose = CTX.state.shiftsDaysChoose; + const goToEditTask = CTX.state.goToEditTask; + const taskData = CTX.state.taskData; + const idEditTask = CTX.state.idEditTask; + + const schedule = [ + { key: "هفتگی", value: 1 }, + { key: "روزانه", value: 0 }, + { key: "مخصوص یک روز ", value: 2 }, + ]; + + const week = [ + { key: "شنبه", value: 6 }, + { key: "یکشنبه", value: 0 }, + { key: "دوشنبه", value: 1 }, + { key: "سه شنبه", value: 2 }, + { key: "چهار شنبه", value: 3 }, + { key: "پنج شنبه", value: 4 }, + { key: "جمعه", value: 5 }, + ]; + + const validator = useRef( + new SimpleReactValidator({ + messages: { + required: "پر کردن این فیلد الزامی میباشد", + }, + element: (message) => ( + <> +

+ {message} +
+ + ), + }) + ); + + const body = { + title, + description, + routines: routineForTaskChoose, + positions: positionsForTaskChoose, + shifts: shiftsForTaskChoose, + scheduleType, + setFor: + birthDateTimeStamp && + moment + .utc( + [ + birthDateTimeStamp.year, + birthDateTimeStamp.month, + birthDateTimeStamp.day, + ], + "jYYYY-jMM-jDDTHH" + ) + .unix(), + days: shiftsDaysChoose, + }; + + const bodyUpdate = { + title, + description, + routines: routineForTaskChoose, + positions: positionsForTaskChoose, + shifts: shiftsForTaskChoose, + scheduleType, + setFor: + birthDateTimeStamp && + moment + .utc( + [ + birthDateTimeStamp.year, + birthDateTimeStamp.month, + birthDateTimeStamp.day, + ], + "jYYYY-jMM-jDDTHH" + ) + .unix(), + days: shiftsDaysChoose, + id: idEditTask, + }; + + const clear = () => { + setPositionsForTaskCurrent([]); + // setPositionsSelectData([]); + setRoutineForTaskCurrent([]); + // setRoutinesSelectData([]); + setBirthDateTimeStamp(0); + setScheduleType([]); + setDescription(""); + setTitle(""); + setShiftsForTaskCurrent([]); + // setShiftsSelectData([]); + setShiftsDaysCurrent([]); + // setShiftsDaysSelectData([]); + CTX.setRoutineForTaskChoose([]); + CTX.setPositionsForTaskChoose([]); + CTX.setShiftsForTaskChoose([]); + CTX.setShiftsDaysChoose([]); + }; + + const CreateTask = async (body) => { + CTX.setLoading(true); + try { + const data = await Chapar.post( + `${process.env.NEXT_PUBLIC_API_URL}/task`, + JSON.stringify(body), + { + headers: { + Authorization: "Bearer " + localStorage.getItem("token"), + }, + } + ); + toast.success(`فعالیت ساخته شد`, { + position: "bottom-right", + closeOnClick: true, + }); + clear(); + CTX.setBottomSheetCreateTaskOpen(false); + CTX.setLoading(false); + } catch ({ error, status }) { + toast.error(`${error?.response?.data?.message}`, { + position: "bottom-right", + closeOnClick: true, + }); + CTX.setLoading(false); + } + }; + + const UpdateTask = async (body) => { + CTX.setLoading(true); + try { + const data = await Chapar.put( + `${process.env.NEXT_PUBLIC_API_URL}/task`, + body, + + { + headers: { + Authorization: "Bearer " + localStorage.getItem("token"), + }, + } + ); + toast.success(`فعالیت ویرایش شد`, { + position: "bottom-right", + closeOnClick: true, + }); + + // router-> + + CTX.setLoading(false); + + CTX.setStopGetTasks(false); + CTX.setPageGetTasks(0); + CTX.setBottomSheetCreateTaskOpen(false); + } catch ({ error, status }) { + toast.error(`${error?.response?.data?.message}`, { + position: "bottom-right", + closeOnClick: true, + }); + setLoading(false); + } + }; + + const handleCreateTask = (update) => { + if (scheduleType == 0) { + validator.current.message("shiftsDaysChoose", true, "required"); + validator.current.message("birthDateTimeStamp", true, "required"); + } + + if (scheduleType == 1) { + validator.current.message("birthDateTimeStamp", true, "required"); + } + + if (scheduleType == 2) { + validator.current.message("shiftsDaysChoose", true, "required"); + } + + if (validator.current.allValid()) { + if (update == "UPDATE") { + UpdateTask(bodyUpdate); + } else { + CreateTask(body); + } + } else { + toast.error("پرکردن همه ی فیلد ها واجب است", { + position: "bottom-right", + autoClose: 2000, + hideProgressBar: false, + closeOnClick: true, + pauseOnHover: true, + draggable: true, + progress: undefined, + }); + + validator.current.showMessages(); + forceUpdate(1); + } + }; + + const deleteRoutineForTask = (value) => { + CTX.setRoutineForTaskChoose( + routineForTaskChoose.filter((el) => el !== value) + ); + }; + + const deletePositionForTask = (value) => { + CTX.setPositionsForTaskChoose( + positionsForTaskChoose.filter((el) => el !== value) + ); + }; + + const deleteShiftForTask = (value) => { + CTX.setShiftsForTaskChoose( + shiftsForTaskChoose.filter((el) => el !== value) + ); + }; + + const deleteShiftsDaysForTask = (value) => { + CTX.setShiftsDaysChoose(shiftsDaysChoose.filter((el) => el !== value)); + }; + + const handleBottomSheetCreateTaskOpen = (e) => { + if (e.type == "OPEN") { + CTX.GetRoutines(); + CTX.GetPositions(); + } else if (e.type == "CLOSE") { + clear(); + } + }; + + useEffect(() => { + setRoutinesSelectData( + routinesData?.map((item) => ({ + key: item?.name, + value: item?.id, + })) + ); + }, [routinesData]); + + useEffect(() => { + setPositionsSelectData( + positionsData?.map((item) => ({ + key: item?.name, + value: item?.id, + })) + ); + }, [positionsData]); + + useEffect(() => { + setShiftsSelectData( + shiftsData?.map((item) => ({ + key: item?.title, + value: item?.id, + })) + ); + }, [shiftsData]); + + useEffect(() => { + setShiftsDaysSelectData( + shiftsForTaskChoose?.length > 0 && + shiftsData + ?.find((e) => e?.id == shiftsForTaskChoose[0]) + ?.days?.map((item) => ({ + key: week?.find((e) => e.value == item)?.key, + value: item, + })) + ); + }, [shiftsForTaskChoose]); + + useEffect(() => { + switch (scheduleType) { + case 0: + setBirthDateTimeStamp(0); + CTX.setShiftsDaysChoose([]); + + break; + case 1: + setBirthDateTimeStamp(0); + + break; + case 2: + CTX.setShiftsDaysChoose([]); + + break; + default: + break; + } + }, [scheduleType]); + + useEffect(() => { + if (goToEditTask) { + // const date = moment + // .unix(taskData.birthDateTimeStamp) + // .locale("fa") + // .format("YYYY/MM/DD") + // .split("/"); + + // setBirthDateTimeStamp({ + // day: parseInt(date[2]), + // month: parseInt(date[1]), + // year: parseInt(date[0]), + // }); + setScheduleType(taskData.scheduleType); + setDescription(taskData.description); + setTitle(taskData.title); + CTX.setRoutineForTaskChoose( + taskData.routines?.map((item) => item.routineId) + ); + CTX.setPositionsForTaskChoose( + taskData.positions?.map((item) => item.positionId) + ); + CTX.setShiftsDaysChoose(taskData.days?.map((item) => item.dayOfWeek)); + CTX.setShiftsForTaskChoose(taskData.shifts?.map((item) => item.shiftId)); + } + }, [taskData]); + + return ( + handleBottomSheetCreateTaskOpen(e)} + open={CTX.state.BottomSheetCreateTaskOpen} + onDismiss={() => CTX.setBottomSheetCreateTaskOpen(false)} + blocking={true} + > +
+

+ افزودن تسک جدید{" "} +

+
+
+
+
+ { + setTitle(e.target.value); + validator.current.showMessageFor("title"); + }} + style="text-right" + validator={true} + validatorData={validator.current.message( + "title", + title, + "required" + )} + /> +
+ +
+ { + setDescription(e.target.value); + }} + textarea={true} + style="text-right" + /> +
+ {/* ===========routine=============== */} + +
+ { + setRoutineForTaskCurrent(e.target.value); + validator.current.showMessageFor("routines"); + + if (!!routineForTaskChoose.find((b) => b == e.target.value)) { + toast.error("روز تکراری است", { + position: "bottom-right", + closeOnClick: true, + }); + } else { + CTX.setRoutineForTaskChoose(() => [e.target.value]); + } + }} + style="text-right" + validator={true} + validatorData={validator.current.message( + "routines", + routineForTaskChoose, + ["required", { min: 1 }] + )} + select={true} + selectData={routinesSelectData} + defaultValue={"انتخاب کنید"} + /> +
+ +
+ {routineForTaskChoose && + routineForTaskChoose.map((e, index) => ( +
+ {/*
deleteRoutineForTask(e)} + >
*/} + +
+

+ {routinesData?.find((b) => b.id == e)?.name} +

+
+
+ ))} +
+ {/* ===========position=============== */} + +
+ { + setPositionsForTaskCurrent(e.target.value); + validator.current.showMessageFor("positions"); + + if (positionsForTaskChoose.length >= 1) { + toast.error("شما فقط یک پوزیشن را میتوانید انتخاب کنید", { + position: "bottom-right", + closeOnClick: true, + }); + } else { + if ( + !!positionsForTaskChoose.find((b) => b == e.target.value) + ) { + toast.error("پوزیشن تکراری است", { + position: "bottom-right", + closeOnClick: true, + }); + } else { + CTX.setPositionsForTaskChoose((current) => [ + ...current, + e.target.value, + ]); + } + } + }} + style="text-right" + validatorData={validator.current.message( + "positions", + positionsForTaskChoose, + ["required", { min: 1 }] + )} + select={true} + selectData={positionsSelectData} + defaultValue={"انتخاب کنید"} + /> +
+ +
+ {positionsForTaskChoose && + positionsForTaskChoose.map((e, index) => ( +
+
deletePositionForTask(e)} + >
+ +
+

+ {positionsData?.find((b) => b.id == e)?.name} +

+
+
+ ))} +
+ + {/* ===========shifts=============== */} +
+ { + setShiftsForTaskCurrent(e.target.value); + validator.current.showMessageFor("shifts"); + + if (!!shiftsForTaskChoose.find((b) => b == e.target.value)) { + toast.error("روز تکراری است", { + position: "bottom-right", + closeOnClick: true, + }); + } else { + CTX.setShiftsForTaskChoose(() => [e.target.value]); + } + }} + style="text-right" + validatorData={validator.current.message( + "shifts", + shiftsForTaskChoose, + ["required", { min: 1 }] + )} + select={true} + selectData={shiftsSelectData} + defaultValue={"انتخاب کنید"} + /> +
+ +
+ {shiftsForTaskChoose && + shiftsForTaskChoose.map((e, index) => ( +
+ {/*
deleteShiftForTask(e)} + >
*/} + +
+

+ {shiftsData?.find((b) => b?.id == e)?.title} +

+
+
+ ))} +
+ + {/* ===========scheduleType=============== */} + +
+ { + setScheduleType(parseInt(e.target.value)); + validator.current.showMessageFor("scheduleType"); + }} + style="text-right" + validator={true} + validatorData={validator.current.message( + "scheduleType", + scheduleType, + ["required"] + )} + select={true} + selectData={[ + { key: "هفتگی", value: 1 }, + { key: "روزانه", value: 0 }, + { key: "مخصوص یک روز ", value: 2 }, + ]} + defaultValue={"انتخاب کنید"} + /> +
+ + {/*
+
+
+

+ {schedule?.find((b) => b.value == scheduleType)?.key} +

+
+
+
*/} + + {/* ===========scheduleType setFor=============== */} + + {scheduleType == 2 && ( + { + setBirthDateTimeStamp(e); + validator.current.showMessageFor("birthDateTimeStamp"); + }} + date={birthDateTimeStamp} + zindex="z-[101]" + validator={true} + validatorData={validator.current.message( + "birthDateTimeStamp", + birthDateTimeStamp, + ["required"] + )} + /> + )} +
+ {/* ===========shiftsDaysTask=============== */} + {scheduleType == 1 && ( + <> +
+ { + setShiftsDaysCurrent(e.target.value); + validator.current.showMessageFor("shiftsDaysChoose"); + + if (!!shiftsDaysChoose.find((b) => b == e.target.value)) { + toast.error("روز تکراری است", { + position: "bottom-right", + closeOnClick: true, + }); + } else { + CTX.setShiftsDaysChoose((current) => [ + ...current, + parseInt(e.target.value), + ]); + } + }} + validator={true} + validatorData={validator.current.message( + "shiftsDaysChoose", + shiftsDaysChoose, + ["required", { min: 1 }] + )} + style="text-right" + select={true} + selectData={shiftsDaysSelectData} + defaultValue={"انتخاب کنید"} + /> +
+ +
+ {shiftsDaysChoose && + shiftsDaysChoose.map((e, index) => ( +
+
deleteShiftsDaysForTask(e)} + >
+ +
+

+ {week?.find((b) => b.value == e).key} +

+
+
+ ))} +
+ + )} + {goToEditTask ? ( + handleCreateTask("UPDATE")} + subButton={true} + subButtonTitle="حذف فعالیت" + subButtonEvent={() => CTX.DeleteTask(idEditTask)} + /> + ) : ( + handleCreateTask()} + /> + )}{" "} +
+
+ ); +}; + +export default BottomSheetCreateTask; diff --git a/plugins/BottomSheet/BottomSheetReport.jsx b/plugins/BottomSheet/BottomSheetReport.jsx index 5717aa6..e40263e 100644 --- a/plugins/BottomSheet/BottomSheetReport.jsx +++ b/plugins/BottomSheet/BottomSheetReport.jsx @@ -27,10 +27,10 @@ const BottomSheetReport = (props) => { CTX.setBottomSheetReportOpen(false)} - blocking={false} + blocking={true} > -
-

گزارشات

+
+

گزارشات

diff --git a/plugins/BottomSheet/BottomSheetReportManageShift.jsx b/plugins/BottomSheet/BottomSheetReportManageShift.jsx index c0ad65a..2837342 100644 --- a/plugins/BottomSheet/BottomSheetReportManageShift.jsx +++ b/plugins/BottomSheet/BottomSheetReportManageShift.jsx @@ -15,6 +15,7 @@ const BottomSheetReportManageShift = (props) => { const CTX = useContext(AppContext); const shiftplansData = CTX.state.shiftPlansData; const [shiftplans, setShiftplans] = useState([]); + const [type, setType] = useState(0); // const reportDetail = CTX.state.reportDetail; @@ -31,9 +32,16 @@ const BottomSheetReportManageShift = (props) => { const handleBottomSheetCreateRole = (e) => { if (e.type == "OPEN") { CTX.GetShifPlans(0, 12); + } else if (e.type == "CLOSE") { + setType(0); } }; + const handleReportManageShift = (num, filterId) => { + setType(num); + CTX.GetShifPlans(0, filterId); + }; + const groupObjectsByPlanFor = (responseData) => { const groupedData = {}; @@ -107,12 +115,42 @@ const BottomSheetReportManageShift = (props) => { onSpringStart={(e) => handleBottomSheetCreateRole(e)} open={CTX.state.BottomSheetReportManageShiftOpen} onDismiss={() => CTX.setBottomSheetReportManageShiftOpen(false)} - blocking={false} + blocking={true} > -
-

گزارشات

+
+

گزارشات

+
+
handleReportManageShift(0, 12)} + > +

+ همین هفته{" "} +

+
+
handleReportManageShift(1, 11)} + > +

+ هفته بعد{" "} +

+
+

{shiftplans?.map((e, index) => ( diff --git a/plugins/Charts/CoffeeBrewChart.jsx b/plugins/Charts/CoffeeBrewChart.jsx new file mode 100644 index 0000000..b129c97 --- /dev/null +++ b/plugins/Charts/CoffeeBrewChart.jsx @@ -0,0 +1,113 @@ +// components/RecipeChart.js +import React from "react"; +import { Line } from "react-chartjs-2"; +import { + Chart as ChartJS, + CategoryScale, + LinearScale, + PointElement, + LineElement, + Title, + Tooltip, + Legend, +} from "chart.js"; + +ChartJS.register( + CategoryScale, + LinearScale, + PointElement, + LineElement, + Title, + Tooltip, + Legend +); + +const CoffeeBrewChart = ({ data }) => { + console.log("data", data); + const chartData = { + labels: data?.map((entry) => + new Date(entry?.logAt).toLocaleDateString("fa-IR", { + month: "numeric", + day: "numeric", + }) + ), // X-axis labels + datasets: [ + { + label: "Ratio", + data: data?.map((entry) => entry?.ratio), + borderColor: "rgba(75, 192, 192, 1)", + backgroundColor: "rgba(75, 192, 192, 0.2)", + fill: false, + }, + { + label: "Extraction Time", + data: data?.map((entry) => entry?.extractionTime), + borderColor: "rgba(153, 102, 255, 1)", + backgroundColor: "rgba(153, 102, 255, 0.2)", + fill: false, + }, + { + label: "Final Yield", + data: data?.map((entry) => entry?.finalYield), + borderColor: "rgba(255, 159, 64, 1)", + backgroundColor: "rgba(255, 159, 64, 0.2)", + fill: false, + }, + ], + }; + + const options = { + responsive: true, + maintainAspectRatio: false, // Disable aspect ratio to allow custom sizing + plugins: { + legend: { + display: false, // Hide the legend + }, + title: { + display: false, // Hide the title + }, + }, + scales: { + x: { + title: { + display: false, + text: "Date", + font: { + size: 16, + family: "KalamehWeb", // Customize font family if needed + style: "normal", + }, + }, + ticks: { + font: { + size: 12, + family: "KalamehWeb", // Customize font family if needed + style: "normal", + }, + }, + }, + y: { + title: { + display: false, // Hide the y-axis title + }, + ticks: { + font: { + size: 12, + family: "Arial", // Customize font family if needed + style: "normal", + }, + }, + }, + }, + }; + + return ( +

+
+ +
+
+ ); +}; + +export default CoffeeBrewChart; diff --git a/plugins/DatePickerIran/page.jsx b/plugins/DatePickerIran/page.jsx index 9a5f412..91563f7 100644 --- a/plugins/DatePickerIran/page.jsx +++ b/plugins/DatePickerIran/page.jsx @@ -31,7 +31,7 @@ const DatePickerIran = ({
-
+

{title}

@@ -41,7 +41,7 @@ const DatePickerIran = ({ onChange={datePickerEvent} shouldHighlightWeekends inputClassName={`peer w-full border-b placeholder:text-transparent relative !text-right ${ - 2 == 1 ? "form-control-white" : "form-control" + 1 == 1 ? "form-control-white" : "form-control" }`} locale="fa" name={name} diff --git a/public/images/notif.png b/public/images/notif.png new file mode 100644 index 0000000..8d351b0 Binary files /dev/null and b/public/images/notif.png differ diff --git a/public/images/setting.png b/public/images/setting.png new file mode 100644 index 0000000..c773f80 Binary files /dev/null and b/public/images/setting.png differ diff --git a/public/sw.js.map b/public/sw.js.map index 23c4bb6..1765718 100644 --- a/public/sw.js.map +++ b/public/sw.js.map @@ -1 +1 @@ -{"version":3,"file":"sw.js","sources":["C:/Users/jp/AppData/Local/Temp/eee290646bf53d05d19a19d5d8869e59/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from 'Y:/projects/brizco/node_modules/workbox-routing/registerRoute.mjs';\nimport {NetworkFirst as workbox_strategies_NetworkFirst} from 'Y:/projects/brizco/node_modules/workbox-strategies/NetworkFirst.mjs';\nimport {NetworkOnly as workbox_strategies_NetworkOnly} from 'Y:/projects/brizco/node_modules/workbox-strategies/NetworkOnly.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from 'Y:/projects/brizco/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from 'Y:/projects/brizco/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from 'Y:/projects/brizco/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\nimportScripts(\n \"/fallback-development.js\"\n);\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"/offline\",\n \"revision\": \"development\"\n }\n], {\n \"ignoreURLParametersMatching\": [/^utm_/, /^fbclid$/, /ts/]\n});\nworkbox_precaching_cleanupOutdatedCaches();\n\n\n\nworkbox_routing_registerRoute(\"/\", new workbox_strategies_NetworkFirst({ \"cacheName\":\"start-url\", plugins: [{ cacheWillUpdate: async ({ response: e })=>e && \"opaqueredirect\" === e.type ? new Response(e.body, { status: 200, statusText: \"OK\", headers: e.headers }) : e }, { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/.*/i, new workbox_strategies_NetworkOnly({ \"cacheName\":\"dev\", plugins: [{ handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\n\n\n\n\nself.__WB_DISABLE_DEV_LOGS = true;"],"names":["importScripts","self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","workbox_precaching_cleanupOutdatedCaches","workbox_routing_registerRoute","workbox_strategies_NetworkFirst","plugins","cacheWillUpdate","response","e","type","Response","body","status","statusText","headers","handlerDidError","request","fallback","error","workbox_strategies_NetworkOnly","__WB_DISABLE_DEV_LOGS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBAA,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACX,CACF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAA;EAQDC,CAAI,CAAA,CAAA,CAAA,CAACC,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA;AAElBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAyB,EAAE,CAAA;;AAG3B,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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AAA,CAAA,CAAA,CAAA;EAAEC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAO,EAAER,CAAAA;AAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,KAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAOV,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAI,GAAGA,CAAI,CAAA,CAAA,CAAA,CAACmB,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAACT,CAAC,CAAC,CAAA,CAAA,CAAGE,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAACQ,KAAK,CAAC,CAAA;KAAG,CAAA;AAAE,CAAA,CAAA,CAAC,CAAC,CAAA,CAAE,CAAK,CAAA,CAAA,CAAA,CAAA,CAAC,CAAA;EAKhOpB,CAAI,CAAA,CAAA,CAAA,CAACsB,CAAqB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAI,CAAA,CAAA,CAAA,CAAA;;"} \ No newline at end of file +{"version":3,"file":"sw.js","sources":["C:/Users/jp/AppData/Local/Temp/8c3af03a8ba81ebf81af28ca89289773/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from 'Y:/projects/brizco/node_modules/workbox-routing/registerRoute.mjs';\nimport {NetworkFirst as workbox_strategies_NetworkFirst} from 'Y:/projects/brizco/node_modules/workbox-strategies/NetworkFirst.mjs';\nimport {NetworkOnly as workbox_strategies_NetworkOnly} from 'Y:/projects/brizco/node_modules/workbox-strategies/NetworkOnly.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from 'Y:/projects/brizco/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from 'Y:/projects/brizco/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from 'Y:/projects/brizco/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\nimportScripts(\n \"/fallback-development.js\"\n);\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"/offline\",\n \"revision\": \"development\"\n }\n], {\n \"ignoreURLParametersMatching\": [/^utm_/, /^fbclid$/, /ts/]\n});\nworkbox_precaching_cleanupOutdatedCaches();\n\n\n\nworkbox_routing_registerRoute(\"/\", new workbox_strategies_NetworkFirst({ \"cacheName\":\"start-url\", plugins: [{ cacheWillUpdate: async ({ response: e })=>e && \"opaqueredirect\" === e.type ? new Response(e.body, { status: 200, statusText: \"OK\", headers: e.headers }) : e }, { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/.*/i, new workbox_strategies_NetworkOnly({ \"cacheName\":\"dev\", plugins: [{ handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\n\n\n\n\nself.__WB_DISABLE_DEV_LOGS = true;"],"names":["importScripts","self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","workbox_precaching_cleanupOutdatedCaches","workbox_routing_registerRoute","workbox_strategies_NetworkFirst","plugins","cacheWillUpdate","response","e","type","Response","body","status","statusText","headers","handlerDidError","request","fallback","error","workbox_strategies_NetworkOnly","__WB_DISABLE_DEV_LOGS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBAA,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACX,CACF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAA;EAQDC,CAAI,CAAA,CAAA,CAAA,CAACC,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA;AAElBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAyB,EAAE,CAAA;;AAG3B,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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,CAAAA;AAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,KAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAOV,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAI,GAAGA,CAAI,CAAA,CAAA,CAAA,CAACmB,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAACT,CAAC,CAAC,CAAA,CAAA,CAAGE,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAACQ,KAAK,CAAC,CAAA;KAAG,CAAA;AAAE,CAAA,CAAA,CAAC,CAAC,CAAA,CAAE,CAAK,CAAA,CAAA,CAAA,CAAA,CAAC,CAAA;EAKhOpB,CAAI,CAAA,CAAA,CAAA,CAACsB,CAAqB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAI,CAAA,CAAA,CAAA,CAAA;;"} \ No newline at end of file diff --git a/src/app/acount/page.jsx b/src/app/acount/page.jsx index fc4089b..cc27bcf 100644 --- a/src/app/acount/page.jsx +++ b/src/app/acount/page.jsx @@ -18,8 +18,8 @@ const page = () => { const [fistName, setFistName] = useState(""); const [lastName, setLastName] = useState(""); const [phoneNumber, setPhoneNumber] = useState(""); - const [nationalId, setNationalId] = useState(""); - const [birthDateTimeStamp, setBirthDateTimeStamp] = useState(""); + // const [nationalId, setNationalId] = useState(""); + // const [birthDateTimeStamp, setBirthDateTimeStamp] = useState(""); const [, forceUpdate] = useState(); const validator = useRef( @@ -49,7 +49,7 @@ const page = () => { setFistName(profile?.firstName); setLastName(profile?.lastName); setPhoneNumber(profile?.phoneNumber); - setNationalId(profile?.nationalId); + // setNationalId(profile?.nationalId); // setBirthDateTimeStamp( // profile.birthDateTimeStamp < 0 ? ["1376", "09", "14"] : "" @@ -135,6 +135,7 @@ const page = () => { fistName, "required" )} + theme={1} />
@@ -155,6 +156,7 @@ const page = () => { lastName, "required" )} + theme={1} />
@@ -176,35 +178,16 @@ const page = () => { phoneNumber, "required" )} + theme={1} readOnly={true} />
-
- { - setNationalId(e.target.value); - validator.current.showMessageFor("nationalId"); - }} - style="text-right" - validator={true} - validatorData={validator.current.message( - "nationalId", - nationalId, - "required" - )} - /> -
- setBirthDateTimeStamp(e)} date={birthDateTimeStamp} zindex="z-[101]" - /> + /> */}
diff --git a/src/app/coffee-brew/page.jsx b/src/app/coffee-brew/page.jsx index de4229e..e902766 100644 --- a/src/app/coffee-brew/page.jsx +++ b/src/app/coffee-brew/page.jsx @@ -10,6 +10,7 @@ import CoffeeBrewCard from "@comp/CoffeeBrew/CoffeeBrewCard/page"; import AppContext from "@ctx/AppContext"; import Chapar from "plugins/Chapar"; import { toast } from "react-toastify"; +import CoffeeBrewChart from "plugins/Charts/CoffeeBrewChart"; const page = () => { const router = useRouter(); @@ -175,7 +176,8 @@ const page = () => {

تاریخچه ادجاست ها

-
+ + {coffeeBrewData?.pastRecipes?.map((e) => ( diff --git a/src/app/employees/page.jsx b/src/app/employees/page.jsx index a548f61..2662e46 100644 --- a/src/app/employees/page.jsx +++ b/src/app/employees/page.jsx @@ -20,16 +20,23 @@ import ShiftsEmployees from "@comp/EmployeesComponent/Shifts/page"; import ParseJwt from "plugins/ParseJwt/page"; import GoBack from "plugins/GoBack/page"; import HasPermission from "plugins/HasPermission/page"; +import { useRouter } from "next/navigation"; +import TasksEmployees from "@comp/EmployeesComponent/Tasks/page"; +import BottomSheetCreateTask from "plugins/BottomSheet/BottomSheetCreateTask"; // import second from "@img/test.png"; const Employees = (props) => { const CTX = useContext(AppContext); const permissions = CTX.state.profile?.permissions; + const pageGetTasks = CTX.state.pageGetTasks; + + const router = useRouter(); const [activeSection, setActiveSection] = useState(0); useEffect(() => { + CTX.GetUnReadNotif(); CTX.GetRoutines(); }, []); @@ -67,6 +74,11 @@ const Employees = (props) => { } break; + case 5: + if (activeSection != num) { + CTX.GetShifts(); + } + break; default: break; } @@ -79,12 +91,6 @@ const Employees = (props) => { { - GoBack(); - }} />
@@ -103,7 +109,7 @@ const Employees = (props) => {

- +

@@ -158,7 +164,7 @@ const Employees = (props) => {

- +

@@ -209,7 +215,7 @@ const Employees = (props) => {

- +

@@ -263,7 +269,7 @@ const Employees = (props) => {

- +

@@ -317,7 +323,7 @@ const Employees = (props) => {

- +

@@ -357,6 +363,65 @@ const Employees = (props) => {
{activeSection == 4 && }
+
+
handleGetApi(5)} + > +
+
+

+ +

+
+
+

افزودن تسک مجموعه

+
+
+ + {HasPermission("ManageTasks", permissions) && ( + <> + {activeSection == 5 ? ( +
{ + CTX.setTaskData([]); + CTX.setIdEditTask(""); + CTX.setGoToEditTask(false); + CTX.setBottomSheetCreateTaskOpen(true); + }} + > + + + +
+ ) : ( +
+ )} + + )} +
+ {activeSection == 5 && } +
{/* */} @@ -364,6 +429,7 @@ const Employees = (props) => { +
); }; diff --git a/src/app/home/page.jsx b/src/app/home/page.jsx index 2155b8c..ab45b3d 100644 --- a/src/app/home/page.jsx +++ b/src/app/home/page.jsx @@ -34,6 +34,7 @@ const Home = (props) => { useEffect(() => { CTX.GetHomePageData(); CTX.GetLatesCoffeeBrewData(); + CTX.GetUnReadNotif(); }, []); const dataChart = (totalActivitiesCount, doneActivitiesCount) => { @@ -65,9 +66,19 @@ const Home = (props) => { CTX.setBottomSheetReportOpen(true); }; + const handleActiveShiftPlanHom = (index) => { + if (activeShiftPlanHome == index) { + setActiveShiftPlanHome(-1); + } else { + setActiveShiftPlanHome(index); + } + }; + const today = new Date(); const formattedDate = FormatJalaliDate(today); + console.log(latesCoffeeBrewData); + return (
{
-
+ {latesCoffeeBrewData.logBy !== "" ? ( +
+ + + +
+ ) : ( - +
+

+ افزودن ادجاست جدید +

+
-
+ )}
{homePageData?.shiftPlans?.map((e, index) => ( <>
setActiveShiftPlanHome(index)} + onClick={() => handleActiveShiftPlanHom(index)} >
{homePageData?.currentShiftId == e.id && ( -
+
)} -

{e.shiftTitle}

+

{e.shiftTitle}

@@ -159,7 +180,9 @@ const Home = (props) => { viewBox="0 0 151 89" fill="none" xmlns="http://www.w3.org/2000/svg" - className="opacity-80 mt-2 mx-auto" + className={`opacity-80 mt-2 mx-auto tr03 ${ + activeShiftPlanHome == index ? "rotate-180" : "" + }`} > {
- -
-
-
- - - - - -
-
-

شیفت های تمام شده

-

- خروجی اکسل -

-
-
-
- -
-
-
- - - - - -
-
-

شیفت های مجموعه

-

- خروجی اکسل -

-
-
-
- -
-
-
- - - - - -
-
-

- {" "} - کاست تمام شده آیتم ها{" "} -

-

- خروجی اکسل -

-
-
-
diff --git a/src/app/layout.jsx b/src/app/layout.jsx index ed3c3d3..a142788 100644 --- a/src/app/layout.jsx +++ b/src/app/layout.jsx @@ -66,6 +66,9 @@ export default function RootLayout({ children }) { setBottomSheetReportManageShiftOpen, ] = useState(false); + const [BottomSheetCreateTaskOpen, setBottomSheetCreateTaskOpen] = + useState(false); + // BigPlus const [BigPlusOpen, setBigPlusOpen] = useState(false); const [BigPlusRotateIcon, setBigPlusRotateIcon] = useState(false); @@ -94,6 +97,7 @@ export default function RootLayout({ children }) { // createUser/ user const [usersData, setUsersData] = useState([]); + const [userStaffData, setUserStaffData] = useState([]); const [rolesChoose, setRolesChoose] = useState([]); const [userData, setUserData] = useState([]); const [goToEditUser, setGoToEditUser] = useState(false); @@ -166,6 +170,9 @@ export default function RootLayout({ children }) { const [coffeeBrewData, setCoffeeBrewData] = useState([]); const [latesCoffeeBrewData, setLatesCoffeeBrewData] = useState([]); + //notif + const [notifUnreadData, setNotifUnreadData] = useState(""); + const pathname = usePathname(); const router = useRouter(); const hiddenUrls = ["/login", "/pricing", "/about-us", "/"]; @@ -510,6 +517,30 @@ export default function RootLayout({ children }) { setLoading(false); } }; + const GetUserStaff = async (FilterDate) => { + setLoading(true); + try { + const data = await Chapar.get( + `${ + process.env.NEXT_PUBLIC_API_URL + }/user/staff?filter=${FilterDate}&page=${0}`, + + { + headers: { + Authorization: "Bearer " + localStorage.getItem("token"), + }, + } + ); + setUserStaffData(data); + setLoading(false); + } catch ({ error, status }) { + toast.error(`${error?.response?.data?.message}`, { + position: "bottom-right", + closeOnClick: true, + }); + setLoading(false); + } + }; const DeleteUser = async (id) => { setLoading(true); try { @@ -1122,7 +1153,6 @@ export default function RootLayout({ children }) { // router-> setLoading(false); - GetTasks(0); router.push("/tasks"); } catch ({ error, status }) { @@ -1154,7 +1184,6 @@ export default function RootLayout({ children }) { // router-> setLoading(false); - GetTasks(0); router.push("/tasks"); } catch ({ error, status }) { toast.error(`${error?.response?.data?.message}`, { @@ -1164,11 +1193,11 @@ export default function RootLayout({ children }) { setLoading(false); } }; - const GetTasks = async (page) => { + const GetTasks = async (page, shiftId) => { setLoading(true); try { const data = await Chapar.get( - `${process.env.NEXT_PUBLIC_API_URL}/task?page=${page}`, + `${process.env.NEXT_PUBLIC_API_URL}/task?page=${page}&shiftId=${shiftId}`, { headers: { Authorization: "Bearer " + localStorage.getItem("token"), @@ -1230,8 +1259,7 @@ export default function RootLayout({ children }) { ); setLoading(false); - GetTasks(); - router.push("/tasks"); + setBottomSheetCreateTaskOpen(false); } catch ({ error, status }) { toast.error(`${error?.response?.data?.message}`, { position: "bottom-right", @@ -1241,7 +1269,7 @@ export default function RootLayout({ children }) { } }; - const GetActivity = async (date, shift, page, dateQueryFilter) => { + const GetActivity = async (date, shift, page, dateQueryFilter, userId) => { setLoading(true); try { const data = await Chapar.get( @@ -1249,7 +1277,7 @@ export default function RootLayout({ children }) { date ? `&selectedDate=${date}` : "" }${shift ? `&selectedShiftPlanId=${shift}` : ""}${ dateQueryFilter != null ? `&dateQueryFilter=${dateQueryFilter}` : "" - }`, + }${userId != null ? `&userId=${userId}` : ""}`, { headers: { @@ -1540,15 +1568,34 @@ export default function RootLayout({ children }) { } }; + const GetUnReadNotif = async () => { + setLoading(true); + try { + const data = await Chapar.get( + `${process.env.NEXT_PUBLIC_API_URL}/notification/unread/count` + ); + setNotifUnreadData(data); + setLoading(false); + + return data; + } catch ({ error, status }) { + toast.error(`${error?.response?.data?.message}`, { + position: "bottom-right", + closeOnClick: true, + }); + setLoading(false); + } + }; + useEffect(() => { console.log(` - bbbbbbbb - b::::::b iiii - b::::::b i::::i - b::::::b iiii - b:::::b - b:::::bbbbbbbbb rrrrr rrrrrrrrr iiiiiiizzzzzzzzzzzzzzzzz cccccccccccccccc ooooooooooo - b::::::::::::::bb r::::rrr:::::::::ri:::::iz:::::::::::::::z cc:::::::::::::::coo:::::::::::oo + bbbbbbbb + b::::::b iiii + b::::::b i::::i + b::::::b iiii + b:::::b + b:::::bbbbbbbbb rrrrr rrrrrrrrr iiiiiiizzzzzzzzzzzzzzzzz cccccccccccccccc ooooooooooo + b::::::::::::::bb r::::rrr:::::::::ri:::::iz:::::::::::::::z cc:::::::::::::::coo:::::::::::oo b::::::::::::::::br:::::::::::::::::ri::::iz::::::::::::::z c:::::::::::::::::o:::::::::::::::o b:::::bbbbb:::::::rr::::::rrrrr::::::i::::izzzzzzzz::::::z c:::::::cccccc:::::o:::::ooooo:::::o b:::::b b::::::br:::::r r:::::i::::i z::::::z c::::::c cccccco::::o o::::o @@ -1557,18 +1604,20 @@ export default function RootLayout({ children }) { b:::::b b:::::br:::::r i::::i z::::::z c::::::c cccccco::::o o::::o b:::::bbbbbb::::::br:::::r i::::::i z::::::zzzzzzzc:::::::cccccc:::::o:::::ooooo:::::o b::::::::::::::::b r:::::r i::::::iz::::::::::::::zc:::::::::::::::::o:::::::::::::::o - b:::::::::::::::b r:::::r i::::::z:::::::::::::::z cc:::::::::::::::coo:::::::::::oo - bbbbbbbbbbbbbbbb rrrrrrr iiiiiiizzzzzzzzzzzzzzzzz cccccccccccccccc ooooooooooo + b:::::::::::::::b r:::::r i::::::z:::::::::::::::z cc:::::::::::::::coo:::::::::::oo + bbbbbbbbbbbbbbbb rrrrrrr iiiiiiizzzzzzzzzzzzzzzzz cccccccccccccccc ooooooooooo + + soli chizi bood bgo hossein__masoomi - soli chizi bood bgo hossein__masoomi - `); const token = localStorage.getItem("token"); // if (!token) { // router.push("/login"); // } - if (profile.length <= 0 && token) CheckUser(); + if (profile.length <= 0 && token) { + CheckUser(); + } }, []); return ( @@ -1652,6 +1701,9 @@ export default function RootLayout({ children }) { BottomSheetReportManageShiftOpen, coffeeBrewData, latesCoffeeBrewData, + BottomSheetCreateTaskOpen, + userStaffData, + notifUnreadData, }, setBottomSheetCreateRoleOpen, setBottomSheetCreateEmployeesOpen, @@ -1782,6 +1834,11 @@ export default function RootLayout({ children }) { GetCoffeeBrewData, GetLatesCoffeeBrewData, setLatesCoffeeBrewData, + setBottomSheetCreateTaskOpen, + setUserStaffData, + GetUserStaff, + setNotifUnreadData, + GetUnReadNotif, }} > diff --git a/src/app/news/page.jsx b/src/app/news/page.jsx new file mode 100644 index 0000000..179c0e0 --- /dev/null +++ b/src/app/news/page.jsx @@ -0,0 +1,557 @@ +"use client"; +import AppHeader from "@comp/AppHeader/page"; +import { useRouter } from "next/navigation"; +import React, { useContext, useEffect, useState } from "react"; + +import AppContext from "@ctx/AppContext"; +import Chapar from "plugins/Chapar"; +import { toast } from "react-toastify"; +import Avatar from "boring-avatars"; +import PersianNumber from "../../../plugins/PersianNumber"; +import moment from "jalali-moment"; +import InfiniteScroll from "react-infinite-scroll-component"; + +const page = () => { + const router = useRouter(); + const CTX = useContext(AppContext); + const [typeNews, setTypeNews] = useState(1); + const [notifData, setNotifData] = useState([]); + const [loading, setLoading] = useState(false); + const [page, setPage] = useState(0); + const [hasMore, setHasMore] = useState(true); + + const markAsRead = async (id, notifData, setNotifData) => { + console.log("ssssssssssssssssssssssssssss"); + try { + const data = await Chapar.post( + `${process.env.NEXT_PUBLIC_API_URL}/notification/${id}/read` + ); + + // Update the local state to mark the notification as read + const updatedNotifData = notifData.map((notif) => + notif.id === id ? { ...notif, isRead: true } : notif + ); + setNotifData(updatedNotifData); + return data; + } catch ({ error, status }) { + toast.error(`در خواندن نوتیف مشکلی هست`, { + position: "bottom-right", + closeOnClick: true, + }); + } + }; + + const loadNotifications = async () => { + setLoading(true); + try { + const data = await Chapar.get( + `${ + process.env.NEXT_PUBLIC_API_URL + }/notification?page=${page}&count=${40}` + ); + + if (data.length === 0) { + setHasMore(false); + } else { + setNotifData((prevData) => [...prevData, ...data]); + setPage((prevPage) => prevPage + 1); + } + setLoading(false); + } catch ({ error, status }) { + toast.error(`${error?.response?.data?.message}`, { + position: "bottom-right", + closeOnClick: true, + }); + setLoading(false); + } + }; + + useEffect(() => { + loadNotifications(); + }, []); + + let lastDate = null; + + return ( + <> + {" "} +
+ + + {} +
+ {" "} +
+
setTypeNews(0)} + > +

+ اخبار{" "} +

+
+
setTypeNews(1)} + > +

+ نوتیف{" "} +

+
+
+ {typeNews == 0 ? ( +
+
+
+
+
+ + +
+
+
+
+
+
+
+
+

محمد کاشغی

+ +
+
+ + + + +

+ نظر سنجی +

+
+ +
+ + + + +

+ اختصاصی{" "} +

+
+
+ +
+