diff --git a/.env b/.env index 8e19167..023304b 100644 --- a/.env +++ b/.env @@ -3,6 +3,7 @@ NODE_ENV="development" NEXT_PUBLIC_SERVER_URL=http://192.168.88.12:32769 NEXT_PUBLIC_PUBLIC_URL=http://192.168.88.12:32769 NEXT_PUBLIC_API_URL=http://192.168.88.12:32769/api + # 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 diff --git a/components/EmployeesComponent/Users/page.jsx b/components/EmployeesComponent/Users/page.jsx index ac08a04..b99a420 100644 --- a/components/EmployeesComponent/Users/page.jsx +++ b/components/EmployeesComponent/Users/page.jsx @@ -33,7 +33,7 @@ const UsersEmployees = () => {

- {e.firstName}{" "} + {e.firstName} {e.lastName}

{e.roleNames.length > 0 diff --git a/components/TaskPage/TasksCard/page.jsx b/components/TaskPage/TasksCard/page.jsx index 531e107..6a24319 100644 --- a/components/TaskPage/TasksCard/page.jsx +++ b/components/TaskPage/TasksCard/page.jsx @@ -12,9 +12,6 @@ const TasksCard = ({ tasksData, permissions }) => { const CTX = useContext(AppContext); const router = useRouter(); - const [showAllTasks, setShowAllTasks] = useState(false); - const [showJust5TasksData, setShowJust5TasksData] = useState(null); - const goToEditTask = (id) => { if (!!HasPermission("ManageTasks", permissions)) { CTX.setGoToEditTask(true); @@ -24,149 +21,38 @@ const TasksCard = ({ tasksData, permissions }) => { } }; - useEffect(() => { - if (tasksData.length > 5) { - setShowJust5TasksData(tasksData.slice(0, 5)); - } else { - setShowJust5TasksData(tasksData); - } - }, [tasksData]); - return ( <> - {showAllTasks ? ( -

- {tasksData.map((e) => ( -
goToEditTask(e.id)} - > -
-
- {e?.scheduleType == 0 - ? "روزانه" - : e?.scheduleType == 1 - ? "هفتگی" - : e?.scheduleType == 2 - ? "مخصوص" - : ""} -
-
-
-
-

- {e?.title}{" "} -

-
-
- -
- {e?.scheduleType == 2 && ( -
- {" "} -
- )} - -
- {e?.shifts[0]} -
-
+ {tasksData?.map((e) => ( +
{ + goToEditTask(e.id); + }} + > +
+
+ {e?.scheduleType == 0 + ? "روزانه" + : e?.scheduleType == 1 + ? "هفتگی" + : e?.scheduleType == 2 + ? "مخصوص" + : ""}
- ))} +
+ {e?.shifts[0]} +
+
+
+
+

+ {e?.title}{" "} +

+
+
- ) : ( - - {showJust5TasksData?.map((e) => ( - -
{ - goToEditTask(e.id); - }} - > - {HasPermission("ManageTasks") &&
salam
} -
-
- {e?.scheduleType == 0 - ? "روزانه" - : e?.scheduleType == 1 - ? "هفتگی" - : e?.scheduleType == 2 - ? "مخصوص" - : ""} -
-
- {e?.shifts[0]} -
-
-
-
-

- {e?.title}{" "} -

-
- -
-
-
-
-
-
- -
-

- + - - - - نفر دیگر -

-
-
- -
-
- - - -
-

- -

-
-
-
-
- ))} - - {tasksData.length > 5 && ( -
setShowAllTasks(true)} - > -
-

- مشاهده بیشتر -

-
-
- )} -
-
- )} + ))} ); }; diff --git a/components/UnderDevelopeTimer.jsx b/components/UnderDevelopeTimer.jsx index 4ca5c3a..28cdf0f 100644 --- a/components/UnderDevelopeTimer.jsx +++ b/components/UnderDevelopeTimer.jsx @@ -4,7 +4,7 @@ import PersianNumber from "../plugins/PersianNumber"; import Link from "next/link"; const UnderDevelopeTimer = () => { - const targetTimestamp = 1698635992 * 1000; // Convert to milliseconds + const targetTimestamp = 1704170967 * 1000; // Convert to milliseconds const [timeRemaining, setTimeRemaining] = useState({ days: 0, @@ -46,7 +46,7 @@ const UnderDevelopeTimer = () => { }, []); return ( -
+

diff --git a/package.json b/package.json index d6e0f33..21fabff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "brizco", - "version": "0.1.8", + "version": "0.1.9", "private": true, "scripts": { "dev": "next dev", @@ -18,12 +18,14 @@ "core-util-is": "^1.0.3", "framer-motion": "^10.16.1", "jalali-moment": "^3.3.11", + "lodash": "^4.17.21", "next": "13.4.19", "postcss": "8.4.28", "rc-slider": "^10.5.0", "react": "18.2.0", "react-chartjs-2": "^5.2.0", "react-dom": "18.2.0", + "react-infinite-scroll-component": "^6.1.0", "react-modern-calendar-datepicker": "^3.1.6", "react-spring-bottom-sheet": "^3.4.1", "react-toastify": "^9.1.3", diff --git a/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx b/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx index 7f21789..4a3cd89 100644 --- a/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx +++ b/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx @@ -75,6 +75,7 @@ const BottomSheetAddUserToPositionShiftPlan = ({ }, ]); } + CTX.setBottomSheetAddUserToPositionShiftPlanOpen(false); }} >

