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: dataset exists error in save Dataset modal #21244

Conversation

AAfghahi
Copy link
Member

SUMMARY

When a user tried to create a dataset with an already existing name, the current SaveDatasetModal was soft failing. This adds a danger toast to the action that creates datasources.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2022-08-29.at.5.03.19.PM.mov

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

@AAfghahi AAfghahi changed the title bug: dataset exists error in save Dataset modal fix: dataset exists error in save Dataset modal Aug 29, 2022
@codecov
Copy link

codecov bot commented Aug 29, 2022

Codecov Report

Merging #21244 (5ba0d51) into master (8772e2c) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #21244      +/-   ##
==========================================
- Coverage   66.43%   66.42%   -0.01%     
==========================================
  Files        1784     1784              
  Lines       68163    68280     +117     
  Branches     7264     7307      +43     
==========================================
+ Hits        45285    45356      +71     
- Misses      21010    21047      +37     
- Partials     1868     1877       +9     
Flag Coverage Δ
hive 53.03% <ø> (ø)
javascript 52.46% <0.00%> (-0.04%) ⬇️
mysql 80.87% <ø> (?)
postgres 80.93% <ø> (+0.01%) ⬆️
presto 52.93% <ø> (ø)
python 81.40% <ø> (+0.05%) ⬆️
sqlite 79.44% <ø> (ø)
unit 50.65% <ø> (ø)

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

Impacted Files Coverage Δ
superset-frontend/src/SqlLab/actions/sqlLab.js 61.05% <0.00%> (-0.33%) ⬇️
...d/src/SqlLab/components/SaveDatasetModal/index.tsx 52.87% <0.00%> (ø)
...ols/DndColumnSelectControl/ColumnSelectPopover.tsx 2.85% <0.00%> (-0.41%) ⬇️
superset/reports/commands/execute.py 91.54% <0.00%> (+0.35%) ⬆️
superset/views/core.py 75.60% <0.00%> (+0.45%) ⬆️
superset/common/query_object.py 94.38% <0.00%> (+0.51%) ⬆️
superset/models/core.py 88.88% <0.00%> (+0.70%) ⬆️
superset/commands/importers/v1/utils.py 93.50% <0.00%> (+1.29%) ⬆️
superset/reports/commands/log_prune.py 89.28% <0.00%> (+3.57%) ⬆️
...tend/src/views/CRUD/data/database/DatabaseList.tsx 72.12% <0.00%> (+3.75%) ⬆️
... and 2 more

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

});

setDatasetName(getDefaultDatasetName());
console.log(formData);
Copy link
Member

Choose a reason for hiding this comment

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

remove this

Copy link
Member Author

Choose a reason for hiding this comment

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

yup removed.

@hughhhh hughhhh self-requested a review August 29, 2022 22:34
Copy link
Member

@hughhhh hughhhh left a comment

Choose a reason for hiding this comment

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

remove the console.log

@geido
Copy link
Member

geido commented Aug 30, 2022

@AAfghahi from the video it appears that the modals close and reopen when the error occurs. It does not look ideal for the end user. How hard would it be to wait for the response and then only close the modal when successful and leave it open when unsuccessful? This would avoid the quick close-reopen behaviour currently shown in the video.

Also, I am not sure if it makes more sense to show this error inline in the form? @kasiazjc what you think?

@kasiazjc
Copy link
Contributor

@AAfghahi from the video it appears that the modals close and reopen when the error occurs. It does not look ideal for the end user. How hard would it be to wait for the response and then only close the modal when successful and leave it open when unsuccessful? This would avoid the quick close-reopen behaviour currently shown in the video.

Also, I am not sure if it makes more sense to show this error inline in the form? @kasiazjc what you think?

Definitely agree with @geido. Errors should be shown in context, so it would be better to use inline info type. Toast can be easily missed by the user and this pattern is not intuitive.

@AAfghahi
Copy link
Member Author

@AAfghahi from the video it appears that the modals close and reopen when the error occurs. It does not look ideal for the end user. How hard would it be to wait for the response and then only close the modal when successful and leave it open when unsuccessful? This would avoid the quick close-reopen behaviour currently shown in the video.

Also, I am not sure if it makes more sense to show this error inline in the form? @kasiazjc what you think?

Hey, yeah I am working on that portion right now!

@AAfghahi
Copy link
Member Author

@geido Fixed in latest.

Screen.Recording.2022-08-30.at.11.09.43.AM.mov

@yousoph
Copy link
Member

yousoph commented Aug 30, 2022

@AAfghahi from the video it appears that the modals close and reopen when the error occurs. It does not look ideal for the end user. How hard would it be to wait for the response and then only close the modal when successful and leave it open when unsuccessful? This would avoid the quick close-reopen behaviour currently shown in the video.
Also, I am not sure if it makes more sense to show this error inline in the form? @kasiazjc what you think?

Definitely agree with @geido. Errors should be shown in context, so it would be better to use inline info type. Toast can be easily missed by the user and this pattern is not intuitive.

Inline makes sense to me! We'll plan to do that as a follow up so we can at least give the user some feedback first while we work on improving the display of the message.

@AAfghahi
Copy link
Member Author

/testenv up

@github-actions
Copy link
Contributor

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

@AAfghahi AAfghahi added need:qa-review Requires QA review and removed Preset-QA labels Aug 31, 2022
Copy link
Member

@jinghua-qa jinghua-qa left a comment

Choose a reason for hiding this comment

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

LGTM

@AAfghahi AAfghahi merged commit a7fe485 into master Aug 31, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@yousoph yousoph mentioned this pull request Aug 31, 2022
3 tasks
@mistercrunch mistercrunch added the 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels label Mar 13, 2024
@mistercrunch mistercrunch deleted the arash.afghahi/sc-56047/chart-power-query-no-error-msg-if-save-new branch March 26, 2024 16:07
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 need:qa-review Requires QA review size/S 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants