addded imported field added
This commit is contained in:
parent
2531d91209
commit
9884943907
@ -138,7 +138,7 @@ const Attendance = ({ getRole, handleModalData, searchTerm, projectId, organizat
|
|||||||
<tr className="border-top-1">
|
<tr className="border-top-1">
|
||||||
<th colSpan={2}>Name</th>
|
<th colSpan={2}>Name</th>
|
||||||
<th>Role</th>
|
<th>Role</th>
|
||||||
<th>Organization</th>
|
{/* <th>Organization</th> */}
|
||||||
<th>
|
<th>
|
||||||
<i className="bx bxs-down-arrow-alt text-success"></i>
|
<i className="bx bxs-down-arrow-alt text-success"></i>
|
||||||
Check-In
|
Check-In
|
||||||
@ -187,7 +187,7 @@ const Attendance = ({ getRole, handleModalData, searchTerm, projectId, organizat
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>{item.jobRoleName}</td>
|
<td>{item.jobRoleName}</td>
|
||||||
<td>{item.organizationName || "--"}</td>
|
{/* <td>{item.organizationName || "--"}</td> */}
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
{item.checkInTime
|
{item.checkInTime
|
||||||
|
@ -84,56 +84,50 @@ const AttendanceLog = ({ handleModalData, searchTerm ,organizationId}) => {
|
|||||||
dateRange.endDate,
|
dateRange.endDate,
|
||||||
organizationId
|
organizationId
|
||||||
);
|
);
|
||||||
const filtering = (data) => {
|
const filtering = useCallback((dataToFilter) => {
|
||||||
const filteredData = showPending
|
const filteredData = showPending
|
||||||
? data.filter((item) => item.checkOutTime === null)
|
? dataToFilter.filter((item) => item.checkOutTime === null)
|
||||||
: data;
|
: dataToFilter;
|
||||||
|
|
||||||
const group1 = filteredData
|
const group1 = filteredData
|
||||||
.filter((d) => d.activity === 1 && isSameDay(d.checkInTime))
|
.filter((d) => d.activity === 1 && isSameDay(d.checkInTime))
|
||||||
.sort(sortByName);
|
.sort(sortByName);
|
||||||
const group2 = filteredData
|
const group2 = filteredData
|
||||||
.filter((d) => d.activity === 4 && isSameDay(d.checkOutTime))
|
.filter((d) => d.activity === 4 && isSameDay(d.checkOutTime))
|
||||||
.sort(sortByName);
|
.sort(sortByName);
|
||||||
const group3 = filteredData
|
const group3 = filteredData
|
||||||
.filter((d) => d.activity === 1 && isBeforeToday(d.checkInTime))
|
.filter((d) => d.activity === 1 && isBeforeToday(d.checkInTime))
|
||||||
.sort(sortByName);
|
.sort(sortByName);
|
||||||
const group4 = filteredData.filter(
|
const group4 = filteredData.filter(
|
||||||
(d) => d.activity === 4 && isBeforeToday(d.checkOutTime)
|
(d) => d.activity === 4 && isBeforeToday(d.checkOutTime)
|
||||||
);
|
);
|
||||||
const group5 = filteredData
|
const group5 = filteredData
|
||||||
.filter((d) => d.activity === 2 && isBeforeToday(d.checkOutTime))
|
.filter((d) => d.activity === 2 && isBeforeToday(d.checkOutTime))
|
||||||
.sort(sortByName);
|
.sort(sortByName);
|
||||||
const group6 = filteredData
|
const group6 = filteredData
|
||||||
.filter((d) => d.activity === 5)
|
.filter((d) => d.activity === 5)
|
||||||
.sort(sortByName);
|
.sort(sortByName);
|
||||||
|
|
||||||
const sortedList = [
|
const sortedList = [...group1, ...group2, ...group3, ...group4, ...group5, ...group6];
|
||||||
...group1,
|
|
||||||
...group2,
|
|
||||||
...group3,
|
|
||||||
...group4,
|
|
||||||
...group5,
|
|
||||||
...group6,
|
|
||||||
];
|
|
||||||
|
|
||||||
// Group by date
|
// Group by date
|
||||||
const groupedByDate = sortedList.reduce((acc, item) => {
|
const groupedByDate = sortedList.reduce((acc, item) => {
|
||||||
const date = (item.checkInTime || item.checkOutTime)?.split("T")[0];
|
const date = (item.checkInTime || item.checkOutTime)?.split("T")[0];
|
||||||
if (date) {
|
if (date) {
|
||||||
acc[date] = acc[date] || [];
|
acc[date] = acc[date] || [];
|
||||||
acc[date].push(item);
|
acc[date].push(item);
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
const sortedDates = Object.keys(groupedByDate).sort(
|
const sortedDates = Object.keys(groupedByDate).sort(
|
||||||
(a, b) => new Date(b) - new Date(a)
|
(a, b) => new Date(b) - new Date(a)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const finalData = sortedDates.flatMap((date) => groupedByDate[date]);
|
||||||
|
setProcessedData(finalData);
|
||||||
|
}, [showPending]);
|
||||||
|
|
||||||
const finalData = sortedDates.flatMap((date) => groupedByDate[date]);
|
|
||||||
setProcessedData(finalData);
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
filtering(data);
|
filtering(data);
|
||||||
@ -285,7 +279,7 @@ const AttendanceLog = ({ handleModalData, searchTerm ,organizationId}) => {
|
|||||||
Name
|
Name
|
||||||
</th>
|
</th>
|
||||||
<th className="border-top-1">Date</th>
|
<th className="border-top-1">Date</th>
|
||||||
<th>Organization</th>
|
{/* <th>Organization</th> */}
|
||||||
<th>
|
<th>
|
||||||
<i className="bx bxs-down-arrow-alt text-success"></i> Check-In
|
<i className="bx bxs-down-arrow-alt text-success"></i> Check-In
|
||||||
</th>
|
</th>
|
||||||
@ -344,7 +338,7 @@ const AttendanceLog = ({ handleModalData, searchTerm ,organizationId}) => {
|
|||||||
attendance.checkInTime || attendance.checkOutTime
|
attendance.checkInTime || attendance.checkOutTime
|
||||||
).format("DD-MMM-YYYY")}
|
).format("DD-MMM-YYYY")}
|
||||||
</td>
|
</td>
|
||||||
<td>{attendance.organizationName || "--"}</td>
|
{/* <td>{attendance.organizationName || "--"}</td> */}
|
||||||
<td>{convertShortTime(attendance.checkInTime)}</td>
|
<td>{convertShortTime(attendance.checkInTime)}</td>
|
||||||
<td>
|
<td>
|
||||||
{attendance.checkOutTime
|
{attendance.checkOutTime
|
||||||
|
@ -89,7 +89,7 @@ const CheckInCheckOut = ({ modeldata, closeModal, handleSubmitForm }) => {
|
|||||||
Id: modeldata?.id || null,
|
Id: modeldata?.id || null,
|
||||||
comment: data.description,
|
comment: data.description,
|
||||||
employeeID: modeldata.employeeId,
|
employeeID: modeldata.employeeId,
|
||||||
// projectId: projectId,
|
projectId: projectId,
|
||||||
date: new Date().toISOString(),
|
date: new Date().toISOString(),
|
||||||
markTime: data.markTime,
|
markTime: data.markTime,
|
||||||
latitude: coords.latitude.toString(),
|
latitude: coords.latitude.toString(),
|
||||||
|
@ -128,7 +128,7 @@ const Regularization = ({ handleRequest, searchTerm,projectId, organizationId, I
|
|||||||
<tr>
|
<tr>
|
||||||
<th colSpan={2}>Name</th>
|
<th colSpan={2}>Name</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>Organization</th>
|
{/* <th>Organization</th> */}
|
||||||
<th>
|
<th>
|
||||||
<i className="bx bxs-down-arrow-alt text-success"></i>Check-In
|
<i className="bx bxs-down-arrow-alt text-success"></i>Check-In
|
||||||
</th>
|
</th>
|
||||||
@ -158,7 +158,7 @@ const Regularization = ({ handleRequest, searchTerm,projectId, organizationId, I
|
|||||||
</td>
|
</td>
|
||||||
<td>{moment(att.checkOutTime).format("DD-MMM-YYYY")}</td>
|
<td>{moment(att.checkOutTime).format("DD-MMM-YYYY")}</td>
|
||||||
|
|
||||||
<td>{att.organizationName || "--"}</td>
|
{/* <td>{att.organizationName || "--"}</td> */}
|
||||||
|
|
||||||
<td>{convertShortTime(att.checkInTime)}</td>
|
<td>{convertShortTime(att.checkInTime)}</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -86,6 +86,8 @@ const ListViewContact = ({ data, Pagination, isLoading }) => {
|
|||||||
ActiveInActive({ contactId: contactId, contactStatus: !showActive });
|
ActiveInActive({ contactId: contactId, contactStatus: !showActive });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(isLoading) return <Loader/>
|
||||||
|
if(!data|| data.length === 0)return <div className="text-center py-12">No Contact Found</div>
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ConfirmModal
|
<ConfirmModal
|
||||||
@ -103,11 +105,7 @@ const ListViewContact = ({ data, Pagination, isLoading }) => {
|
|||||||
className="card-datatable table-responsive"
|
className="card-datatable table-responsive"
|
||||||
id="horizontal-example"
|
id="horizontal-example"
|
||||||
>
|
>
|
||||||
{isLoading && (
|
|
||||||
<div>
|
|
||||||
<Loader />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{data && (
|
{data && (
|
||||||
<div className="dataTables_wrapper no-footer mx-5 pb-2">
|
<div className="dataTables_wrapper no-footer mx-5 pb-2">
|
||||||
<table className="table dataTable text-nowrap">
|
<table className="table dataTable text-nowrap">
|
||||||
@ -124,7 +122,7 @@ const ListViewContact = ({ data, Pagination, isLoading }) => {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{Array.isArray(data) && data.length > 0 ? (
|
{Array.isArray(data) && data.length > 0 && (
|
||||||
data.map((row, i) => (
|
data.map((row, i) => (
|
||||||
<tr
|
<tr
|
||||||
key={i}
|
key={i}
|
||||||
@ -184,16 +182,7 @@ const ListViewContact = ({ data, Pagination, isLoading }) => {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))
|
))
|
||||||
) : (
|
) }
|
||||||
<tr style={{ height: "200px" }}>
|
|
||||||
<td
|
|
||||||
colSpan={contactList.length + 1}
|
|
||||||
className="text-center align-middle border-0"
|
|
||||||
>
|
|
||||||
No contacts found
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
)}
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{Pagination && (
|
{Pagination && (
|
||||||
|
@ -23,7 +23,7 @@ import Label from "../common/Label";
|
|||||||
const ManageContact = ({ contactId, closeModal }) => {
|
const ManageContact = ({ contactId, closeModal }) => {
|
||||||
// fetch master data
|
// fetch master data
|
||||||
const { buckets, loading: bucketsLoaging } = useBuckets();
|
const { buckets, loading: bucketsLoaging } = useBuckets();
|
||||||
const { data:projects, loading: projectLoading } = useProjects();
|
const { data: projects, loading: projectLoading } = useProjects();
|
||||||
const { contactCategory, loading: contactCategoryLoading } =
|
const { contactCategory, loading: contactCategoryLoading } =
|
||||||
useContactCategory();
|
useContactCategory();
|
||||||
const { organizationList } = useOrganization();
|
const { organizationList } = useOrganization();
|
||||||
@ -205,13 +205,14 @@ const ManageContact = ({ contactId, closeModal }) => {
|
|||||||
<Label htmlFor={"organization"} required>
|
<Label htmlFor={"organization"} required>
|
||||||
Organization
|
Organization
|
||||||
</Label>
|
</Label>
|
||||||
<InputSuggestions
|
<InputSuggestions
|
||||||
organizationList={organizationList}
|
organizationList={organizationList}
|
||||||
value={watch("organization") || ""}
|
value={watch("organization") || ""}
|
||||||
onChange={(val) => setValue("organization", val, { shouldValidate: true })}
|
onChange={(val) =>
|
||||||
error={errors.organization?.message}
|
setValue("organization", val, { shouldValidate: true })
|
||||||
/>
|
}
|
||||||
|
error={errors.organization?.message}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -394,6 +395,7 @@ const ManageContact = ({ contactId, closeModal }) => {
|
|||||||
labelKey="name"
|
labelKey="name"
|
||||||
valueKey="id"
|
valueKey="id"
|
||||||
IsLoading={projectLoading}
|
IsLoading={projectLoading}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
{errors.projectIds && (
|
{errors.projectIds && (
|
||||||
<small className="danger-text">{errors.projectIds.message}</small>
|
<small className="danger-text">{errors.projectIds.message}</small>
|
||||||
@ -408,6 +410,7 @@ const ManageContact = ({ contactId, closeModal }) => {
|
|||||||
label="Tags"
|
label="Tags"
|
||||||
options={contactTags}
|
options={contactTags}
|
||||||
isRequired={true}
|
isRequired={true}
|
||||||
|
require
|
||||||
/>
|
/>
|
||||||
{errors.tags && (
|
{errors.tags && (
|
||||||
<small className="danger-text">{errors.tags.message}</small>
|
<small className="danger-text">{errors.tags.message}</small>
|
||||||
@ -417,7 +420,7 @@ const ManageContact = ({ contactId, closeModal }) => {
|
|||||||
{/* Buckets */}
|
{/* Buckets */}
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-md-12 mt-1 text-start">
|
<div className="col-md-12 mt-1 text-start">
|
||||||
<label className="form-label ">Select Bucket</label>
|
<Label required>Select Bucket</Label>
|
||||||
<ul className="d-flex flex-wrap px-1 list-unstyled mb-0">
|
<ul className="d-flex flex-wrap px-1 list-unstyled mb-0">
|
||||||
{bucketsLoaging && <p>Loading...</p>}
|
{bucketsLoaging && <p>Loading...</p>}
|
||||||
{buckets?.map((item) => (
|
{buckets?.map((item) => (
|
||||||
@ -450,7 +453,7 @@ const ManageContact = ({ contactId, closeModal }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Address + Description */}
|
{/* Address + Description */}
|
||||||
<div className="col-12 text-start">
|
<div className="col-12 text-start mb-2">
|
||||||
<label className="form-label">Address</label>
|
<label className="form-label">Address</label>
|
||||||
<textarea
|
<textarea
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
@ -459,7 +462,7 @@ const ManageContact = ({ contactId, closeModal }) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12 text-start">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Description</label>
|
<Label required>Description</Label>
|
||||||
<textarea
|
<textarea
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
rows="2"
|
rows="2"
|
||||||
@ -479,10 +482,13 @@ const ManageContact = ({ contactId, closeModal }) => {
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button className="btn btn-sm btn-primary" type="submit" disabled={isPending}>
|
<button
|
||||||
|
className="btn btn-sm btn-primary"
|
||||||
|
type="submit"
|
||||||
|
disabled={isPending}
|
||||||
|
>
|
||||||
{isPending ? "Please Wait..." : "Submit"}
|
{isPending ? "Please Wait..." : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</FormProvider>
|
</FormProvider>
|
||||||
|
@ -8,12 +8,14 @@ import { orgSize, reference } from "../../utils/constants";
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { useGlobalServices } from "../../hooks/masterHook/useMaster";
|
import { useGlobalServices } from "../../hooks/masterHook/useMaster";
|
||||||
import SelectMultiple from "../common/SelectMultiple";
|
import SelectMultiple from "../common/SelectMultiple";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
||||||
const { data, isError, isLoading: industryLoading } = useIndustries();
|
const { data, isError, isLoading: industryLoading } = useIndustries();
|
||||||
const [logoPreview, setLogoPreview] = useState(null);
|
const [logoPreview, setLogoPreview] = useState(null);
|
||||||
const [logoName, setLogoName] = useState("");
|
const [logoName, setLogoName] = useState("");
|
||||||
const { data: services, isLoading: serviceLoading } = useGlobalServices();
|
const { data: services, isLoading: serviceLoading } = useGlobalServices();
|
||||||
|
const navigate = useNavigate()
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
control,
|
control,
|
||||||
@ -29,7 +31,8 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
|||||||
error,
|
error,
|
||||||
isPending,
|
isPending,
|
||||||
} = useCreateTenant(() => {
|
} = useCreateTenant(() => {
|
||||||
onNext()
|
// onNext()
|
||||||
|
navigate("/tenants");
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleNext = async () => {
|
const handleNext = async () => {
|
||||||
|
@ -4,21 +4,26 @@ import { createPortal } from "react-dom";
|
|||||||
import "./MultiSelectDropdown.css";
|
import "./MultiSelectDropdown.css";
|
||||||
import Label from "./Label";
|
import Label from "./Label";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const SelectMultiple = ({
|
const SelectMultiple = ({
|
||||||
name,
|
name,
|
||||||
options = [],
|
options = [],
|
||||||
label = "Select options",
|
label = "Select options",
|
||||||
labelKey = "name",
|
labelKey = "name",
|
||||||
valueKey = "id",
|
valueKey = "id",
|
||||||
placeholder = "Please select...",
|
placeholder = "Please select...",
|
||||||
IsLoading = false,required = false
|
IsLoading = false,
|
||||||
|
required = false,
|
||||||
}) => {
|
}) => {
|
||||||
const { setValue, watch,register } = useFormContext();
|
const { setValue, watch, register } = useFormContext();
|
||||||
useEffect(() => {
|
|
||||||
register(name, { value: [] });
|
|
||||||
}, [register, name]);
|
|
||||||
|
|
||||||
const selectedValues = watch(name) || [];
|
useEffect(() => {
|
||||||
|
register(name, { value: [] });
|
||||||
|
}, [register, name]);
|
||||||
|
|
||||||
|
const selectedValues = watch(name) || [];
|
||||||
|
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [searchText, setSearchText] = useState("");
|
const [searchText, setSearchText] = useState("");
|
||||||
@ -60,18 +65,20 @@ const selectedValues = watch(name) || [];
|
|||||||
const updated = selectedValues.includes(value)
|
const updated = selectedValues.includes(value)
|
||||||
? selectedValues.filter((v) => v !== value)
|
? selectedValues.filter((v) => v !== value)
|
||||||
: [...selectedValues, value];
|
: [...selectedValues, value];
|
||||||
|
|
||||||
setValue(name, updated, { shouldValidate: true });
|
setValue(name, updated, { shouldValidate: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
const filteredOptions = (options || []).filter((item) => {
|
const filteredOptions = (options || []).filter((item) => {
|
||||||
const label = getLabel(item);
|
const label = getLabel(item);
|
||||||
return (
|
return typeof label === "string" && label.toLowerCase().includes(searchText.toLowerCase());
|
||||||
typeof label === "string" &&
|
});
|
||||||
label.toLowerCase().includes(searchText.toLowerCase())
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
// Sort filtered options in ascending order
|
||||||
|
const sortedOptions = filteredOptions.sort((a, b) => {
|
||||||
|
const labelA = getLabel(a).toString().toLowerCase();
|
||||||
|
const labelB = getLabel(b).toString().toLowerCase();
|
||||||
|
return labelA.localeCompare(labelB);
|
||||||
|
});
|
||||||
|
|
||||||
const dropdownElement = (
|
const dropdownElement = (
|
||||||
<div
|
<div
|
||||||
@ -101,7 +108,7 @@ const selectedValues = watch(name) || [];
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{filteredOptions.map((item) => {
|
{sortedOptions.map((item) => {
|
||||||
const labelVal = getLabel(item);
|
const labelVal = getLabel(item);
|
||||||
const valueVal = item[valueKey];
|
const valueVal = item[valueKey];
|
||||||
const isChecked = selectedValues.includes(valueVal);
|
const isChecked = selectedValues.includes(valueVal);
|
||||||
@ -124,12 +131,12 @@ const selectedValues = watch(name) || [];
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
||||||
{!IsLoading && filteredOptions.length === 0 && (
|
{!IsLoading && sortedOptions.length === 0 && (
|
||||||
<div className="multi-select-dropdown-Not-found" style={{ padding: 8 }}>
|
<div className="multi-select-dropdown-Not-found" style={{ padding: 8 }}>
|
||||||
<label className="text-muted">Not Found {`'${searchText}'`}</label>
|
<label className="text-muted">Not Found {`'${searchText}'`}</label>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{IsLoading && filteredOptions.length === 0 && (
|
{IsLoading && sortedOptions.length === 0 && (
|
||||||
<div className="multi-select-dropdown-Not-found" style={{ padding: 8 }}>
|
<div className="multi-select-dropdown-Not-found" style={{ padding: 8 }}>
|
||||||
<label className="text-muted">Loading...</label>
|
<label className="text-muted">Loading...</label>
|
||||||
</div>
|
</div>
|
||||||
@ -140,19 +147,14 @@ const selectedValues = watch(name) || [];
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div ref={containerRef} className="multi-select-dropdown-container" style={{ position: "relative" }}>
|
<div ref={containerRef} className="multi-select-dropdown-container" style={{ position: "relative" }}>
|
||||||
<label className="form-label mb-1">{label}</label>
|
<Label required={required}>{label}</Label>
|
||||||
<Label className={name} required={required}></Label>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="multi-select-dropdown-header"
|
className="multi-select-dropdown-header"
|
||||||
onClick={() => setIsOpen((prev) => !prev)}
|
onClick={() => setIsOpen((prev) => !prev)}
|
||||||
style={{ cursor: "pointer" }}
|
style={{ cursor: "pointer" }}
|
||||||
>
|
>
|
||||||
<span
|
<span className={selectedValues.length > 0 ? "placeholder-style-selected" : "placeholder-style"}>
|
||||||
className={
|
|
||||||
selectedValues.length > 0 ? "placeholder-style-selected" : "placeholder-style"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div className="selected-badges-container">
|
<div className="selected-badges-container">
|
||||||
{selectedValues.length > 0 ? (
|
{selectedValues.length > 0 ? (
|
||||||
selectedValues.map((val) => {
|
selectedValues.map((val) => {
|
||||||
|
@ -2,7 +2,7 @@ import { useFormContext, useWatch } from "react-hook-form";
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import Label from "./Label";
|
import Label from "./Label";
|
||||||
|
|
||||||
const TagInput = ({ label, name, placeholder, color = "#e9ecef", options = [] }) => {
|
const TagInput = ({ label, name, placeholder, color = "#e9ecef", options = [],require = false }) => {
|
||||||
const { setValue, watch } = useFormContext();
|
const { setValue, watch } = useFormContext();
|
||||||
const tags = watch(name) || [];
|
const tags = watch(name) || [];
|
||||||
const [input, setInput] = useState("");
|
const [input, setInput] = useState("");
|
||||||
@ -65,9 +65,9 @@ const handleChange = (e) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<label htmlFor={name} className="form-label">
|
<Label required={require}>
|
||||||
{label}
|
{label}
|
||||||
</label>
|
</Label>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="form-control form-control-sm p-1"
|
className="form-control form-control-sm p-1"
|
||||||
|
@ -399,7 +399,6 @@ export const useUpdateBucket = (onSuccessCallBack) => {
|
|||||||
mutationFn: async ({ bucketId, BucketPayload }) =>
|
mutationFn: async ({ bucketId, BucketPayload }) =>
|
||||||
await DirectoryRepository.UpdateBuckets(bucketId, BucketPayload),
|
await DirectoryRepository.UpdateBuckets(bucketId, BucketPayload),
|
||||||
onSuccess: (_, variables) => {
|
onSuccess: (_, variables) => {
|
||||||
debugger;
|
|
||||||
queryClient.invalidateQueries({ queryKey: ["bucketList"] });
|
queryClient.invalidateQueries({ queryKey: ["bucketList"] });
|
||||||
showToast("Bucket updated successfully", "success");
|
showToast("Bucket updated successfully", "success");
|
||||||
if (onSuccessCallBack) onSuccessCallBack();
|
if (onSuccessCallBack) onSuccessCallBack();
|
||||||
@ -464,6 +463,7 @@ export const useCreateContact = (onSuccessCallBack) => {
|
|||||||
await DirectoryRepository.CreateContact(contactPayload),
|
await DirectoryRepository.CreateContact(contactPayload),
|
||||||
onSuccess: (_, variables) => {
|
onSuccess: (_, variables) => {
|
||||||
queryClient.invalidateQueries({ queryKey: ["contacts"] });
|
queryClient.invalidateQueries({ queryKey: ["contacts"] });
|
||||||
|
queryClient.invalidateQueries({ queryKey: ["bucketList"] });
|
||||||
showToast("Contact created Successfully", "success");
|
showToast("Contact created Successfully", "success");
|
||||||
if (onSuccessCallBack) onSuccessCallBack();
|
if (onSuccessCallBack) onSuccessCallBack();
|
||||||
},
|
},
|
||||||
|
@ -6,6 +6,7 @@ import { useDispatch } from "react-redux";
|
|||||||
import { setCurrentTenant } from "../slices/globalVariablesSlice";
|
import { setCurrentTenant } from "../slices/globalVariablesSlice";
|
||||||
import { ITEMS_PER_PAGE } from "../utils/constants";
|
import { ITEMS_PER_PAGE } from "../utils/constants";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import { queryClient } from "../layouts/AuthLayout";
|
||||||
|
|
||||||
const cleanFilter = (filter) => {
|
const cleanFilter = (filter) => {
|
||||||
const cleaned = { ...filter };
|
const cleaned = { ...filter };
|
||||||
@ -71,6 +72,7 @@ export const useSubscriptionPlan = (freq) => {
|
|||||||
// ------------Mutation---------------------
|
// ------------Mutation---------------------
|
||||||
|
|
||||||
export const useCreateTenant = (onSuccessCallback) => {
|
export const useCreateTenant = (onSuccessCallback) => {
|
||||||
|
const clinet = queryClient()
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: async (tenantPayload) => {
|
mutationFn: async (tenantPayload) => {
|
||||||
@ -87,6 +89,9 @@ export const useCreateTenant = (onSuccessCallback) => {
|
|||||||
operationMode = 2; // tenant exists but subscription not added yet
|
operationMode = 2; // tenant exists but subscription not added yet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clinet.invalidateQueries({queryKey:["Tenants"]})
|
||||||
|
|
||||||
|
|
||||||
dispatch(setCurrentTenant({ operationMode, data }));
|
dispatch(setCurrentTenant({ operationMode, data }));
|
||||||
|
|
||||||
if (onSuccessCallback) onSuccessCallback();
|
if (onSuccessCallback) onSuccessCallback();
|
||||||
|
@ -88,7 +88,7 @@ const ContactsPage = ({ projectId, searchText, onExport }) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
{data?.data?.length === 0 && (<div className="py-12 text-secondary">
|
{data?.data?.length === 0 && (<div className="py-12 ">
|
||||||
{searchText ? `No contact found for "${searchText}"`:"No contacts found" }
|
{searchText ? `No contact found for "${searchText}"`:"No contacts found" }
|
||||||
</div>)}
|
</div>)}
|
||||||
{data?.data?.map((contact) => (
|
{data?.data?.map((contact) => (
|
||||||
|
@ -22,7 +22,7 @@ export function startSignalR(loggedUser) {
|
|||||||
accessTokenFactory: () => jwtToken,
|
accessTokenFactory: () => jwtToken,
|
||||||
transport: signalR.HttpTransportType.LongPolling,
|
transport: signalR.HttpTransportType.LongPolling,
|
||||||
withCredentials: false,
|
withCredentials: false,
|
||||||
})
|
})
|
||||||
.withAutomaticReconnect()
|
.withAutomaticReconnect()
|
||||||
.build();
|
.build();
|
||||||
const todayDate = new Date();
|
const todayDate = new Date();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user