diff --git a/plugins/BottomSheet/BottomSheetCreateEmployees.jsx b/plugins/BottomSheet/BottomSheetCreateEmployees.jsx index 93fad1f..1a5d8b8 100644 --- a/plugins/BottomSheet/BottomSheetCreateEmployees.jsx +++ b/plugins/BottomSheet/BottomSheetCreateEmployees.jsx @@ -91,7 +91,7 @@ const BottomSheetCreateEmployees = (props) => { setLastName(""); setPhoneNumber(""); // setNationalId(""); - setGender(""); + setGender(parseInt(0)); // setBirthDate(""); setRoleSelectCurrntData(""); setRoleSelectData([]); @@ -346,7 +346,7 @@ const BottomSheetCreateEmployees = (props) => {

- {rolesData?.find((b) => b.id == e).persianName} + {rolesData?.find((b) => b.id == e)?.persianName}

diff --git a/plugins/BottomSheet/BottomSheetCreatePosition.jsx b/plugins/BottomSheet/BottomSheetCreatePosition.jsx index d9bac6e..8f896e8 100644 --- a/plugins/BottomSheet/BottomSheetCreatePosition.jsx +++ b/plugins/BottomSheet/BottomSheetCreatePosition.jsx @@ -91,7 +91,6 @@ const BottomSheetCreatePosition = (props) => { })) ); if (e.type == "OPEN") { - CTX.GetSections(); if (goToEditPosition) { CTX.GetPosition(idEditPosition); } @@ -158,16 +157,16 @@ const BottomSheetCreatePosition = (props) => { value={description} inputEvent={(e) => { setDescription(e.target.value); - validator.current.showMessageFor("description"); + // validator.current.showMessageFor("description"); }} textarea={true} style="text-right" - validator={true} - validatorData={validator.current.message( - "description", - description, - "required" - )} + // validator={true} + // validatorData={validator.current.message( + // "description", + // description, + // "required" + // )} />
diff --git a/plugins/BottomSheet/BottomSheetCreateRoutine.jsx b/plugins/BottomSheet/BottomSheetCreateRoutine.jsx index 88528d7..38ddd86 100644 --- a/plugins/BottomSheet/BottomSheetCreateRoutine.jsx +++ b/plugins/BottomSheet/BottomSheetCreateRoutine.jsx @@ -136,16 +136,16 @@ const BottomSheetCreateRoutine = (props) => { value={description} inputEvent={(e) => { setDescription(e.target.value); - validator.current.showMessageFor("description"); + // validator.current.showMessageFor("description"); }} textarea={true} style="text-right" - validator={true} - validatorData={validator.current.message( - "description", - description, - "required" - )} + // validator={true} + // validatorData={validator.current.message( + // "description", + // description, + // "required" + // )} />
diff --git a/plugins/BottomSheet/BottomSheetCreateSection.jsx b/plugins/BottomSheet/BottomSheetCreateSection.jsx index 6c0f8f4..58050cc 100644 --- a/plugins/BottomSheet/BottomSheetCreateSection.jsx +++ b/plugins/BottomSheet/BottomSheetCreateSection.jsx @@ -134,16 +134,16 @@ const BottomSheetCreateSection = (props) => { value={description} inputEvent={(e) => { setDescription(e.target.value); - validator.current.showMessageFor("description"); + // validator.current.showMessageFor("description"); }} textarea={true} style="text-right" - validator={true} - validatorData={validator.current.message( - "description", - description, - "required" - )} + // validator={true} + // validatorData={validator.current.message( + // "description", + // description, + // "required" + // )} />
diff --git a/plugins/BottomSheet/BottomSheetCreateShifts.jsx b/plugins/BottomSheet/BottomSheetCreateShifts.jsx index 131ba04..7ebb334 100644 --- a/plugins/BottomSheet/BottomSheetCreateShifts.jsx +++ b/plugins/BottomSheet/BottomSheetCreateShifts.jsx @@ -144,6 +144,8 @@ const BottomSheetCreateShifts = (props) => { } }, [shiftData]); + console.log("----------------------------------", CTX.state.startAtTimeShift); + return ( handleBottomSheetCreateShift(e)} @@ -185,7 +187,7 @@ const BottomSheetCreateShifts = (props) => { id="startAtTimeShift-id" name="startAtTimeShift" type={"text"} - value={startAtTimeShift} + value={startAtTimeShift[0] + ":" + startAtTimeShift[1]} inputEvent={(e) => { validator.current.showMessageFor("startAt"); }} @@ -219,7 +221,7 @@ const BottomSheetCreateShifts = (props) => { id="endAtTimeShift-id" name="endAtTimeShift" type={"text"} - value={endAtTimeShift} + value={endAtTimeShift[0] + ":" + endAtTimeShift[1]} inputEvent={(e) => { validator.current.showMessageFor("startAt"); }} diff --git a/plugins/Chapar/index.js b/plugins/Chapar/index.js index cc97fa0..8243fe0 100644 --- a/plugins/Chapar/index.js +++ b/plugins/Chapar/index.js @@ -33,7 +33,7 @@ Chapar.interceptors.response.use( if (error.response.status === 401) { localStorage.removeItem("token"); - window.location.href = "/"; + window.location.href = "/login"; } return Promise.reject({ error, status: error?.response?.status }); diff --git a/plugins/GoBack/page.jsx b/plugins/GoBack/page.jsx new file mode 100644 index 0000000..d3281be --- /dev/null +++ b/plugins/GoBack/page.jsx @@ -0,0 +1,8 @@ +import { useRouter } from "next/navigation"; + +const GoBack = () => { + // console.log(history); + return history.back(); +}; + +export default GoBack; diff --git a/plugins/Input/page.jsx b/plugins/Input/page.jsx index 8165edc..7ebd5dd 100644 --- a/plugins/Input/page.jsx +++ b/plugins/Input/page.jsx @@ -37,6 +37,7 @@ const Input = ({ readOnly={readOnly ? true : false} value={value} onChange={inputEvent} + id={id} /> ) : select ? (