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 -
-
-
- -
+ //
+ //
+ //
+ // + // 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/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 + +
- +
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/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", 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; 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;