Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions apps/files_sharing/src/services/SharingService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,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)
})

Expand Down
14 changes: 13 additions & 1 deletion apps/files_sharing/src/services/SharingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,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,
Expand All @@ -86,7 +97,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) {
Expand Down
2 changes: 1 addition & 1 deletion dist/9261-9261.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-init.js.map

Large diffs are not rendered by default.

Loading