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

show used space in user list #5342

Merged
merged 3 commits into from
Jul 5, 2017
Merged

show used space in user list #5342

merged 3 commits into from
Jul 5, 2017

Conversation

icewind1991
Copy link
Member

@icewind1991 icewind1991 commented Jun 12, 2017

Fixes #117

Makes the quota dropdown into a progress bar, used space is shown as tooltip on hover

preview

@soamz
Copy link

soamz commented Jun 12, 2017

I dont see it.
Is it another latest version ?

@MorrisJobke
Copy link
Member

Is it another latest version ?

This is a pull request. That means the code on ready for comments before it gets into the product.

@MorrisJobke
Copy link
Member

beside this little nitpick that looks really good 👍

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • tooltip is escaped weirdly:

bildschirmfoto 2017-06-12 um 11 58 54

@MorrisJobke MorrisJobke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jun 12, 2017
@enoch85
Copy link
Member

enoch85 commented Jun 12, 2017

"Unlimited" will disappear right? I mean this implementation will show the same values as this PR #5305?

@enoch85
Copy link
Member

enoch85 commented Jun 12, 2017

Also, would it be possible to show the % of the total used storage?

@codecov
Copy link

codecov bot commented Jun 12, 2017

Codecov Report

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

@@             Coverage Diff              @@
##             master    #5342      +/-   ##
============================================
- Coverage     54.15%   44.77%   -9.38%     
+ Complexity    22326     1678   -20648     
============================================
  Files          1380      157    -1223     
  Lines         85535    13426   -72109     
  Branches       1329     1329              
============================================
- Hits          46320     6012   -40308     
+ Misses        39215     7414   -31801
Impacted Files Coverage Δ Complexity Δ
lib/private/Files/Storage/DAV.php 64.6% <0%> (-0.22%) 161% <0%> (ø)
apps/dav/lib/Connector/Sabre/Node.php
settings/ajax/setquota.php
lib/private/Preview/MSOfficeDoc.php
lib/private/SystemTag/SystemTag.php
apps/systemtags/appinfo/routes.php
apps/dav/lib/DAV/CustomPropertiesBackend.php
lib/private/Encryption/Keys/Storage.php
lib/private/Updater/VersionCheck.php
.../Exceptions/EncryptionHeaderKeyExistsException.php
... and 1212 more

Copy link
Member

@LukasReschke LukasReschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice stuff and works as expected, see comments for remarks :)

@@ -332,4 +333,29 @@ public function remoteStorageMounts($storageId) {
->where($builder->expr()->eq('storage_id', $builder->createNamedParameter($storageId, IQueryBuilder::PARAM_INT)));
$query->execute();
}

public function getUsedSpaceForUsers(array $userIds) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I haz test? 🍪 😉

* Note that this only includes the space in their home directory,
* not any incoming shares or external storages.
*
* @param string[] $userIds
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason that this is an array of userIds instead of IUser[]? The other functions all take the user objects :)

@@ -138,7 +142,8 @@ public function __construct($appName,
ITimeFactory $timeFactory,
ICrypto $crypto,
Manager $keyManager,
IJobList $jobList) {
IJobList $jobList,
IUserMountCache $userMountCache) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also adjust the PHPDocs 😉

@icewind1991 icewind1991 force-pushed the userlist-used-space branch from 3bb42a9 to 4c27f00 Compare June 13, 2017 13:35
@icewind1991
Copy link
Member Author

@LukasReschke all fixed

@@ -455,4 +456,34 @@ public function testGetMountsForFileIdDeletedUser() {
$cachedMounts = $this->cache->getMountsForFileId($rootId);
$this->assertEmpty($cachedMounts);
}

public function testGtUsedSpaceForUsers() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testGetUsedSpaceForUsers? 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 force-pushed the userlist-used-space branch from 4c27f00 to 2e8e6f9 Compare June 15, 2017 12:07
@MorrisJobke MorrisJobke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 15, 2017
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

@linucksrox
Copy link

linucksrox commented Jun 21, 2017

I've been using this, and it works nicely 👍
I reported an issue #5470 which was a result of this pull request. Something in /settings/css/settings.css has changed causing a layout issue on the Personal configuration page. I haven't had a chance to dig more into what the fix could be, but wanted to mention this here.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
@MorrisJobke
Copy link
Member

I fixed the missing PHPDoc for the public interface. Now the CI should be fine :)

@MorrisJobke MorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jun 21, 2017
@codecov-io
Copy link

codecov-io commented Jul 4, 2017

Codecov Report

Merging #5342 into master will decrease coverage by 22.87%.
The diff coverage is 0%.

@@              Coverage Diff              @@
##             master    #5342       +/-   ##
=============================================
- Coverage     54.03%   31.15%   -22.88%     
+ Complexity    22465    22463        -2     
=============================================
  Files          1389     1388        -1     
  Lines         85957    85373      -584     
  Branches       1329     1329               
=============================================
- Hits          46449    26602    -19847     
- Misses        39508    58771    +19263
Impacted Files Coverage Δ Complexity Δ
settings/Controller/UsersController.php 0% <0%> (-69.2%) 114 <20> (+2)
settings/templates/users/part.userlist.php 0% <0%> (ø) 0 <0> (ø) ⬇️
lib/private/Files/Config/UserMountCache.php 3.44% <0%> (-85.69%) 39 <2> (-1)
apps/files_versions/lib/Command/Expire.php 0% <0%> (-100%) 3% <0%> (ø)
lib/private/DB/OCSqlitePlatform.php 0% <0%> (-100%) 5% <0%> (ø)
apps/user_ldap/lib/Migration/UUIDFix.php 0% <0%> (-100%) 5% <0%> (ø)
apps/user_ldap/lib/Mapping/GroupMapping.php 0% <0%> (-100%) 1% <0%> (ø)
apps/provisioning_api/lib/AppInfo/Application.php 0% <0%> (-100%) 6% <0%> (ø)
apps/user_ldap/lib/BackendUtility.php 0% <0%> (-100%) 1% <0%> (ø)
lib/private/DB/SQLiteSessionInit.php 0% <0%> (-100%) 4% <0%> (ø)
... and 373 more

@MorrisJobke
Copy link
Member

I fixed the not updated unit tests 😉

@MorrisJobke MorrisJobke force-pushed the userlist-used-space branch 3 times, most recently from 01da4b6 to 4b518f5 Compare July 5, 2017 09:27
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants