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: Fix parsing onSaving reports toast when user hasn't saved chart #16330

Merged
merged 7 commits into from
Aug 19, 2021

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Aug 18, 2021

SUMMARY

Remove extra index when parsing errors to render to user. This was specfically happening when users would try to create a report without saving the chart

Screen Shot 2021-08-18 at 1 32 50 PM

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

@hughhhh hughhhh changed the title fix: Fix parsing on reports errors fix: Fix parsing onSaving reports toast when user hasn't saved chart Aug 18, 2021
@@ -60,4 +61,4 @@ def validate_chart_dashboard(
exceptions.append(DashboardNotFoundValidationError())
self._properties["dashboard"] = dashboard
elif not update:
exceptions.append(ReportScheduleChartOrDashboardValidationError())
exceptions.append(ChartNotSavedValidationError())
Copy link
Member

Choose a reason for hiding this comment

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

is it possible that this could be a dashboard?

Copy link
Member Author

@hughhhh hughhhh Aug 18, 2021

Choose a reason for hiding this comment

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

From my understanding dashboards would always be saved and have a record in the metastore, but for a more defensive approach i'll make a specific condition for both dashboards and charts just in case.

@codecov
Copy link

codecov bot commented Aug 18, 2021

Codecov Report

Merging #16330 (e605d94) into master (a547dcb) will decrease coverage by 0.05%.
The diff coverage is 69.60%.

❗ Current head e605d94 differs from pull request most recent head ae5de18. Consider uploading reports for the commit ae5de18 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16330      +/-   ##
==========================================
- Coverage   76.63%   76.58%   -0.06%     
==========================================
  Files        1000     1000              
  Lines       53424    53465      +41     
  Branches     6818     6816       -2     
==========================================
+ Hits        40943    40944       +1     
- Misses      12245    12285      +40     
  Partials      236      236              
Flag Coverage Δ
javascript 70.76% <33.33%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset-frontend/src/reports/actions/reports.js 9.80% <0.00%> (ø)
superset/charts/post_processing.py 66.07% <26.08%> (-28.11%) ⬇️
...rset-frontend/src/components/ReportModal/index.tsx 72.91% <50.00%> (-0.56%) ⬇️
superset/reports/commands/execute.py 90.23% <62.50%> (-2.36%) ⬇️
superset/reports/notifications/slack.py 87.14% <80.00%> (+0.18%) ⬆️
superset/utils/csv.py 97.61% <90.00%> (-2.39%) ⬇️
superset/reports/commands/base.py 90.32% <91.66%> (ø)
superset/charts/api.py 85.82% <100.00%> (ø)
superset/common/query_actions.py 93.05% <100.00%> (+0.19%) ⬆️
superset/reports/commands/exceptions.py 98.79% <100.00%> (+0.06%) ⬆️
... and 4 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 a547dcb...ae5de18. Read the comment docs.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Aug 19, 2021
Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Looks great! We should also disable the report button if the user hasn't saved the chart, and have a tooltip that tells them to save it.

cc: @yousoph

@hughhhh hughhhh merged commit 50d896f into master Aug 19, 2021
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Aug 24, 2021
* master: (582 commits)
  feat: config to customize bootstrap data overrides (apache#16386)
  fix: regex for multi-region IPs (apache#16410)
  chore: Changes the DatabaseSelector to use the new Select component (apache#16334)
  chore: Displays the dataset description in a tooltip in the datasets list (apache#16392)
  fix(pylint): Fix master (apache#16405)
  chore(pylint): Enable useless-suppression check (apache#16388)
  feat: Add extraVolumes and extraVolumeMounts to all main containers (apache#16361)
  initial commit (apache#16366)
  fix: big number default date format (apache#16383)
  initial commit (apache#16380)
  fix: import dashboard w/o metadata (apache#16360)
  test: Functional RTL for email report modal II (apache#16148)
  fix: update table ID in query context on chart import (apache#16374)
  docs: document FLASK_APP_MUTATOR (apache#16286)
  feat: Add new dev commands to Makefile (apache#16327)
  fix: call external metadata endpoint with correct rison object (apache#16369)
  fix: Fix parsing onSaving reports toast when user hasn't saved chart (apache#16330)
  fix: columns/index rebuild (apache#16355)
  chore(viz): bump deckgl plugin to 0.4.11 (apache#16353)
  fix: Blank space in Change dataset modal without warning message (apache#16324)
  ...

# Conflicts:
#	superset/app.py
#	superset/models/dashboard.py
#	tests/integration_tests/charts/filter_sets/__init__.py
#	tests/integration_tests/charts/filter_sets/conftest.py
#	tests/integration_tests/charts/filter_sets/consts.py
#	tests/integration_tests/charts/filter_sets/create_api_tests.py
#	tests/integration_tests/charts/filter_sets/delete_api_tests.py
#	tests/integration_tests/charts/filter_sets/get_api_tests.py
#	tests/integration_tests/charts/filter_sets/update_api_tests.py
#	tests/integration_tests/charts/filter_sets/utils.py
#	tests/integration_tests/superset_test_config.py
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
…pache#16330)

* don't maniuplate error message

* remove extra idx reference

* u

* change print

* update with test

* add case for dashboards

* fix test
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
…pache#16330)

* don't maniuplate error message

* remove extra idx reference

* u

* change print

* update with test

* add case for dashboards

* fix test
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the hugh/show-full-error-for-reports branch March 26, 2024 17:56
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/M 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants