Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow filtering for analytics page (frontend) #178

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jyo142
Copy link

@jyo142 jyo142 commented Jun 3, 2024

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • Allow filtering (frontend) for analytics page

  • Created a DateRangePicker component

  • The analytics component adds url parameters on change of the date range

  • Why was this change needed? (You can also link to an open issue here)
    https://github.com/gitroomhq/gitroom/issues/147

Screen.Recording.2024-06-03.at.3.44.43.PM.mov

Copy link

vercel bot commented Jun 3, 2024

@jyo142 is attempting to deploy a commit to the Listinai Team on Vercel.

A member of the Team first needs to authorize it.

@jyo142
Copy link
Author

jyo142 commented Jun 3, 2024

@nevo-david sorry for the very late PR! I have been pretty caught up with other life things :(
This is the PR for the front end side for allowing filtering in the analytics page

const query =
newState === 'none' ? `` : `?key=${param}&state=${newState}`;
router.replace(`/analytics${query}`);
const params = new URLSearchParams();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to use URLSearchParams to make it easier to manage the dynamic params

@jamesread jamesread changed the title Jyo142 issue 147 Allow filtering for analytics page (frontend) Sep 9, 2024
@jamesread jamesread changed the title Allow filtering for analytics page (frontend) feat: Allow filtering for analytics page (frontend) Sep 9, 2024
},
[state, param]
[state, param, startDate, endDate]

Check warning

Code scanning / ESLint

verifies the list of dependencies for Hooks like useEffect and similar Warning

React Hook useCallback has a missing dependency: 'router'. Either include it or remove the dependency array.
);

const changeState = useCallback(() => {
changeStateUrl(
state === 'none' ? 'desc' : state === 'desc' ? 'asc' : 'none'
);
}, [state, param]);
}, [state, param, startDate, endDate]);

Check warning

Code scanning / ESLint

verifies the list of dependencies for Hooks like useEffect and similar Warning

React Hook useCallback has a missing dependency: 'changeStateUrl'. Either include it or remove the dependency array.
},
[page, key, state]
[page, key, state, startDate, endDate]

Check warning

Code scanning / ESLint

verifies the list of dependencies for Hooks like useEffect and similar Warning

React Hook useCallback has a missing dependency: 'router'. Either include it or remove the dependency array.
@@ -0,0 +1,129 @@
import { FC, useCallback, useState } from 'react';
import dayjs from 'dayjs';
import { Calendar, RangeCalendar, TimeInput } from '@mantine/dates';

Check warning

Code scanning / ESLint

Disallow unused variables Warning

'Calendar' is defined but never used.
@@ -0,0 +1,129 @@
import { FC, useCallback, useState } from 'react';
import dayjs from 'dayjs';
import { Calendar, RangeCalendar, TimeInput } from '@mantine/dates';

Check warning

Code scanning / ESLint

Disallow unused variables Warning

'TimeInput' is defined but never used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants