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 misleading save action #24862

Merged

Conversation

michael-s-molina
Copy link
Member

SUMMARY

When saving a chart in Explore, we have different states:

  • If a user is overriding a chart or creating a new one
  • If a user is selecting a dashboard or creating a new one
  • If a user can override a chart or not

Currently, the Save modal buttons change to accommodate different combination of states:

  • Save
  • Save as new chart
  • Save to new dashboard
  • Save & go to dashboard
  • Save & go to new dashboard

The problem is that are missing some combinations which leads to confusion when saving charts:

  • Save as new chart to new dashboard
  • Save as new chart & go to dashboard
  • Save as new chart & go to new dashboard

One example of such confusion is when a user is not an owner of a chart but can save that chart as a new one. The button displays Save & go to dashboard which leads the user to think that a chart will be overridden in that dashboard but what actually happens is that a new chart is created and added to the dashboard. One can argue that the Save as radio selection would be sufficient to indicate the difference but that's not the case. Specially because we're changing the buttons text for some states and not for others.

To fix this, my first attempt was to make sure the button labels accounted for all possible states but that resulted in a poor UI as you can see bellow:

Screenshot 2023-08-01 at 13 11 06


A better solution was to change the modal to preserve the button labels and add an information message when creating a new chart, a dashboard or both:

Screenshot 2023-08-01 at 15 48 24


This message only appears when it's not clear that a new asset will be created. If a user is creating a chart for the first time and adding it to an existing dashboard, no message is displayed.

This PR also moves the alert message to the bottom, similar to the native filters modal, closer to the dashboard select and save button which are the sources for the alert.

Screenshot 2023-08-01 at 15 54 18

TESTING INSTRUCTIONS

Make sure the correct information message is displayed or not depending on the chart state.

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

placeholder={
<div>
<b>{t('Select')}</b>
{t(' a dashboard OR ')}
Copy link
Member

Choose a reason for hiding this comment

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

These labels should be a good example of adding unit tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes but I'll focus on the PR changes. This part was only indented.

Copy link
Contributor

@kasiazjc kasiazjc left a comment

Choose a reason for hiding this comment

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

I think this change makes the process more intuitive, so lgtm design wise. Thanks!

@michael-s-molina michael-s-molina marked this pull request as ready for review August 1, 2023 22:05
@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #24862 (7ac29d3) into master (77889b2) will increase coverage by 0.01%.
Report is 6 commits behind head on master.
The diff coverage is 91.15%.

❗ Current head 7ac29d3 differs from pull request most recent head 9063106. Consider uploading reports for the commit 9063106 to get more accurate results

@@            Coverage Diff             @@
##           master   #24862      +/-   ##
==========================================
+ Coverage   68.99%   69.01%   +0.01%     
==========================================
  Files        1903     1904       +1     
  Lines       74073    74111      +38     
  Branches     8193     8196       +3     
==========================================
+ Hits        51108    51145      +37     
- Misses      20844    20847       +3     
+ Partials     2121     2119       -2     
Flag Coverage Δ
javascript 55.84% <77.41%> (+0.01%) ⬆️

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

Files Changed Coverage Δ
...ins/legacy-preset-chart-nvd3/src/transformProps.js 7.14% <0.00%> (-0.27%) ⬇️
...t-frontend/src/explore/actions/saveModalActions.js 95.52% <ø> (-0.13%) ⬇️
...-frontend/src/explore/reducers/saveModalReducer.js 60.00% <ø> (+5.45%) ⬆️
superset/advanced_data_type/api.py 100.00% <ø> (ø)
superset/annotation_layers/annotations/api.py 89.23% <ø> (ø)
superset/annotation_layers/annotations/schemas.py 100.00% <ø> (ø)
superset/annotation_layers/api.py 86.20% <ø> (ø)
superset/annotation_layers/schemas.py 100.00% <ø> (ø)
superset/async_events/api.py 100.00% <ø> (ø)
superset/available_domains/api.py 100.00% <ø> (ø)
... and 58 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@justinpark justinpark left a comment

Choose a reason for hiding this comment

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

LGTM

@michael-s-molina michael-s-molina merged commit bf1b1a4 into apache:master Aug 2, 2023
46 checks passed
@michael-s-molina michael-s-molina added the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Aug 3, 2023
michael-s-molina added a commit that referenced this pull request Aug 4, 2023
@mistercrunch mistercrunch added 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 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 v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants