pramod_Bug#128 #54
@ -2,7 +2,6 @@ import React, { useState, useEffect } from "react";
|
|||||||
import { useModal } from "../../../ModalContext";
|
import { useModal } from "../../../ModalContext";
|
||||||
import AssignRoleModel from "../AssignRole";
|
import AssignRoleModel from "../AssignRole";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import GlobalModel from "../../common/GlobalModel";
|
|
||||||
|
|
||||||
const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
||||||
const { projectId } = useParams();
|
const { projectId } = useParams();
|
||||||
@ -22,7 +21,7 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setNewWorkItem(workItem);
|
setNewWorkItem(workItem);
|
||||||
}, [workItem]); // This hook will run whenever the workItem prop changes
|
}, [workItem]);
|
||||||
|
|
||||||
let assigndata = {
|
let assigndata = {
|
||||||
building: forBuilding,
|
building: forBuilding,
|
||||||
@ -33,22 +32,24 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
|
|
||||||
const hasWorkItem = NewWorkItem && NewWorkItem;
|
const hasWorkItem = NewWorkItem && NewWorkItem;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const tooltipTriggerList = Array.from(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
const tooltipTriggerList = Array.from(
|
||||||
|
document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
||||||
|
);
|
||||||
tooltipTriggerList.forEach((el) => new bootstrap.Tooltip(el));
|
tooltipTriggerList.forEach((el) => new bootstrap.Tooltip(el));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<GlobalModel
|
<div
|
||||||
isOpen={isModalOpen}
|
className={`modal fade ${isModalOpen ? "show" : ""}`}
|
||||||
closeModal={closeModal}
|
tabIndex="-1"
|
||||||
dialogClass="modal-dialog-centered"
|
role="dialog"
|
||||||
role="document"
|
style={{ display: isModalOpen ? "block" : "none" }}
|
||||||
size="lg"
|
aria-hidden={!isModalOpen}
|
||||||
>
|
>
|
||||||
<AssignRoleModel assignData={assigndata} onClose={closeModal} />
|
<AssignRoleModel assignData={assigndata} onClose={closeModal} />
|
||||||
</GlobalModel>
|
</div>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td className="text-start table-cell-small">
|
<td className="text-start table-cell-small">
|
||||||
<i className="bx bx-right-arrow-alt"></i>
|
<i className="bx bx-right-arrow-alt"></i>
|
||||||
@ -75,7 +76,6 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
<td className="text-center d-none d-md-table-cell">
|
<td className="text-center d-none d-md-table-cell">
|
||||||
{NewWorkItem?.workItem?.completedWork}
|
{NewWorkItem?.workItem?.completedWork}
|
||||||
</td>
|
</td>
|
||||||
{/* ************************************************ */}
|
|
||||||
<td className="text-center" style={{ width: "15%" }}>
|
<td className="text-center" style={{ width: "15%" }}>
|
||||||
<div className="progress p-0">
|
<div className="progress p-0">
|
||||||
<div
|
<div
|
||||||
@ -99,7 +99,6 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
{/* for greather than mobile view */}
|
|
||||||
<td className="d-none d-md-table-cell">
|
<td className="d-none d-md-table-cell">
|
||||||
<div className="dropdown">
|
<div className="dropdown">
|
||||||
{!projectId && (
|
{!projectId && (
|
||||||
@ -134,14 +133,16 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
type="button"
|
type="button"
|
||||||
className="btn p-0 dropdown-toggle hide-arrow"
|
className="btn p-0 dropdown-toggle hide-arrow"
|
||||||
>
|
>
|
||||||
<i className="bx bx-trash me-1 text-danger" data-bs-toggle="tooltip"
|
<i
|
||||||
|
className="bx bx-trash me-1 text-danger"
|
||||||
|
data-bs-toggle="tooltip"
|
||||||
data-bs-placement="top"
|
data-bs-placement="top"
|
||||||
title="Delete Activity"
|
title="Delete Activity"
|
||||||
data-bs-original-title="Delete Activity"></i>
|
data-bs-original-title="Delete Activity"
|
||||||
|
></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
{/* for mobile view */}
|
|
||||||
<td className="text-end d-sm-none d-sm-table-cell">
|
<td className="text-end d-sm-none d-sm-table-cell">
|
||||||
<div className="d-flex align-items-center justify-content-center ">
|
<div className="d-flex align-items-center justify-content-center ">
|
||||||
<a
|
<a
|
||||||
@ -159,14 +160,19 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
</a>
|
</a>
|
||||||
<a className="dropdown-item">
|
<a className="dropdown-item">
|
||||||
{" "}
|
{" "}
|
||||||
<i className="bx bx-trash me-1 text-danger" ></i>Delete
|
<i className="bx bx-trash me-1 text-danger"></i>Delete
|
||||||
</a>
|
</a>
|
||||||
{!projectId && ( <a className="dropdown-item" data-bs-toggle="modal"
|
{!projectId && (
|
||||||
data-bs-target="#project-modal"
|
<a
|
||||||
onClick={openModal}>
|
className="dropdown-item"
|
||||||
{" "}
|
data-bs-toggle="modal"
|
||||||
<i className="bx bx-task me-1 text-info" ></i>Assign
|
data-bs-target="#project-modal"
|
||||||
</a> )}
|
onClick={openModal}
|
||||||
|
>
|
||||||
|
{" "}
|
||||||
|
<i className="bx bx-task me-1 text-info"></i>Assign
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user