init
parent
bc6db23a50
commit
f588d7e75c
4
.env
4
.env
|
@ -3,8 +3,7 @@ NODE_ENV="development"
|
|||
# NEXT_PUBLIC_SERVER_URL=http://192.168.1.12:32767
|
||||
# NEXT_PUBLIC_PUBLIC_URL=http://192.168.1.12:32767
|
||||
# NEXT_PUBLIC_API_URL=http://192.168.1.12:32767/api
|
||||
# NEXT_PUBLIC_VERSION=0.3.3
|
||||
|
||||
# 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
|
||||
|
@ -18,5 +17,6 @@ NODE_ENV="development"
|
|||
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_API_URL_IMAGE=https://api.macsonline.ir/Files/ReportImages
|
||||
# NEXT_PUBLIC_API_URL_BackUp=https://api.macsonline.ir/Files/BackUps
|
|
@ -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=0.3.3
|
||||
NEXT_PUBLIC_VERSION=1.0.1.2
|
|
@ -14,3 +14,5 @@ CMD ["/app/node_modules/.bin/next", "start"]
|
|||
|
||||
|
||||
|
||||
# docker build -f Dockerfile.x -t registry.vnfco.ir/netinashop/vesmeh:0.32.31 .
|
||||
# docker push registry.vnfco.ir/brizco/web:1.0.0.1 .
|
|
@ -0,0 +1 @@
|
|||
self.fallback=async e=>{let{destination:a,url:n}=e,o={document:"/offline",image:!1,audio:!1,video:!1,font:!1}[a];return o?caches.match(o,{ignoreSearch:!0}):Response.error()};
|
|
@ -1,102 +0,0 @@
|
|||
/*
|
||||
* ATTENTION: An "eval-source-map" devtool has been used.
|
||||
* This devtool is neither made for production nor for readable output files.
|
||||
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
|
||||
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
||||
* or disable the default devtool with "devtool: false".
|
||||
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
||||
*/
|
||||
/******/ (function() { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ "./node_modules/@ducanh2912/next-pwa/dist/fallback.js":
|
||||
/*!************************************************************!*\
|
||||
!*** ./node_modules/@ducanh2912/next-pwa/dist/fallback.js ***!
|
||||
\************************************************************/
|
||||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\nself.fallback = async (_)=>{\n let { destination: e, url: A } = _, s = {\n document: \"/offline\",\n image: false,\n audio: false,\n video: false,\n font: false\n }[e];\n return s ? caches.match(s, {\n ignoreSearch: !0\n }) : \"\" === e && false && 0 ? 0 : Response.error();\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQGR1Y2FuaDI5MTIvbmV4dC1wd2EvZGlzdC9mYWxsYmFjay5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7QUFDQSxVQUFVLHlCQUF5QjtBQUNuQyxrQkFBa0IsVUFBcUM7QUFDdkQsZUFBZSxLQUFrQztBQUNqRCxlQUFlLEtBQWtDO0FBQ2pELGVBQWUsS0FBa0M7QUFDakQsY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ibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/@ducanh2912/next-pwa/dist/fallback.js\n"));
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ !function() {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/trusted types policy */
|
||||
/******/ !function() {
|
||||
/******/ var policy;
|
||||
/******/ __webpack_require__.tt = function() {
|
||||
/******/ // Create Trusted Type policy if Trusted Types are available and the policy doesn't exist yet.
|
||||
/******/ if (policy === undefined) {
|
||||
/******/ policy = {
|
||||
/******/ createScript: function(script) { return script; }
|
||||
/******/ };
|
||||
/******/ if (typeof trustedTypes !== "undefined" && trustedTypes.createPolicy) {
|
||||
/******/ policy = trustedTypes.createPolicy("nextjs#bundler", policy);
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ return policy;
|
||||
/******/ };
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/trusted types script */
|
||||
/******/ !function() {
|
||||
/******/ __webpack_require__.ts = function(script) { return __webpack_require__.tt().createScript(script); };
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/react refresh */
|
||||
/******/ !function() {
|
||||
/******/ if (__webpack_require__.i) {
|
||||
/******/ __webpack_require__.i.push(function(options) {
|
||||
/******/ var originalFactory = options.factory;
|
||||
/******/ options.factory = function(moduleObject, moduleExports, webpackRequire) {
|
||||
/******/ var hasRefresh = typeof self !== "undefined" && !!self.$RefreshInterceptModuleExecution$;
|
||||
/******/ var cleanup = hasRefresh ? self.$RefreshInterceptModuleExecution$(moduleObject.id) : function() {};
|
||||
/******/ try {
|
||||
/******/ originalFactory.call(this, moduleObject, moduleExports, webpackRequire);
|
||||
/******/ } finally {
|
||||
/******/ cleanup();
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ })
|
||||
/******/ }
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/compat */
|
||||
/******/
|
||||
/******/
|
||||
/******/ // noop fns to prevent runtime errors during initialization
|
||||
/******/ if (typeof self !== "undefined") {
|
||||
/******/ self.$RefreshReg$ = function () {};
|
||||
/******/ self.$RefreshSig$ = function () {
|
||||
/******/ return function (type) {
|
||||
/******/ return type;
|
||||
/******/ };
|
||||
/******/ };
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/
|
||||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module can't be inlined because the eval-source-map devtool is used.
|
||||
/******/ var __webpack_exports__ = {};
|
||||
/******/ __webpack_modules__["./node_modules/@ducanh2912/next-pwa/dist/fallback.js"](0, __webpack_exports__, __webpack_require__);
|
||||
/******/
|
||||
/******/ })()
|
||||
;
|
116
public/sw.js
116
public/sw.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
self.onmessage=async e=>{switch(e.data.type){case"__START_URL_CACHE__":{let t=e.data.url,a=await fetch(t);if(!a.redirected)return(await caches.open("start-url")).put(t,a);return Promise.resolve()}case"__FRONTEND_NAV_CACHE__":{let t=e.data.url,a=await caches.open("pages");if(await a.match(t,{ignoreSearch:!0}))return;let s=await fetch(t);if(!s.ok)return;if(a.put(t,s.clone()),e.data.shouldCacheAggressively&&s.headers.get("Content-Type")?.includes("text/html"))try{let e=await s.text(),t=[],a=await caches.open("static-style-assets"),r=await caches.open("next-static-js-assets"),c=await caches.open("static-js-assets");for(let[s,r]of e.matchAll(/<link.*?href=['"](.*?)['"].*?>/g))/rel=['"]stylesheet['"]/.test(s)&&t.push(a.match(r).then(e=>e?Promise.resolve():a.add(r)));for(let[,a]of e.matchAll(/<script.*?src=['"](.*?)['"].*?>/g)){let e=/\/_next\/static.+\.js$/i.test(a)?r:c;t.push(e.match(a).then(t=>t?Promise.resolve():e.add(a)))}return await Promise.all(t)}catch{}return Promise.resolve()}default:return Promise.resolve()}};
|
|
@ -1,102 +0,0 @@
|
|||
/*
|
||||
* ATTENTION: An "eval-source-map" devtool has been used.
|
||||
* This devtool is neither made for production nor for readable output files.
|
||||
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
|
||||
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
||||
* or disable the default devtool with "devtool: false".
|
||||
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
||||
*/
|
||||
/******/ (function() { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ "./node_modules/@ducanh2912/next-pwa/dist/sw-entry-worker.js":
|
||||
/*!*******************************************************************!*\
|
||||
!*** ./node_modules/@ducanh2912/next-pwa/dist/sw-entry-worker.js ***!
|
||||
\*******************************************************************/
|
||||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\nself.onmessage = async (e)=>{\n switch(e.data.type){\n case \"__START_URL_CACHE__\":\n {\n let t = e.data.url, a = await fetch(t);\n if (!a.redirected) return (await caches.open(\"start-url\")).put(t, a);\n return Promise.resolve();\n }\n case \"__FRONTEND_NAV_CACHE__\":\n {\n let t = e.data.url, a = await caches.open(\"pages\");\n if (await a.match(t, {\n ignoreSearch: !0\n })) return;\n let s = await fetch(t);\n if (!s.ok) return;\n if (a.put(t, s.clone()), e.data.shouldCacheAggressively && s.headers.get(\"Content-Type\")?.includes(\"text/html\")) try {\n let e = await s.text(), t = [], a = await caches.open(\"static-style-assets\"), r = await caches.open(\"next-static-js-assets\"), c = await caches.open(\"static-js-assets\");\n for (let [s, r] of e.matchAll(/<link.*?href=['\"](.*?)['\"].*?>/g))/rel=['\"]stylesheet['\"]/.test(s) && t.push(a.match(r).then((e)=>e ? Promise.resolve() : a.add(r)));\n for (let [, a] of e.matchAll(/<script.*?src=['\"](.*?)['\"].*?>/g)){\n let e = /\\/_next\\/static.+\\.js$/i.test(a) ? r : c;\n t.push(e.match(a).then((t)=>t ? Promise.resolve() : e.add(a)));\n }\n return await Promise.all(t);\n } catch {}\n return Promise.resolve();\n }\n default:\n return Promise.resolve();\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQGR1Y2FuaDI5MTIvbmV4dC1wd2EvZGlzdC9zdy1lbnRyeS13b3JrZXIuanMiLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsaUJBQWlCO0FBQ2pCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esa0JBQWtCO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQGR1Y2FuaDI5MTIvbmV4dC1wd2EvZGlzdC9zdy1lbnRyeS13b3JrZXIuanM/NmM4NCJdLCJzb3VyY2VzQ29udGVudCI6WyJzZWxmLm9ubWVzc2FnZSA9IGFzeW5jIChlKT0+e1xuICAgIHN3aXRjaChlLmRhdGEudHlwZSl7XG4gICAgICAgIGNh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ldHNcIiksIGMgPSBhd2FpdCBjYWNoZXMub3BlbihcInN0YXRpYy1qcy1hc3NldHNcIik7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IFtzLCByXSBvZiBlLm1hdGNoQWxsKC88bGluay4qP2hyZWY9WydcIl0oLio/KVsnXCJdLio/Pi9nKSkvcmVsPVsnXCJdc3R5bGVzaGVldFsnXCJdLy50ZXN0KHMpICYmIHQucHVzaChhLm1hdGNoKHIpLnRoZW4oKGUpPT5lID8gUHJvbWlzZS5yZXNvbHZlKCkgOiBhLmFkZChyKSkpO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBbLCBhXSBvZiBlLm1hdGNoQWxsKC88c2NyaXB0Lio/c3JjPVsnXCJdKC4qPylbJ1wiXS4qPz4vZykpe1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGUgPSAvXFwvX25leHRcXC9zdGF0aWMuK1xcLmpzJC9pLnRlc3QoYSkgPyByIDogYztcbiAgICAgICAgICAgICAgICAgICAgICAgIHQucHVzaChlLm1hdGNoKGEpLnRoZW4oKHQpPT50ID8gUHJvbWlzZS5yZXNvbHZlKCkgOiBlLmFkZChhKSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhd2FpdCBQcm9taXNlLmFsbCh0KTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoICB7fVxuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoKTtcbiAgICB9XG59OyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@ducanh2912/next-pwa/dist/sw-entry-worker.js\n"));
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ !function() {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/trusted types policy */
|
||||
/******/ !function() {
|
||||
/******/ var policy;
|
||||
/******/ __webpack_require__.tt = function() {
|
||||
/******/ // Create Trusted Type policy if Trusted Types are available and the policy doesn't exist yet.
|
||||
/******/ if (policy === undefined) {
|
||||
/******/ policy = {
|
||||
/******/ createScript: function(script) { return script; }
|
||||
/******/ };
|
||||
/******/ if (typeof trustedTypes !== "undefined" && trustedTypes.createPolicy) {
|
||||
/******/ policy = trustedTypes.createPolicy("nextjs#bundler", policy);
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ return policy;
|
||||
/******/ };
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/trusted types script */
|
||||
/******/ !function() {
|
||||
/******/ __webpack_require__.ts = function(script) { return __webpack_require__.tt().createScript(script); };
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/react refresh */
|
||||
/******/ !function() {
|
||||
/******/ if (__webpack_require__.i) {
|
||||
/******/ __webpack_require__.i.push(function(options) {
|
||||
/******/ var originalFactory = options.factory;
|
||||
/******/ options.factory = function(moduleObject, moduleExports, webpackRequire) {
|
||||
/******/ var hasRefresh = typeof self !== "undefined" && !!self.$RefreshInterceptModuleExecution$;
|
||||
/******/ var cleanup = hasRefresh ? self.$RefreshInterceptModuleExecution$(moduleObject.id) : function() {};
|
||||
/******/ try {
|
||||
/******/ originalFactory.call(this, moduleObject, moduleExports, webpackRequire);
|
||||
/******/ } finally {
|
||||
/******/ cleanup();
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ })
|
||||
/******/ }
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/compat */
|
||||
/******/
|
||||
/******/
|
||||
/******/ // noop fns to prevent runtime errors during initialization
|
||||
/******/ if (typeof self !== "undefined") {
|
||||
/******/ self.$RefreshReg$ = function () {};
|
||||
/******/ self.$RefreshSig$ = function () {
|
||||
/******/ return function (type) {
|
||||
/******/ return type;
|
||||
/******/ };
|
||||
/******/ };
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/
|
||||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module can't be inlined because the eval-source-map devtool is used.
|
||||
/******/ var __webpack_exports__ = {};
|
||||
/******/ __webpack_modules__["./node_modules/@ducanh2912/next-pwa/dist/sw-entry-worker.js"](0, __webpack_exports__, __webpack_require__);
|
||||
/******/
|
||||
/******/ })()
|
||||
;
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -21,6 +21,7 @@ import axios from "axios";
|
|||
import "rc-slider/assets/index.css";
|
||||
import BottomSheetReport from "plugins/BottomSheet/BottomSheetReport";
|
||||
import BottomSheetReportManageShift from "plugins/BottomSheet/BottomSheetReportManageShift";
|
||||
import moment from "jalali-moment";
|
||||
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
||||
|
@ -1340,7 +1341,7 @@ export default function RootLayout({ children }) {
|
|||
},
|
||||
}
|
||||
);
|
||||
toast.success(`فعالیت ثبت شد`, {
|
||||
toast.success(`شیفت بسته شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
|
@ -1371,6 +1372,7 @@ export default function RootLayout({ children }) {
|
|||
},
|
||||
}
|
||||
);
|
||||
localStorage.setItem("token", data.access_token);
|
||||
setProfile(data);
|
||||
setLoading(false);
|
||||
} catch ({ error, status }) {
|
||||
|
|
|
@ -47,6 +47,8 @@ const Calendar = () => {
|
|||
const [currentShiftPlanId, setCurrentShiftPlanId] = useState(null);
|
||||
|
||||
const transformData = (responseArray) => {
|
||||
// console.log("responseArray", responseArray);
|
||||
|
||||
const daysArray = [];
|
||||
return responseArray.map((item) => {
|
||||
const date = moment(item.dateTime).locale("fa");
|
||||
|
@ -64,11 +66,11 @@ const Calendar = () => {
|
|||
});
|
||||
};
|
||||
|
||||
// Existing GetListDaysWithShiftByRoutine function
|
||||
const GetListDaysWithShiftByRoutine = async (id) => {
|
||||
try {
|
||||
const data = await Chapar.get(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/page/app/shifting?routineId=${id}`,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
|
@ -78,12 +80,32 @@ const Calendar = () => {
|
|||
|
||||
setDaysManageShiftData(data);
|
||||
transformData(data);
|
||||
} catch ({ error, status }) {
|
||||
|
||||
if (data && data.length > 0) {
|
||||
// Find the first shift that is not completed
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const shifts = data[i].shifts;
|
||||
for (let j = 0; j < shifts.length; j++) {
|
||||
if (!shifts[j].hasCurrentShiftPlan) {
|
||||
setSelectDay(i);
|
||||
setShiftPlanSteps(2);
|
||||
setShiftsCurrentDaysData(data[i]?.shifts);
|
||||
handleSelectShift(j);
|
||||
setShiftPlanSteps(3);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return data; // Ensure this returns the data for further processing
|
||||
} catch (error) {
|
||||
toast.error(`${error?.response?.data?.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
CTX.setLoading(false);
|
||||
return []; // Return an empty array in case of an error
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -130,6 +152,7 @@ const Calendar = () => {
|
|||
};
|
||||
|
||||
const handleSelectShift = (index) => {
|
||||
// console.log("usersData.length", usersData.length);
|
||||
setselectShift(index);
|
||||
setShiftPlanSteps(3);
|
||||
if (usersData.length <= 0) {
|
||||
|
@ -177,7 +200,7 @@ const Calendar = () => {
|
|||
CTX.setLoading(false);
|
||||
}
|
||||
};
|
||||
const CreateShifPlan = async (body) => {
|
||||
const CreateShiftPlan = async (body) => {
|
||||
CTX.setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.post(
|
||||
|
@ -193,13 +216,12 @@ const Calendar = () => {
|
|||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
|
||||
setSelectDay(null);
|
||||
setSuperId(null);
|
||||
setUserAndPositionIds([]);
|
||||
setShiftPlanSteps(1);
|
||||
GetListDaysWithShiftByRoutine(idRoutineShiftPlan);
|
||||
CTX.setLoading(false);
|
||||
GetListDaysWithShiftByRoutine(idRoutineShiftPlan);
|
||||
|
||||
// router.push("/shifts");
|
||||
} catch ({ error, status }) {
|
||||
|
@ -211,11 +233,28 @@ const Calendar = () => {
|
|||
}
|
||||
};
|
||||
|
||||
// const updateDaysAndShifts = async () => {
|
||||
// const currentShiftId = shiftsCurrentDaysData[selectShift]?.id;
|
||||
// const filteredShifts = shiftsCurrentDaysData.filter(
|
||||
// (shift) => shift.id !== currentShiftId
|
||||
// );
|
||||
// const allCompleted = filteredShifts.every((shift) => shift.isCompleted);
|
||||
|
||||
// if (allCompleted && selectDay <= daysManageShiftData?.length - 1) {
|
||||
// setSelectDay(selectDay + 1);
|
||||
// setSuperId(null);
|
||||
// setUserAndPositionIds([]);
|
||||
// setShiftPlanSteps(2);
|
||||
// setselectShift(-1);
|
||||
// CTX.setLoading(false);
|
||||
// }
|
||||
// };
|
||||
|
||||
const handleCreateShiftPlan = (update) => {
|
||||
if (update == "UPDATE") {
|
||||
UpdateShiftPlan(bodyUpdate);
|
||||
} else {
|
||||
CreateShifPlan(body);
|
||||
CreateShiftPlan(body);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -269,6 +308,10 @@ const Calendar = () => {
|
|||
);
|
||||
}, [usersData]);
|
||||
|
||||
// console.log(
|
||||
// "hiftsCurrentDaysData[selectShift]",
|
||||
// shiftsCurrentDaysData[selectShift]
|
||||
// );
|
||||
return (
|
||||
<div className="pb-20">
|
||||
<AppHeader
|
||||
|
|
|
@ -12,10 +12,12 @@ import SimpleReactValidator from "simple-react-validator";
|
|||
import moment from "jalali-moment";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import GoBack from "plugins/GoBack/page";
|
||||
import Chapar from "plugins/Chapar";
|
||||
|
||||
const AddTask = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
const query = useSearchParams();
|
||||
const router = useRouter();
|
||||
|
||||
const [routinesSelectData, setRoutinesSelectData] = useState([]);
|
||||
const [routineForTaskCurrent, setRoutineForTaskCurrent] = useState([]);
|
||||
|
@ -127,23 +129,85 @@ const AddTask = () => {
|
|||
|
||||
const clear = () => {
|
||||
setPositionsForTaskCurrent([]);
|
||||
setPositionsSelectData([]);
|
||||
// setPositionsSelectData([]);
|
||||
setRoutineForTaskCurrent([]);
|
||||
setRoutinesSelectData([]);
|
||||
// setRoutinesSelectData([]);
|
||||
setBirthDateTimeStamp(0);
|
||||
setScheduleType([]);
|
||||
setDescription("");
|
||||
setTitle("");
|
||||
setShiftsForTaskCurrent([]);
|
||||
setShiftsSelectData([]);
|
||||
// setShiftsSelectData([]);
|
||||
setShiftsDaysCurrent([]);
|
||||
setShiftsDaysSelectData([]);
|
||||
// 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.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);
|
||||
|
||||
window.scrollTo(0, 0);
|
||||
CTX.setStopGetTasks(false);
|
||||
CTX.setPageGetTasks(0);
|
||||
router.push("/tasks");
|
||||
} 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");
|
||||
|
@ -160,9 +224,9 @@ const AddTask = () => {
|
|||
|
||||
if (validator.current.allValid()) {
|
||||
if (update == "UPDATE") {
|
||||
CTX.UpdateTask(bodyUpdate);
|
||||
UpdateTask(bodyUpdate);
|
||||
} else {
|
||||
CTX.CreateTask(body);
|
||||
CreateTask(body);
|
||||
}
|
||||
} else {
|
||||
toast.error("پرکردن همه ی فیلد ها واجب است", {
|
||||
|
@ -357,6 +421,7 @@ const AddTask = () => {
|
|||
id="routines-id"
|
||||
name="routines"
|
||||
type={"text"}
|
||||
value={setRoutineForTaskCurrent}
|
||||
inputEvent={(e) => {
|
||||
setRoutineForTaskCurrent(e.target.value);
|
||||
validator.current.showMessageFor("routines");
|
||||
|
@ -477,6 +542,7 @@ const AddTask = () => {
|
|||
id="shifts-id"
|
||||
name="shifts"
|
||||
type={"text"}
|
||||
value={setShiftsForTaskCurrent}
|
||||
inputEvent={(e) => {
|
||||
setShiftsForTaskCurrent(e.target.value);
|
||||
validator.current.showMessageFor("shifts");
|
||||
|
|
Loading…
Reference in New Issue