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

feat: disable edits on external assets #19344

Merged

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Mar 24, 2022

SUMMARY

Disable edits on resources (databases, datasets, charts, dashboards) that are marked as managed externally.

This just disables the UI, not the API.

Depends on #19315.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Database managed externally:

Screen Shot 2022-03-24 at 2 47 20 PM

Dataset:

Screen Shot 2022-03-24 at 2 48 50 PM

Chart:

Screen Shot 2022-03-24 at 2 49 12 PM

Also, must save as new:

Screen Shot 2022-03-24 at 2 49 34 PM

Dashboard:

Screen Shot 2022-03-24 at 2 49 56 PM

Also, edit is disabled:

Screen Shot 2022-03-24 at 2 50 16 PM

TESTING INSTRUCTIONS

To test, import the following dashboard: dashboard_export.zip. All the resources in it have been modified to have is_managed_externally set to true.

The database, dataset, chart, and dashboard should all be uneditable, similar to the screenshots above.

I also updated the unit tests.

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

@betodealmeida betodealmeida force-pushed the is_managed_externally_affordances branch from 82fbdd7 to 8b70d35 Compare March 24, 2022 17:42
@betodealmeida betodealmeida changed the base branch from import_managed_externally to master March 24, 2022 17:42
@betodealmeida betodealmeida force-pushed the is_managed_externally_affordances branch from e1cf09a to d7568a5 Compare March 25, 2022 01:01
@codecov
Copy link

codecov bot commented Mar 25, 2022

Codecov Report

Merging #19344 (c9c927c) into master (c7f9060) will increase coverage by 0.01%.
The diff coverage is 90.72%.

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

@@            Coverage Diff             @@
##           master   #19344      +/-   ##
==========================================
+ Coverage   66.65%   66.66%   +0.01%     
==========================================
  Files        1675     1676       +1     
  Lines       64665    64715      +50     
  Branches     6503     6510       +7     
==========================================
+ Hits        43103    43145      +42     
- Misses      19876    19880       +4     
- Partials     1686     1690       +4     
Flag Coverage Δ
javascript 51.30% <40.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...et-ui-chart-controls/src/shared-controls/index.tsx 36.19% <0.00%> (-0.35%) ⬇️
...perset-ui-chart-controls/src/utils/D3Formatting.ts 100.00% <ø> (ø)
...frontend/src/SqlLab/components/ResultSet/index.tsx 50.49% <0.00%> (ø)
superset-frontend/src/components/Button/index.tsx 100.00% <ø> (ø)
...end/src/components/Form/LabeledErrorBoundInput.tsx 100.00% <ø> (ø)
...frontend/src/dashboard/components/Header/index.jsx 61.37% <ø> (ø)
superset-frontend/src/explore/controls.jsx 31.57% <ø> (ø)
superset-frontend/src/views/CRUD/hooks.ts 47.15% <ø> (ø)
superset/charts/api.py 85.93% <ø> (ø)
superset/config.py 91.63% <ø> (-0.06%) ⬇️
... and 49 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 c7f9060...d7568a5. Read the comment docs.

@betodealmeida betodealmeida merged commit d304849 into apache:master Mar 28, 2022
villebro pushed a commit that referenced this pull request Apr 3, 2022
* feat: disable edits on external assets

* Update tests

(cherry picked from commit d304849)
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
* feat: disable edits on external assets

* Update tests
@mistercrunch mistercrunch added 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.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 lts-v1 size/M 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants