Modified assign task popup from Daily task planning component.

This commit is contained in:
kartik.sharma 2025-05-16 16:53:51 +05:30
parent 0a1f76afb6
commit 115b49ac44
2 changed files with 45 additions and 30 deletions

View File

@ -9,6 +9,7 @@ import { useNavigate } from "react-router-dom";
const Attendance = ({ attendance, getRole, handleModalData }) => { const Attendance = ({ attendance, getRole, handleModalData }) => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const navigate = useNavigate(); const navigate = useNavigate();
const [todayDate, setTodayDate] = useState(new Date());
// Ensure attendance is an array // Ensure attendance is an array
const attendanceList = Array.isArray(attendance) ? attendance : []; const attendanceList = Array.isArray(attendance) ? attendance : [];
@ -41,6 +42,13 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
<> <>
<table className="table "> <table className="table ">
<thead> <thead>
<tr className="border-top-0" style={{ textAlign: 'left' }}>
<td >
<strong>Date : {todayDate.toLocaleDateString('en-GB')}</strong>
</td>
<td style={{ paddingLeft: '20px' }}>
</td>
</tr>
<tr> <tr>
<th className="border-top-0" colSpan={2}> <th className="border-top-0" colSpan={2}>
Name Name
@ -126,8 +134,7 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
<nav aria-label="Page "> <nav aria-label="Page ">
<ul className="pagination pagination-sm justify-content-end py-1"> <ul className="pagination pagination-sm justify-content-end py-1">
<li <li
className={`page-item ${ className={`page-item ${currentPage === 1 ? "disabled" : ""
currentPage === 1 ? "disabled" : ""
}`} }`}
> >
<button <button
@ -140,8 +147,7 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
{[...Array(totalPages)].map((_, index) => ( {[...Array(totalPages)].map((_, index) => (
<li <li
key={index} key={index}
className={`page-item ${ className={`page-item ${currentPage === index + 1 ? "active" : ""
currentPage === index + 1 ? "active" : ""
}`} }`}
> >
<button <button
@ -153,8 +159,7 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
</li> </li>
))} ))}
<li <li
className={`page-item ${ className={`page-item ${currentPage === totalPages ? "disabled" : ""
currentPage === totalPages ? "disabled" : ""
}`} }`}
> >
<button <button

View File

@ -188,7 +188,7 @@ const AssignRoleModel = ({ assignData, onClose }) => {
<div className="form-text text-start"> <div className="form-text text-start">
<div className="d-flex align-items-center"> <div className="d-flex align-items-center">
<strong>Select Team</strong> Select Team
<div className="me-2">{displayedSelection}</div> <div className="me-2">{displayedSelection}</div>
<a <a
className="dropdown-toggle hide-arrow cursor-pointer" className="dropdown-toggle hide-arrow cursor-pointer"
@ -272,10 +272,10 @@ const AssignRoleModel = ({ assignData, onClose }) => {
)} )}
/> />
<div className="flex-grow-1"> <div className="flex-grow-1">
<p className="mb-1 fw-bold" style={{ fontSize: "13px" }}> <p className="mb-0" style={{ fontSize: "13px" }}>
{emp.firstName} {emp.lastName} {emp.firstName} {emp.lastName}
</p> </p>
<small className="text-muted" style={{ fontSize: "11px" }}> <small className="text-muted" style={{ fontSize: "11px"}}>
{loading ? ( {loading ? (
<span className="placeholder-glow"> <span className="placeholder-glow">
<span className="placeholder col-6"></span> <span className="placeholder col-6"></span>
@ -347,13 +347,13 @@ const AssignRoleModel = ({ assignData, onClose }) => {
<div className="col-md text-start mx-0 px-0"> <div className="col-md text-start mx-0 px-0">
<div className="form-check form-check-inline mt-3 px-1"> <div className="form-check form-check-inline mt-3 px-1">
<label <label
className="form-text fs-6" className="form-text fs-7"
htmlFor="inlineCheckbox1" htmlFor="inlineCheckbox1"
> >
<strong>Pending Task of Activity:</strong> Pending Task of Activity:
</label> </label>
<label <label
className="form-check-label ms-4" className="form-check-label fs-7 ms-4"
htmlFor="inlineCheckbox1" htmlFor="inlineCheckbox1"
> >
@ -369,29 +369,38 @@ const AssignRoleModel = ({ assignData, onClose }) => {
</div> </div>
<div className="col-md text-start mx-0 px-0"> <div className="col-md text-start mx-0 px-0">
<div className="form-check form-check-inline mt-2 px-1"> <div className="form-check form-check-inline mt-2 px-1 mb-2 text-start">
<label <label
className="form-text fs-6" className="form-check-label fs-7"
htmlFor="inlineCheckbox1" htmlFor="inlineCheckbox1"
> >
<strong>Target for Today:</strong> Target for Today:
</label> </label>
</div> </div>
<div className="form-check form-check-inline col-sm-2 col"> <div className="form-check form-check-inline col-sm-3 mt-2">
<Controller <Controller
name="plannedTask" name="plannedTask"
control={control} control={control}
render={({ field }) => ( render={({ field }) => (
<div className="d-flex align-items-center gap-1 ">
<input <input
type="text" type="text"
className="form-control form-control-xs" className="form-control form-control-sm"
{...field} {...field}
id="defaultFormControlInput" id="defaultFormControlInput"
aria-describedby="defaultFormControlHelp" aria-describedby="defaultFormControlHelp"
/> />
<span style={{ paddingLeft: '6px' }}>{
assignData?.workItem?.workItem?.activityMaster
?.unitOfMeasurement
}</span>
</div>
)} )}
/> />
</div> </div>
{errors.plannedTask && ( {errors.plannedTask && (
<div className="danger-text mt-1"> <div className="danger-text mt-1">
{errors.plannedTask.message} {errors.plannedTask.message}
@ -400,14 +409,15 @@ const AssignRoleModel = ({ assignData, onClose }) => {
</div> </div>
{errors.selectedEmployees && ( {errors.selectedEmployees && (
<div className="danger-text mt-1"> <div className="danger-text mt-1">
<p>{errors.selectedEmployees.message}</p> <p>{errors.selectedEmployees.message}</p>
</div> </div>
)} )}
<label htmlFor="exampleFormControlTextarea1"> <label htmlFor="exampleFormControlTextarea1" className="m-1 text-lg font-semibold block">
<strong>Description</strong> Description
</label> </label>
<Controller <Controller
name="description" name="description"