-
toggleCollapse(type)}
- >
-
{label}
-
- {((type === "dateRange" &&
- (selectedFilters.startDate || selectedFilters.endDate)) ||
- (type !== "dateRange" && selectedFilters[type]?.length > 0)) && (
-
- )}
-
- {collapsedFilters[type] ? "+" : "-"}
-
-
-
- {!collapsedFilters[type] && (
-
- {type === "dateRange" ? (
-
- ) : (
- items.map(([id, name]) => (
-
- ))
- )}
-
- )}
-
- );
-
- return (
-
-
-
-
-
- {isLoading ? (
-
- ) : images.length ? (
- images.map((batch) => {
- const doc = batch.documents[0];
- const userName = `${doc.uploadedBy?.firstName || ""} ${
- doc.uploadedBy?.lastName || ""
- }`.trim();
- const date = formatUTCToLocalTime(doc.uploadedAt);
- const hasArrows = batch.documents.length > SCROLL_THRESHOLD;
- return (
-
-
- {/* Uploader Info */}
-
-
-
- {userName}
- {date}
-
-
-
- {/* Location Info */}
-
-
- {" "}
-
- {batch.buildingName}
-
-
-
- {batch.floorName}
-
-
-
- {batch.workAreaName || "Unknown"}
-
- {batch.activityName}
-
-
- {batch.workCategoryName && (
-
- {batch.workCategoryName}
-
- )}
-
-
-
-
- {hasArrows && (
-
- )}
-
(imageGroupRefs.current[batch.batchId] = el)}
- >
- {batch.documents.map((d, i) => {
- const hoverDate = moment(d.uploadedAt).format(
- "DD MMMM, YYYY"
- );
- const hoverTime = moment(d.uploadedAt).format(
- "hh:mm A"
- );
- return (
-
- openModal(
-
- )
- }
- onMouseEnter={() => setHoveredImage(d)}
- onMouseLeave={() => setHoveredImage(null)}
- >
-
-

-
- {hoveredImage === d && (
-
-
- Date: {hoverDate}
-
-
- Time: {hoverTime}
-
-
- Activity:{" "}
- {batch.activityName}
-
-
- )}
-
- );
- })}
-
- {hasArrows && (
-
- )}
-
-
- );
- })
- ) : (
-
- No images match the selected filters.
-
- )}
-
- {isFetchingNextPage && hasNextPage &&
Loading...
}
- {!hasNextPage && !isLoading && images.length > 0 && (
-
- You've reached the end of the images.
-
- )}
-
-
-
-
-
-
-
Filters
-
-
-
-
-
-
- {renderCategory("Date Range", [], "dateRange")}
- {renderCategory("Building", buildings, "building")}
- {renderCategory("Floor", floors, "floor")}
- {renderCategory("Work Area", workAreas, "workArea")}
- {renderCategory("Activity", activities, "activity")}
- {renderCategory("Uploaded By (User)", uploadedByUsers, "uploadedBy")}
- {renderCategory("Work Category", workCategories, "workCategory")}
-
-
-
- );
-};
-
-export default ImageGallery;
diff --git a/src/pages/Gallary/ImagePop.jsx b/src/pages/Gallary/ImagePop.jsx
deleted file mode 100644
index 52bee8cd..00000000
--- a/src/pages/Gallary/ImagePop.jsx
+++ /dev/null
@@ -1,111 +0,0 @@
-import React, { useState, useEffect } from "react";
-import "./ImagePop.css";
-import { useModal } from "./ModalContext";
-import moment from "moment";
-import { formatUTCToLocalTime } from "../../utils/dateUtils";
-
-const ImagePop = ({ batch, initialIndex = 0 }) => {
- const { closeModal } = useModal();
- const [currentIndex, setCurrentIndex] = useState(initialIndex);
-
- // Effect to update currentIndex if the initialIndex prop changes
- useEffect(() => {
- setCurrentIndex(initialIndex);
- }, [initialIndex, batch]);
-
- // If no batch or documents are provided, don't render
- if (!batch || !batch.documents || batch.documents.length === 0) return null;
-
- // Get the current image document from the batch's documents array
- const image = batch.documents[currentIndex];
-
- // Fallback if for some reason the image at the current index doesn't exist
- if (!image) return null;
-
- // Format details for display from the individual image document
- const fullName = `${image.uploadedBy?.firstName || ""} ${
- image.uploadedBy?.lastName || ""
- }`.trim();
- const date = formatUTCToLocalTime(image.uploadedAt);
-
- // Location and category details from the 'batch' object (as previously corrected)
- const buildingName = batch.buildingName;
- const floorName = batch.floorName;
- const workAreaName = batch.workAreaName;
- const activityName = batch.activityName;
- const batchComment = batch.comment;
-
- // Handler for navigating to the previous image
- const handlePrev = () => {
- setCurrentIndex((prevIndex) => Math.max(0, prevIndex - 1));
- };
-
- // Handler for navigating to the next image
- const handleNext = () => {
- setCurrentIndex((prevIndex) =>
- Math.min(batch.documents.length - 1, prevIndex + 1)
- );
- };
-
- // Determine if previous/next buttons should be enabled/visible
- const hasPrev = currentIndex > 0;
- const hasNext = currentIndex < batch.documents.length - 1;
-
- return (
-
-
-
-
+ const bodyContxt = (
+
+
+
+
Change Password
-
+
Enter old and new password to update.
@@ -175,7 +168,7 @@ const ChangePasswordPage = ({ onClose }) => {
)}
-
+
Your password must have at least 8 characters and include a lower
case letter, an uppercase letter, a number, and a special
character.
@@ -200,9 +193,11 @@ const ChangePasswordPage = ({ onClose }) => {
-
-
+
+
);
+
+ return
;
};
-export default ChangePasswordPage;
\ No newline at end of file
+export default ChangePasswordPage;
diff --git a/src/router/AppRoutes.jsx b/src/router/AppRoutes.jsx
index 48dd5dd2..c0787e95 100644
--- a/src/router/AppRoutes.jsx
+++ b/src/router/AppRoutes.jsx
@@ -22,7 +22,6 @@ import Inventory from "../pages/project/Inventory";
import AttendancePage from "../pages/Activities/AttendancePage";
import TaskPlannng from "../pages/Activities/TaskPlannng";
import Reports from "../pages/reports/Reports";
-import ImageGallary from "../pages/Gallary/ImageGallary";
import MasterPage from "../pages/master/MasterPage";
import Support from "../pages/support/Support";
import Documentation from "../pages/support/Documentation";
diff --git a/src/slices/localVariablesSlice.jsx b/src/slices/localVariablesSlice.jsx
index b7885cf7..b520b7e5 100644
--- a/src/slices/localVariablesSlice.jsx
+++ b/src/slices/localVariablesSlice.jsx
@@ -4,11 +4,18 @@ const localVariablesSlice = createSlice({
name: "localVariables",
initialState: {
selectedMaster: "Application Role",
- // Attendances
+ // Attendances
attendance: {
regularizationCount: 0,
defaultDateRange: { startDate: null, endDate: null },
- SelectedOrg:null,
+ SelectedOrg: "",
+ },
+
+ // Modal for all simple pass Name
+
+ modals: {
+ auth: { isOpen: false },
+ organization: { isOpen: false },
},
projectId: null,
reload: false,
@@ -30,19 +37,17 @@ const localVariablesSlice = createSlice({
state.selectedMaster = action.payload;
},
-
- // ─── ATTENDANCE ─────────────────────────
+ // ─── ATTENDANCE ─────────────────────────
updateRegularizationCount: (state, action) => {
state.attendance.regularizationCount = action.payload;
},
setDefaultDateRange: (state, action) => {
state.attendance.defaultDateRange = action.payload;
},
- setOrganization:(state,action)=>{
+ setOrganization: (state, action) => {
state.attendance.SelectedOrg = action.payload;
},
-
setProjectId: (state, action) => {
localStorage.setItem("project", null);
state.projectId = action.payload;
@@ -78,6 +83,19 @@ const localVariablesSlice = createSlice({
closeAuthModal: (state, action) => {
state.AuthModal.isOpen = false;
},
+
+ openModal: (state, action) => {
+ const { modalType, data } = action.payload;
+ state.modals[modalType] = { isOpen: true, ...data };
+ },
+ closeModal: (state, action) => {
+ const { modalType } = action.payload;
+ state.modals[modalType] = { ...state.modals[modalType], isOpen: false };
+ },
+ toggleModal: (state, action) => {
+ const { modalType } = action.payload;
+ state.modals[modalType].isOpen = !state.modals[modalType].isOpen;
+ },
},
});
@@ -91,6 +109,7 @@ export const {
closeOrgModal,
toggleOrgModal,
openAuthModal,
- closeAuthModal,setOrganization
+ closeAuthModal,
+ setOrganization,openModal, closeModal, toggleModal
} = localVariablesSlice.actions;
export default localVariablesSlice.reducer;