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

fix(explore): timestamp format when copy datatable to clipboard #17166

Merged
merged 6 commits into from
Oct 21, 2021

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Oct 20, 2021

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:

Screen.Recording.2021-10-20.at.11.54.16.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

CC @junlincc @jinghua-qa

Comment on lines 108 to 111
return data.filter((row: Record<string, any>) =>
Object.values(row).some(value =>
value?.toString().toLowerCase().includes(filterText.toLowerCase()),
),
Copy link
Member

@zhaoyongjie zhaoyongjie Oct 21, 2021

Choose a reason for hiding this comment

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

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Is that what you meant?

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

no blocking performance optimization. LGTM.

@codecov
Copy link

codecov bot commented Oct 21, 2021

Codecov Report

Merging #17166 (e50764a) into master (e32acd2) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ 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

@@            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%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/views/core.py 76.94% <ø> (ø)
...end/src/components/Datasource/DatasourceEditor.jsx 72.10% <100.00%> (+0.19%) ⬆️
...tend/src/components/Datasource/DatasourceModal.tsx 75.38% <100.00%> (ø)
.../src/explore/components/DataTableControl/index.tsx 98.18% <100.00%> (+0.18%) ⬆️
...nd/src/explore/components/DataTablesPane/index.tsx 85.71% <100.00%> (+10.22%) ⬆️
superset/config.py 91.50% <100.00%> (+0.02%) ⬆️
superset/connectors/base/models.py 88.25% <100.00%> (ø)
superset/connectors/druid/models.py 82.99% <100.00%> (ø)
superset/connectors/sqla/models.py 87.35% <100.00%> (+0.02%) ⬆️
superset/sql_lab.py 80.85% <100.00%> (+0.30%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e32acd2...815b3fb. Read the comment docs.

@kgabryje kgabryje merged commit 860e481 into apache:master Oct 21, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
…he#17166)

* fix(explore): timestamp format when copy datatable to clipboard

* Fix test

* Fix test

* Use translation for aria label

* Memoize stringified cells

* Fix test
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[explore][south tables] When copy data from 'view result' timestamp is not showing in correct format
4 participants