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

Results data table #193

Closed

Conversation

acharliekelly
Copy link
Collaborator

This PR has a couple of issues that require input and/or assistance. It's supposed to fix #188, updating the Results table on the Search page. It also updates the Saved Results and Saved Searches tables, even though no one knows what the second one is for and it will probably be dropped from MVP. All the tables have been using react-table, but with fake data written in, so there was no way to use API data. With this PR, the tables now... continue to use fake data, but it might be easier to change now?

The main thing I haven't figured out is the table header. I don't have filtering working yet, and there are a bunch of style problems. I made tooltips for the columns with extra info, but I can't figure out the transparency - you can see the map right through them. Also, there's problems with column width, especially if you sort the columns - the sort arrows make the width jump around madly.

But now you can deploy it and see my mock data! (It's generated fake incident data, merged with a dataset of the 2019 Grammy winners, because random fake data gets boring quickly.)

(Also, I should really put the mock data wherever mocks are supposed to go, so they don't clutter the build.)

@acharliekelly acharliekelly added the Draft Requirement isn't finalized. Need more discussion. label Oct 15, 2021
@github-actions
Copy link

github-actions bot commented Oct 15, 2021

Visit the preview URL for this PR (updated for commit acharliekelly/police-data-trust@e3e9ede):

https://police-data-trust-dev--pr193-results-data-table-ockolx2t.web.app

(expires Fri, 22 Oct 2021 06:56:55 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 89ee28768ddf114979e2cf8eddd3746214cf93af

@acharliekelly
Copy link
Collaborator Author

The snapshots appear to be failing because of the generated id attribute of a FontAwesome icon, which is brand new every time it renders. So I can run update-snapshots, and then run test immediately after, and it still fails. Does anyone have thoughts on this?

@alexjball
Copy link
Member

Hey @acharliekelly where can I view your changes in the firebase preview? Or do I need to use storybook?

@acharliekelly
Copy link
Collaborator Author

@alexjball the table components are in the search page, and the profile page's Saved Results and Saved Searches

Copy link
Member

@alexjball alexjball left a comment

Choose a reason for hiding this comment

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

So does this make shared-components/data-table obsolete?

I pushed a change to fix the snapshot test, had to mock Math.random which is awful. Tried using this but i got a different warning

}
export default function InfoTooltip({ type }: InfoTooltipProps) {
export default function InfoTooltip({
Copy link
Member

Choose a reason for hiding this comment

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

I think you can set background in css to white to cover over the map

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks!

The DataTable component is technically obsolete, in that it's not currently being used; but only temporarily - I just copied @dylanesque's code into the composition components that use tables. It would be much DRYer to reuse one shared component for all the tables, but I was trying to get them all to work first, and can refactor them later.

Copy link
Collaborator

Choose a reason for hiding this comment

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

wait what is wrong with the current data table?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Draft Requirement isn't finalized. Need more discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Update search results data table
4 participants