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

refactor: Renders addSlice in SPA #20675

Merged

Conversation

michael-s-molina
Copy link
Member

SUMMARY

This PR eliminates another React entry point by integrating the add chart route to SPA. This will also reduce the number of requests to the server because this route only depends on user information which is already available in the initial bootstrap data.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2022-07-11.at.3.09.51.PM.mov

TESTING INSTRUCTIONS

See the video for 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

@codecov
Copy link

codecov bot commented Jul 11, 2022

Codecov Report

Merging #20675 (6aa5da1) into master (ff5b4bc) will decrease coverage by 11.65%.
The diff coverage is 50.00%.

❗ Current head 6aa5da1 differs from pull request most recent head 75c1cbb. Consider uploading reports for the commit 75c1cbb to get more accurate results

@@             Coverage Diff             @@
##           master   #20675       +/-   ##
===========================================
- Coverage   66.85%   55.20%   -11.66%     
===========================================
  Files        1753     1753               
  Lines       65839    65835        -4     
  Branches     7007     7007               
===========================================
- Hits        44017    36344     -7673     
- Misses      20036    27705     +7669     
  Partials     1786     1786               
Flag Coverage Δ
hive 53.88% <50.00%> (-0.01%) ⬇️
mysql ?
postgres ?
presto 53.74% <50.00%> (-0.01%) ⬇️
python 58.72% <50.00%> (-24.27%) ⬇️
sqlite ?
unit 50.96% <50.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...perset-frontend/src/addSlice/AddSliceContainer.tsx 59.61% <ø> (ø)
...perset-frontend/src/views/CRUD/chart/ChartList.tsx 58.77% <ø> (ø)
...perset-frontend/src/views/components/RightMenu.tsx 65.17% <ø> (ø)
superset-frontend/src/views/routes.tsx 55.88% <50.00%> (ø)
superset/views/chart/views.py 83.33% <50.00%> (-6.67%) ⬇️
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) ⬇️
superset/key_value/commands/upsert.py 0.00% <0.00%> (-89.14%) ⬇️
superset/key_value/commands/update.py 0.00% <0.00%> (-88.89%) ⬇️
superset/key_value/commands/delete.py 0.00% <0.00%> (-85.30%) ⬇️
superset/key_value/commands/delete_expired.py 0.00% <0.00%> (-80.77%) ⬇️
... and 284 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 ff5b4bc...75c1cbb. Read the comment docs.

<AddSliceContainer
user={user}
addSuccessToast={() => null}
{...routeProps}
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I think you can use MemoryRouter instead of manually adding routeProps

<MemoryRouter>
  <AddSliceContainer ... />
</MemoryRouter>

Copy link
Member Author

Choose a reason for hiding this comment

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

It won't satisfy Typescript 😞. We should probably change the tests to RTL in the future where we could use the helper that allows composition.

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

Works perfectly! LGTM

@michael-s-molina michael-s-molina merged commit ec2eb3d into apache:master Jul 13, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 labels Mar 13, 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 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants