From 6c0b92606a786168515599ad40bc5229719ededd Mon Sep 17 00:00:00 2001 From: Vaibhav Surve Date: Mon, 7 Apr 2025 17:01:08 +0530 Subject: [PATCH 1/6] updated links for Daily Expenses and Application Users in menuData.json --- src/data/menuData.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/menuData.json b/src/data/menuData.json index bdff275d..6f2f3f8c 100644 --- a/src/data/menuData.json +++ b/src/data/menuData.json @@ -70,7 +70,7 @@ { "text": "Daily Expenses", "available": true, - "link": "/dashboard" + "link": "/dashboard/" } ] }, @@ -83,12 +83,12 @@ { "text": "Application Users", "available": true, - "link": "/employees" + "link": "/employees/" }, { "text": "Employees", "available": true, - "link": "/employees" + "link": "/employees/list" }, { "text": "Masters", From c595930640dc702e7c5cb67d97798c8e021e9733 Mon Sep 17 00:00:00 2001 From: Vaibhav Surve Date: Mon, 7 Apr 2025 17:02:15 +0530 Subject: [PATCH 2/6] refactor: streamline modal handling and improve floor management functionality --- .../Project/Infrastructure/FloorModel.jsx | 14 +- .../Project/Infrastructure/InfraTable.jsx | 211 ++++++++++++------ src/components/Project/ProjectInfra.jsx | 39 ++-- 3 files changed, 172 insertions(+), 92 deletions(-) diff --git a/src/components/Project/Infrastructure/FloorModel.jsx b/src/components/Project/Infrastructure/FloorModel.jsx index e2c5f6ac..5946d5ef 100644 --- a/src/components/Project/Infrastructure/FloorModel.jsx +++ b/src/components/Project/Infrastructure/FloorModel.jsx @@ -106,12 +106,7 @@ const FloorModel = ({
- + diff --git a/src/components/Project/Infrastructure/InfraTable.jsx b/src/components/Project/Infrastructure/InfraTable.jsx index 90e6a0c1..969e01fc 100644 --- a/src/components/Project/Infrastructure/InfraTable.jsx +++ b/src/components/Project/Infrastructure/InfraTable.jsx @@ -1,69 +1,154 @@ -import {useEffect, useState} from "react"; +import { useEffect, useState } from "react"; import Building from "./Building"; import Floor from "./Floor"; +import FloorModel from "./FloorModel"; +import showToast from "../../../services/toastService"; +import ProjectRepository from "../../../repositories/ProjectRepository"; -const InfraTable = ( {buildings,assign} ) => -{ - const [projectBuiling,setProjectBuilding] = useState([]) - const [expandedBuildings, setExpandedBuildings] = useState([]); - - const toggleBuilding = (buildingId) => { - setExpandedBuildings((prevExpanded) => - prevExpanded.includes(buildingId) - ? prevExpanded.filter((id) => id !== buildingId) - : [...prevExpanded, buildingId] - ); - }; - +const InfraTable = ({ buildings }) => { + const [projectBuilding, setProjectBuilding] = useState([]); + const [expandedBuildings, setExpandedBuildings] = useState([]); + const [showFloorModal, setShowFloorModal] = useState(false); + const [selectedBuilding, setSelectedBuilding] = useState(null); + const [clearTrigger, setClearTrigger] = useState(false); - const getContent = (building) => { - return building.floors.length > 0 ? ( - building.floors.map((floor) => ) - ) : ( - - -
-

No floors have been added yet. Please add floors to start managing your building.

- -
- - - ); - }; - - - useEffect( () => - { - setProjectBuilding(buildings) - },[buildings]) - - return ( -
- {projectBuiling && projectBuiling.length > 0 && ( - - - {projectBuiling.map((building) => ( - - ))} - -
- )} -
+ const toggleBuilding = (buildingId) => { + setExpandedBuildings((prevExpanded) => + prevExpanded.includes(buildingId) + ? prevExpanded.filter((id) => id !== buildingId) + : [...prevExpanded, buildingId] ); }; - export default InfraTable \ No newline at end of file + + const handleAddFloor = (building) => { + setSelectedBuilding(building); + setShowFloorModal(true); + }; + + const handleFloorSubmit = async (data) => { + try { + const payload = [ + { + building: null, + floor: { + id: data.id || "0", + floorName: data.floorName, + buildingId: data.buildingId, + }, + workArea: null, + }, + ]; + + const res = await ProjectRepository.manageProjectInfra(payload); + + if (res?.success) { + showToast("Floor saved successfully!", "success"); + + // Find and update the correct building + const updatedBuildings = projectBuilding.map((b) => { + if (b.id === parseInt(data.buildingId)) { + const newFloor = { + id: res.data?.[0]?.floor?.id || Math.random(), + floorName: res.data?.[0]?.floor?.floorName || data.floorName, + workAreas: [], + }; + + return { + ...b, + floors: [...(b.floors || []), newFloor], + }; + } + return b; + }); + + setProjectBuilding(updatedBuildings); + setShowFloorModal(false); + setClearTrigger(true); + } else { + showToast("Failed to save floor", "error"); + } + } catch (err) { + console.error("Error adding floor", err); + showToast("Error occurred while saving floor", "error"); + } + }; + + + const handleClearComplete = () => { + setClearTrigger(false); + }; + + const getContent = (building) => { + return building.floors?.length > 0 ? ( + building.floors.map((floor) => ( + + )) + ) : ( + + +
+

No floors have been added yet. Please add floors to start managing your building.

+ +
+ + + ); + }; + useEffect(() => { + setProjectBuilding(buildings); + }, [buildings]); + + return ( +
+ {projectBuilding && projectBuilding.length > 0 && ( + + + {projectBuilding.map((building) => ( + + ))} + +
+ )} + {showFloorModal && selectedBuilding && ( + + )} + +
+ ); +}; + +export default InfraTable; diff --git a/src/components/Project/ProjectInfra.jsx b/src/components/Project/ProjectInfra.jsx index 351eeead..f85e91db 100644 --- a/src/components/Project/ProjectInfra.jsx +++ b/src/components/Project/ProjectInfra.jsx @@ -312,12 +312,12 @@ const ProjectInfra = ({ data, activityMaster, onDataChange,eachSiteEngineer }) = } const openModal = () => { const modalElement = document.getElementById('building-model'); - const modal = new Modal(modalElement, { - backdrop: false, - keyboard: true, - focus: true - }); - modal.show() + const modal = new Modal(modalElement, { + backdrop: false, + keyboard: true, + focus: true + }); + modal.show() }; const closeModal = () => { setIsModalOpen(false); @@ -364,10 +364,12 @@ const ProjectInfra = ({ data, activityMaster, onDataChange,eachSiteEngineer }) =
{isFloorModalOpen && ( )} @@ -437,15 +439,14 @@ const ProjectInfra = ({ data, activityMaster, onDataChange,eachSiteEngineer }) = Manage Building + type="button" + className="link-button m-1" + onClick={() => openFloorModel()} +> + + Manage Floors + +
- +
From f2a77b0685dde9494bc3edc8ba258105ba078358 Mon Sep 17 00:00:00 2001 From: Vaibhav Surve Date: Mon, 7 Apr 2025 18:29:22 +0530 Subject: [PATCH 3/6] added "Coming Soon!" message and illustration to multiple components --- src/components/Project/ActivityTimeline.jsx | 273 +++++++++++--------- src/components/Project/WorkPlan.jsx | 20 +- src/pages/Gallary/ImageGallary.jsx | 16 +- src/pages/employee/EmployeeProfile.jsx | 16 +- src/pages/project/Inventory.jsx | 20 +- src/pages/project/ProjectDetails.jsx | 16 +- src/pages/reports/Reports.jsx | 16 +- 7 files changed, 238 insertions(+), 139 deletions(-) diff --git a/src/components/Project/ActivityTimeline.jsx b/src/components/Project/ActivityTimeline.jsx index 90e09f8d..159b182c 100644 --- a/src/components/Project/ActivityTimeline.jsx +++ b/src/components/Project/ActivityTimeline.jsx @@ -2,136 +2,151 @@ import React from "react"; const ActivityTimeline = () => { return ( -
-
-
- - Activity Timeline -
-
-
-
    -
  • - -
    -
    -
    12 Invoices have been paid
    - 12 min ago -
    -

    Invoices have been paid to the company

    -
    -
    - img - invoices.pdf -
    -
    -
    -
  • -
  • - -
    -
    -
    Client Meeting
    - 45 min ago -
    -

    Project meeting with john @10:15am

    -
    -
    -
    - Avatar -
    -
    -

    - Lester McCarthy (Client) -

    - CEO of ThemeSelection -
    -
    -
    -
    -
  • -
  • - -
    -
    -
    Create a new project for client
    - 2 Day Ago -
    -

    6 team members in a project

    -
      -
    • -
      -
        -
      • - Avatar -
      • -
      • - Avatar -
      • -
      • - Avatar -
      • -
      • - - +3 - -
      • -
      -
      -
    • -
    -
    -
  • -
-
+ //
+ //
+ //
+ // + // Activity Timeline + //
+ //
+ //
+ //
    + //
  • + // + //
    + //
    + //
    12 Invoices have been paid
    + // 12 min ago + //
    + //

    Invoices have been paid to the company

    + //
    + //
    + // img + // invoices.pdf + //
    + //
    + //
    + //
  • + //
  • + // + //
    + //
    + //
    Client Meeting
    + // 45 min ago + //
    + //

    Project meeting with john @10:15am

    + //
    + //
    + //
    + // Avatar + //
    + //
    + //

    + // Lester McCarthy (Client) + //

    + // CEO of ThemeSelection + //
    + //
    + //
    + //
    + //
  • + //
  • + // + //
    + //
    + //
    Create a new project for client
    + // 2 Day Ago + //
    + //

    6 team members in a project

    + //
      + //
    • + //
      + //
        + //
      • + // Avatar + //
      • + //
      • + // Avatar + //
      • + //
      • + // Avatar + //
      • + //
      • + // + // +3 + // + //
      • + //
      + //
      + //
    • + //
    + //
    + //
  • + //
+ //
+ //
+
+

Coming Soon!

+

We're currently working on this feature and will have it ready shortly. + Thank you for your patience!

+
+ girl-doing-yoga-light
+
); }; diff --git a/src/components/Project/WorkPlan.jsx b/src/components/Project/WorkPlan.jsx index 076d8f07..ebaa8a8b 100644 --- a/src/components/Project/WorkPlan.jsx +++ b/src/components/Project/WorkPlan.jsx @@ -1,7 +1,25 @@ import React from "react"; const WorkPlan = () => { - return
Work plan calender will go here
; + return ( + <> +
+

Coming Soon!

+

We're currently working on this feature and will have it ready shortly. + Thank you for your patience!

+
+ girl-doing-yoga-light +
+
+ +) }; export default WorkPlan; diff --git a/src/pages/Gallary/ImageGallary.jsx b/src/pages/Gallary/ImageGallary.jsx index 47ab1b19..de5c2bcc 100644 --- a/src/pages/Gallary/ImageGallary.jsx +++ b/src/pages/Gallary/ImageGallary.jsx @@ -1,7 +1,21 @@ import React from "react"; const ImageGallary = () => { - return
Image Gallery
; + return
+

Coming Soon!

+

We're currently working on this feature and will have it ready shortly. + Thank you for your patience!

+
+ girl-doing-yoga-light +
+
; }; export default ImageGallary; diff --git a/src/pages/employee/EmployeeProfile.jsx b/src/pages/employee/EmployeeProfile.jsx index 297de953..6987c322 100644 --- a/src/pages/employee/EmployeeProfile.jsx +++ b/src/pages/employee/EmployeeProfile.jsx @@ -84,7 +84,21 @@ const EmployeeProfile = () => { } default: - return
Select a pill to display content here.
; + return
+

Coming Soon!

+

We're currently working on this feature and will have it ready shortly. + Thank you for your patience!

+
+ girl-doing-yoga-light +
+
; } }; diff --git a/src/pages/project/Inventory.jsx b/src/pages/project/Inventory.jsx index de705df8..74ca9e5e 100644 --- a/src/pages/project/Inventory.jsx +++ b/src/pages/project/Inventory.jsx @@ -1,11 +1,21 @@ import React from "react"; const Inventory = () => { - return
Inventory -
-

ddj

-
-
; + return
+

Coming Soon!

+

We're currently working on this feature and will have it ready shortly. + Thank you for your patience!

+
+ girl-doing-yoga-light +
+
; }; export default Inventory; diff --git a/src/pages/project/ProjectDetails.jsx b/src/pages/project/ProjectDetails.jsx index 7c0fb529..937c6de7 100644 --- a/src/pages/project/ProjectDetails.jsx +++ b/src/pages/project/ProjectDetails.jsx @@ -149,7 +149,21 @@ const ProjectDetails = () => { } default: - return
Select a pill to display content here.
; + return
+

Coming Soon!

+

We're currently working on this feature and will have it ready shortly. + Thank you for your patience!

+
+ girl-doing-yoga-light +
+
; } }; diff --git a/src/pages/reports/Reports.jsx b/src/pages/reports/Reports.jsx index 79aa9c0a..b14cce50 100644 --- a/src/pages/reports/Reports.jsx +++ b/src/pages/reports/Reports.jsx @@ -1,7 +1,21 @@ import React from "react"; const Reports = () => { - return
Reports
; + return
+

Coming Soon!

+

We're currently working on this feature and will have it ready shortly. + Thank you for your patience!

+
+ girl-doing-yoga-light +
+
; }; export default Reports; From 66c4e44ded2035441157f2d8814e03929a632979 Mon Sep 17 00:00:00 2001 From: Vaibhav Surve Date: Mon, 7 Apr 2025 18:30:01 +0530 Subject: [PATCH 4/6] updated Connect, Documentation, and Support pages with "Coming Soon!" message and illustration --- src/pages/support/Connect.jsx | 16 +++++++++++++++- src/pages/support/Documentation.jsx | 16 +++++++++++++++- src/pages/support/Support.jsx | 16 +++++++++++++++- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/pages/support/Connect.jsx b/src/pages/support/Connect.jsx index 61b5f582..31a19dfd 100644 --- a/src/pages/support/Connect.jsx +++ b/src/pages/support/Connect.jsx @@ -1,7 +1,21 @@ import React from "react"; const Connect = () => { - return
Connect
; + return
+

Coming Soon!

+

We're currently working on this feature and will have it ready shortly. + Thank you for your patience!

+
+ girl-doing-yoga-light +
+
; }; export default Connect; diff --git a/src/pages/support/Documentation.jsx b/src/pages/support/Documentation.jsx index b3f447aa..fad15f99 100644 --- a/src/pages/support/Documentation.jsx +++ b/src/pages/support/Documentation.jsx @@ -1,7 +1,21 @@ import React from "react"; const Documentation = () => { - return
Documentation
; + return
+

Coming Soon!

+

We're currently working on this feature and will have it ready shortly. + Thank you for your patience!

+
+ girl-doing-yoga-light +
+
; }; export default Documentation; diff --git a/src/pages/support/Support.jsx b/src/pages/support/Support.jsx index ca3f1779..aac9a4b5 100644 --- a/src/pages/support/Support.jsx +++ b/src/pages/support/Support.jsx @@ -1,7 +1,21 @@ import React from "react"; const Support = () => { - return
Support
; + return
+

Coming Soon!

+

We're currently working on this feature and will have it ready shortly. + Thank you for your patience!

+
+ girl-doing-yoga-light +
+
; }; export default Support; From 984efe207b7e03796bcb98ecc152c17752d52724 Mon Sep 17 00:00:00 2001 From: Vikas Nale Date: Mon, 7 Apr 2025 22:11:38 +0530 Subject: [PATCH 5/6] Reduce font size on menu and project infra --- public/assets/vendor/css/core.css | 2 +- .../Project/Infrastructure/Building.jsx | 61 ++++++++++--------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/public/assets/vendor/css/core.css b/public/assets/vendor/css/core.css index 88827bc4..b5c63690 100644 --- a/public/assets/vendor/css/core.css +++ b/public/assets/vendor/css/core.css @@ -35469,7 +35469,7 @@ html:not([dir="rtl"]) .menu-toggle::after { } .menu-vertical .menu-item .menu-link { - font-size: 0.8375rem; + font-size: 0.7375rem; min-height: 1.825rem; } diff --git a/src/components/Project/Infrastructure/Building.jsx b/src/components/Project/Infrastructure/Building.jsx index 30d5eacf..419e9b09 100644 --- a/src/components/Project/Infrastructure/Building.jsx +++ b/src/components/Project/Infrastructure/Building.jsx @@ -1,31 +1,34 @@ import React from "react"; -const Building = ( {building, toggleBuilding, expandedBuildings, getContent} ) => -{ +const Building = ({ + building, + toggleBuilding, + expandedBuildings, + getContent, +}) => { + return ( + + + toggleBuilding(building.id)} + > +
+
+ {building.name}   + {expandedBuildings.includes(building.id) ? ( + + ) : ( + + )} +
+
+ + - return ( - - - toggleBuilding(building.id)} - > -
-
- {building.name}   - {expandedBuildings.includes(building.id) ? ( - - ) : ( - - )} -
-
- - - - {expandedBuildings.includes(building.id) && getContent(building)} -
- ); - }; - export default Building \ No newline at end of file + {expandedBuildings.includes(building.id) && getContent(building)} +
+ ); +}; +export default Building; From 5995c74ae6191a2b7465f39fbd36a229bfeddd83 Mon Sep 17 00:00:00 2001 From: Vikas Nale Date: Tue, 8 Apr 2025 09:37:38 +0530 Subject: [PATCH 6/6] change class= to className= --- index.html | 16 +- src/components/Activities/ReportTask.jsx | 258 ++++----- .../Activities/ReportTaskComments.jsx | 190 ++++--- src/components/Employee/DemoTable.jsx | 293 +++++----- src/components/Employee/ManageEmployee.jsx | 156 +++--- src/components/Project/AboutProject.jsx | 13 +- src/components/Project/AssignRole.jsx | 526 ++++++++++-------- .../Project/Infrastructure/WorkItem.jsx | 51 +- src/components/common/Loader.jsx | 38 +- src/components/master/DeleteMaster.jsx | 20 +- src/pages/Activities/AttendancePage.jsx | 336 +++++------ src/pages/Activities/DailyTask.jsx | 144 ++--- src/pages/authentication/LoginPage.jsx | 2 +- .../authentication/ResetPasswordPage.jsx | 34 +- src/utils/axiosClient.jsx | 40 +- 15 files changed, 1148 insertions(+), 969 deletions(-) diff --git a/index.html b/index.html index acbe7277..f6530280 100644 --- a/index.html +++ b/index.html @@ -46,7 +46,7 @@ - + @@ -71,12 +71,12 @@ - + - + @@ -84,8 +84,8 @@ - - + + @@ -94,15 +94,15 @@ - + - + - + diff --git a/src/components/Activities/ReportTask.jsx b/src/components/Activities/ReportTask.jsx index 7503a84e..d6370f38 100644 --- a/src/components/Activities/ReportTask.jsx +++ b/src/components/Activities/ReportTask.jsx @@ -6,9 +6,8 @@ import { z } from "zod"; import showToast from "../../services/toastService"; import { TasksRepository } from "../../repositories/TaskRepository"; -export const ReportTask = ({ report,closeModal,refetch }) => { - const [ loading, setloading ] = useState( false ); - +export const ReportTask = ({ report, closeModal, refetch }) => { + const [loading, setloading] = useState(false); const schema = z.object({ completedTask: z @@ -32,149 +31,156 @@ export const ReportTask = ({ report,closeModal,refetch }) => { }); const onSubmit = async (data) => { - try - { - setloading(true) - const reportData = { - ...data, + try { + setloading(true); + const reportData = { + ...data, id: report?.id, reportedDate: new Date().toISOString(), - }; - - - let response = await TasksRepository.reportTsak( reportData ) - showToast( "succesfully", "success" ) - refetch() - closeModal() - + }; + + let response = await TasksRepository.reportTsak(reportData); + showToast("succesfully", "success"); + refetch(); + closeModal(); } catch (error) { showToast("Somthing wrog", "error"); } }; const handleClose = () => { - closeModal(); + closeModal(); }; return ( +
+
+
+ - -
-
-
- - -
-
- -
-
- Assigned Date : {formatDate(report?.assignmentDate)} +
+
+
+
+ + {" "} + Assigned Date : {formatDate(report?.assignmentDate)} +
-
-
-
- Assigned By -
-
- {/*
+
+
+
+ Assigned By +
+
+ {/*
{report?.assignedBy?.firstName.slice(0, 1)} */} - {` ${report?.assignedBy.firstName} ${report?.assignedBy.lastName}`} - {/*
*/} -
-
-
+ {` ${report?.assignedBy.firstName} ${report?.assignedBy.lastName}`} + {/*
*/} + +
+
-
-
- -
-

{report?.workItem?.workArea?.floor?.building?.name}

-

{report?.workItem?.workArea?.floor?.floorName}

-
-
-
- Work Area : {report?.workItem?.workArea?.areaName} -
-
- {report?.workItem?.activityMaster.activityName} -
-
-
-
Team
- -
- {report?.teamMembers.map((member) => ( - <> -
- {/* Avatar */} - - {member?.firstName.slice(0, 1)} - +
+
+
- - ))} -
-
Planned : {report?.plannedTask}
-
-
-
-
- - {errors.completedTask && ( -
{errors.completedTask.message}
- )} -
-
-