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

dashboard group by options show duplicates #8580

Open
Vadman97 opened this issue May 15, 2024 — with Linear · 9 comments · May be fixed by #8624
Open

dashboard group by options show duplicates #8580

Vadman97 opened this issue May 15, 2024 — with Linear · 9 comments · May be fixed by #8624

Comments

Copy link
Member

No description provided.

@Vadman97 Vadman97 added the waterloo label May 15, 2024 — with Linear
Copy link

linear bot commented May 15, 2024

Copy link

greptile-apps bot commented May 15, 2024

To resolve the issue of duplicate group by options in the dashboard, follow these steps:

  1. Dashboard.tsx: Ensure that the Graph component's props are correctly managed to avoid duplicates. Specifically, check the groupByKey prop.

  2. DashboardOverview.tsx: Verify that the data fetched by useGetVisualizationsQuery does not contain duplicates. You may need to filter the results before setting the state.

  3. CreateDashboardModal.tsx: When creating a new dashboard, ensure that the options for grouping are unique. This can be done by filtering the options before rendering them in the modal.

  4. DashboardsContext.tsx: Ensure that the context provider does not introduce duplicates when managing the state of dashboards and their group by options.

Example code snippet to filter duplicates:

const uniqueOptions = options.filter((option, index, self) =>
  index === self.findIndex((o) => (
    o.value === option.value
  ))
);

Apply this filtering logic wherever the group by options are set or rendered.

References

/frontend/src/pages/Graphing/Dashboard.tsx
/frontend/src/pages/Graphing/DashboardOverview.tsx
/frontend/src/pages/Dashboards/components/CreateDashboardModal/CreateDashboardModal.tsx
/frontend/src/pages/Dashboards/DashboardsContext/DashboardsContext.tsx

Ask Greptile

Copy link
Member Author

/bounty $30

Copy link

algora-pbc bot commented May 15, 2024

💎 $30 bounty • Highlight (YC W23)

Payment will be awarded to the first person to successfully merge a PR meeting all requirements. In the event that multiple PRs are submitted for the issue, we will award payment to the highest quality PR (the one that has cleanest code, best test coverage, most thorough, etc.).

Steps to solve:

  1. Start working: Comment /attempt #8580 with your implementation plan
  2. Submit work: Create a pull request including /claim #8580 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to highlight/highlight!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @rituraj12797 May 16, 2024, 12:54:09 PM WIP
🟢 @asr2003 May 20, 2024, 2:56:57 AM #8624

@xonx4l
Copy link

xonx4l commented May 16, 2024

Assign me on this as I think I am close to a solution . Thanks

@rituraj12797
Copy link

/attempt #8580

@rajeshj11
Copy link
Contributor

@Vadman97 can you please provide more context to help us better understand the issues at hand? A screenshot or recording would be greatly helpful.

@asr2003
Copy link

asr2003 commented May 20, 2024

/attempt #8580

Copy link

algora-pbc bot commented May 20, 2024

💡 @asr2003 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants