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

Add onSortTable handler for StatementsPage #15

Merged
merged 2 commits into from
Aug 4, 2020
Merged

Add onSortTable handler for StatementsPage #15

merged 2 commits into from
Aug 4, 2020

Conversation

koorosh
Copy link
Contributor

@koorosh koorosh commented Jul 31, 2020

Related to cockroachdb/cockroach#51910 (comment)

When StatementsPage component was extracted, analytics tracking
functionality which was embedded into component has been removed and
should be handled outside of component (with respective callback
functions).
trackTableSort tracking function was missing. To make it work,
onSortingChange prop is added to handle it outside.

ColumnDescriptor configuration provides information about existing
columns in the table. The issue appeared when a user sorts data by some
column and it is necessary to know column name (to send it as part
of analytics data). Previously, title column was used for this
purpose, but the problem is that title field is ReactNode, not string.
It means, after casting field to string - it always has [object Object]
value instead of a meaningful column name.

With the current change, ColumnDescriptor configuration is extended with
extra string field "name" as unique column name.

When StatementsPage component was extracted, analytics tracking
functionality which was embedded into component has been removed and
should be handled outside of component (with respective callback
functions).
`trackTableSort` tracking function was missed. To make it work,
`onSortingChange` prop is added to handle it outside.

Also unnecessary `refreshDiagnosticsReports` is removed because it
duplicates already existing `refreshStatementDiagnosticsRequests` prop.
@koorosh koorosh requested a review from dhartunian July 31, 2020 13:16
@koorosh koorosh marked this pull request as draft July 31, 2020 14:48
@koorosh koorosh removed the request for review from dhartunian July 31, 2020 14:48
ColumnDescriptor configuration provides information about existing
columns in table. The issue appeared when user sorts data by some
column and it is necessary to know column name (to send it as part
of analytics data). Previously, `title` column was used for this
purpose, but the problem is that `title` field is ReactNode, not string.
It means, after casting field to string - it always has [object Object]
value instead of meaningful column name.

With current change, ColumnDescriptor configuration is extended with
extra string field "name" as unique column name.
@koorosh koorosh requested a review from dhartunian August 3, 2020 06:40
@koorosh koorosh marked this pull request as ready for review August 3, 2020 06:41
@koorosh koorosh merged commit ffbb203 into cockroachdb:master Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants