From a77d2da47c901fe85fa9642586c6e63b1f7af0fd Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 28 Oct 2019 15:18:33 +0100 Subject: [PATCH 1/3] Refresh shared folder owners in properties --- www/common/drive-ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 1561db904..c87d028d3 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -3752,7 +3752,7 @@ define([ data.sharedFolder = true; } - if (manager.isFile(el) && data.roHref) { // Only for pads! + if ((manager.isFile(el) && data.roHref) || manager.isSharedFolder(el)) { // Only for pads! sframeChan.query('Q_GET_PAD_METADATA', { channel: data.channel }, function (err, val) { From 77c6269e0cbe3e756cdf5c927b128b29b995797c Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 29 Oct 2019 11:16:46 +0100 Subject: [PATCH 2/3] Update shared folder owners locally when offering ownership --- www/common/proxy-manager.js | 6 ++++-- www/common/userObject.js | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/www/common/proxy-manager.js b/www/common/proxy-manager.js index ca914b57a..420cf4101 100644 --- a/www/common/proxy-manager.js +++ b/www/common/proxy-manager.js @@ -82,9 +82,11 @@ define([ // All occurences are returned, in drive or shared folders var findChannel = function (Env, channel) { var ret = []; - Env.user.userObject.findChannels([channel]).forEach(function (id) { + Env.user.userObject.findChannels([channel], true).forEach(function (id) { + var data = Env.user.proxy[UserObject.SHARED_FOLDERS][id] || + Env.user.userObject.getFileData(id); ret.push({ - data: Env.user.userObject.getFileData(id), + data: data, userObject: Env.user.userObject }); }); diff --git a/www/common/userObject.js b/www/common/userObject.js index 7795f09b3..5c987eb48 100644 --- a/www/common/userObject.js +++ b/www/common/userObject.js @@ -492,10 +492,13 @@ define([ }; // Get drive ids of files from their channel ids - exp.findChannels = function (channels) { + exp.findChannels = function (channels, includeSharedFolders) { var allFilesList = files[FILES_DATA]; - return getFiles([FILES_DATA]).filter(function (k) { - var data = allFilesList[k]; + var sfList = files[SHARED_FOLDERS]; + var paths = [FILES_DATA]; + if (includeSharedFolders) { paths.push(SHARED_FOLDERS); } + return getFiles(paths).filter(function (k) { + var data = allFilesList[k] || sfList[k] || {}; return channels.indexOf(data.channel) !== -1; }); }; From 6b1e39417066c1e85312e3b0ffcb4eab17e37f33 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 29 Oct 2019 11:36:53 +0100 Subject: [PATCH 3/3] Remove log --- www/common/common-ui-elements.js | 1 - 1 file changed, 1 deletion(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index b3e03bb7d..ffaefa45d 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -317,7 +317,6 @@ define([ teamId: obj.id }, waitFor(function (err) { if (err) { return void console.error(err); } - console.warn(obj.id); })); }); }));