From dcfd7bf7fffb6b7c946011870f1ae8a292937ddd Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sun, 19 Nov 2017 16:37:37 +0100 Subject: fix avatars in file rows of outgoing shares Signed-off-by: Arthur Schiwon --- apps/files_sharing/js/share.js | 4 ++-- apps/files_sharing/js/sharedfilelist.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'apps/files_sharing') diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 5cd04ece446..dbfce6e83b5 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -53,6 +53,7 @@ } if (fileData.recipientsDisplayName) { tr.attr('data-share-recipients', fileData.recipientsDisplayName); + tr.attr('data-share-recipient-data', JSON.stringify(fileData.recipientData)); } if (fileData.shareTypes) { tr.attr('data-share-types', fileData.shareTypes.join(',')); @@ -67,8 +68,7 @@ fileInfo.shareOwner = $el.attr('data-share-owner') || undefined; if( $el.attr('data-share-types')){ - var shareTypes = $el.attr('data-share-types').split(','); - fileInfo.shareTypes = shareTypes; + fileInfo.shareTypes = $el.attr('data-share-types').split(','); } if( $el.attr('data-expiration')){ diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index b11b302c6c2..b32ee97f716 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -307,6 +307,7 @@ else { if (share.share_type !== OC.Share.SHARE_TYPE_LINK) { file.share.targetDisplayName = share.share_with_displayname; + file.share.targetShareWithId = share.share_with; } file.name = OC.basename(share.path); file.path = OC.dirname(share.path); @@ -325,12 +326,14 @@ .reduce(function(memo, file) { var data = memo[file.id]; var recipient = file.share.targetDisplayName; + var recipientId = file.share.targetShareWithId; if (!data) { data = memo[file.id] = file; data.shares = [file.share]; // using a hash to make them unique, // this is only a list to be displayed data.recipients = {}; + data.recipientData = {}; // share types data.shareTypes = {}; // counter is cheaper than calling _.keys().length @@ -351,6 +354,7 @@ // only store the first ones, they will be the only ones // displayed data.recipients[recipient] = true; + data.recipientData[recipientId] = recipient; } data.recipientsCount++; } -- cgit v1.2.3