removed condiational vaiable and added tooltip for edit and delet icon.
This commit is contained in:
parent
1b03ea646d
commit
5663a0f071
@ -32,6 +32,11 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const hasWorkItem = NewWorkItem && NewWorkItem;
|
const hasWorkItem = NewWorkItem && NewWorkItem;
|
||||||
|
useEffect(() => {
|
||||||
|
const tooltipTriggerList = Array.from(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
||||||
|
tooltipTriggerList.forEach((el) => new bootstrap.Tooltip(el));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -56,10 +61,7 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
</td>
|
</td>
|
||||||
{/* for mobile view */}
|
{/* for mobile view */}
|
||||||
<td className="text-center d-sm-none d-sm-table-cell">
|
<td className="text-center d-sm-none d-sm-table-cell">
|
||||||
{hasWorkItem
|
{NewWorkItem?.workItem?.completedWork}/{" "}
|
||||||
? NewWorkItem?.workItem?.completedWork || workItem?.completedWork
|
|
||||||
: "NA"}
|
|
||||||
/{" "}
|
|
||||||
{hasWorkItem
|
{hasWorkItem
|
||||||
? NewWorkItem?.workItem?.plannedWork || workItem?.plannedWork
|
? NewWorkItem?.workItem?.plannedWork || workItem?.plannedWork
|
||||||
: "NA"}
|
: "NA"}
|
||||||
@ -71,9 +73,7 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
: "NA"}
|
: "NA"}
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center d-none d-md-table-cell">
|
<td className="text-center d-none d-md-table-cell">
|
||||||
{hasWorkItem
|
{NewWorkItem?.workItem?.completedWork}
|
||||||
? NewWorkItem?.workItem?.completedWork || workItem?.completedWork
|
|
||||||
: "NA"}
|
|
||||||
</td>
|
</td>
|
||||||
{/* ************************************************ */}
|
{/* ************************************************ */}
|
||||||
<td className="text-center" style={{ width: "15%" }}>
|
<td className="text-center" style={{ width: "15%" }}>
|
||||||
@ -89,12 +89,7 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
),
|
),
|
||||||
height: "5px",
|
height: "5px",
|
||||||
}}
|
}}
|
||||||
aria-valuenow={
|
aria-valuenow={NewWorkItem?.workItem?.completedWor}
|
||||||
hasWorkItem
|
|
||||||
? NewWorkItem?.workItem?.completedWork ||
|
|
||||||
workItem?.completedWork
|
|
||||||
: 0
|
|
||||||
}
|
|
||||||
aria-valuemin="0"
|
aria-valuemin="0"
|
||||||
aria-valuemax={
|
aria-valuemax={
|
||||||
hasWorkItem
|
hasWorkItem
|
||||||
@ -126,14 +121,23 @@ 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 bxs-edit me-2 text-primary"></i>
|
<i
|
||||||
|
className="bx bxs-edit me-2 text-primary"
|
||||||
|
data-bs-toggle="tooltip"
|
||||||
|
data-bs-placement="top"
|
||||||
|
title="Edit Activity"
|
||||||
|
data-bs-original-title="Edit Activity"
|
||||||
|
></i>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
aria-label="Delete"
|
aria-label="Delete"
|
||||||
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"></i>
|
<i className="bx bx-trash me-1 text-danger" data-bs-toggle="tooltip"
|
||||||
|
data-bs-placement="top"
|
||||||
|
title="Delete Activity"
|
||||||
|
data-bs-original-title="Delete Activity"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user