-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 upload button visible on read-only folders #8589
Fix upload button visible on read-only folders #8589
Conversation
apps/files/css/files.scss
Outdated
@@ -27,6 +26,8 @@ | |||
} | |||
} | |||
|
|||
.actions.hidden { display: none; } |
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.
Please use the correct css multi-line Format :)
Otherwize 👍
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.
Right, done ;-)
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 <[email protected]>
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
|
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.