Changes in during a merge
This commit is contained in:
parent
527e052786
commit
d7986e4af4
@ -88,6 +88,8 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
|
||||
// Changed to an array to hold multiple selected roles
|
||||
const [selectedRoles, setSelectedRoles] = useState(["all"]);
|
||||
// Changed to an array to hold multiple selected roles
|
||||
// const [selectedRoles, setSelectedRoles] = useState(["all"]);
|
||||
const [displayedSelection, setDisplayedSelection] = useState("");
|
||||
const {
|
||||
handleSubmit,
|
||||
@ -230,7 +232,7 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
<div className="mb-1">
|
||||
<p className="mb-0">
|
||||
<span className="text-dark text-start d-flex align-items-center flex-wrap form-text">
|
||||
<span className="me-2 m-0 font-bold">Work Location :</span>
|
||||
<span className="me-2 m-0 fw-bold">Work Location :</span> {/* Changed font-bold to fw-bold */}
|
||||
{[
|
||||
assignData?.building?.buildingName,
|
||||
assignData?.floor?.floorName,
|
||||
@ -258,7 +260,8 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
<span className="text-dark">Select Team</span>
|
||||
<div className="dropdown position-relative d-inline-block">
|
||||
<a
|
||||
className={`dropdown-toggle hide-arrow cursor-pointer ${selectedRoles.includes("all") || selectedRoles.length === 0
|
||||
className={`dropdown-toggle hide-arrow cursor-pointer ${
|
||||
selectedRoles.includes("all") || selectedRoles.length === 0
|
||||
? "text-secondary"
|
||||
: "text-primary"
|
||||
}`}
|
||||
@ -287,16 +290,14 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
</span>
|
||||
)}
|
||||
|
||||
{/* Dropdown Menu */}
|
||||
<ul
|
||||
className="dropdown-menu p-2 text-capitalize "
|
||||
>
|
||||
<li key="all">
|
||||
{/* Dropdown Menu - Corrected: Removed duplicate ul block */}
|
||||
<ul className="dropdown-menu p-2 text-capitalize" style={{ maxHeight: "300px", overflowY: "auto" }}>
|
||||
<li> {/* Changed key="all" to a unique key if possible, or keep it if "all" is a unique identifier */}
|
||||
<div className="form-check dropdown-item py-0">
|
||||
<input
|
||||
className="form-check-input"
|
||||
type="checkbox"
|
||||
id="checkboxAllRoles"
|
||||
id="checkboxAllRoles" // Unique ID
|
||||
value="all"
|
||||
checked={selectedRoles.includes("all")}
|
||||
onChange={(e) => handleRoleChange(e, e.target.value)}
|
||||
@ -313,7 +314,7 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
<input
|
||||
className="form-check-input"
|
||||
type="checkbox"
|
||||
id={`checkboxRole-${role.id}`}
|
||||
id={`checkboxRole-${role.id}`} // Unique ID
|
||||
value={role.id}
|
||||
checked={selectedRoles.includes(String(role.id))}
|
||||
onChange={(e) => handleRoleChange(e, e.target.value)}
|
||||
@ -326,60 +327,13 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
<ul
|
||||
className="dropdown-menu p-2 text-capitalize"
|
||||
style={{ maxHeight: "300px", overflowY: "auto" }}
|
||||
>
|
||||
<li key="all">
|
||||
<div className="form-check dropdown-item py-0">
|
||||
<input
|
||||
className="form-check-input"
|
||||
type="checkbox"
|
||||
id="checkboxAllRoles"
|
||||
value="all"
|
||||
checked={selectedRoles.includes("all")}
|
||||
onChange={(e) =>
|
||||
handleRoleChange(e, e.target.value)
|
||||
}
|
||||
/>
|
||||
<label
|
||||
className="form-check-label ms-2"
|
||||
htmlFor="checkboxAllRoles"
|
||||
>
|
||||
All Roles
|
||||
</label>
|
||||
</div>
|
||||
</li>
|
||||
{jobRolesForDropdown?.map((role) => (
|
||||
<li key={role.id}>
|
||||
<div className="form-check dropdown-item py-0">
|
||||
<input
|
||||
className="form-check-input"
|
||||
type="checkbox"
|
||||
id={`checkboxRole-${role.id}`}
|
||||
value={role.id}
|
||||
checked={selectedRoles.includes(String(role.id))}
|
||||
onChange={(e) =>
|
||||
handleRoleChange(e, e.target.value)
|
||||
}
|
||||
/>
|
||||
<label
|
||||
className="form-check-label ms-2"
|
||||
htmlFor={`checkboxRole-${role.id}`}
|
||||
>
|
||||
{role.name}
|
||||
</label>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<input
|
||||
type="text"
|
||||
className="form-control form-control-sm ms-auto mb-2 mt-2"
|
||||
placeholder="Search employees or roles..."
|
||||
value={searchTerm}
|
||||
onChange={handleSearchChange}
|
||||
style={{ maxWidth: '200px' }}
|
||||
style={{ maxWidth: "200px" }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -415,7 +369,7 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
{...field}
|
||||
className="form-check-input me-1 mt-1"
|
||||
type="checkbox"
|
||||
id={`employee-${emp?.id}`}
|
||||
id={`employee-${emp?.id}`} // Unique ID
|
||||
value={emp.id}
|
||||
checked={field.value?.includes(emp.id)}
|
||||
onChange={(e) => {
|
||||
@ -475,10 +429,11 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
className="badge rounded-pill bg-label-primary d-inline-flex align-items-center me-1 mb-1"
|
||||
>
|
||||
{emp.firstName} {emp.lastName}
|
||||
<p
|
||||
{/* Changed p tag to button for semantic correctness and accessibility */}
|
||||
<button
|
||||
type="button"
|
||||
className=" btn-close-white p-0 m-0"
|
||||
aria-label="Close"
|
||||
className="btn-close btn-close-white ms-1" // Added ms-1 for spacing, removed p-0 m-0
|
||||
aria-label="Remove employee" // More descriptive aria-label
|
||||
onClick={() => {
|
||||
const updatedSelected = watch(
|
||||
"selectedEmployees"
|
||||
@ -490,8 +445,8 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
trigger("selectedEmployees");
|
||||
}}
|
||||
>
|
||||
<i className="icon-base bx bx-x icon-md "></i>
|
||||
</p>
|
||||
<i className="icon-base bx bx-x icon-md"></i>
|
||||
</button>
|
||||
</span>
|
||||
)
|
||||
);
|
||||
@ -511,12 +466,12 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
<div className="form-check form-check-inline mt-3 px-1">
|
||||
<label
|
||||
className="form-text text-dark align-items-center d-flex"
|
||||
htmlFor="inlineCheckbox1"
|
||||
htmlFor="inlineCheckbox1" // This htmlFor isn't linked to a checkbox in this context
|
||||
>
|
||||
Pending Task of Activity :
|
||||
<label
|
||||
className="form-check-label fs-7 ms-4"
|
||||
htmlFor="inlineCheckbox1"
|
||||
htmlFor="inlineCheckbox1" // This htmlFor isn't linked to a checkbox in this context
|
||||
>
|
||||
<strong>
|
||||
{assignData?.workItem?.plannedWork -
|
||||
@ -563,7 +518,7 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
<div className="form-check form-check-inline mt-2 px-1 mb-2 text-start">
|
||||
<label
|
||||
className="text-dark text-start d-flex align-items-center flex-wrap form-text"
|
||||
htmlFor="inlineCheckbox1"
|
||||
htmlFor="targetForTodayInput" // Added a unique htmlFor for clarity
|
||||
>
|
||||
<span>Target for Today</span>
|
||||
<span style={{ marginLeft: "46px" }}>:</span>
|
||||
@ -582,14 +537,17 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
type="text"
|
||||
className="form-control form-control-sm"
|
||||
{...field}
|
||||
id="defaultFormControlInput"
|
||||
id="defaultFormControlInput" // Consider a more descriptive ID if used elsewhere
|
||||
aria-describedby="defaultFormControlHelp"
|
||||
/>
|
||||
<span style={{ paddingLeft: "6px", whiteSpace: "nowrap" }}>
|
||||
<u> {
|
||||
<u>
|
||||
{" "}
|
||||
{
|
||||
assignData?.workItem?.activityMaster
|
||||
?.unitOfMeasurement
|
||||
}</u>
|
||||
}
|
||||
</u>
|
||||
</span>
|
||||
<div
|
||||
style={{
|
||||
@ -645,7 +603,7 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
</div>
|
||||
|
||||
<label
|
||||
className="form-text fs-7 m-1 text-lg text-dark"
|
||||
className="form-text fs-7 m-1 text-dark" // Removed duplicate htmlFor and text-lg
|
||||
htmlFor="descriptionTextarea"
|
||||
>
|
||||
Description
|
||||
@ -657,7 +615,7 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
<textarea
|
||||
{...field}
|
||||
className="form-control"
|
||||
id="descriptionTextarea"
|
||||
id="descriptionTextarea" // Unique ID
|
||||
rows="2"
|
||||
/>
|
||||
)}
|
||||
@ -689,8 +647,7 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
</div> );
|
||||
};
|
||||
|
||||
export default AssignTask;
|
||||
Loading…
x
Reference in New Issue
Block a user