Changes in OnField Work.

This commit is contained in:
Kartik Sharma 2025-10-15 16:52:27 +05:30
parent 73534226e3
commit b318d469f6
3 changed files with 10 additions and 10 deletions

View File

@ -119,12 +119,12 @@ const ExpenseFilterPanel = forwardRef(({ onApply, handleGroupBy, setFilterdata }
const [appliedStatusId, setAppliedStatusId] = useState(null);
useEffect(() => {
if (!status) return;
if (!status || !data) return;
if (status !== appliedStatusId && data) {
if (status !== appliedStatusId) {
const filterWithStatus = {
...dynamicDefaultFilter,
projectIds: selectedProjectId ? [selectedProjectId] : [], // include project ID
projectIds: selectedProjectId ? [selectedProjectId] : dynamicDefaultFilter.projectIds || [],
startDate: dynamicDefaultFilter.startDate
? moment.utc(dynamicDefaultFilter.startDate, "DD-MM-YYYY").toISOString()
: undefined,
@ -135,7 +135,6 @@ const ExpenseFilterPanel = forwardRef(({ onApply, handleGroupBy, setFilterdata }
onApply(filterWithStatus);
handleGroupBy(selectedGroup.id);
setAppliedStatusId(status);
}
}, [
@ -146,10 +145,9 @@ const ExpenseFilterPanel = forwardRef(({ onApply, handleGroupBy, setFilterdata }
handleGroupBy,
selectedGroup.id,
appliedStatusId,
selectedProjectId, // added dependency
selectedProjectId, // Added dependency
]);
if (isLoading || isFetching) return <ExpenseFilterSkeleton />;
if (isError && isFetched)
return <div>Something went wrong Here- {error.message} </div>;

View File

@ -36,16 +36,17 @@ const Header = () => {
const pathname = location.pathname;
// ======= MEMO CHECKS =======
const isDashboardPath = pathname === "/" || pathname === "/dashboard";
const isProjectPath = pathname === "/projects";
const isDirectory = pathname === "/directory";
const isEmployeeList = pathname === "/employees";
const isMasters = pathname === "/masters";
// const isExpense = pathname === "/expenses";
const isEmployeeProfile = UUID_REGEX.test(pathname);
const isMasters = pathname === "/masters";
const isExpensePath = pathname.startsWith("/expenses");
const hideDropPaths =
isDirectory || isEmployeeList || isMasters || isEmployeeProfile;
isDirectory || isEmployeeList || isMasters || isEmployeeProfile || isExpensePath;
const showProjectDropdown = !hideDropPaths;

View File

@ -95,6 +95,7 @@ const router = createBrowserRouter(
{ path: "/activities/reports", element: <Reports /> },
{ path: "/gallary", element: <ComingSoonPage /> },
{ path: "/expenses/:status?/:project?", element: <ExpensePage /> },
{ path: "/expenses", element: <ExpensePage /> },
{ path: "/masters", element: <MasterPage /> },
{ path: "/tenants", element: <TenantPage /> },
{ path: "/tenants/new-tenant", element: <CreateTenant /> },