Merge branch 'staging' into ro

pull/1/head
yflory 5 years ago
commit 0ce79e9c04

@ -317,7 +317,6 @@ define([
teamId: obj.id
}, waitFor(function (err) {
if (err) { return void console.error(err); }
console.warn(obj.id);
}));
});
}));

@ -3822,7 +3822,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) {

@ -119,9 +119,14 @@ define([
// it's a cloned object (NOTE: href should never be edited directly)
var findChannel = function (Env, channel, editable) {
var ret = [];
Env.user.userObject.findChannels([channel]).forEach(function (id) {
Env.user.userObject.findChannels([channel], true).forEach(function (id) {
// Check in shared folders, then clone if needed
var data = Env.user.proxy[UserObject.SHARED_FOLDERS][id];
if (data && !editable) { data = JSON.parse(JSON.stringify(data)); }
// If it's not a shared folder, check the pads
if (!data) { Env.user.userObject.getFileData(id, editable); }
ret.push({
data: Env.user.userObject.getFileData(id, editable),
data: data,
userObject: Env.user.userObject
});
});

@ -615,10 +615,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;
});
};

Loading…
Cancel
Save