Compare commits
1 Commits
main
...
Kartik_Tas
Author | SHA1 | Date | |
---|---|---|---|
7d6fda790a |
@ -17,7 +17,7 @@ import { hasUserPermission } from "../../utils/authUtils";
|
|||||||
import { useHasUserPermission } from "../../hooks/useHasUserPermission";
|
import { useHasUserPermission } from "../../hooks/useHasUserPermission";
|
||||||
import { REGULARIZE_ATTENDANCE } from "../../utils/constants";
|
import { REGULARIZE_ATTENDANCE } from "../../utils/constants";
|
||||||
import eventBus from "../../services/eventBus";
|
import eventBus from "../../services/eventBus";
|
||||||
import { useProjectName } from "../../hooks/useProjects";
|
import { useProjectAssignedOrganizations, useProjectName } from "../../hooks/useProjects";
|
||||||
import GlobalModel from "../../components/common/GlobalModel";
|
import GlobalModel from "../../components/common/GlobalModel";
|
||||||
import CheckCheckOutmodel from "../../components/Activities/CheckCheckOutForm";
|
import CheckCheckOutmodel from "../../components/Activities/CheckCheckOutForm";
|
||||||
import AttendLogs from "../../components/Activities/AttendLogs";
|
import AttendLogs from "../../components/Activities/AttendLogs";
|
||||||
@ -39,11 +39,15 @@ const AttendancePage = () => {
|
|||||||
const [modelConfig, setModelConfig] = useState();
|
const [modelConfig, setModelConfig] = useState();
|
||||||
const DoRegularized = useHasUserPermission(REGULARIZE_ATTENDANCE);
|
const DoRegularized = useHasUserPermission(REGULARIZE_ATTENDANCE);
|
||||||
const { projectNames, loading: projectLoading, fetchData } = useProjectName();
|
const { projectNames, loading: projectLoading, fetchData } = useProjectName();
|
||||||
|
|
||||||
|
const { data: organizations = [], isLoading: orgLoading } = useProjectAssignedOrganizations(selectedProject);
|
||||||
|
|
||||||
const [appliedFilters, setAppliedFilters] = useState({
|
const [appliedFilters, setAppliedFilters] = useState({
|
||||||
selectedOrganization: "",
|
selectedOrganization: "",
|
||||||
selectedServices: [],
|
selectedServices: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
markTime: "",
|
markTime: "",
|
||||||
description: "",
|
description: "",
|
||||||
@ -85,7 +89,7 @@ const AttendancePage = () => {
|
|||||||
// Handler to change tab and reset search term
|
// Handler to change tab and reset search term
|
||||||
const handleTabChange = (tabName) => {
|
const handleTabChange = (tabName) => {
|
||||||
setActiveTab(tabName);
|
setActiveTab(tabName);
|
||||||
setSearchTerm(""); // Reset search term when tab changes
|
setSearchTerm("");
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -169,18 +173,6 @@ const AttendancePage = () => {
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Single search input that moves */}
|
|
||||||
{/* <div className="col-12 col-md-auto mt-2 mt-md-0 ms-md-auto d-flex gap-2 align-items-center">
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
className="form-control form-control-sm"
|
|
||||||
placeholder="Search Employee..."
|
|
||||||
value={searchTerm}
|
|
||||||
onChange={(e) => setSearchTerm(e.target.value)}
|
|
||||||
style={{ minWidth: "200px" }}
|
|
||||||
/>
|
|
||||||
</div> */}
|
|
||||||
|
|
||||||
{/* Search + Organization filter */}
|
{/* Search + Organization filter */}
|
||||||
<div className="col-12 col-md-auto mt-2 mt-md-0 ms-md-auto d-flex gap-2 align-items-center">
|
<div className="col-12 col-md-auto mt-2 mt-md-0 ms-md-auto d-flex gap-2 align-items-center">
|
||||||
{/* Organization Dropdown */}
|
{/* Organization Dropdown */}
|
||||||
@ -194,11 +186,14 @@ const AttendancePage = () => {
|
|||||||
selectedOrganization: e.target.value,
|
selectedOrganization: e.target.value,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
disabled={orgLoading}
|
||||||
>
|
>
|
||||||
<option value="">All Organizations</option>
|
<option value="">All Organizations</option>
|
||||||
<option value="Org A">Org A</option>
|
{organizations?.map((org) => (
|
||||||
<option value="Org B">Org B</option>
|
<option key={org.id} value={org.id}>
|
||||||
<option value="Org C">Org C</option>
|
{org.name}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
{/* Search Input */}
|
{/* Search Input */}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user