Skip to content
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

Merged
merged 1 commit into from
Feb 28, 2018

Conversation

danxuliu
Copy link
Member

@danxuliu danxuliu commented Feb 28, 2018

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.

@@ -27,6 +26,8 @@
}
}

.actions.hidden { display: none; }
Copy link
Member

@skjnldsv skjnldsv Feb 28, 2018

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 👍

Copy link
Member Author

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]>
@danxuliu danxuliu force-pushed the fix-upload-button-visible-on-read-only-folders branch from 0e1aa3c to 542dc2b Compare February 28, 2018 16:28
@codecov
Copy link

codecov bot commented Feb 28, 2018

Codecov Report

Merging #8589 into master will decrease coverage by 20.5%.
The diff coverage is n/a.

@@              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
Impacted Files Coverage Δ Complexity Δ
apps/files_sharing/lib/External/MountProvider.php 0% <0%> (-100%) 4% <0%> (ø)
apps/comments/lib/AppInfo/Application.php 0% <0%> (-100%) 1% <0%> (ø)
apps/files_versions/lib/Command/Expire.php 0% <0%> (-100%) 3% <0%> (ø)
lib/public/Comments/CommentsEvent.php 0% <0%> (-100%) 3% <0%> (ø)
...public/AppFramework/OCS/OCSBadRequestException.php 0% <0%> (-100%) 1% <0%> (ø)
lib/private/SystemTag/ManagerFactory.php 0% <0%> (-100%) 3% <0%> (ø)
lib/private/Files/Mount/CacheMountProvider.php 0% <0%> (-100%) 4% <0%> (ø)
apps/dav/lib/Connector/Sabre/Server.php 0% <0%> (-100%) 1% <0%> (ø)
apps/user_ldap/lib/BackendUtility.php 0% <0%> (-100%) 1% <0%> (ø)
...ivate/Files/Cache/Wrapper/CachePermissionsMask.php 0% <0%> (-100%) 3% <0%> (ø)
... and 373 more

@rullzer rullzer merged commit faca634 into master Feb 28, 2018
@rullzer rullzer deleted the fix-upload-button-visible-on-read-only-folders branch February 28, 2018 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug design Design, UI, UX, etc. regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restricted permission notice misplaced Share by link (read-only): upload button
3 participants