summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-02-20 12:24:49 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2025-03-04 21:51:53 +0100
commiteb8c19c7cf3f07cf3ed274b8825370c365fe32b1 (patch)
treee2c1fc509eac21a9c554037bd2e8ca0d259c1234
parentf7fc17c2c928f162031d2955cdf6d56b634c0835 (diff)
downloadnextcloud-server-eb8c19c7cf3f07cf3ed274b8825370c365fe32b1.tar.gz
nextcloud-server-eb8c19c7cf3f07cf3ed274b8825370c365fe32b1.zip
fix(files_sharing): Map sharee information for `shared-by-you` view
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
-rw-r--r--apps/files_sharing/src/services/SharingService.spec.ts7
-rw-r--r--apps/files_sharing/src/services/SharingService.ts14
2 files changed, 20 insertions, 1 deletions
diff --git a/apps/files_sharing/src/services/SharingService.spec.ts b/apps/files_sharing/src/services/SharingService.spec.ts
index 2224a1d3967..936c1afafc4 100644
--- a/apps/files_sharing/src/services/SharingService.spec.ts
+++ b/apps/files_sharing/src/services/SharingService.spec.ts
@@ -355,6 +355,13 @@ describe('SharingService share to Node mapping', () => {
expect(file.root).toBe('/files/test')
expect(file.attributes).toBeInstanceOf(Object)
expect(file.attributes['has-preview']).toBe(true)
+ expect(file.attributes.sharees).toEqual({
+ sharee: {
+ id: 'user00',
+ 'display-name': 'User00',
+ type: 0,
+ },
+ })
expect(file.attributes.favorite).toBe(0)
})
diff --git a/apps/files_sharing/src/services/SharingService.ts b/apps/files_sharing/src/services/SharingService.ts
index 01a92cfff87..d8c6747f89c 100644
--- a/apps/files_sharing/src/services/SharingService.ts
+++ b/apps/files_sharing/src/services/SharingService.ts
@@ -71,6 +71,17 @@ const ocsEntryToNode = async function(ocsEntry: any): Promise<Folder | File | nu
mtime = new Date((ocsEntry.stime) * 1000)
}
+ let sharees: { sharee: object } | undefined
+ if ('share_with' in ocsEntry) {
+ sharees = {
+ sharee: {
+ id: ocsEntry.share_with,
+ 'display-name': ocsEntry.share_with_displayname || ocsEntry.share_with,
+ type: ocsEntry.share_type,
+ },
+ }
+ }
+
return new Node({
id: fileid,
source,
@@ -88,7 +99,8 @@ const ocsEntryToNode = async function(ocsEntry: any): Promise<Folder | File | nu
'owner-display-name': ocsEntry?.displayname_owner,
'share-types': ocsEntry?.share_type,
'share-attributes': ocsEntry?.attributes || '[]',
- favorite: ocsEntry?.tags?.includes((window.OC as Nextcloud.v29.OC & { TAG_FAVORITE: string }).TAG_FAVORITE) ? 1 : 0,
+ sharees,
+ favorite: ocsEntry?.tags?.includes((window.OC as { TAG_FAVORITE: string }).TAG_FAVORITE) ? 1 : 0,
},
})
} catch (error) {