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: set label on adhoc column should persist #26154

Merged
merged 3 commits into from
Dec 1, 2023
Merged

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Nov 30, 2023

SUMMARY

The component for defining columns has an unorthodox architecture:

 ____________________________________
|                                    |
| <DndColumnSelect />                |
|  ________________________________  |
| |                                | |
| | <ColumnSelectPopoverTrigger /> | |
| |                                | |
| | genre (pencil)                 | |
| |________________________________| |
|  ________________________________  |
| |                                | |
| | <ColumnSelectPopover />        | |
| |                                | |
| | Saved | Simple | Custom SQL    | |
| |                                | |
| | genre                          | |
| |                                | |
| | [    CLOSE    ] [    SAVE    ] | |
| |________________________________| |
|____________________________________|

When a user edits the label using the pencil in <ColumnSelectPopoverTrigger />, the <ColumnSelectPopover /> component is not aware of that change. If the users then clicks "SAVE" to use the adhoc column ("CUSTOM SQL") with the new label, the <ColumnSelectPopover /> won't do anything because it's not aware of any changes.

This PR modifies <ColumnSelectPopover /> so that if the user selects "CUSTOM SQL" and the label has been modified (via a new prop hasCustomLabel), then an adhoc column is defined in the component's state. This way, when "SAVE" is clicked, the label gets persisted correctly.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (cff473f) 69.13% compared to head (3f56815) 69.20%.
Report is 2 commits behind head on master.

Files Patch % Lines
...ColumnSelectControl/ColumnSelectPopoverTrigger.tsx 33.33% 2 Missing ⚠️
...ols/DndColumnSelectControl/ColumnSelectPopover.tsx 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26154      +/-   ##
==========================================
+ Coverage   69.13%   69.20%   +0.07%     
==========================================
  Files        1941     1941              
  Lines       75893    75901       +8     
  Branches     8450     8453       +3     
==========================================
+ Hits        52466    52531      +65     
+ Misses      21252    21177      -75     
- Partials     2175     2193      +18     
Flag Coverage Δ
hive 53.68% <ø> (ø)
javascript 56.49% <72.72%> (+0.15%) ⬆️
mysql 78.16% <ø> (ø)
postgres 78.26% <ø> (ø)
presto 53.63% <ø> (ø)
python 82.95% <ø> (ø)
sqlite 76.91% <ø> (ø)
unit 55.78% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 1, 2023
@eschutho
Copy link
Member

eschutho commented Dec 1, 2023

/testenv up

Copy link
Contributor

github-actions bot commented Dec 1, 2023

@eschutho Ephemeral environment spinning up at http://18.237.178.227:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@betodealmeida betodealmeida merged commit b2ea97a into master Dec 1, 2023
51 checks passed
Copy link
Contributor

github-actions bot commented Dec 1, 2023

Ephemeral environment shutdown and build artifacts deleted.

@michael-s-molina michael-s-molina added v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch labels Dec 1, 2023
michael-s-molina pushed a commit that referenced this pull request Dec 4, 2023
michael-s-molina pushed a commit that referenced this pull request Dec 4, 2023
josedev-union pushed a commit to Ortege-xyz/studio that referenced this pull request Jan 22, 2024
@mistercrunch mistercrunch added 🍒 3.0.3 🍒 3.0.4 🍒 3.1.0 🍒 3.1.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Mar 8, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@mistercrunch mistercrunch deleted the sc-70649 branch March 26, 2024 18:06
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 v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch 🍒 3.0.3 🍒 3.0.4 🍒 3.1.0 🍒 3.1.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants