From ad1db0f366951e8f86723046af4002cfe152a883 Mon Sep 17 00:00:00 2001 From: Kartik sharma Date: Mon, 7 Jul 2025 15:07:43 +0530 Subject: [PATCH 01/95] Image Popup Expands Page Width when add lengthy comment on Click in Image Gallery. --- src/pages/Gallary/ImagePop.css | 98 +++++++++++++++++++++++++--------- 1 file changed, 72 insertions(+), 26 deletions(-) diff --git a/src/pages/Gallary/ImagePop.css b/src/pages/Gallary/ImagePop.css index dfdb549c..367758f6 100644 --- a/src/pages/Gallary/ImagePop.css +++ b/src/pages/Gallary/ImagePop.css @@ -1,103 +1,149 @@ +/* Image Modal Overlay */ .image-modal-overlay { position: fixed; top: 0; left: 0; - z-index: 9999; /* High z-index to ensure it's on top */ + z-index: 9999; width: 100%; height: 100%; - background-color: rgba(0, 0, 0, 0.85); /* Dark semi-transparent background */ + background-color: rgba(0, 0, 0, 0.85); display: flex; justify-content: center; align-items: center; } +/* Main Modal Content Box */ .image-modal-content { background: #fff; padding: 24px; - max-width: 90%; /* Responsive max-width */ - max-height: 100%; /* Responsive max-height */ + max-width: 50%; + max-height: 95vh; /* Limits the modal's height to 95% of viewport height */ border-radius: 12px; position: relative; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); text-align: center; - display: flex; /* Use flexbox for internal layout */ + display: flex; flex-direction: column; align-items: center; justify-content: center; + overflow-y: auto; /* Enables vertical scrolling */ + + /* --- HIDE SCROLLBAR FOR MAIN MODAL CONTENT --- */ + /* For Webkit browsers (Chrome, Safari, Edge) */ + &::-webkit-scrollbar { + width: 0px; /* Hide vertical scrollbar */ + height: 0px; /* Hide horizontal scrollbar, though unlikely needed here */ + } + /* For Firefox */ + scrollbar-width: none; /* Hide scrollbar in Firefox */ + /* For Internet Explorer and Edge (legacy) */ + -ms-overflow-style: none; + /* --- END HIDE SCROLLBAR --- */ } +/* Image Styles */ .modal-image { max-width: 100%; - max-height: 70vh; /* Limits image height to 70% of viewport height */ + max-height: 70vh; + width: auto; border-radius: 10px; - object-fit: contain; /* Ensures the whole image is visible without cropping */ + object-fit: contain; margin-bottom: 20px; - flex-shrink: 0; /* Prevent image from shrinking if content is too large */ + flex-shrink: 0; } -.image-details { +/* Scrollable Container for Text Details */ +.image-details-scroll-container { + width: 100%; + flex-grow: 1; + max-height: calc(95vh - 70vh - (24px * 2) - 20px); /* Approximate calculation for text area height */ + overflow-y: auto; /* Enables vertical scrolling for details */ text-align: left; + padding-right: 5px; /* Add some padding so text doesn't touch the hidden scrollbar area */ + + /* --- HIDE SCROLLBAR FOR TEXT DETAILS SECTION --- */ + /* For Webkit browsers (Chrome, Safari, Edge) */ + &::-webkit-scrollbar { + width: 0px; /* Hide vertical scrollbar */ + height: 0px; /* Hide horizontal scrollbar */ + } + /* For Firefox */ + scrollbar-width: none; /* Hide scrollbar in Firefox */ + /* For Internet Explorer and Edge (legacy) */ + -ms-overflow-style: none; + /* --- END HIDE SCROLLBAR --- */ +} + +/* Image Details Section (inside the scroll container) */ +.image-details { color: #444; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; - width: 100%; /* Ensure details section takes full width */ + width: 100%; + text-align: left; } .image-details p { - margin: 4px 0; /* Reduce vertical space between lines in details */ + margin: 4px 0; + white-space: normal; + word-wrap: break-word; + overflow-wrap: break-word; + text-overflow: initial; + text-align: left; } +/* Close Button */ .close-button { position: absolute; - top: 1px; /* Position relative to the modal content */ + top: 1px; right: 8px; font-size: 30px; background: none; border: none; - color: black; /* White color for visibility on dark overlay */ + color: black; cursor: pointer; padding: 0; line-height: 1; - z-index: 10000; /* Ensure it's above everything else */ + z-index: 10000; } -/* Styles for the navigation buttons */ +/* Navigation Buttons */ .nav-button { position: absolute; - top: 50%; /* Vertically center them */ - transform: translateY(-50%); /* Adjust for perfect vertical centering */ - background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */ + top: 50%; + transform: translateY(-50%); + background-color: rgba(0, 0, 0, 0.5); color: white; border: none; padding: 10px 15px; font-size: 30px; cursor: pointer; - z-index: 1000; /* Ensure buttons are above the image */ - border-radius: 50%; /* Make them circular */ + z-index: 1000; + border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; - transition: background-color 0.3s ease; /* Smooth hover effect */ + transition: background-color 0.3s ease; } .nav-button:hover { - background-color: rgba(0, 0, 0, 0.8); /* Darker on hover */ + background-color: rgba(0, 0, 0, 0.8); } .nav-button.prev-button { - left: 0px; /* Position left arrow */ + left: 0px; } .nav-button.next-button { - right: 0px; /* Position right arrow */ + right: 0px; } -/* Style for disabled buttons (optional) */ +/* Disabled Button Style */ .nav-button:disabled { opacity: 0.5; cursor: not-allowed; -} +} \ No newline at end of file From 9b63b2000ed18603bbc4eed8b5fa71c2e60f22e1 Mon Sep 17 00:00:00 2001 From: Kartik sharma Date: Tue, 8 Jul 2025 12:35:02 +0530 Subject: [PATCH 02/95] Adding pagination 20 in Profile Attendance page and adding condtion to show more then 20 records to show paging. --- .../employee/AttendancesEmployeeRecords.jsx | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/pages/employee/AttendancesEmployeeRecords.jsx b/src/pages/employee/AttendancesEmployeeRecords.jsx index 1908ef21..bac57a09 100644 --- a/src/pages/employee/AttendancesEmployeeRecords.jsx +++ b/src/pages/employee/AttendancesEmployeeRecords.jsx @@ -85,7 +85,7 @@ const AttendancesEmployeeRecords = ({ employee }) => { const currentDate = new Date().toLocaleDateString("en-CA"); const { currentPage, totalPages, currentItems, paginate } = usePagination( sortedFinalList, - 10 + 20 ); useEffect(() => { @@ -141,13 +141,12 @@ const AttendancesEmployeeRecords = ({ employee }) => { id="DataTables_Table_0_length" >
- +
setIsRefreshing(!isRefreshing)} @@ -224,7 +223,7 @@ const AttendancesEmployeeRecords = ({ employee }) => { )}
- {!loading && data.length > 5 && ( + {!loading && sortedFinalList.length > 20 && ( )} + ); }; -export default Directory; \ No newline at end of file +export default Directory; + From e1e4ba2b541e8bb329b614186596867614cbacf0 Mon Sep 17 00:00:00 2001 From: Kartik sharma Date: Tue, 8 Jul 2025 12:45:48 +0530 Subject: [PATCH 04/95] Navigate to "Projects" Page Should Display Only Message When No Projects Are Assigned. --- src/pages/project/ProjectList.jsx | 162 +++++++++++++++--------------- 1 file changed, 79 insertions(+), 83 deletions(-) diff --git a/src/pages/project/ProjectList.jsx b/src/pages/project/ProjectList.jsx index 24e87ca1..a72276ed 100644 --- a/src/pages/project/ProjectList.jsx +++ b/src/pages/project/ProjectList.jsx @@ -315,96 +315,91 @@ const ProjectList = () => {

No projects found.

)} - {listView ? ( -
-
-
- - - - - - - - - - - - - - - {currentItems.length === 0 ? ( + {listView ? ( + currentItems.length === 0 ? ( +
+ No projects found. +
+ ) : ( +
+
+
+
- Project Name - Contact PersonSTART DATEDEADLINETaskProgress -
- -
    - {[ - { - id: "b74da4c2-d07e-46f2-9919-e75e49b12731", - label: "Active", - }, - { - id: "603e994b-a27f-4e5d-a251-f3d69b0498ba", - label: "On Hold", - }, - { - id: "ef1c356e-0fe0-42df-a5d3-8daee355492d", - label: "Inactive", - }, - { - id: "33deaef9-9af1-4f2a-b443-681ea0d04f81", - label: "Completed", - }, - ].map(({ id, label }) => ( -
  • -
    - handleStatusChange(id)} - /> - -
    -
  • - ))} -
-
-
- Action -
+ - + + + + + + + + - ) : ( - currentItems.map((project) => ( + + + {currentItems.map((project) => ( - )) - )} - -
- No projects found - + Project Name + Contact PersonSTART DATEDEADLINETaskProgress +
+ +
    + {[ + { + id: "b74da4c2-d07e-46f2-9919-e75e49b12731", + label: "Active", + }, + { + id: "603e994b-a27f-4e5d-a251-f3d69b0498ba", + label: "On Hold", + }, + { + id: "ef1c356e-0fe0-42df-a5d3-8daee355492d", + label: "Inactive", + }, + { + id: "33deaef9-9af1-4f2a-b443-681ea0d04f81", + label: "Completed", + }, + ].map(({ id, label }) => ( +
  • +
    + handleStatusChange(id)} + /> + +
    +
  • + ))} +
+
+
+ Action +
-
{" "} -
{" "} -
+ ))} + + + + + + ) ) : (
{currentItems.map((project) => ( @@ -417,6 +412,7 @@ const ProjectList = () => {
)} + {!loading && totalPages > 1 && ( + )} ); From e3d7d6005b5ba713aea891c96b62a827a7fb5a3f Mon Sep 17 00:00:00 2001 From: Kartik sharma Date: Wed, 9 Jul 2025 15:15:53 +0530 Subject: [PATCH 87/95] Nevigate to "Projects" Page Should Display Only Message When No Projects Are Assigned. --- src/pages/project/ProjectList.jsx | 278 ++++++++++++++++-------------- 1 file changed, 144 insertions(+), 134 deletions(-) diff --git a/src/pages/project/ProjectList.jsx b/src/pages/project/ProjectList.jsx index 50c60643..6213a786 100644 --- a/src/pages/project/ProjectList.jsx +++ b/src/pages/project/ProjectList.jsx @@ -264,144 +264,154 @@ const ProjectList = () => { )} {listView ? ( - currentItems.length === 0 ? ( -
- No projects found. -
- ) : ( -
-
-
- - - - - - - - - - - - - - - {currentItems.map((project) => ( - - ))} - -
- Project Name - Contact PersonSTART DATEDEADLINETaskProgress -
- -
    - {[ - { - id: "b74da4c2-d07e-46f2-9919-e75e49b12731", - label: "Active", - }, - { - id: "603e994b-a27f-4e5d-a251-f3d69b0498ba", - label: "On Hold", - }, - { - id: "ef1c356e-0fe0-42df-a5d3-8daee355492d", - label: "Inactive", - }, - { - id: "33deaef9-9af1-4f2a-b443-681ea0d04f81", - label: "Completed", - }, - ].map(({ id, label }) => ( -
  • -
    - handleStatusChange(id)} - /> - -
    -
  • - ))} -
-
-
- Action -
-
-
-
- ) - ) : ( -
- {currentItems.map((project) => ( - - ))} -
- )} - - - {!loading && totalPages > 1 && ( - +)} + ); From f8abcc8aa89a95c14de20c0350f267e2c6278a1e Mon Sep 17 00:00:00 2001 From: Kartik sharma Date: Thu, 10 Jul 2025 16:58:25 +0530 Subject: [PATCH 88/95] In ProjectNav.jsx and AttendancePage.jsx, remove inline CSS font-size styles and replace them with Bootstrap classes. --- src/components/Project/ProjectNav.jsx | 5 ----- src/pages/Activities/AttendancePage.jsx | 3 --- 2 files changed, 8 deletions(-) diff --git a/src/components/Project/ProjectNav.jsx b/src/components/Project/ProjectNav.jsx index ffaf65dd..9fa89cdb 100644 --- a/src/components/Project/ProjectNav.jsx +++ b/src/components/Project/ProjectNav.jsx @@ -20,7 +20,6 @@ const ProjectNav = ({ onPillClick, activePill }) => { e.preventDefault(); onPillClick("profile"); }} - style={{ fontSize: '1rem' }} > Profile @@ -33,7 +32,6 @@ const ProjectNav = ({ onPillClick, activePill }) => { e.preventDefault(); onPillClick("teams"); }} - style={{ fontSize: '1rem' }} > Teams @@ -46,7 +44,6 @@ const ProjectNav = ({ onPillClick, activePill }) => { e.preventDefault(); onPillClick("infra"); }} - style={{ fontSize: '1rem' }} > Infrastructure @@ -62,7 +59,6 @@ const ProjectNav = ({ onPillClick, activePill }) => { e.preventDefault(); // Prevent page reload onPillClick("imagegallary"); }} - style={{ fontSize: '1rem' }} > Image Gallary @@ -76,7 +72,6 @@ const ProjectNav = ({ onPillClick, activePill }) => { e.preventDefault(); // Prevent page reload onPillClick("directory"); }} - style={{ fontSize: '1rem' }} > Directory diff --git a/src/pages/Activities/AttendancePage.jsx b/src/pages/Activities/AttendancePage.jsx index aabc7ee2..9f309197 100644 --- a/src/pages/Activities/AttendancePage.jsx +++ b/src/pages/Activities/AttendancePage.jsx @@ -237,7 +237,6 @@ const AttendancePage = () => { onClick={() => setActiveTab("all")} data-bs-toggle="tab" data-bs-target="#navs-top-home" - style={{ fontSize: '1rem' }} > Today's @@ -249,7 +248,6 @@ const AttendancePage = () => { onClick={() => setActiveTab("logs")} data-bs-toggle="tab" data-bs-target="#navs-top-profile" - style={{ fontSize: '1rem' }} > Logs @@ -263,7 +261,6 @@ const AttendancePage = () => { onClick={() => setActiveTab("regularization")} data-bs-toggle="tab" data-bs-target="#navs-top-messages" - style={{ fontSize: '1rem' }} > Regularization From b8949b3b71aa04594f874d4c9438632a8fc59020 Mon Sep 17 00:00:00 2001 From: Kartik sharma Date: Tue, 8 Jul 2025 13:09:10 +0530 Subject: [PATCH 89/95] In filter DatePicker should not display dates in Image Gallery. --- .../Gallary/DateRangePickerNoDefault.jsx | 55 +++++++++++++++++++ src/pages/Gallary/ImageGallary.jsx | 6 +- 2 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 src/pages/Gallary/DateRangePickerNoDefault.jsx diff --git a/src/pages/Gallary/DateRangePickerNoDefault.jsx b/src/pages/Gallary/DateRangePickerNoDefault.jsx new file mode 100644 index 00000000..6c793b86 --- /dev/null +++ b/src/pages/Gallary/DateRangePickerNoDefault.jsx @@ -0,0 +1,55 @@ +import React, { useEffect, useRef } from "react"; + +const DateRangePickerNoDefault = ({ + onRangeChange, + startDate, + endDate, +}) => { + const inputRef = useRef(null); + + useEffect(() => { + const fp = flatpickr(inputRef.current, { + mode: "range", + dateFormat: "Y-m-d", + altInput: true, + altFormat: "d-m-Y", + static: true, + clickOpens: true, + onChange: (selectedDates, dateStr) => { + if (selectedDates.length === 2) { + const [startDateString, endDateString] = dateStr.split(" to "); + onRangeChange?.({ startDate: startDateString, endDate: endDateString }); + } else if (selectedDates.length === 0) { + onRangeChange?.({ startDate: "", endDate: "" }); + } + }, + onReady: (selectedDates, dateStr, instance) => { + if (startDate && endDate) { + instance.setDate([startDate, endDate], true); + } + }, + }); + + if (startDate && endDate) { + fp.setDate([startDate, endDate], false); + } else if (!startDate && !endDate) { + fp.clear(); + } + + return () => { + fp.destroy(); + }; + }, [onRangeChange, startDate, endDate]); + + return ( + + ); +}; + +export default DateRangePickerNoDefault; diff --git a/src/pages/Gallary/ImageGallary.jsx b/src/pages/Gallary/ImageGallary.jsx index 8716e398..96236cba 100644 --- a/src/pages/Gallary/ImageGallary.jsx +++ b/src/pages/Gallary/ImageGallary.jsx @@ -8,8 +8,8 @@ import Avatar from "../../components/common/Avatar"; import DateRangePicker from "../../components/common/DateRangePicker"; import eventBus from "../../services/eventBus"; import Breadcrumb from "../../components/common/Breadcrumb"; -import { formatUTCToLocalTime } from "../../utils/dateUtils"; -import useImageGallery from "../../hooks/useImageGallery"; +import {formatUTCToLocalTime} from "../../utils/dateUtils"; +import DateRangePickerNoDefault from "./DateRangePickerNoDefault"; const SCROLL_THRESHOLD = 5; @@ -319,7 +319,7 @@ const ImageGallery = () => {
{type === "dateRange" ? (
- Date: Wed, 9 Jul 2025 13:09:44 +0530 Subject: [PATCH 90/95] In the Image Gallery, the filter drawer's date picker should default to the last 7 days (today minus 7 days). --- .../Gallary/DateRangePickerNoDefault.jsx | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/pages/Gallary/DateRangePickerNoDefault.jsx b/src/pages/Gallary/DateRangePickerNoDefault.jsx index 6c793b86..dd364daf 100644 --- a/src/pages/Gallary/DateRangePickerNoDefault.jsx +++ b/src/pages/Gallary/DateRangePickerNoDefault.jsx @@ -8,6 +8,15 @@ const DateRangePickerNoDefault = ({ const inputRef = useRef(null); useEffect(() => { + const today = new Date(); + const sevenDaysAgo = new Date(); + sevenDaysAgo.setDate(today.getDate() - 7); + + const formatDate = (date) => date.toISOString().split('T')[0]; + + const defaultStartDate = formatDate(sevenDaysAgo); + const defaultEndDate = formatDate(today); + const fp = flatpickr(inputRef.current, { mode: "range", dateFormat: "Y-m-d", @@ -24,7 +33,10 @@ const DateRangePickerNoDefault = ({ } }, onReady: (selectedDates, dateStr, instance) => { - if (startDate && endDate) { + if (!startDate && !endDate) { + instance.setDate([defaultStartDate, defaultEndDate], true); + onRangeChange?.({ startDate: defaultStartDate, endDate: defaultEndDate }); + } else if (startDate && endDate) { instance.setDate([startDate, endDate], true); } }, @@ -32,8 +44,12 @@ const DateRangePickerNoDefault = ({ if (startDate && endDate) { fp.setDate([startDate, endDate], false); - } else if (!startDate && !endDate) { + } else if (!startDate && !endDate && fp.selectedDates.length > 0) { fp.clear(); + onRangeChange?.({ startDate: defaultStartDate, endDate: defaultEndDate }); + } else if (!startDate && !endDate && fp.selectedDates.length === 0) { + fp.setDate([defaultStartDate, defaultEndDate], false); + onRangeChange?.({ startDate: defaultStartDate, endDate: defaultEndDate }); } return () => { @@ -52,4 +68,4 @@ const DateRangePickerNoDefault = ({ ); }; -export default DateRangePickerNoDefault; +export default DateRangePickerNoDefault; \ No newline at end of file From 94358c7aa277861bb18318d636a4d41072dccb56 Mon Sep 17 00:00:00 2001 From: Kartik sharma Date: Fri, 11 Jul 2025 11:40:09 +0530 Subject: [PATCH 91/95] Changes in Date picker . --- .../Gallary/DateRangePickerNoDefault.jsx | 71 ------------------- src/pages/Gallary/ImageGallary.jsx | 55 ++++++++++---- 2 files changed, 40 insertions(+), 86 deletions(-) delete mode 100644 src/pages/Gallary/DateRangePickerNoDefault.jsx diff --git a/src/pages/Gallary/DateRangePickerNoDefault.jsx b/src/pages/Gallary/DateRangePickerNoDefault.jsx deleted file mode 100644 index dd364daf..00000000 --- a/src/pages/Gallary/DateRangePickerNoDefault.jsx +++ /dev/null @@ -1,71 +0,0 @@ -import React, { useEffect, useRef } from "react"; - -const DateRangePickerNoDefault = ({ - onRangeChange, - startDate, - endDate, -}) => { - const inputRef = useRef(null); - - useEffect(() => { - const today = new Date(); - const sevenDaysAgo = new Date(); - sevenDaysAgo.setDate(today.getDate() - 7); - - const formatDate = (date) => date.toISOString().split('T')[0]; - - const defaultStartDate = formatDate(sevenDaysAgo); - const defaultEndDate = formatDate(today); - - const fp = flatpickr(inputRef.current, { - mode: "range", - dateFormat: "Y-m-d", - altInput: true, - altFormat: "d-m-Y", - static: true, - clickOpens: true, - onChange: (selectedDates, dateStr) => { - if (selectedDates.length === 2) { - const [startDateString, endDateString] = dateStr.split(" to "); - onRangeChange?.({ startDate: startDateString, endDate: endDateString }); - } else if (selectedDates.length === 0) { - onRangeChange?.({ startDate: "", endDate: "" }); - } - }, - onReady: (selectedDates, dateStr, instance) => { - if (!startDate && !endDate) { - instance.setDate([defaultStartDate, defaultEndDate], true); - onRangeChange?.({ startDate: defaultStartDate, endDate: defaultEndDate }); - } else if (startDate && endDate) { - instance.setDate([startDate, endDate], true); - } - }, - }); - - if (startDate && endDate) { - fp.setDate([startDate, endDate], false); - } else if (!startDate && !endDate && fp.selectedDates.length > 0) { - fp.clear(); - onRangeChange?.({ startDate: defaultStartDate, endDate: defaultEndDate }); - } else if (!startDate && !endDate && fp.selectedDates.length === 0) { - fp.setDate([defaultStartDate, defaultEndDate], false); - onRangeChange?.({ startDate: defaultStartDate, endDate: defaultEndDate }); - } - - return () => { - fp.destroy(); - }; - }, [onRangeChange, startDate, endDate]); - - return ( - - ); -}; - -export default DateRangePickerNoDefault; \ No newline at end of file diff --git a/src/pages/Gallary/ImageGallary.jsx b/src/pages/Gallary/ImageGallary.jsx index 96236cba..aeac34bd 100644 --- a/src/pages/Gallary/ImageGallary.jsx +++ b/src/pages/Gallary/ImageGallary.jsx @@ -5,11 +5,10 @@ import { useSelector } from "react-redux"; import { useModal } from "./ModalContext"; import ImagePop from "./ImagePop"; import Avatar from "../../components/common/Avatar"; -import DateRangePicker from "../../components/common/DateRangePicker"; import eventBus from "../../services/eventBus"; import Breadcrumb from "../../components/common/Breadcrumb"; -import {formatUTCToLocalTime} from "../../utils/dateUtils"; -import DateRangePickerNoDefault from "./DateRangePickerNoDefault"; +import { formatUTCToLocalTime } from "../../utils/dateUtils"; +import DateRangePicker from "../../components/common/DateRangePicker"; const SCROLL_THRESHOLD = 5; @@ -153,8 +152,15 @@ const ImageGallery = () => { const getUniqueValuesWithIds = useCallback((idKey, nameKey) => { const map = new Map(); allImagesData.forEach(batch => { - let id = idKey === "floorIds" ? batch.floorIds : batch[idKey]; + let id; + if (idKey === "floorIds") { + id = batch.floorIds; + } else { + id = batch[idKey]; + } + const name = batch[nameKey]; + if (id && name && !map.has(id)) { map.set(id, name); } @@ -175,7 +181,6 @@ const ImageGallery = () => { }); }); return Array.from(uniqueUsersMap.entries()).sort((a, b) => a[1].localeCompare(b[1])); - return Array.from(uniqueUsersMap.entries()).sort((a, b) => a[1].localeCompare(b[1])); }, [allImagesData]); const buildings = getUniqueValuesWithIds("buildingId", "buildingName"); @@ -240,7 +245,9 @@ const ImageGallery = () => { } return false; } - if ((oldVal === null && newVal === "") || (oldVal === "" && newVal === null)) return false; + if ((oldVal === null && newVal === "") || (oldVal === "" && newVal === null)) { + return false; + } return oldVal !== newVal; }); @@ -319,10 +326,9 @@ const ImageGallery = () => {
{type === "dateRange" ? (
- @@ -346,7 +352,12 @@ const ImageGallery = () => { return (
- +
@@ -433,8 +452,12 @@ const ImageGallery = () => {
- - + +
{renderFilterCategory("Date Range", [], "dateRange")} @@ -444,6 +467,8 @@ const ImageGallery = () => { {renderFilterCategory("Activity", activities, "activity")} {renderFilterCategory("Uploaded By (User)", uploadedByUsers, "uploadedBy")} {renderFilterCategory("Work Category", workCategories, "workCategory")} + +
From 85d10e3b1782f88eb3130f221c6602dd9ebf410d Mon Sep 17 00:00:00 2001 From: Kartik sharma Date: Fri, 11 Jul 2025 13:13:44 +0530 Subject: [PATCH 92/95] Creating a custom hook for ImageGallery to call an API. --- src/pages/Gallary/ImageGallary.jsx | 49 +++++++----------------------- 1 file changed, 11 insertions(+), 38 deletions(-) diff --git a/src/pages/Gallary/ImageGallary.jsx b/src/pages/Gallary/ImageGallary.jsx index aeac34bd..eb7bd8ad 100644 --- a/src/pages/Gallary/ImageGallary.jsx +++ b/src/pages/Gallary/ImageGallary.jsx @@ -5,10 +5,11 @@ import { useSelector } from "react-redux"; import { useModal } from "./ModalContext"; import ImagePop from "./ImagePop"; import Avatar from "../../components/common/Avatar"; +import DateRangePicker from "../../components/common/DateRangePicker"; import eventBus from "../../services/eventBus"; import Breadcrumb from "../../components/common/Breadcrumb"; import { formatUTCToLocalTime } from "../../utils/dateUtils"; -import DateRangePicker from "../../components/common/DateRangePicker"; +import useImageGallery from "../../hooks/useImageGallery"; const SCROLL_THRESHOLD = 5; @@ -152,15 +153,8 @@ const ImageGallery = () => { const getUniqueValuesWithIds = useCallback((idKey, nameKey) => { const map = new Map(); allImagesData.forEach(batch => { - let id; - if (idKey === "floorIds") { - id = batch.floorIds; - } else { - id = batch[idKey]; - } - + let id = idKey === "floorIds" ? batch.floorIds : batch[idKey]; const name = batch[nameKey]; - if (id && name && !map.has(id)) { map.set(id, name); } @@ -245,9 +239,7 @@ const ImageGallery = () => { } return false; } - if ((oldVal === null && newVal === "") || (oldVal === "" && newVal === null)) { - return false; - } + if ((oldVal === null && newVal === "") || (oldVal === "" && newVal === null)) return false; return oldVal !== newVal; }); @@ -352,12 +344,7 @@ const ImageGallery = () => { return (
- +
@@ -452,12 +431,8 @@ const ImageGallery = () => {
- - + +
{renderFilterCategory("Date Range", [], "dateRange")} @@ -467,8 +442,6 @@ const ImageGallery = () => { {renderFilterCategory("Activity", activities, "activity")} {renderFilterCategory("Uploaded By (User)", uploadedByUsers, "uploadedBy")} {renderFilterCategory("Work Category", workCategories, "workCategory")} - -
From 50585e1fbdbfcfe7df05e3bc06edb494719fe9de Mon Sep 17 00:00:00 2001 From: pramod mahajan Date: Mon, 14 Jul 2025 14:10:25 +0530 Subject: [PATCH 93/95] rebase from main --- src/pages/Directory/Directory.jsx | 118 +++++++++++------------------- 1 file changed, 42 insertions(+), 76 deletions(-) diff --git a/src/pages/Directory/Directory.jsx b/src/pages/Directory/Directory.jsx index c80ec0f2..ca95181f 100644 --- a/src/pages/Directory/Directory.jsx +++ b/src/pages/Directory/Directory.jsx @@ -353,7 +353,7 @@ const Directory = ({ IsPage = true, prefernceContacts }) => { setOpenBucketModal={setOpenBucketModal} contactsToExport={contacts} notesToExport={notes} - selectedNoteNames={selectedNoteNames} + selectedNoteNames={selectedNoteNames} setSelectedNoteNames={setSelectedNoteNames} notesForFilter={notes} setFilterAppliedNotes={setFilterAppliedNotes} @@ -361,35 +361,25 @@ const Directory = ({ IsPage = true, prefernceContacts }) => {
- {/* LIST VIEW */} + {(viewType === "card" || viewType === "list" || viewType === "notes") && ( +
+ {!loading && (viewType === "card" || viewType === "list") && contacts?.length === 0 && ( +

No contact found

+ )} + {!loading && + (viewType === "card" || viewType === "list") && + contacts?.length > 0 && + currentItems.length === 0 && ( +

No matching contact found

+ )} +
+ )} + {viewType === "list" && ( -
-
+
+
- {!loading && contacts?.length === 0 ? ( - - -
-

No contact found

-
- - - ) : !loading && contacts?.length > 0 && currentItems.length === 0 ? ( - - -
-

No matching contact found

-
- - - ) : ( - !loading && + {!loading && currentItems.map((contact) => ( { IsDeleted={setDeleteContact} restore={handleDeleteContact} /> - )) - )} + ))}
)} - {/* CARD VIEW */} {viewType === "card" && ( - <> - {contacts?.length === 0 && !loading ? ( -
-

No contact found

-
- ) : currentItems.length === 0 && !loading ? ( -
-

No matching contact found

-
- ) : ( -
- {currentItems.map((contact) => ( -
- -
- ))} -
- )} - +
+ {!loading && + currentItems.map((contact) => ( +
+ +
+ ))} +
)} - {/* NOTES VIEW */} {viewType === "notes" && (
{ setNotesForFilter={setNotes} searchText={searchText} setIsOpenModalNote={setIsOpenModalNote} - filterAppliedNotes={filterAppliedNotes} + filterAppliedNotes={filterAppliedNotes} />
)} - {/* PAGINATION */} + {/* Pagination */} {!loading && viewType !== "notes" && contacts?.length > 0 && @@ -494,10 +464,7 @@ const Directory = ({ IsPage = true, prefernceContacts }) => { ))} -
  • +
  • -
    ); }; From 39f0908fc052424b5a065bf7aa6d94f004abea21 Mon Sep 17 00:00:00 2001 From: pramod mahajan Date: Mon, 14 Jul 2025 14:13:58 +0530 Subject: [PATCH 94/95] fixed error during rebase --- src/pages/project/ProjectDetails.jsx | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/pages/project/ProjectDetails.jsx b/src/pages/project/ProjectDetails.jsx index 732255b8..f34586aa 100644 --- a/src/pages/project/ProjectDetails.jsx +++ b/src/pages/project/ProjectDetails.jsx @@ -81,22 +81,9 @@ const ProjectDetails = () => { switch (activePill) { case "profile": { return ( - <> -
    -
    - {/* About User */} - - - {/* About User */} -
    -
    - {/* Profile Overview */} - - {/* Profile Overview */} -
    +
    +
    +
    @@ -136,8 +123,8 @@ const ProjectDetails = () => { } case "directory": { return ( -
    - +
    +
    ); } @@ -177,7 +164,7 @@ const ProjectDetails = () => { ]} > -
    +
    {projectLoading &&

    Loading....

    } {/* {!projectLoading && project && ( From 0ccd00d3f703f175ff500bbadb8fde7c52c15270 Mon Sep 17 00:00:00 2001 From: pramod mahajan Date: Mon, 14 Jul 2025 14:30:49 +0530 Subject: [PATCH 95/95] error fixed during occured rebase --- src/components/Activities/InfraPlanning.jsx | 46 +++++---------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/src/components/Activities/InfraPlanning.jsx b/src/components/Activities/InfraPlanning.jsx index a0ee3ac3..da0a9a33 100644 --- a/src/components/Activities/InfraPlanning.jsx +++ b/src/components/Activities/InfraPlanning.jsx @@ -40,48 +40,24 @@ const InfraPlanning = () => },[reloadedData]) - // Show only "No Result Found" message if no data is present - if (!project_deatilsLoader && projects_Details?.buildings?.length === 0) { - return
    No Result Found
    ; - } - - // Optionally show loading indicator - if (project_deatilsLoader) { - return
    Loading...
    ; - } - return (
    -
    - {/*
    -
    - -
    - -
    */} + {ManageInfra ? ( +
    - {project_deatilsLoader && (

    Loading...

    )} - {( !project_deatilsLoader && projects_Details?.buildings.length === 0 ) && (

    No Result Found

    )} - - - - {(!project_deatilsLoader && projects_Details?.buildings?.length > 0) && ()} + {isLoading && (

    Loading...

    )} + {( !isLoading && projectInfra?.length === 0 ) && (

    No Result Found

    )} + {(!isLoading && projectInfra?.length > 0) && ()}
    + ) : ( +
    + +

    Access Denied: You don't have permission to perform this action. !

    +
    + )}