pramod_Task#207 Assign button hide and completedWork not editable if , > 0 #92
@ -50,8 +50,11 @@ const CheckCheckOutmodel = ({modeldata,closeModal,handleSubmitForm,}) => {
|
|||||||
|
|
||||||
showToast("Attendance Marked Successfully", "success");
|
showToast("Attendance Marked Successfully", "success");
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch( ( error ) =>
|
||||||
showToast(error, "error");
|
{
|
||||||
|
|
||||||
|
showToast(error, "error" );
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// } else
|
// } else
|
||||||
|
@ -303,6 +303,7 @@ const EditActivityModal = ({
|
|||||||
type="number"
|
type="number"
|
||||||
className="form-control form-control-sm me-2"
|
className="form-control form-control-sm me-2"
|
||||||
placeholder="Completed Work"
|
placeholder="Completed Work"
|
||||||
|
disabled={getValues("completedWork") > 0}
|
||||||
/>
|
/>
|
||||||
{errors.completedWork && (
|
{errors.completedWork && (
|
||||||
<p className="danger-text">{errors.completedWork.message}</p>
|
<p className="danger-text">{errors.completedWork.message}</p>
|
||||||
|
@ -23,7 +23,7 @@ const Floor = ({ floor, workAreas, forBuilding }) => {
|
|||||||
<span className="fw-semibold text-primary">
|
<span className="fw-semibold text-primary">
|
||||||
Floor:
|
Floor:
|
||||||
</span>{" "}
|
</span>{" "}
|
||||||
<span class="fw-normal text-darkgreen">
|
<span className="fw-normal text-darkgreen">
|
||||||
{floor.floorName}
|
{floor.floorName}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -69,7 +69,9 @@ const WorkArea = ({ workArea, floor, forBuilding }) => {
|
|||||||
</th>
|
</th>
|
||||||
{/* ************************** */}
|
{/* ************************** */}
|
||||||
<th className="infra-activity-table-header">Progress</th>
|
<th className="infra-activity-table-header">Progress</th>
|
||||||
<th className="infra-activity-table-header">Actions</th>
|
<th className="infra-activity-table-header text-end ">
|
||||||
|
<span className="px-3"> Actions</span>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="table-border-bottom-0">
|
<tbody className="table-border-bottom-0">
|
||||||
|
@ -119,6 +119,9 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
showToast(message, "error");
|
showToast(message, "error");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const PlannedWork = NewWorkItem?.workItem?.plannedWork || workItem?.plannedWork;
|
||||||
|
const CompletedWork = NewWorkItem?.workItem?.completedWork ?? workItem?.completedWork;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isModalOpen && (
|
{isModalOpen && (
|
||||||
@ -233,56 +236,65 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
|||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="d-md-table-cell">
|
<td className="text-end align-middle">
|
||||||
<div className="dropdown">
|
<div className="dropdown w-auto d-inline-flex align-items-center gap-1">
|
||||||
{!projectId && ManageTasks && (
|
{/* Reserve space for Assign button */}
|
||||||
<button
|
<div style={{ width: 'auto', minWidth: '60px' }}>
|
||||||
aria-label="Modify"
|
{(!projectId && ManageTasks) && (PlannedWork !== CompletedWork) ? (
|
||||||
type="button"
|
<button
|
||||||
className="btn p-0"
|
aria-label="Modify"
|
||||||
data-bs-toggle="modal"
|
type="button"
|
||||||
data-bs-target="#project-modal"
|
className="btn p-0"
|
||||||
onClick={openModal}
|
data-bs-toggle="modal"
|
||||||
>
|
data-bs-target="#project-modal"
|
||||||
<span className="badge badge-md bg-label-primary me-1">
|
onClick={openModal}
|
||||||
Assign
|
>
|
||||||
</span>
|
<span className="badge badge-md bg-label-primary me-1">Assign</span>
|
||||||
</button>
|
</button>
|
||||||
)}
|
) : (
|
||||||
{ManageInfra && (
|
// Hidden placeholder to preserve layout
|
||||||
<>
|
<span className="invisible">
|
||||||
<button
|
<span className="badge badge-md bg-label-primary me-1">Assign</span>
|
||||||
aria-label="Modify"
|
</span>
|
||||||
type="button"
|
)}
|
||||||
className="btn p-0 dropdown-toggle hide-arrow"
|
</div>
|
||||||
onClick={showModal1}
|
|
||||||
>
|
{/* Edit and Delete buttons */}
|
||||||
<i
|
{ManageInfra && (
|
||||||
className="bx bxs-edit me-2 text-primary"
|
<>
|
||||||
data-bs-toggle="tooltip"
|
<button
|
||||||
data-bs-placement="top"
|
aria-label="Modify"
|
||||||
title="Edit Activity"
|
type="button"
|
||||||
data-bs-original-title="Edit Activity"
|
className="btn p-0"
|
||||||
></i>
|
onClick={showModal1}
|
||||||
</button>
|
>
|
||||||
<button
|
<i
|
||||||
aria-label="Delete"
|
className="bx bxs-edit me-2 text-primary"
|
||||||
type="button"
|
data-bs-toggle="tooltip"
|
||||||
className="btn p-0 dropdown-toggle hide-arrow"
|
data-bs-placement="top"
|
||||||
onClick={showModalDelete}
|
title="Edit Activity"
|
||||||
>
|
></i>
|
||||||
<i
|
</button>
|
||||||
className="bx bx-trash me-1 text-danger"
|
<button
|
||||||
data-bs-toggle="tooltip"
|
aria-label="Delete"
|
||||||
data-bs-placement="top"
|
type="button"
|
||||||
title="Delete Activity"
|
className="btn p-0"
|
||||||
data-bs-original-title="Delete Activity"
|
onClick={showModalDelete}
|
||||||
></i>
|
>
|
||||||
</button>
|
<i
|
||||||
</>
|
className="bx bx-trash me-1 text-danger"
|
||||||
)}
|
data-bs-toggle="tooltip"
|
||||||
</div>
|
data-bs-placement="top"
|
||||||
</td>
|
title="Delete Activity"
|
||||||
|
></i>
|
||||||
|
</button>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -120,15 +120,21 @@ const TimePicker = ({ label, onChange, interval = 10, value,checkInTime,checkOut
|
|||||||
}, [value, interval, onChange]);
|
}, [value, interval, onChange]);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpen && time && slotRefs.current[time]) {
|
if (isOpen) {
|
||||||
const selectedSlot = slotRefs.current[time];
|
const slots = generateTimeSlots();
|
||||||
selectedSlot.scrollIntoView({
|
const targetTime = slots.find(slot => slot.time === time && slot.isSelectable)
|
||||||
|
? time
|
||||||
|
: (slots.find(slot => slot.isSelectable)?.time || null);
|
||||||
|
|
||||||
|
if (targetTime && slotRefs.current[targetTime]) {
|
||||||
|
slotRefs.current[targetTime].scrollIntoView({
|
||||||
behavior: "smooth",
|
behavior: "smooth",
|
||||||
block: "center",
|
block: "center",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [isOpen, time]);
|
}
|
||||||
|
}, [isOpen, time]);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -38,8 +38,10 @@ export const markAttendance = createAsyncThunk(
|
|||||||
|
|
||||||
const response = await AttendanceRepository.markAttendance( newRecordAttendance );
|
const response = await AttendanceRepository.markAttendance( newRecordAttendance );
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch ( error )
|
||||||
return thunkAPI.rejectWithValue(error.message);
|
{
|
||||||
|
const message = error?.response?.data?.message || error.message || "Error Occured During Api Call";
|
||||||
|
return thunkAPI.rejectWithValue(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -41,7 +41,7 @@ export const convertShortTime = (dateString) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const timeElapsed = (checkInTime, timeElapsedInHours) => {
|
export const timeElapsed = (checkInTime, timeElapsedInHours) => {
|
||||||
const checkInDate = new Date(checkInTime);
|
const checkInDate = new Date( checkInTime.split( "T" )[ 0 ] );
|
||||||
|
|
||||||
const currentTime = new Date();
|
const currentTime = new Date();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user