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

Table: upgrades react-table to 7.0.0 and typings #23247

Merged
merged 4 commits into from Apr 1, 2020

Conversation

hugohaggmark
Copy link
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes:
Relates #20709

Special notes for your reviewer:

@hugohaggmark hugohaggmark added this to the 7.0 milestone Apr 1, 2020
@hugohaggmark hugohaggmark requested review from peterholmberg, Estrax and a team April 1, 2020 09:05
@hugohaggmark hugohaggmark self-assigned this Apr 1, 2020
@hugohaggmark hugohaggmark added this to In Review in Frontend Platform Backlog via automation Apr 1, 2020
@hugohaggmark hugohaggmark requested review from torkelo and removed request for a team April 1, 2020 09:05
@torkelo torkelo mentioned this pull request Apr 1, 2020
20 tasks
Copy link

@Estrax Estrax left a comment

Choose a reason for hiding this comment

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

LGTM! Great job @hugohaggmark!

@@ -57,6 +61,7 @@ export function getColumns(data: DataFrame, availableWidth: number, columnMinWid

columns.push({
Cell,
id: field.name,
Copy link
Member

Choose a reason for hiding this comment

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

field name is not guaranteed to be unique sadly (A table can include multiple fields with same name). Can we use index instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great catch, I'll do that instead!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I tried several approaches, but no one worked.

  • Adding index as id, react-table will replace the id with the Header name
  • Using the accessor to retrieve the field failed too because it didn't match the correct memory area, got [object, object] instead of real values.
  • Using the accessor to retrieve the index of field failed too for unknown reason, got strange values instead of real values.

So I settled with just using index from the loops, which seem to work for now when we don't have reordering of columns. I really don't like the react-table API because I'm just not getting it at all.

Copy link
Contributor

@peterholmberg peterholmberg left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link

@Estrax Estrax left a comment

Choose a reason for hiding this comment

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

LGTM!

@hugohaggmark hugohaggmark merged commit a92bcb7 into master Apr 1, 2020
Frontend Platform Backlog automation moved this from In Review to Done Apr 1, 2020
@hugohaggmark hugohaggmark deleted the hugoh/upgrade-react-table branch April 1, 2020 12:24
@dprokop dprokop changed the title ReactTable: upgrades react table to 7.0.0 and typings Table: upgrades react-table to 7.0.0 and typings Apr 28, 2020
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.

None yet

5 participants