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 2021/10/20 09:58:31 UTC

[GitHub] [superset] kgabryje opened a new pull request #17166: fix(explore): timestamp format when copy datatable to clipboard

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


   ### SUMMARY
   When user copied a data with timestamp to clipboard from data table in Exlore view, the timestamp was copied without formatting. This PR fixes that issue.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before: see linked issue
   After:
   
   https://user-images.githubusercontent.com/15073128/138071816-951fea99-17cd-4b4b-9ae1-4828802fe4e8.mov.
   
   ### TESTING INSTRUCTIONS
   1. Open a chart with a `__timestamp` column in it's data
   2. Copy the data table below the chart
   3. Verify that copied timestamp is formatted properly
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: fixes #16905
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   CC @junlincc 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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] [superset] geido commented on a change in pull request #17166: fix(explore): timestamp format when copy datatable to clipboard

Posted by GitBox <gi...@apache.org>.
geido commented on a change in pull request #17166:
URL: https://github.com/apache/superset/pull/17166#discussion_r732950740



##########
File path: superset-frontend/src/explore/components/DataTableControl/index.tsx
##########
@@ -48,7 +45,7 @@ export const CopyButton = styled(Button)`
 `;
 
 const CopyNode = (
-  <CopyButton buttonSize="xsmall">
+  <CopyButton buttonSize="xsmall" aria-label="copy">

Review comment:
       ```suggestion
     <CopyButton buttonSize="xsmall" aria-label={t('Copy')}>
   ```




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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] [superset] zhaoyongjie commented on a change in pull request #17166: fix(explore): timestamp format when copy datatable to clipboard

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #17166:
URL: https://github.com/apache/superset/pull/17166#discussion_r733333563



##########
File path: superset-frontend/src/explore/components/DataTableControl/index.tsx
##########
@@ -108,8 +105,7 @@ export const useFilteredTableData = (
     if (!data?.length) {
       return [];
     }
-    const formattedData = applyFormattingToTabularData(data);
-    return formattedData.filter((row: Record<string, any>) =>
+    return data.filter((row: Record<string, any>) =>
       Object.values(row).some(value =>
         value?.toString().toLowerCase().includes(filterText.toLowerCase()),
       ),

Review comment:
       a bit performance optimization, could we process the `row of data` before calling `useFilteredTableData`?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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] [superset] codecov[bot] commented on pull request #17166: fix(explore): timestamp format when copy datatable to clipboard

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #17166:
URL: https://github.com/apache/superset/pull/17166#issuecomment-948636436


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17166?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#17166](https://codecov.io/gh/apache/superset/pull/17166?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e50764a) into [master](https://codecov.io/gh/apache/superset/commit/e32acd22fd204ed47d09dd9d445218f50c309011?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e32acd2) will **increase** coverage by `0.02%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head e50764a differs from pull request most recent head 815b3fb. Consider uploading reports for the commit 815b3fb to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17166/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/17166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #17166      +/-   ##
   ==========================================
   + Coverage   76.91%   76.94%   +0.02%     
   ==========================================
     Files        1039     1039              
     Lines       55559    55576      +17     
     Branches     7567     7574       +7     
   ==========================================
   + Hits        42733    42761      +28     
   + Misses      12576    12565      -11     
     Partials      250      250              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `70.98% <100.00%> (+0.05%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/17166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/views/core.py](https://codecov.io/gh/apache/superset/pull/17166/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `76.94% <ø> (ø)` | |
   | [...end/src/components/Datasource/DatasourceEditor.jsx](https://codecov.io/gh/apache/superset/pull/17166/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRGF0YXNvdXJjZS9EYXRhc291cmNlRWRpdG9yLmpzeA==) | `72.10% <100.00%> (+0.19%)` | :arrow_up: |
   | [...tend/src/components/Datasource/DatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/17166/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRGF0YXNvdXJjZS9EYXRhc291cmNlTW9kYWwudHN4) | `75.38% <100.00%> (ø)` | |
   | [.../src/explore/components/DataTableControl/index.tsx](https://codecov.io/gh/apache/superset/pull/17166/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhVGFibGVDb250cm9sL2luZGV4LnRzeA==) | `98.18% <100.00%> (+0.18%)` | :arrow_up: |
   | [...nd/src/explore/components/DataTablesPane/index.tsx](https://codecov.io/gh/apache/superset/pull/17166/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhVGFibGVzUGFuZS9pbmRleC50c3g=) | `85.71% <100.00%> (+10.22%)` | :arrow_up: |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17166/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `91.50% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset/connectors/base/models.py](https://codecov.io/gh/apache/superset/pull/17166/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9iYXNlL21vZGVscy5weQ==) | `88.25% <100.00%> (ø)` | |
   | [superset/connectors/druid/models.py](https://codecov.io/gh/apache/superset/pull/17166/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9kcnVpZC9tb2RlbHMucHk=) | `82.99% <100.00%> (ø)` | |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/17166/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `87.35% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/17166/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `80.85% <100.00%> (+0.30%)` | :arrow_up: |
   | ... and [2 more](https://codecov.io/gh/apache/superset/pull/17166/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17166?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/17166?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [e32acd2...815b3fb](https://codecov.io/gh/apache/superset/pull/17166?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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] [superset] kgabryje commented on a change in pull request #17166: fix(explore): timestamp format when copy datatable to clipboard

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



##########
File path: superset-frontend/src/explore/components/DataTableControl/index.tsx
##########
@@ -108,8 +105,7 @@ export const useFilteredTableData = (
     if (!data?.length) {
       return [];
     }
-    const formattedData = applyFormattingToTabularData(data);
-    return formattedData.filter((row: Record<string, any>) =>
+    return data.filter((row: Record<string, any>) =>
       Object.values(row).some(value =>
         value?.toString().toLowerCase().includes(filterText.toLowerCase()),
       ),

Review comment:
       Done. Is that what you meant?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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] [superset] kgabryje merged pull request #17166: fix(explore): timestamp format when copy datatable to clipboard

Posted by GitBox <gi...@apache.org>.
kgabryje merged pull request #17166:
URL: https://github.com/apache/superset/pull/17166


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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] [superset] zhaoyongjie commented on a change in pull request #17166: fix(explore): timestamp format when copy datatable to clipboard

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #17166:
URL: https://github.com/apache/superset/pull/17166#discussion_r733333563



##########
File path: superset-frontend/src/explore/components/DataTableControl/index.tsx
##########
@@ -108,8 +105,7 @@ export const useFilteredTableData = (
     if (!data?.length) {
       return [];
     }
-    const formattedData = applyFormattingToTabularData(data);
-    return formattedData.filter((row: Record<string, any>) =>
+    return data.filter((row: Record<string, any>) =>
       Object.values(row).some(value =>
         value?.toString().toLowerCase().includes(filterText.toLowerCase()),
       ),

Review comment:
       a bit performance optimization, could we process the `row of data` before calling `useFilteredTableData`? (in the other words, pre-process every cell into string)




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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