Fix admin view saving permission#1946
Open
AaronPlave wants to merge 1 commit into
Open
Conversation
…h hasUpdateViewPermission to ensure correct disabled view save tooltip
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Fixes plan view menu save button disabled state to ensure admins can save views they do not own.
Details
The view menu save button was explicitly gating view save on view ownership. Now the button ties into actual permission to perform a view save. Additionally, there was a subtle svelte reactivity issue with
hasUpdateViewPermissioncomputation in the parent+page.sveltewhere theviewstore was being reactively updated twice within one reactive pass and the second write was not explicitly declaring that it wrote to the store (initializeView) so the svelte compiler didn't see any reactive dependencies and therefore didn't mark the store as dirty the second time. This meant that as an admin AND the owner of the view, upon page load, the save button would be disabled with a tooltip warning of a lack of update permissions when in reality the user did have update permissions. Upon view update, the issue would correct itself. The solution here was to move the initialization of the view above the computation of thehasUpdateViewPermissionso that the view is fully set beforehasUpdateViewPermissionreceives it initially.Visible UX Changes
Verification