diff --git a/src/components/Project/Infrastructure/WorkItem.jsx b/src/components/Project/Infrastructure/WorkItem.jsx
index 241f5e33..43e41729 100644
--- a/src/components/Project/Infrastructure/WorkItem.jsx
+++ b/src/components/Project/Infrastructure/WorkItem.jsx
@@ -32,8 +32,8 @@ const WorkItem = ({
forWorkArea,
deleteHandleTask,
}) => {
- const projectId = useSelector((store)=>store.localVariables.projectId)
-const isTaskPlanning = /^\/activities\/task$/.test(location.pathname);
+ const projectId = useSelector((store) => store.localVariables.projectId);
+ const isTaskPlanning = /^\/activities\/task$/.test(location.pathname);
const [itemName, setItemName] = useState("");
const [NewWorkItem, setNewWorkItem] = useState();
@@ -135,25 +135,15 @@ const isTaskPlanning = /^\/activities\/task$/.test(location.pathname);
)}
{showModal2 && (
-
@@ -240,9 +230,7 @@ const isTaskPlanning = /^\/activities\/task$/.test(location.pathname);
{(ManageInfra ||
- (
- ManageAndAssignTak &&
- PlannedWork !== CompletedWork)) && (
+ (ManageAndAssignTak && PlannedWork !== CompletedWork)) && (
{/* Desktop (md and up): inline icons */}
diff --git a/src/components/Project/Teams.jsx b/src/components/Project/Teams.jsx
index cb725e30..49d4e0fd 100644
--- a/src/components/Project/Teams.jsx
+++ b/src/components/Project/Teams.jsx
@@ -249,26 +249,15 @@ const Teams = () => {
{IsDeleteModal && (
-
-
-
+ removeAllocation(deleteEmployee)}
+ onClose={closeDeleteModal}
+ loading={isPending}
+ />
)}
diff --git a/src/components/common/TagInput.jsx b/src/components/common/TagInput.jsx
index b31a7456..c1830d10 100644
--- a/src/components/common/TagInput.jsx
+++ b/src/components/common/TagInput.jsx
@@ -3,13 +3,15 @@ import { useFormContext } from "react-hook-form";
const TagInput = ({ label, name, placeholder, color = "#e9ecef", options = [] }) => {
const { setValue, watch } = useFormContext();
- const tags = watch(name) || [];
+ const tags = watch(name) || [];
const [input, setInput] = useState("");
const [suggestions, setSuggestions] = useState([]);
const handleAdd = (newTag) => {
- if (!tags.some((t) => t.name === newTag)) {
- setValue(name, [...tags, { name: newTag, isActive: true }], { shouldValidate: true });
+ const tagObj = typeof newTag === "string" ? { name: newTag, isActive: true } : newTag;
+
+ if (!tags.some((t) => t.name === tagObj.name)) {
+ setValue(name, [...tags, tagObj], { shouldValidate: true });
}
};
@@ -30,26 +32,32 @@ const TagInput = ({ label, name, placeholder, color = "#e9ecef", options = [] })
}
};
- const handleChange = (e) => {
- const val = e.target.value;
- setInput(val);
- if (val) {
- setSuggestions(
- options
- .filter(
- (opt) =>
- opt.toLowerCase().includes(val.toLowerCase()) &&
- !tags.some((t) => t.name === opt)
- )
- .map((s) => ({ name: s, isActive: true }))
- );
- } else {
- setSuggestions([]);
- }
- };
+const handleChange = (e) => {
+ const val = e.target.value;
+ setInput(val);
+
+ if (val) {
+ setSuggestions(
+ options
+ .filter((opt) => {
+ const label = typeof opt === "string" ? opt : opt.name;
+ return (
+ label.toLowerCase().includes(val.toLowerCase()) &&
+ !tags.some((t) => t.name === label)
+ );
+ })
+ .map((opt) => ({
+ name: typeof opt === "string" ? opt : opt.name,
+ isActive: true,
+ }))
+ );
+ } else {
+ setSuggestions([]);
+ }
+};
const handleSuggestionClick = (sugg) => {
- handleAdd(sugg.name);
+ handleAdd(sugg);
setInput("");
setSuggestions([]);
};
@@ -60,7 +68,10 @@ const TagInput = ({ label, name, placeholder, color = "#e9ecef", options = [] })
{label}
-
+
{tags.map((tag, index) => (
{
)}
{deleteContact && (
-
- setDeleteContact(null)}
- loading={IsDeleting}
- />
-
+ setDeleteContact(null)}
+ loading={IsDeleting}
+ />
)}
{openBucketModal && (
@@ -383,12 +373,14 @@ const Directory = ({ IsPage = true, prefernceContacts }) => {
{/* Empty state AFTER list */}
{!loading && contacts?.length === 0 && (
- No contact found
+ No contact found
)}
{!loading &&
contacts?.length > 0 &&
currentItems.length === 0 && (
- No matching contact found
+
+ No matching contact found
+
)}
@@ -419,11 +411,9 @@ const Directory = ({ IsPage = true, prefernceContacts }) => {
{!loading && contacts?.length === 0 && (
No contact found
)}
- {!loading &&
- contacts?.length > 0 &&
- currentItems.length === 0 && (
- No matching contact found
- )}
+ {!loading && contacts?.length > 0 && currentItems.length === 0 && (
+ No matching contact found
+ )}
)}
@@ -446,7 +436,9 @@ const Directory = ({ IsPage = true, prefernceContacts }) => {
currentItems.length > ITEMS_PER_PAGE && (
|