Fix upload button visible on read-only folders#8589
Merged
Conversation
This was referenced Feb 28, 2018
skjnldsv
requested changes
Feb 28, 2018
apps/files/css/files.scss
Outdated
| } | ||
| } | ||
|
|
||
| .actions.hidden { display: none; } |
Member
There was a problem hiding this comment.
Please use the correct css multi-line Format :)
Otherwize 👍
The div that contains the elements related to the creation of new files, and thus the upload button, is always present in the DOM; it is hidden or shown based on the folder permissions by adding or removing the "hidden" CSS class. However, as the other CSS classes for the div are "actions" and "creatable" and a "display: flex" rule was defined for ".actions.creatable" below the "display: none" rule for ".actions.hidden" the last one took precedence and the div ended being always visible, even if the "hidden" CSS class was set. Now the rules for the ".actions.hidden" selector are defined below the rules for the ".actions.creatable" selector and thus the "display: none" rule is applied as expected. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
0e1aa3c to
542dc2b
Compare
Codecov Report
@@ Coverage Diff @@
## master #8589 +/- ##
=============================================
- Coverage 51.87% 31.37% -20.51%
Complexity 25406 25406
=============================================
Files 1609 1609
Lines 95296 95296
Branches 1378 1378
=============================================
- Hits 49437 29897 -19540
- Misses 45859 65399 +19540
|
skjnldsv
approved these changes
Feb 28, 2018
rullzer
approved these changes
Feb 28, 2018
This was referenced Feb 28, 2018
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.
Fixes #8343, which is a regression introduced in 7a9e65c
It also fixes #8543, as now the restricted permission notice will be shown in read-only folders in the same place as the upload button in writable folders.
I have written acceptance tests for this, but as they required some refactoring they were sent in a different pull request (#8594).
This fix causes the button to switch to the Gallery app to be hidden on read-only folders; a follow-up pull request for the Gallery app to solve this is in nextcloud/gallery#401.