diff --git a/.env b/.env
index bf70d31..e4e1a63 100644
--- a/.env
+++ b/.env
@@ -1,8 +1,8 @@
NODE_ENV="development"
-NEXT_PUBLIC_SERVER_URL=http://192.168.189.123:32769
-NEXT_PUBLIC_PUBLIC_URL=http://192.168.189.123:32769
-NEXT_PUBLIC_API_URL=http://192.168.189.123:32769/api
+NEXT_PUBLIC_SERVER_URL=http://192.168.88.251:32769
+NEXT_PUBLIC_PUBLIC_URL=http://192.168.88.251:32769
+NEXT_PUBLIC_API_URL=http://192.168.88.251:32769/api
# SECURE_LOCAL_STORAGE_HASH_KEY=f1da2b2c7a4c446934267fea631102ec389b5b99
# NEXT_PUBLIC_API_URL_IMAGE=https://192.168.88.12:49154/Files/ReportImages
diff --git a/components/AppHeader/page.jsx b/components/AppHeader/page.jsx
index d21c456..0c73e60 100644
--- a/components/AppHeader/page.jsx
+++ b/components/AppHeader/page.jsx
@@ -3,9 +3,10 @@
import Avatar from "boring-avatars";
import Link from "next/link";
import { useRouter } from "next/navigation";
-import React from "react";
+import React, { useContext } from "react";
import { useLongPress } from "@uidotdev/usehooks";
import { toast } from "react-toastify";
+import AppContext from "@ctx/AppContext";
const AppHeader = ({
title,
@@ -27,8 +28,10 @@ const AppHeader = ({
logOut,
}) => {
const router = useRouter();
+ const CTX = useContext(AppContext);
const handlelogOut = () => {
+ CTX.setStepLogin(0);
localStorage.removeItem("token");
router.push("/login");
};
diff --git a/components/EmployeesComponent/Position/page.jsx b/components/EmployeesComponent/Position/page.jsx
index 4e7e1c7..2dfa7e3 100644
--- a/components/EmployeesComponent/Position/page.jsx
+++ b/components/EmployeesComponent/Position/page.jsx
@@ -1,11 +1,13 @@
"use client";
import AppContext from "@ctx/AppContext";
+import HasPermission from "plugins/HasPermission/page";
import React, { useContext } from "react";
const PositionEmployees = () => {
const CTX = useContext(AppContext);
const positionsData = CTX.state.positionsData;
+ const permissions = CTX.state.profile?.permissions;
const goToEditPosition = (id) => {
CTX.setGoToEditPosition(true);
@@ -24,49 +26,54 @@ const PositionEmployees = () => {
{e.name}
-
diff --git a/components/EmployeesComponent/Users/page.jsx b/components/EmployeesComponent/Users/page.jsx
index b99a420..b97b3ce 100644
--- a/components/EmployeesComponent/Users/page.jsx
+++ b/components/EmployeesComponent/Users/page.jsx
@@ -4,10 +4,12 @@ import AppContext from "@ctx/AppContext";
import React, { useContext } from "react";
import Avatar from "boring-avatars";
import PersianNumber from "plugins/PersianNumber";
+import HasPermission from "plugins/HasPermission/page";
const UsersEmployees = () => {
const CTX = useContext(AppContext);
const usersData = CTX.state.usersData;
+ const permissions = CTX.state.profile?.permissions;
const goToEditUser = (id) => {
CTX.setGoToEditUser(true);
@@ -44,49 +46,53 @@ const UsersEmployees = () => {
{
}`}
>
setConditionTask(0)}
>
{activeSection == 4 &&
}
diff --git a/src/app/home/page.jsx b/src/app/home/page.jsx
index 7e58911..1231c78 100644
--- a/src/app/home/page.jsx
+++ b/src/app/home/page.jsx
@@ -50,20 +50,6 @@ const Home = (props) => {
const profile = CTX.state.profile;
- useEffect(() => {
- if (!!localStorage.token) {
- const datatoken = ParseJwt(getToken());
- CTX.setComplexId(datatoken.ComplexId);
-
- if (datatoken.SignUpStatus == 1) {
- CTX.setStepLogin(2);
- router.push(`/login?phoneNumber=${datatoken.unique_name}`);
- }
- } else {
- router.push("/login");
- }
- }, []);
-
// useEffect(() => {
// if (!HasPermission("ViewDashboard")) {
// // You can customize the redirect path as needed
diff --git a/src/app/layout.jsx b/src/app/layout.jsx
index 92c3d62..a691935 100644
--- a/src/app/layout.jsx
+++ b/src/app/layout.jsx
@@ -197,7 +197,7 @@ export default function RootLayout({ children }) {
setStepLogin(2);
} else if (data.user.signUpStatus == 2 || data.user.signUpStatus == 3) {
setProfile(data);
- toast.success(` ${data.user.firstName} جان خوش اومدی `, {
+ toast.success(`${data.user.firstName} جان خوش اومدی `, {
position: "bottom-right",
closeOnClick: true,
});
@@ -220,7 +220,7 @@ export default function RootLayout({ children }) {
body,
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -234,6 +234,7 @@ export default function RootLayout({ children }) {
position: "bottom-right",
closeOnClick: true,
});
+ // localStorage.removeItem("token");
localStorage.setItem("token", data.access_token);
router.push("/home");
@@ -255,7 +256,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -279,7 +280,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -307,7 +308,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -334,7 +335,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -356,7 +357,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -378,7 +379,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -403,7 +404,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -431,7 +432,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -458,7 +459,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -481,7 +482,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -503,7 +504,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -527,7 +528,7 @@ export default function RootLayout({ children }) {
JSON.stringify(body),
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -555,7 +556,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -590,7 +591,7 @@ export default function RootLayout({ children }) {
}`,
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -612,7 +613,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -634,7 +635,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -658,7 +659,7 @@ export default function RootLayout({ children }) {
JSON.stringify(body),
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -686,7 +687,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -714,7 +715,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -736,7 +737,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -758,7 +759,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -782,7 +783,7 @@ export default function RootLayout({ children }) {
JSON.stringify(body),
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -810,7 +811,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -838,7 +839,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -864,7 +865,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -886,7 +887,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -908,7 +909,7 @@ export default function RootLayout({ children }) {
`${process.env.NEXT_PUBLIC_API_URL}/shift/plan/${id}`,
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -931,7 +932,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -959,7 +960,7 @@ export default function RootLayout({ children }) {
JSON.stringify(body),
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -984,7 +985,7 @@ export default function RootLayout({ children }) {
`${process.env.NEXT_PUBLIC_API_URL}/shift/plan?page=${page}`,
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1010,7 +1011,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1034,7 +1035,7 @@ export default function RootLayout({ children }) {
JSON.stringify(body),
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1062,7 +1063,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1090,7 +1091,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1112,7 +1113,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1134,7 +1135,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1158,7 +1159,7 @@ export default function RootLayout({ children }) {
JSON.stringify(body),
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1189,7 +1190,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1218,7 +1219,7 @@ export default function RootLayout({ children }) {
`${process.env.NEXT_PUBLIC_API_URL}/task?page=${page}`,
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1249,7 +1250,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1271,7 +1272,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1298,7 +1299,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1329,7 +1330,7 @@ export default function RootLayout({ children }) {
`${process.env.NEXT_PUBLIC_API_URL}/activity/done/${id}`,
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1355,7 +1356,7 @@ export default function RootLayout({ children }) {
`${process.env.NEXT_PUBLIC_API_URL}/activity/undone/${id}?undoneReason=${resone}`,
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1375,7 +1376,7 @@ export default function RootLayout({ children }) {
}
};
- const CloseShift = async (body, id) => {
+ const CloseShift = async (body, id, index) => {
setLoading(true);
try {
const data = await Chapar.post(
@@ -1383,7 +1384,7 @@ export default function RootLayout({ children }) {
body,
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1393,6 +1394,8 @@ export default function RootLayout({ children }) {
});
// router->
+ CTX.GetShifts(moment().locale("fa").startOf("day").unix() * 1000);
+
setLoading(false);
// GetTasks();
} catch ({ error, status }) {
@@ -1405,6 +1408,7 @@ export default function RootLayout({ children }) {
};
const changeRole = async (id) => {
+ console.log(getToken());
setLoading(true);
try {
const data = await Chapar.post(
@@ -1412,7 +1416,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1435,7 +1439,7 @@ export default function RootLayout({ children }) {
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1458,7 +1462,7 @@ export default function RootLayout({ children }) {
`${process.env.NEXT_PUBLIC_API_URL}/report/shift/plan/${shiftPlanId}`,
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1493,7 +1497,7 @@ export default function RootLayout({ children }) {
`${process.env.NEXT_PUBLIC_API_URL}/report/task`,
{
headers: {
- Authorization: getToken(),
+ Authorization: "Bearer " + localStorage.getItem("token"),
},
}
);
@@ -1544,8 +1548,12 @@ export default function RootLayout({ children }) {
soli chizi bood bgo hossein__masoomi
`);
+ const token = localStorage.getItem("token");
+ if (!token) {
+ router.push("/login");
+ }
- if (profile.length <= 0 && localStorage.token) CheckUser();
+ if (profile.length <= 0 && token) CheckUser();
}, []);
return (
diff --git a/src/app/shifts/complete-shift/page.jsx b/src/app/shifts/complete-shift/page.jsx
index 30c8c10..4d5615a 100644
--- a/src/app/shifts/complete-shift/page.jsx
+++ b/src/app/shifts/complete-shift/page.jsx
@@ -15,7 +15,7 @@ import { toast } from "react-toastify";
const CompleteShift = () => {
const CTX = useContext(AppContext);
- const [closeShiftScore, setCloseShiftScore] = useState(70);
+ const [closeShiftScore, setCloseShiftScore] = useState(50);
const [activeShifPlan, setActiveShifPlan] = useState(-1);
const [selectDayForShift, setSelectDayForShift] = useState(-1);
const currentDate = new Date();
@@ -32,18 +32,17 @@ const CompleteShift = () => {
cursor: "pointer",
height: 30, // Adjust the height in pixels
width: 30, // Adjust the width to maintain a circular shape
- marginLeft: -15, // Adjust the margin to center the handle
marginTop: -10, // Adjust the margin to center the handle
borderRadius: "50%", // Make the handle circular
};
const railStyle = {
- backgroundColor: "red", // Overall track color
+ backgroundColor: "rgba(255, 0, 37, 0.54)", // Overall track color
height: 10,
};
const trackStyle = {
- backgroundColor: "green", // Color between handles
+ backgroundColor: "rgba(0, 165, 0, 0.7)", // Color between handles
height: 10,
};
@@ -84,7 +83,7 @@ const CompleteShift = () => {
};
const handleActivityCloseShift = (id, index) => {
CTX.setCompleteActivities([]);
- setCloseShiftScore(70);
+ setCloseShiftScore(50);
if (activeShifPlan == index) {
setActiveShifPlan(-1);
} else {
@@ -127,11 +126,8 @@ const CompleteShift = () => {
const handleCloseShift = () => {
CTX.CloseShift(body, siftsData[activeShifPlan]?.currentShiftPlanId);
-
- // ;
- // ;
- // ;
- // ;
+ setActiveShifPlan(-1);
+ handleDayCloseShift(1);
};
const handleGoToReport = (title, shiftId) => {
@@ -184,7 +180,7 @@ const CompleteShift = () => {
{
{
{
}, [shiftPlanData]);
useEffect(() => {
- const userJustSuper = usersData?.filter((obj) =>
- obj.roleNames.includes("سوپروایزر")
+ const userJustSuper = usersData?.filter(
+ (obj) =>
+ obj.roleNames.includes("سوپروایزر") || obj.roleNames.includes("مدیریت")
);
-
setSuperData(
userJustSuper?.map((item) => ({
key: item.firstName + " " + item.lastName,
diff --git a/src/app/shifts/page.jsx b/src/app/shifts/page.jsx
index ffc6711..1b2afd9 100644
--- a/src/app/shifts/page.jsx
+++ b/src/app/shifts/page.jsx
@@ -6,6 +6,7 @@ import moment from "jalali-moment";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/navigation";
+import HasPermission from "plugins/HasPermission/page";
import PersianNumber from "plugins/PersianNumber";
import React, { useContext, useEffect, useState } from "react";
@@ -13,6 +14,7 @@ import React, { useContext, useEffect, useState } from "react";
const Shifts = (props) => {
const CTX = useContext(AppContext);
const router = useRouter();
+ const permissions = CTX.state.profile?.permissions;
const [shiftplans, setShiftplans] = useState([]);
const [shiftPlansSelect, setShiftPlansSelect] = useState(0);
@@ -83,91 +85,107 @@ const Shifts = (props) => {
}}
/>
-
-
-
-
-
-
-
- {" "}
- شیفت بعدی
- هفته بعد
-
-
{" "}
-
-
-
-
-
- {shiftplans?.map((e, index) => (
- <>
-
+
+
-
setShiftPlansSelect(index)}
- >
-
+
+
شیفت هفته
-
-
- {shiftPlansSelect == index && (
-
- {e.data.map((e) => (
-
-
- {" "}
- {e.shiftTitle}
-
-
-
-
- ))}
-
- )}
+
+
+
+
+ {" "}
+ شیفت بعدی
+ هفته بعد
+
+
{" "}
+
+
+
+ >
+ )}
+
+ {shiftplans.length <= 0 ? (
+
+ ) : (
+ <>
+ {shiftplans?.map((e, index) => (
+ <>
+
+
setShiftPlansSelect(index)}
+ >
+
+
+
+
+
+ {shiftPlansSelect == index && (
+
+ {e.data.map((e) => (
+
+
+ {" "}
+ {e.shiftTitle}
+
+
+
+
+ ))}
+
+ )}
+
+ >
+ ))}
>
- ))}
+ )}
>
diff --git a/src/app/tasks/add-task/page.jsx b/src/app/tasks/add-task/page.jsx
index 47e4635..78030b4 100644
--- a/src/app/tasks/add-task/page.jsx
+++ b/src/app/tasks/add-task/page.jsx
@@ -361,26 +361,13 @@ const AddTask = () => {
setRoutineForTaskCurrent(e.target.value);
validator.current.showMessageFor("routines");
- if (routineForTaskChoose.length >= 1) {
- toast.error(
- "فعلا معلوم نیست بیشتر از یکی بتونی باید با ممد اینا حرف بزنیم",
- {
- position: "bottom-right",
- closeOnClick: true,
- }
- );
+ if (!!routineForTaskChoose.find((b) => b == e.target.value)) {
+ toast.error("روز تکراری است", {
+ position: "bottom-right",
+ closeOnClick: true,
+ });
} else {
- if (!!routineForTaskChoose.find((b) => b == e.target.value)) {
- toast.error("روز تکراری است", {
- position: "bottom-right",
- closeOnClick: true,
- });
- } else {
- CTX.setRoutineForTaskChoose((current) => [
- ...current,
- e.target.value,
- ]);
- }
+ CTX.setRoutineForTaskChoose(() => [e.target.value]);
}
}}
style="text-right"
@@ -403,13 +390,13 @@ const AddTask = () => {
className="flex bg-gray-300 p-1 rounded-full m-1 justify-start mt-3"
key={index}
>
-
deleteRoutineForTask(e)}
- >
+ >
*/}
-
+
{routinesData?.find((b) => b.id == e)?.name}
@@ -423,24 +410,22 @@ const AddTask = () => {
lable="پوزیشن فعالیت"
id="positions-id"
name="positions"
+ value={setPositionsForTaskCurrent}
type={"text"}
inputEvent={(e) => {
setPositionsForTaskCurrent(e.target.value);
validator.current.showMessageFor("positions");
if (positionsForTaskChoose.length >= 1) {
- toast.error(
- "فعلا معلوم نیست بیشتر از یکی بتونی باید با ممد اینا حرف بزنیم",
- {
- position: "bottom-right",
- closeOnClick: true,
- }
- );
+ toast.error("شما فقط یک پوزیشن را میتوانید انتخاب کنید", {
+ position: "bottom-right",
+ closeOnClick: true,
+ });
} else {
if (
!!positionsForTaskChoose.find((b) => b == e.target.value)
) {
- toast.error("روز تکراری است", {
+ toast.error("پوزیشن تکراری است", {
position: "bottom-right",
closeOnClick: true,
});
@@ -472,12 +457,12 @@ const AddTask = () => {
key={index}
>
deletePositionForTask(e)}
>
-
+
{positionsData?.find((b) => b.id == e)?.name}
@@ -496,26 +481,13 @@ const AddTask = () => {
setShiftsForTaskCurrent(e.target.value);
validator.current.showMessageFor("shifts");
- if (shiftsForTaskChoose.length >= 1) {
- toast.error(
- "فعلا معلوم نیست بیشتر از یکی بتونی باید با ممد اینا حرف بزنیم",
- {
- position: "bottom-right",
- closeOnClick: true,
- }
- );
+ if (!!shiftsForTaskChoose.find((b) => b == e.target.value)) {
+ toast.error("روز تکراری است", {
+ position: "bottom-right",
+ closeOnClick: true,
+ });
} else {
- if (!!shiftsForTaskChoose.find((b) => b == e.target.value)) {
- toast.error("روز تکراری است", {
- position: "bottom-right",
- closeOnClick: true,
- });
- } else {
- CTX.setShiftsForTaskChoose((current) => [
- ...current,
- e.target.value,
- ]);
- }
+ CTX.setShiftsForTaskChoose(() => [e.target.value]);
}
}}
style="text-right"
@@ -537,13 +509,13 @@ const AddTask = () => {
className="flex bg-gray-300 p-1 rounded-full m-1 justify-start mt-3"
key={index}
>
-
deleteShiftForTask(e)}
- >
+ >
*/}
-
+
{shiftsData?.find((b) => b?.id == e)?.title}
@@ -617,11 +589,11 @@ const AddTask = () => {
<>
{
setShiftsDaysCurrent(e.target.value);
validator.current.showMessageFor("shiftsDaysChoose");
@@ -659,12 +631,12 @@ const AddTask = () => {
key={index}
>
deleteShiftsDaysForTask(e)}
>
-
+
{week?.find((b) => b.value == e).key}
diff --git a/src/app/tasks/page.jsx b/src/app/tasks/page.jsx
index 9d38c3c..6b2013d 100644
--- a/src/app/tasks/page.jsx
+++ b/src/app/tasks/page.jsx
@@ -85,23 +85,28 @@ const page = () => {
GoBack();
}}
/>
-
-
handleGoToReport()}
- >
-
-
خروجی گرفتن از فعالیت ها
-
-
+ {HasPermission("ManageReports", permissions) && (
+ <>
+
+
handleGoToReport()}
+ >
+
+
خروجی گرفتن از فعالیت ها
+
+
+
-
-
+ >
+ )}
{!!HasPermission("ManageTasks", permissions) && (
-
+
{
onClick={() => setTypeTask(0)}
>
@@ -123,7 +128,7 @@ const page = () => {
onClick={() => setTypeTask(1)}
>
@@ -178,7 +183,7 @@ const page = () => {
) : (
-
@@ -198,7 +203,7 @@ const page = () => {
) : (
-
diff --git a/tailwind.config.js b/tailwind.config.js
index 3c7387d..7fb0a13 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -19,6 +19,7 @@ module.exports = {
},
secondary: {
+ 50: "#fd562317",
100: "#FD5523",
200: "#DA4215",
},