diff --git a/public/assets/css/core-extend.css b/public/assets/css/core-extend.css
index 2e9e51ef..8ec6df19 100644
--- a/public/assets/css/core-extend.css
+++ b/public/assets/css/core-extend.css
@@ -280,3 +280,7 @@
.w-8-xl{ width: 2rem; }
.w-10-xl{ width: 2.5rem; }
}
+
+.cursor-not-allowed{
+ cursor: not-allowed;
+}
diff --git a/src/components/Activities/Attendance.jsx b/src/components/Activities/Attendance.jsx
index 9a082976..c46feac3 100644
--- a/src/components/Activities/Attendance.jsx
+++ b/src/components/Activities/Attendance.jsx
@@ -126,7 +126,7 @@ const Attendance = ({ getRole, handleModalData, searchTerm, projectId, organizat
checked={ShowPending}
onChange={(e) => setShowPending(e.target.checked)}
/>
-
+
{attLoading ? (
diff --git a/src/components/Activities/AttendcesLogs.jsx b/src/components/Activities/AttendcesLogs.jsx
index 8f8a55ac..0a917968 100644
--- a/src/components/Activities/AttendcesLogs.jsx
+++ b/src/components/Activities/AttendcesLogs.jsx
@@ -190,7 +190,7 @@ useEffect(() => {
checked={showPending}
onChange={(e) => setShowPending(e.target.checked)}
/>
-
+
diff --git a/src/components/Charts/HorizontalBarChart.jsx b/src/components/Charts/HorizontalBarChart.jsx
index 82608da6..5a02c98f 100644
--- a/src/components/Charts/HorizontalBarChart.jsx
+++ b/src/components/Charts/HorizontalBarChart.jsx
@@ -23,7 +23,7 @@ const HorizontalBarChart = ({
if (loading) {
return (
- Loading chart...
+ Loading chart...
{/* Replace this with a skeleton or spinner if you prefer */}
);
diff --git a/src/components/Dashboard/ProjectCompletionChart.jsx b/src/components/Dashboard/ProjectCompletionChart.jsx
index 8ce4b13a..decf7918 100644
--- a/src/components/Dashboard/ProjectCompletionChart.jsx
+++ b/src/components/Dashboard/ProjectCompletionChart.jsx
@@ -3,7 +3,8 @@ import HorizontalBarChart from "../Charts/HorizontalBarChart";
import { useProjects } from "../../hooks/useProjects";
const ProjectCompletionChart = () => {
- const { projects, loading } = useProjects();
+ const { data: projects = [], isLoading: loading, isError, error } = useProjects();
+
// Bar chart logic
const projectNames = projects?.map((p) => p.name) || [];
@@ -11,7 +12,7 @@ const ProjectCompletionChart = () => {
projects?.map((p) => {
const completed = p.completedWork || 0;
const planned = p.plannedWork || 1;
- const percent = (completed / planned) * 100;
+ const percent = planned ? (completed / planned) * 100 : 0;
return Math.min(Math.round(percent), 100);
}) || [];
diff --git a/src/components/Documents/DocumentFilterPanel.jsx b/src/components/Documents/DocumentFilterPanel.jsx
index 15a2cbf1..581277e8 100644
--- a/src/components/Documents/DocumentFilterPanel.jsx
+++ b/src/components/Documents/DocumentFilterPanel.jsx
@@ -1,4 +1,4 @@
-import React, { useState } from "react";
+import React, { useEffect, useState } from "react";
import { useDocumentFilterEntities } from "../../hooks/useDocument";
import { FormProvider, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
@@ -9,9 +9,11 @@ import {
import { DateRangePicker1 } from "../common/DateRangePicker";
import SelectMultiple from "../common/SelectMultiple";
import moment from "moment";
+import { useLocation } from "react-router-dom";
const DocumentFilterPanel = ({ entityTypeId, onApply }) => {
const [resetKey, setResetKey] = useState(0);
+ const location = useLocation();
const { data, isError, isLoading, error } =
useDocumentFilterEntities(entityTypeId);
@@ -52,6 +54,13 @@ const DocumentFilterPanel = ({ entityTypeId, onApply }) => {
closePanel();
};
+ // Close popup when navigating to another component
+ useEffect(() => {
+ return () => {
+ closePanel();
+ };
+ }, []);
+
if (isLoading) return Loading...
;
if (isError)
return Error: {error?.message || "Something went wrong!"}
;
@@ -63,6 +72,8 @@ const DocumentFilterPanel = ({ entityTypeId, onApply }) => {
documentTag = [],
} = data?.data || {};
+
+
return (