sorted all dropdown list
This commit is contained in:
parent
6daf3f8a35
commit
6496fd7eb2
@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import {getCachedData} from "../../../slices/apiDataManager";
|
||||
import { getCachedData } from "../../../slices/apiDataManager";
|
||||
import showToast from "../../../services/toastService";
|
||||
|
||||
// Zod validation schema
|
||||
@ -25,13 +25,11 @@ const FloorModel = ({
|
||||
onSubmit,
|
||||
clearTrigger,
|
||||
onClearComplete,
|
||||
} ) =>
|
||||
{
|
||||
|
||||
}) => {
|
||||
const [formData, setFormData] = useState(defaultModel);
|
||||
const [ selectedBuilding, setSelectedBuilding ] = useState( {} );
|
||||
const [selectedBuilding, setSelectedBuilding] = useState({});
|
||||
const [buildings, setBuildings] = useState(project?.buildings || []);
|
||||
|
||||
|
||||
// Initialize the form with React Hook Form
|
||||
const {
|
||||
register,
|
||||
@ -45,14 +43,12 @@ const FloorModel = ({
|
||||
defaultValues: defaultModel,
|
||||
});
|
||||
|
||||
useEffect( () =>
|
||||
{
|
||||
|
||||
useEffect(() => {
|
||||
if (clearTrigger) {
|
||||
reset(defaultModel);
|
||||
onClearComplete();
|
||||
}
|
||||
}, [clearTrigger, onClearComplete, reset,]);
|
||||
}, [clearTrigger, onClearComplete, reset]);
|
||||
|
||||
// Handle building selection change
|
||||
const handleBuildigChange = (e) => {
|
||||
@ -64,7 +60,6 @@ const FloorModel = ({
|
||||
id: "",
|
||||
floorName: "",
|
||||
buildingId: building.id,
|
||||
|
||||
});
|
||||
setValue("buildingId", building.id); // Set value for validation
|
||||
setValue("id", "0"); // Reset floorId when changing building
|
||||
@ -74,13 +69,10 @@ const FloorModel = ({
|
||||
id: "",
|
||||
floorName: "",
|
||||
buildingId: "0",
|
||||
|
||||
});
|
||||
setValue("buildingId", "0");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Handle floor selection change
|
||||
const handleFloorChange = (e) => {
|
||||
@ -91,15 +83,13 @@ const FloorModel = ({
|
||||
id: floor.id,
|
||||
floorName: floor.floorName,
|
||||
buildingId: selectedBuilding.id,
|
||||
|
||||
});
|
||||
setValue("floorName", floor.floorName);
|
||||
setValue("floorName", floor.floorName);
|
||||
} else {
|
||||
setFormData({
|
||||
id: "0",
|
||||
floorName: "",
|
||||
buildingId: selectedBuilding.id,
|
||||
|
||||
});
|
||||
setValue("floorName", "");
|
||||
}
|
||||
@ -107,36 +97,32 @@ const FloorModel = ({
|
||||
|
||||
// Handle form submission
|
||||
const onFormSubmit = (data) => {
|
||||
onSubmit( data );
|
||||
reset(
|
||||
{
|
||||
floorName: ""
|
||||
} )
|
||||
if ( data.id !== "0" )
|
||||
{
|
||||
showToast( "Floor updated successfully.", "success" );
|
||||
} else
|
||||
{
|
||||
showToast( "Floor created successfully.", "success" );
|
||||
}
|
||||
|
||||
onSubmit(data);
|
||||
reset({
|
||||
floorName: "",
|
||||
});
|
||||
if (data.id !== "0") {
|
||||
showToast("Floor updated successfully.", "success");
|
||||
} else {
|
||||
showToast("Floor created successfully.", "success");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="modal-dialog modal-lg modal-simple modal-edit-user">
|
||||
<div className="modal-content">
|
||||
<div className="modal-body">
|
||||
<div className="row">
|
||||
<button type="button" className="btn-close" aria-label="Close" onClick={onClose}/>
|
||||
<button
|
||||
type="button"
|
||||
className="btn-close"
|
||||
aria-label="Close"
|
||||
onClick={onClose}
|
||||
/>
|
||||
<div className="text-center mb-1">
|
||||
<h5 className="mb-1">Manage Floors - {project.name}</h5>
|
||||
</div>
|
||||
<form
|
||||
className="row g-2"
|
||||
onSubmit={handleSubmit(onFormSubmit)}
|
||||
>
|
||||
<form className="row g-2" onSubmit={handleSubmit(onFormSubmit)}>
|
||||
<div className="col-12 col-md-12">
|
||||
<label className="form-label" htmlFor="buildingId">
|
||||
Select Building
|
||||
@ -150,12 +136,15 @@ const FloorModel = ({
|
||||
>
|
||||
<option value="0">Select Building</option>
|
||||
{buildings &&
|
||||
buildings?.length > 0 &&
|
||||
buildings.map((building) => (
|
||||
<option key={building.id} value={building.id}>
|
||||
{building.name}
|
||||
</option>
|
||||
))}
|
||||
buildings?.length > 0 &&
|
||||
buildings
|
||||
?.slice()
|
||||
?.sort((a, b) => a.name.localeCompare(b.name))
|
||||
?.map((building) => (
|
||||
<option key={building.id} value={building.id}>
|
||||
{building.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{errors.buildingId && (
|
||||
<p className="text-danger">{errors.buildingId.message}</p>
|
||||
@ -164,9 +153,7 @@ const FloorModel = ({
|
||||
|
||||
{formData.buildingId !== "0" && (
|
||||
<div className="col-12 col-md-12">
|
||||
<label className="form-label" >
|
||||
Select Floor
|
||||
</label>
|
||||
<label className="form-label">Select Floor</label>
|
||||
<select
|
||||
id="id"
|
||||
className="select2 form-select form-select-sm"
|
||||
@ -180,14 +167,16 @@ const FloorModel = ({
|
||||
{floor.floorName}
|
||||
</option>
|
||||
) )} */}
|
||||
|
||||
|
||||
{selectedBuilding &&
|
||||
selectedBuilding?.floors.length > 0 &&
|
||||
selectedBuilding?.floors.map((floor) => (
|
||||
<option key={floor.id} value={floor.id}>
|
||||
{floor.floorName}
|
||||
</option>
|
||||
))}
|
||||
selectedBuilding.floors.length > 0 &&
|
||||
[...selectedBuilding.floors]
|
||||
?.sort((a, b) => a.floorName.localeCompare(b.floorName))
|
||||
?.map((floor) => (
|
||||
<option key={floor.id} value={floor.id}>
|
||||
{floor.floorName}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{errors.id && (
|
||||
<p className="text-danger">{errors.id.message}</p>
|
||||
|
@ -162,11 +162,14 @@ const TaskModel = ({
|
||||
onChange={handleBuildingChange}
|
||||
>
|
||||
<option value="0">Select Building</option>
|
||||
{project.buildings.map((building) => (
|
||||
<option key={building.id} value={building.id}>
|
||||
{building.name}
|
||||
</option>
|
||||
))}
|
||||
{project.buildings
|
||||
?.slice()
|
||||
?.sort((a, b) => a.name.localeCompare(b.name))
|
||||
?.map((building) => (
|
||||
<option key={building.id} value={building.id}>
|
||||
{building.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{errors.buildingID && (
|
||||
<p className="danger-text">{errors.buildingID.message}</p>
|
||||
@ -186,12 +189,15 @@ const TaskModel = ({
|
||||
onChange={handleFloorChange}
|
||||
>
|
||||
<option value="0">Select Floor</option>
|
||||
{selectedBuilding.floors.map((floor) => (
|
||||
<option key={floor.id} value={floor.id}>
|
||||
{floor.floorName} - ({floor.workAreas.length} Work
|
||||
Areas)
|
||||
</option>
|
||||
))}
|
||||
{selectedBuilding.floors
|
||||
?.slice()
|
||||
?.sort((a, b) => a.floorName.localeCompare(b.floorName))
|
||||
?.map((floor) => (
|
||||
<option key={floor.id} value={floor.id}>
|
||||
{floor.floorName} - ({floor.workAreas.length} Work
|
||||
Areas)
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{errors.floorId && (
|
||||
<p className="danger-text">{errors.floorId.message}</p>
|
||||
@ -212,11 +218,14 @@ const TaskModel = ({
|
||||
onChange={handleWorkAreaChange}
|
||||
>
|
||||
<option value="0">Select Work Area</option>
|
||||
{selectedFloor.workAreas.map((workArea) => (
|
||||
<option key={workArea.id} value={workArea.id}>
|
||||
{workArea.areaName}
|
||||
</option>
|
||||
))}
|
||||
{selectedFloor.workAreas
|
||||
?.slice()
|
||||
?.sort((a, b) => a.areaName.localeCompare(b.areaName))
|
||||
?.map((workArea) => (
|
||||
<option key={workArea.id} value={workArea.id}>
|
||||
{workArea.areaName}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{errors.workAreaId && (
|
||||
<p className="danger-text">{errors.workAreaId.message}</p>
|
||||
@ -237,10 +246,11 @@ const TaskModel = ({
|
||||
onChange={handleActivityChange}
|
||||
>
|
||||
<option value="0">Select Activity</option>
|
||||
{activities?.slice()
|
||||
.sort((a, b) =>
|
||||
{activities
|
||||
?.slice()
|
||||
?.sort((a, b) =>
|
||||
a.activityName.localeCompare(b.activityName)
|
||||
)
|
||||
)
|
||||
?.map((activity) => (
|
||||
<option key={activity.id} value={activity.id}>
|
||||
{activity.activityName}
|
||||
|
@ -5,12 +5,15 @@ import { z } from "zod";
|
||||
import showToast from "../../../services/toastService";
|
||||
|
||||
// Zod schema for form validation
|
||||
const workAreaSchema = z.object( {
|
||||
id:z.string().nonempty("Floor is required"),
|
||||
|
||||
const workAreaSchema = z.object({
|
||||
id: z.string().nonempty("Floor is required"),
|
||||
|
||||
buildingId: z.string().nonempty("Building is required"),
|
||||
floorId: z.string().nonempty("Floor is required"),
|
||||
areaName: z.string().nonempty( "Work Area Name is required" ).min( 3, "Name must be at least 3 characters long" ),
|
||||
areaName: z
|
||||
.string()
|
||||
.nonempty("Work Area Name is required")
|
||||
.min(3, "Name must be at least 3 characters long"),
|
||||
});
|
||||
|
||||
// Default form data
|
||||
@ -20,17 +23,30 @@ const defaultModel = {
|
||||
floorId: "0",
|
||||
};
|
||||
|
||||
const WorkAreaModel = ({ project, onSubmit, clearTrigger, onClearComplete, onClose }) => {
|
||||
const WorkAreaModel = ({
|
||||
project,
|
||||
onSubmit,
|
||||
clearTrigger,
|
||||
onClearComplete,
|
||||
onClose,
|
||||
}) => {
|
||||
const [selectedBuilding, setSelectedBuilding] = useState(null);
|
||||
const [ selectedFloor, setSelectedFloor ] = useState( null );
|
||||
const [selectdWorkArea,setWorkArea] = useState()
|
||||
const [selectedFloor, setSelectedFloor] = useState(null);
|
||||
const [selectdWorkArea, setWorkArea] = useState();
|
||||
|
||||
const { register, handleSubmit, formState: { errors }, setValue, reset, watch } = useForm({
|
||||
const {
|
||||
register,
|
||||
handleSubmit,
|
||||
formState: { errors },
|
||||
setValue,
|
||||
reset,
|
||||
watch,
|
||||
} = useForm({
|
||||
resolver: zodResolver(workAreaSchema), // Use Zod resolver for validation
|
||||
defaultValues: defaultModel,
|
||||
});
|
||||
|
||||
const floorId = watch( "floorId" ); // Watch the floorId for conditional rendering
|
||||
const floorId = watch("floorId"); // Watch the floorId for conditional rendering
|
||||
|
||||
useEffect(() => {
|
||||
if (clearTrigger) {
|
||||
@ -41,25 +57,22 @@ const WorkAreaModel = ({ project, onSubmit, clearTrigger, onClearComplete, onClo
|
||||
}
|
||||
}, [clearTrigger, onClearComplete, reset]);
|
||||
|
||||
const handleWorkAreaChange = ( e ) =>
|
||||
{
|
||||
|
||||
|
||||
const handleWorkAreaChange = (e) => {
|
||||
const { value } = e.target;
|
||||
|
||||
if (value === "0") {
|
||||
setValue("id", "0"); // Create New Work Area
|
||||
setValue( "areaName", "" );
|
||||
|
||||
setWorkArea(String(0))
|
||||
} else {
|
||||
const workArea = selectedFloor?.workAreas.find((b) => b.id === Number(value));
|
||||
if ( workArea )
|
||||
{
|
||||
setValue("id", String(workArea.id)); // Set id as a string
|
||||
setValue("areaName", workArea.areaName);
|
||||
setWorkArea(String(workArea.id))
|
||||
setValue("id", "0"); // Create New Work Area
|
||||
setValue("areaName", "");
|
||||
|
||||
setWorkArea(String(0));
|
||||
} else {
|
||||
const workArea = selectedFloor?.workAreas.find(
|
||||
(b) => b.id === Number(value)
|
||||
);
|
||||
if (workArea) {
|
||||
setValue("id", String(workArea.id)); // Set id as a string
|
||||
setValue("areaName", workArea.areaName);
|
||||
setWorkArea(String(workArea.id));
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -70,8 +83,8 @@ const WorkAreaModel = ({ project, onSubmit, clearTrigger, onClearComplete, onClo
|
||||
|
||||
if (floor) {
|
||||
setSelectedFloor(floor);
|
||||
setValue("floorId", floor.id); // Update floorId
|
||||
setValue("id", "0"); // Reset Work Area ID for new area creation
|
||||
setValue("floorId", floor.id); // Update floorId
|
||||
setValue("id", "0"); // Reset Work Area ID for new area creation
|
||||
setValue("areaName", ""); // Reset Work Area Name when changing floor
|
||||
} else {
|
||||
setSelectedFloor(null);
|
||||
@ -89,37 +102,31 @@ const WorkAreaModel = ({ project, onSubmit, clearTrigger, onClearComplete, onClo
|
||||
reset(defaultModel); // Reset the form when a new building is selected
|
||||
};
|
||||
|
||||
const onSubmitForm = ( data ) =>
|
||||
{
|
||||
|
||||
const onSubmitForm = (data) => {
|
||||
let WorkArea = {
|
||||
id: data.id,
|
||||
areaName: data.areaName,
|
||||
floorId: data.floorId,
|
||||
buildingId:data.buildingId
|
||||
buildingId: data.buildingId,
|
||||
};
|
||||
onSubmit(WorkArea);
|
||||
|
||||
reset({
|
||||
id: "0",
|
||||
areaName: "",
|
||||
});
|
||||
if (data.id !== "0") {
|
||||
showToast("WorkArea updated successfully.", "success");
|
||||
} else {
|
||||
showToast("WorkArea created successfully.", "success");
|
||||
}
|
||||
onSubmit( WorkArea );
|
||||
|
||||
reset( {
|
||||
id:"0",
|
||||
areaName:""
|
||||
} );
|
||||
if ( data.id !== "0" )
|
||||
{
|
||||
showToast( "WorkArea updated successfully.", "success" );
|
||||
} else
|
||||
{
|
||||
showToast( "WorkArea created successfully.", "success" );
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
reset(defaultModel);
|
||||
reset(defaultModel);
|
||||
setSelectedFloor(null);
|
||||
setSelectedBuilding( null );
|
||||
onClose()
|
||||
setSelectedBuilding(null);
|
||||
onClose();
|
||||
};
|
||||
|
||||
return (
|
||||
@ -127,14 +134,21 @@ const WorkAreaModel = ({ project, onSubmit, clearTrigger, onClearComplete, onClo
|
||||
<div className="modal-content">
|
||||
<div className="modal-body">
|
||||
<div className="row">
|
||||
<button type="button" className="btn-close" aria-label="Close" onClick={onClose}/>
|
||||
<button
|
||||
type="button"
|
||||
className="btn-close"
|
||||
aria-label="Close"
|
||||
onClick={onClose}
|
||||
/>
|
||||
<div className="text-center mb-1">
|
||||
<h5 className="mb-1">Manage Work Area</h5>
|
||||
</div>
|
||||
<form className="row g-2" onSubmit={handleSubmit(onSubmitForm)}>
|
||||
{/* Building Selection */}
|
||||
<div className="col-6 col-md-6">
|
||||
<label className="form-label" htmlFor="buildingId">Select Building</label>
|
||||
<label className="form-label" htmlFor="buildingId">
|
||||
Select Building
|
||||
</label>
|
||||
<select
|
||||
id="buildingId"
|
||||
name="buildingId"
|
||||
@ -143,11 +157,14 @@ const WorkAreaModel = ({ project, onSubmit, clearTrigger, onClearComplete, onClo
|
||||
onChange={handleBuildingChange}
|
||||
>
|
||||
<option value="0">Select Building</option>
|
||||
{project?.buildings?.map((building) => (
|
||||
<option key={building.id} value={building.id}>
|
||||
{building.name}
|
||||
</option>
|
||||
))}
|
||||
{project?.buildings
|
||||
?.slice()
|
||||
.sort((a, b) => a.name.localeCompare(b.name))
|
||||
.map((building) => (
|
||||
<option key={building.id} value={building.id}>
|
||||
{building.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{errors.buildingId && <span>{errors.buildingId.message}</span>}
|
||||
</div>
|
||||
@ -155,7 +172,9 @@ const WorkAreaModel = ({ project, onSubmit, clearTrigger, onClearComplete, onClo
|
||||
{/* Floor Selection */}
|
||||
{selectedBuilding && selectedBuilding.buildingId !== "0" && (
|
||||
<div className="col-6 col-md-6">
|
||||
<label className="form-label" htmlFor="floorId">Select Floor</label>
|
||||
<label className="form-label" htmlFor="floorId">
|
||||
Select Floor
|
||||
</label>
|
||||
<select
|
||||
id="floorId"
|
||||
name="floorId"
|
||||
@ -164,11 +183,14 @@ const WorkAreaModel = ({ project, onSubmit, clearTrigger, onClearComplete, onClo
|
||||
onChange={handleFloorChange}
|
||||
>
|
||||
<option value="0">Select Floor</option>
|
||||
{selectedBuilding.floors.map((floor) => (
|
||||
<option key={floor.id} value={floor.id}>
|
||||
{floor.floorName}
|
||||
</option>
|
||||
))}
|
||||
{selectedBuilding.floors
|
||||
?.slice()
|
||||
.sort((a, b) => a.floorName.localeCompare(b.floorName))
|
||||
.map((floor) => (
|
||||
<option key={floor.id} value={floor.id}>
|
||||
{floor.floorName}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{errors.floorId && <span>{errors.floorId.message}</span>}
|
||||
</div>
|
||||
@ -178,14 +200,13 @@ const WorkAreaModel = ({ project, onSubmit, clearTrigger, onClearComplete, onClo
|
||||
{floorId !== "0" && (
|
||||
<>
|
||||
<div className="col-12 col-md-12">
|
||||
<label className="form-label" >Select Work Area</label>
|
||||
<label className="form-label">Select Work Area</label>
|
||||
<select
|
||||
id="workAreaId"
|
||||
name="workAreaId"
|
||||
className="select2 form-select form-select-sm"
|
||||
{...register("id")}
|
||||
onChange={handleWorkAreaChange}
|
||||
|
||||
>
|
||||
<option value="0">Create New Work Area</option>
|
||||
{selectedFloor?.workAreas?.map((workArea) => (
|
||||
@ -200,7 +221,9 @@ const WorkAreaModel = ({ project, onSubmit, clearTrigger, onClearComplete, onClo
|
||||
{/* Work Area Name Input */}
|
||||
<div className="col-12 col-md-12">
|
||||
<label className="form-label" htmlFor="areaName">
|
||||
{watch("id") === "0" ? "Enter Work Area Name" : "Modify Work Area Name"}
|
||||
{watch("id") === "0"
|
||||
? "Enter Work Area Name"
|
||||
: "Modify Work Area Name"}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
@ -210,15 +233,28 @@ const WorkAreaModel = ({ project, onSubmit, clearTrigger, onClearComplete, onClo
|
||||
placeholder="Work Area"
|
||||
{...register("areaName")}
|
||||
/>
|
||||
{errors.areaName && <span className="danger-text">{errors.areaName.message}</span>}
|
||||
{errors.areaName && (
|
||||
<span className="danger-text">
|
||||
{errors.areaName.message}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Submit and Cancel Buttons */}
|
||||
<div className="col-12 text-center">
|
||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
||||
<button
|
||||
type="submit"
|
||||
className="btn btn-sm btn-primary me-3"
|
||||
>
|
||||
{watch("id") === "0" ? "Add Work Area" : "Edit Work Area"}
|
||||
</button>
|
||||
<button type="button" className="btn btn-sm btn-label-secondary" onClick={handleCancel} data-bs-dismiss="modal" aria-label="Close">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-sm btn-label-secondary"
|
||||
onClick={handleCancel}
|
||||
data-bs-dismiss="modal"
|
||||
aria-label="Close"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
|
@ -8,6 +8,7 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
||||
const [itemName, setItemName] = useState("");
|
||||
const [NewWorkItem, setNewWorkItem] = useState();
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
|
||||
const openModal = () => setIsModalOpen(true);
|
||||
const closeModal = () => setIsModalOpen(false);
|
||||
@ -38,6 +39,8 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
||||
tooltipTriggerList.forEach((el) => new bootstrap.Tooltip(el));
|
||||
}, []);
|
||||
|
||||
const showModal1 = () => setShowModal(true);
|
||||
const closeModal1 = () => setShowModal(false);
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
@ -50,6 +53,33 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
||||
<AssignRoleModel assignData={assigndata} onClose={closeModal} />
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={`modal fade ${showModal ? "show" : ""}`}
|
||||
tabIndex="-1"
|
||||
role="dialog"
|
||||
style={{ display: showModal ? "block" : "none" }}
|
||||
aria-hidden={!showModal}
|
||||
>
|
||||
<div
|
||||
className="modal-dialog modal-lg modal-simple mx-sm-auto mx-1 edit-project-modal"
|
||||
role="document"
|
||||
>
|
||||
<div className="modal-content">
|
||||
<div className="modal-body p-sm-4 p-0">
|
||||
<button
|
||||
type="button"
|
||||
className="btn-close"
|
||||
onClick={closeModal1}
|
||||
aria-label="Close"
|
||||
></button>
|
||||
<div className="container my-1"></div>
|
||||
|
||||
<h6>Comming Soon</h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<tr>
|
||||
<td className="text-start table-cell-small">
|
||||
<i className="bx bx-right-arrow-alt"></i>
|
||||
@ -119,6 +149,7 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
||||
aria-label="Modify"
|
||||
type="button"
|
||||
className="btn p-0 dropdown-toggle hide-arrow"
|
||||
onClick={showModal1}
|
||||
>
|
||||
<i
|
||||
className="bx bxs-edit me-2 text-primary"
|
||||
@ -132,6 +163,7 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
||||
aria-label="Delete"
|
||||
type="button"
|
||||
className="btn p-0 dropdown-toggle hide-arrow"
|
||||
onClick={showModal1}
|
||||
>
|
||||
<i
|
||||
className="bx bx-trash me-1 text-danger"
|
||||
@ -154,11 +186,11 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => {
|
||||
|
||||
<div className="dropdown-menu dropdown-menu-end m-0">
|
||||
{" "}
|
||||
<a className="dropdown-item ">
|
||||
<a className="dropdown-item " onClick={showModal1}>
|
||||
{" "}
|
||||
<i className="bx bxs-edit me-2 text-primary"></i>Edit
|
||||
</a>
|
||||
<a className="dropdown-item">
|
||||
<a className="dropdown-item" onClick={showModal1}>
|
||||
{" "}
|
||||
<i className="bx bx-trash me-1 text-danger"></i>Delete
|
||||
</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user