From 8a8d039c64c45cd726a8176165a435794f9fcea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 12 Sep 2022 15:26:25 +0000 Subject: [PATCH] PROPFIND: render parent id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/ocs-share-parent-id.md | 5 +++++ .../owncloud/ocs/handlers/apps/sharing/shares/shares.go | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/ocs-share-parent-id.md diff --git a/changelog/unreleased/ocs-share-parent-id.md b/changelog/unreleased/ocs-share-parent-id.md new file mode 100644 index 00000000000..d6096d95453 --- /dev/null +++ b/changelog/unreleased/ocs-share-parent-id.md @@ -0,0 +1,5 @@ +Enhancement: render file parent id for ocs shares + +We brought back the `file_parent` property for ocs shares. The spaces concept makes navigating by path suboptimal. Having a parent id allows navigating without having to look up the full path. + +https://github.com/cs3org/reva/pull/3225 diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go index ff9341fa6d7..41ae82a2c54 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go @@ -1157,7 +1157,10 @@ func (h *Handler) addFileInfo(ctx context.Context, s *conversions.ShareData, inf } } s.StorageID = storageIDPrefix + s.FileTarget - // TODO FileParent: + + if info.ParentId != nil { + s.FileParent = storagespace.FormatResourceID(*info.ParentId) + } // item type s.ItemType = conversions.ResourceType(info.GetType()).String()