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: annotation layer modal err handling #12341

Merged
merged 2 commits into from
Mar 3, 2021

Conversation

riahk
Copy link
Contributor

@riahk riahk commented Jan 7, 2021

SUMMARY

  • Handles errors on save/update so modal does not close when an error is encountered
  • utilizes useEffect hook for initialization to reduce API requests

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

Manual Test:

  1. Create or update annotation/annotation layer with duplicate name
  2. Attempt to save
  3. Confirm that an error toast is thrown and the modal does not close

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@codecov-io
Copy link

codecov-io commented Jan 7, 2021

Codecov Report

Merging #12341 (f024403) into master (08183df) will increase coverage by 0.75%.
The diff coverage is 55.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12341      +/-   ##
==========================================
+ Coverage   72.13%   72.88%   +0.75%     
==========================================
  Files         898      597     -301     
  Lines       45681    21286   -24395     
  Branches     5495     5501       +6     
==========================================
- Hits        32952    15515   -17437     
+ Misses      12517     5644    -6873     
+ Partials      212      127      -85     
Flag Coverage Δ
cypress 57.64% <100.00%> (?)
javascript 62.72% <54.41%> (+0.14%) ⬆️
mysql ?
postgres ?
python ?
sqlite ?

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

Impacted Files Coverage Δ
...rset-frontend/src/components/ButtonGroup/index.tsx 100.00% <ø> (ø)
...et-frontend/src/components/ErrorBoundary/index.jsx 95.45% <ø> (ø)
...-frontend/src/components/Select/Select.stories.tsx 0.00% <0.00%> (ø)
superset-frontend/src/components/Select/Select.tsx 90.81% <ø> (ø)
superset-frontend/src/components/Select/styles.tsx 86.30% <ø> (+24.65%) ⬆️
...et-frontend/src/components/Timer/Timer.stories.tsx 0.00% <0.00%> (ø)
superset-frontend/src/components/Timer/index.tsx 95.83% <ø> (ø)
...ews/CRUD/annotationlayers/AnnotationLayersList.tsx 77.35% <33.33%> (-0.53%) ⬇️
...tend/src/views/CRUD/annotation/AnnotationModal.tsx 63.23% <61.53%> (-3.44%) ⬇️
...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx 69.79% <64.00%> (-5.79%) ⬇️
... and 519 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 391d909...dec3e6c. Read the comment docs.

!currentAnnotation.id ||
(annotation && annotation.id !== currentAnnotation.id) ||
(isHidden && show))
) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can split these if conditions into multiple early returns. Currently it's kind of hard to reason with.

Copy link
Member

Choose a reason for hiding this comment

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

you can also use optional chaining to help if you want.

@riahk riahk force-pushed the moriah/crud-modal-err-handling branch from e9c4c18 to 542f7fb Compare February 18, 2021 21:45
@riahk riahk force-pushed the moriah/crud-modal-err-handling branch from 542f7fb to dec3e6c Compare March 1, 2021 23:38
@willbarrett willbarrett requested review from ktmud, etr2460 and nytai March 2, 2021 00:06
@willbarrett willbarrett merged commit 26e36ae into apache:master Mar 3, 2021
allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
* annotation layer modal err handling

* address comments
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 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 preset-io size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants