You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/09/21 18:18:49 UTC

[GitHub] [incubator-superset] kgabryje opened a new pull request #10981: Replace reactable with DataTable from superset-ui in QueryTable

kgabryje opened a new pull request #10981:
URL: https://github.com/apache/incubator-superset/pull/10981


   ### SUMMARY
   The goal is to replace all uses of `reactable-arc` library with DataTable from superset-ui (which uses `react-table` under the hood) and keep the UI/UX mostly unchanged. The reason for that is that `reactable-arc` has been unsupported for 2 years now, uses deprecated lifecycle methods and is incompatible with Typescript.
   This PR replaces `reactable-arc` in QueryTable component
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before:
   
   ![image](https://user-images.githubusercontent.com/15073128/93799605-a9cac980-fc3f-11ea-8de3-938f111ddc1c.png)
   
   After:
   
   ![image](https://user-images.githubusercontent.com/15073128/93799544-93247280-fc3f-11ea-8795-3bbed63b1e87.png)
   
   As you can see, there's an additional field where we can change the items per page param. Currently `DataTable` doesn't support not showing this field.
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] kgabryje commented on a change in pull request #10981: Replace reactable with DataTable from superset-ui in QueryTable

Posted by GitBox <gi...@apache.org>.
kgabryje commented on a change in pull request #10981:
URL: https://github.com/apache/incubator-superset/pull/10981#discussion_r492290307



##########
File path: superset-frontend/spec/javascripts/sqllab/QueryTable_spec.jsx
##########
@@ -18,27 +18,33 @@
  */
 import React from 'react';
 import { shallow } from 'enzyme';
-import { Table } from 'reactable-arc';
+import DataTable from '@superset-ui/plugin-chart-table/lib/DataTable';
+import * as useMountedMemo from '@superset-ui/plugin-chart-table/lib/DataTable/utils/useMountedMemo';
 import QueryTable from 'src/SqlLab/components/QueryTable';
 
-import { queries } from './fixtures';
+import { dataTableProps } from 'spec/javascripts/sqllab/fixtures';
 
 describe('QueryTable', () => {
+  // hack for mocking hook that implements sticky behaviour of DataTable
+  jest

Review comment:
       @rusackas This was needed because sticky DataTable uses `useLayoutEffect` under the hood and that caused enzyme not to render the component properly. If you have a better idea how to solve it I'll be happy to try it!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] kgabryje commented on pull request #10981: Replace reactable with DataTable from superset-ui in QueryTable

Posted by GitBox <gi...@apache.org>.
kgabryje commented on pull request #10981:
URL: https://github.com/apache/incubator-superset/pull/10981#issuecomment-696285652


   @rusackas Would you mind taking a look?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] rusackas merged pull request #10981: Replace reactable with DataTable from superset-ui in QueryTable

Posted by GitBox <gi...@apache.org>.
rusackas merged pull request #10981:
URL: https://github.com/apache/incubator-superset/pull/10981


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] rusackas merged pull request #10981: Replace reactable with DataTable from superset-ui in QueryTable

Posted by GitBox <gi...@apache.org>.
rusackas merged pull request #10981:
URL: https://github.com/apache/incubator-superset/pull/10981


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] kgabryje commented on pull request #10981: Replace reactable with DataTable from superset-ui in QueryTable

Posted by GitBox <gi...@apache.org>.
kgabryje commented on pull request #10981:
URL: https://github.com/apache/incubator-superset/pull/10981#issuecomment-696285652


   @rusackas Would you mind taking a look?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] kgabryje commented on a change in pull request #10981: Replace reactable with DataTable from superset-ui in QueryTable

Posted by GitBox <gi...@apache.org>.
kgabryje commented on a change in pull request #10981:
URL: https://github.com/apache/incubator-superset/pull/10981#discussion_r492290307



##########
File path: superset-frontend/spec/javascripts/sqllab/QueryTable_spec.jsx
##########
@@ -18,27 +18,33 @@
  */
 import React from 'react';
 import { shallow } from 'enzyme';
-import { Table } from 'reactable-arc';
+import DataTable from '@superset-ui/plugin-chart-table/lib/DataTable';
+import * as useMountedMemo from '@superset-ui/plugin-chart-table/lib/DataTable/utils/useMountedMemo';
 import QueryTable from 'src/SqlLab/components/QueryTable';
 
-import { queries } from './fixtures';
+import { dataTableProps } from 'spec/javascripts/sqllab/fixtures';
 
 describe('QueryTable', () => {
+  // hack for mocking hook that implements sticky behaviour of DataTable
+  jest

Review comment:
       @rusackas This was needed because sticky DataTable uses `useLayoutEffect` under the hood and that caused enzyme not to render the component properly. If you have a better idea how to solve it I'll be happy to try it!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org