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: Alpha are unable to perform a second modification to a Dataset when in Explore #20296

Merged
merged 2 commits into from
Jun 8, 2022

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Jun 7, 2022

SUMMARY

Fix issue when Alpha users want to make a secondary change in Edit Dataset. The issue lies with the API from datasource/save returning a different payload for datasource.owners. To handle we'll add an additional check for the key value to make sure the user will still be able to edit moving forward.

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

Copy link
Member

@pkdotson pkdotson left a comment

Choose a reason for hiding this comment

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

Lgtm!

@@ -200,7 +200,8 @@ class DatasourceControl extends React.PureComponent {
const { user } = this.props;
const allowEdit =
datasource.owners.map(o => o.id).includes(user.userId) ||
isUserAdmin(user);
datasource.owners.map(o => o.value).includes(user.userId);
Copy link
Member

Choose a reason for hiding this comment

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

couldn't you write this in without the ||

o => o.id || o.value == user.userId

Copy link
Member

Choose a reason for hiding this comment

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

don't think this is the right way of doing it though.

Copy link
Member

Choose a reason for hiding this comment

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

also should this be an || or should you be amending allowEdit with the new values from o.value?

@hughhhh
Copy link
Member Author

hughhhh commented Jun 7, 2022

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2022

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

@codecov
Copy link

codecov bot commented Jun 7, 2022

Codecov Report

Merging #20296 (db27742) into master (d1c24f8) will decrease coverage by 0.04%.
The diff coverage is 34.48%.

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

@@            Coverage Diff             @@
##           master   #20296      +/-   ##
==========================================
- Coverage   66.65%   66.61%   -0.05%     
==========================================
  Files        1729     1733       +4     
  Lines       64906    64953      +47     
  Branches     6842     6858      +16     
==========================================
+ Hits        43266    43269       +3     
- Misses      19891    19929      +38     
- Partials     1749     1755       +6     
Flag Coverage Δ
javascript 51.51% <34.48%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
...art-controls/src/sections/annotationsAndLayers.tsx 100.00% <ø> (ø)
...chart-controls/src/shared-controls/dndControls.tsx 26.92% <0.00%> (-8.98%) ⬇️
...d/packages/superset-ui-chart-controls/src/types.ts 100.00% <ø> (ø)
...egacy-plugin-chart-event-flow/src/controlPanel.tsx 14.28% <0.00%> (ø)
...acy-preset-chart-deckgl/src/utilities/controls.jsx 11.11% <0.00%> (ø)
...chart-echarts/src/MixedTimeseries/controlPanel.tsx 86.66% <ø> (ø)
...hart-echarts/src/MixedTimeseries/transformProps.ts 0.00% <0.00%> (ø)
...gin-chart-echarts/src/Timeseries/transformProps.ts 56.84% <0.00%> (-1.50%) ⬇️
...n-chart-handlebars/src/plugin/controls/columns.tsx 15.00% <0.00%> (-1.67%) ⬇️
...n-chart-handlebars/src/plugin/controls/metrics.tsx 41.66% <0.00%> (+3.20%) ⬆️
... and 31 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 d1c24f8...e4bc6fb. Read the comment docs.

Copy link
Member

@AAfghahi AAfghahi left a comment

Choose a reason for hiding this comment

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

could we add some tests for this?

@hughhhh hughhhh merged commit b6c11f2 into apache:master Jun 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2022

Ephemeral environment shutdown and build artifacts deleted.

@mistercrunch mistercrunch added 🏷️ 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 size/XS 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants