-
Notifications
You must be signed in to change notification settings - Fork 2.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
Add webdav property for share info in PROPFIND response #22789
Conversation
*/ | ||
private function getShares($node) { | ||
$shares = []; | ||
$shareTypes = [0, 1, 3]; // FIXME: use constants |
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.
Constants are in \OCP\Share:: for now... I still need to think where to move those properly.
So far we have to call To improve this, we could at some point add a specialized API call for this in the share manager: $shareTypes = $this->shareManager->getOutgoingShareTypes($userId, $nodes); where SELECT DISTINCT shareType FROM *PREFIX*share WHERE item_source IN (...) |
and of course might need to chunk the |
|
f641b43
to
2a7f3ea
Compare
Web UI was changed to make use of the new property.
However the "Favorite" list doesn't use webdav yet, so that one is still missing the share status... Basically the only benefits of this PR are:
How about I rename "oc:share" to "oc:shareTypes" ? Is it ok to have a comma separated list or do we want more fancy |
I prefer the fancy way: <oc:shareTypes>
<oc:shareType>1</oc:shareType>
<oc:shareType>3</oc:shareType>
</oc:shareTypes> |
Added 0045d7b to also fix the favorite file list. While it doesn't use the new webdav property, it still needs the JS changes from this PR to work. That's why I put them together inside the same PR. |
@rullzer ok, I settled on this format: <oc:share-types>
<oc:share-type>1</oc:share-type>
<oc:share-type>3</oc:share-type>
</oc:share-types> using dashes instead of camel case because other properies are alike. I haven't pushed yet, will add some unit tests first. |
0045d7b
to
13ddefc
Compare
Ok, I'm done. To test:
Before this fix: share statuses were missing in the "Tags" and "Favorite" section Note: the other sections in the steps are only for regression testing. Please review @rullzer @nickvergessen @icewind1991 @MorrisJobke @schiesbn @SergioBertolinSG |
|
Weeeird, when I tested it locally it worked. Maybe I messed up my rebase. I'll have a look. |
Ah yes of course, the unit test of the controller needs adjusting... forgot that |
13ddefc
to
8f5f2b9
Compare
Fixed ApiController tests |
This happened after switching to master (to compare) and switch back. (I dunno if this was also broken before the switch) |
Beside the above this works :) |
6066a7d
to
6e6e002
Compare
Ok fixed... we need to deserializer for the repots stuff... @MorrisJobke please have another look. |
Seems we should also have intergration tests for the report methods.. |
Retested and works now 👍 |
@karlitschek backport to 9.0.1 ? |
stable9: #23384 |
please backport 👍 |
Where is the necessity of the backport coming from? |
@@ -137,6 +137,12 @@ public function createServer($baseUri, | |||
|
|||
if($this->userSession->isLoggedIn()) { | |||
$server->addPlugin(new \OCA\DAV\Connector\Sabre\TagsPlugin($objectTree, $this->tagManager)); | |||
$server->addPlugin(new \OCA\DAV\Connector\Sabre\SharesPlugin( |
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.
this plugin has to be added to the v2 endpoint as well
@rullzer can I ask you to duplicate all webdav tests so that the new endpoint is tested as well? THX
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.
Yes added to my TODO... will do
This is to fix #22708 which is a regression. |
@DeepDiver1975 you already merged the backport. Can you also merge this one ? Then we'll need to make another PR + backport to fix your comments. |
Add webdav property for share info in PROPFIND response
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
POC for #22708
To test
Then:
curl -D - -X PROPFIND -H "Content-Type: application/xml" --data-binary "@propfind.txt" http://admin:admin@localhost/owncloud/remote.php/files
Make sure to have something shares, then check the "oc:shares" response.
Tasks
oc:shareTypes
or something@rullzer @DeepDiver1957 @blizzz