-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[stable13] Fix ids of permission checkboxes for shares #9453
Merged
MorrisJobke
merged 2 commits into
stable13
from
stable13-9237-fix-ids-of-permission-checkboxes-for-shares
May 14, 2018
Merged
[stable13] Fix ids of permission checkboxes for shares #9453
MorrisJobke
merged 2 commits into
stable13
from
stable13-9237-fix-ids-of-permission-checkboxes-for-shares
May 14, 2018
Conversation
This file contains 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
The ids of permission checkboxes for shares were generated using the "shareWith" field of the share. The "shareWith" field can contain spaces (as spaces are allowed, for example, in user or circle names), so this could cause the id attribute of the HTML element to contain spaces too, which is forbidden by the HTML specification. It is not just a "formal" issue, though; when the list was rendered after a permission change, if the id contained a space the selector to get the checkbox element was wrong (as it ended being something like "#canEdit-view1-name with spaces") and thus the updated state of the checkbox was not properly set. Besides that, "shareWith" can contain too single quotes, which would even cause the jQuery selector to abort the search and leave the UI in an invalid state. Instead of adding more cases to the regular expression to escape special characters and apply it too when the ids are created now the ids of permission checkboxes for shares are based on the "shareId" field instead of on "shareWith", as "shareId" is expected to always contain compatible characters. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The escaping of special characters was needed when the ids of the permission checkboxes for shares were based on the "shareWith" field. Since they are based on the "shareId" field the escaping is no longer needed, as the "sharedId" is expected to always contain compatible characters. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Codecov Report
@@ Coverage Diff @@
## stable13 #9453 +/- ##
==============================================
+ Coverage 51.36% 51.38% +0.01%
Complexity 25051 25051
==============================================
Files 1609 1609
Lines 95348 95346 -2
Branches 1376 1376
==============================================
+ Hits 48974 48991 +17
+ Misses 46374 46355 -19
|
rullzer
approved these changes
May 11, 2018
MorrisJobke
approved these changes
May 14, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐘
Merged
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.
Backport of #9237
Note that as #8390 was not backported the issues in stable13 are not exactly the same as the ones described in #9237; in master the problems appear as soon as the shares list is rendered, while in stable13 they appear only when the share permissions are updated, for example, when clicking on the Can edit checkbox.