mirror of
https://github.com/nextcloud/server.git
synced 2026-05-26 19:32:28 -04:00
Merge pull request #50935 from nextcloud/backport/50918/stable31
[stable31] fix(files_sharing): Map sharee information for `shared-by-you` view
This commit is contained in:
commit
e115a8fb57
5 changed files with 24 additions and 5 deletions
|
|
@ -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)
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
2
dist/2693-2693.js.map
vendored
2
dist/2693-2693.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/files_sharing-init.js
vendored
4
dist/files_sharing-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_sharing-init.js.map
vendored
2
dist/files_sharing-init.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue