fix(explore): update overwrite button on perm change#16437
Conversation
There was a problem hiding this comment.
This had to be explicitly added, as the action is missing the owners prop when all owners are missing
Codecov Report
@@ Coverage Diff @@
## master #16437 +/- ##
==========================================
+ Coverage 76.39% 76.50% +0.10%
==========================================
Files 1001 1002 +1
Lines 53535 53637 +102
Branches 6822 6853 +31
==========================================
+ Hits 40900 41033 +133
+ Misses 12396 12365 -31
Partials 239 239
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Frontend looks good to me! Thanks for the fixing. Is there any other state that can be maintained on the frontend only? |
4908a47 to
9ad9827
Compare
9ad9827 to
d230f82
Compare
|
/testenv up |
|
@villebro Ephemeral environment spinning up at http://54.201.70.223:8080. Credentials are |
Good question; I did briefly look into moving a few other properties to the frontend, but the other obvious candidates in this template ( |
|
Ephemeral environment shutdown and build artifacts deleted. |
* upstream/master: (25 commits) chore(ci): bump pylint to 2.10.2 (apache#16463) fix: prevent page crash when chart can't render (apache#16464) chore: fixed slack invite link (apache#16466) fix(native-filters): handle null values in value filter (apache#16460) feat: add function list to auto-complete to Clickhouse datasource (apache#16234) refactor(explore): improve typing for Dnd controls (apache#16362) fix(explore): update overwrite button on perm change (apache#16437) feat: Draggable and Resizable Modal (apache#16394) refactor: sql_json view endpoint (apache#16441) fix(dashboard): undo and redo buttons weird alignment (apache#16417) fix: setupPlugin in chart list page (apache#16413) fix: Disable Slack notification method if no api token (apache#16367) feat: add Shillelagh DB engine spec (apache#16416) fix: copy to Clipboard order (apache#16299) docs: make FEATURE_FLAGS.md reference a link (apache#16415) chore(viz): bump superset-ui to 0.17.87 (apache#16420) feat: add activate command (apache#16404) Revert "fix(explore): let admin overwrite slice (apache#16290)" (apache#16408) fix(explore): retain chart ownership on query context update (apache#16419) chore: Removes the TODOs and uses the default page size (apache#16422) ...
* fix(explore): update overwrite on perm change * remove redundant user_id prop * fix types * fix user type * fix tests * fix lint
* fix(explore): update overwrite on perm change * remove redundant user_id prop * fix types * fix user type * fix tests * fix lint
* fix(explore): update overwrite on perm change * remove redundant user_id prop * fix types * fix user type * fix tests * fix lint
SUMMARY
Currently the Explore view does not update the "can_overwrite" permission when the user updates the chart ownership, as it's populated from bootstrap data (rendered server-side when page is loaded). In addition, the "Save" button in the chart metadata modal is enabled when the owners array is initially empty, but after adding and removing a user the save button gets disabled.
This removes the
can_overwriteproperty from the Explore bootstrap data and replaces it with state from Redux, making it possible to change the disabled state of the "Save (Overwrite)" button in the Save modal. In addition, theslice.ownersproperty in bootstrap data is changed to provide numeric ids instead of "firstname lastname" (most other models were already returning owners in this format; it appears the "firstname lastname" results weren't being used anywhere in Explore). Also update some types and remove redundantuser_idproperty from bootstrap data.AFTER
explore-after.mp4
BEFORE
explore-before.mp4
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION