Skip to content

Add API to undelete delete group shares - #9909

Merged
MorrisJobke merged 9 commits into
masterfrom
feature/2192/allow_group_share_undeletion
Jul 5, 2018
Merged

Add API to undelete delete group shares#9909
MorrisJobke merged 9 commits into
masterfrom
feature/2192/allow_group_share_undeletion

Conversation

@rullzer

Copy link
Copy Markdown
Member

When a group share is deleted we keep track of this in the DB.
Right now it is only possible for a recipient to get back the share by
asking the sharer to delete it and to share it again. This doesn't
scale.

This endpoint makes it possible to get back the share.

Signed-off-by: Roeland Jago Douma roeland@famdouma.nl

@codecov

codecovBot commented Jun 19, 2018

Copy link
Copy Markdown

Codecov Report

Merging #9909 into master will decrease coverage by 0.13%.
The diff coverage is 5.51%.

@@ Coverage Diff @@## master #9909 +/- ##
============================================
- Coverage 51.42% 51.29% -0.14% + Complexity 26413 26031 -382 
============================================
Files 1690 1596 -94 Lines 97716 89005 -8711 Branches 1292 0 -1292 ============================================
- Hits 50248 45652 -4596 + Misses 47468 43353 -4115
Impacted FilesCoverage ΔComplexity Δ
...iles_sharing/lib/Controller/ShareAPIController.php68.03% <ø> (ø)160 <0> (ø)⬇️
...iles_sharing/composer/composer/autoload_static.php0% <ø> (ø)1 <0> (ø)⬇️
apps/files_sharing/appinfo/routes.php0% <0%> (ø)0 <0> (ø)⬇️
...aring/lib/Controller/DeletedShareAPIController.php0% <0%> (ø)14 <14> (?)
lib/private/Share20/Manager.php84.84% <0%> (-1.8%)240 <4> (+4)
...es_sharing/composer/composer/autoload_classmap.php0% <0%> (ø)0 <0> (ø)⬇️
...ederatedfilesharing/lib/FederatedShareProvider.php66.97% <0%> (-1.44%)85 <1> (+3)
apps/sharebymail/lib/ShareByMailProvider.php58.57% <0%> (-0.23%)86 <1> (+1)
apps/files_sharing/appinfo/app.php92.3% <100%> (+2.3%)0 <0> (ø)⬇️
lib/private/Share20/DefaultShareProvider.php89.01% <4.54%> (-2.82%)115 <1> (+1)
... and 161 more

@skjnldsv
skjnldsvforce-pushed the feature/2192/allow_group_share_undeletion branch from 65b5bd4 to 0861a86CompareJune 20, 2018 17:15
@skjnldsv
skjnldsvforce-pushed the feature/2192/allow_group_share_undeletion branch from b051bee to 13cca8fCompareJune 26, 2018 06:21
@skjnldsvskjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 26, 2018
Comment threadlib/public/Share/IManager.php Outdated
* @param int $limit The maximum number of shares returned, -1 for all
* @param int $offset
* @return IShare[]
* @since 9.0.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let me fix this. ;)

@MorrisJobkeMorrisJobke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested and code looks good 👍

@MorrisJobke

Copy link
Copy Markdown
Member

@rullzer Could you fix the CI - then this is good to go in.

@MorrisJobkeMorrisJobke 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 26, 2018
@rullzer

Copy link
Copy Markdown
MemberAuthor

I can have a look.
@skjnldsv what did you break ;)

@rullzer
rullzerforce-pushed the feature/2192/allow_group_share_undeletion branch from ca35f1b to 6bdffa9CompareJune 26, 2018 07:33
@skjnldsv

Copy link
Copy Markdown
Member

@rullzer 🙈

@@ -0,0 +1,144 @@
<?php

namespace OCA\Files_Sharing\Controller;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

license missing

@MorrisJobkeMorrisJobke added 2. developing Work in progress and removed 4. to release Ready to be released and/or waiting for tests to finish labels Jun 26, 2018
@rullzer

Copy link
Copy Markdown
MemberAuthor

@skjnldsv could you have a look at the failing js unit tests?

@rullzer
rullzerforce-pushed the feature/2192/allow_group_share_undeletion branch from 6bdffa9 to 874162eCompareJune 27, 2018 18:33
@skjnldsvskjnldsv added the 3. to review Waiting for reviews label Jun 28, 2018
@skjnldsvskjnldsv removed the 2. developing Work in progress label Jun 28, 2018
@rullzer

Copy link
Copy Markdown
MemberAuthor

@skjnldsv still failing jsunit tests :S

@skjnldsvskjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jul 4, 2018
@skjnldsv

Copy link
Copy Markdown
Member

@rullzer sorry, missed this
will fix asap

@skjnldsv
skjnldsvforce-pushed the feature/2192/allow_group_share_undeletion branch from 874162e to 3a9616cCompareJuly 4, 2018 17:35
@MorrisJobke

MorrisJobke commented Jul 5, 2018

Copy link
Copy Markdown
Member
  • JS unit tests do still fail:
PhantomJS 2.1.1 (Linux 0.0.0) OCA.Sharing.Util tests Share action clicking share action opens sidebar and share tab FAILED
Expected false to equal true.
apps/files_sharing/tests/js/shareSpec.js:251:50
TypeError: null is not an object (evaluating 'showDetailsViewStub.getCall(0).args') in apps/files_sharing/tests/js/shareSpec.js (line 252)
apps/files_sharing/tests/js/shareSpec.js:252:41
PhantomJS 2.1.1 (Linux 0.0.0) OCA.Sharing.Util tests Share action adds share icon after sharing a non-shared file FAILED
TypeError: undefined is not an object (evaluating 'shareTab._dialog.model') in apps/files_sharing/tests/js/shareSpec.js (line 276)
apps/files_sharing/tests/js/shareSpec.js:276:20
PhantomJS 2.1.1 (Linux 0.0.0) OCA.Sharing.Util tests Share action updates share icon after updating shares of a file FAILED
TypeError: undefined is not an object (evaluating 'shareTab._dialog.model') in apps/files_sharing/tests/js/shareSpec.js (line 308)
apps/files_sharing/tests/js/shareSpec.js:308:20
PhantomJS 2.1.1 (Linux 0.0.0) OCA.Sharing.Util tests Share action removes share icon after removing all shares from a file FAILED
TypeError: undefined is not an object (evaluating 'shareTab._dialog.model') in apps/files_sharing/tests/js/shareSpec.js (line 340)
apps/files_sharing/tests/js/shareSpec.js:340:20
PhantomJS 2.1.1 (Linux 0.0.0) OCA.Sharing.Util tests Share action keep share text after updating reshare FAILED
TypeError: undefined is not an object (evaluating 'shareTab._dialog.model') in apps/files_sharing/tests/js/shareSpec.js (line 367)
apps/files_sharing/tests/js/shareSpec.js:367:20
PhantomJS 2.1.1 (Linux 0.0.0) OCA.Sharing.Util tests Share action keep share text after unsharing reshare FAILED
TypeError: undefined is not an object (evaluating 'shareTab._dialog.model') in apps/files_sharing/tests/js/shareSpec.js (line 398)
apps/files_sharing/tests/js/shareSpec.js:398:20

rullzerand others added 9 commits July 5, 2018 12:43
When a group share is deleted we keep track of this in the DB.
Right now it is only possible for a recipient to get back the share by
asking the sharer to delete it and to share it again. This doesn't
scale.
This endpoint makes it possible to get back the share.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsv
skjnldsvforce-pushed the feature/2192/allow_group_share_undeletion branch from 3a9616c to f39dfc7CompareJuly 5, 2018 10:44
@skjnldsvskjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 2. developing Work in progress labels Jul 5, 2018
@skjnldsv

Copy link
Copy Markdown
Member

Failure unrelated:
sh: 1: kill: No such process

@MorrisJobke
MorrisJobke merged commit cbfcfb2 into masterJul 5, 2018
@skjnldsv
skjnldsv deleted the feature/2192/allow_group_share_undeletion branch July 5, 2018 11:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishenhancementfeature: sharing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rullzer@MorrisJobke@skjnldsv@nickvergessen