Merge remote-tracking branch 'origin/staging' into staging

pull/1/head
David Benqué 5 years ago
commit 808317f8c1

@ -23,5 +23,26 @@
display: flex; display: flex;
flex-flow: column; flex-flow: column;
} }
.cp-support-list-actions {
margin: 10px 0px 10px 2px;
}
.cp-support-list-message {
&:last-child:not(.cp-support-fromadmin) {
color: @colortheme_cp-red;
background-color: lighten(@colortheme_cp-red, 25%);
.cp-support-showdata {
background-color: lighten(@colortheme_cp-red, 30%);
}
}
}
.cp-support-fromadmin {
color: @colortheme_logo-2;
background-color: #FFF;
.cp-support-message-content {
color: @colortheme_logo-2;
}
}
} }

@ -438,14 +438,24 @@ define([
parentEl.push(id); parentEl.push(id);
return; return;
} }
// Add to root if path is ROOT or if no path // Add to root if no path
var filesList = exp.getFiles([ROOT, TRASH, 'hrefArray']); var filesList = exp.getFiles([ROOT, TRASH, 'hrefArray']);
if (path && exp.isPathIn(newPath, [ROOT]) || filesList.indexOf(id) === -1) { if (filesList.indexOf(id) === -1 && !newPath) {
parentEl = exp.find(newPath || [ROOT]); newPath = [ROOT];
}
// Add to root
if (path && exp.isPathIn(newPath, [ROOT])) {
var parentEl = exp.find(newPath);
if (parentEl) { if (parentEl) {
var newName = exp.getAvailableName(parentEl, Hash.createChannelId()); var newName = exp.getAvailableName(parentEl, Hash.createChannelId());
parentEl[newName] = id; parentEl[newName] = id;
return; return;
} else {
parentEl = exp.find([ROOT]);
newPath.slice(1).forEach(function (folderName) {
parentEl = parentEl[folderName] = parentEl[folderName] || {};
});
parentEl[Hash.createChannelId()] = id;
} }
} }
}; };

@ -170,7 +170,9 @@ define([
var privateData = metadataMgr.getPrivateData(); var privateData = metadataMgr.getPrivateData();
// Check content.sender to see if it comes from us or from an admin // Check content.sender to see if it comes from us or from an admin
var fromMe = content.sender && content.sender.edPublic === privateData.edPublic; var senderKey = content.sender && content.sender.edPublic;
var fromMe = senderKey === privateData.edPublic;
var fromAdmin = ctx.adminKeys.indexOf(senderKey) !== -1;
var userData = h('div.cp-support-showdata', [ var userData = h('div.cp-support-showdata', [
Messages.support_showData, Messages.support_showData,
@ -183,7 +185,7 @@ define([
}); });
var name = Util.fixHTML(content.sender.name) || Messages.anonymous; var name = Util.fixHTML(content.sender.name) || Messages.anonymous;
return h('div.cp-support-list-message', { return h('div.cp-support-list-message' + (fromAdmin? '.cp-support-fromadmin': ''), {
'data-hash': hash 'data-hash': hash
}, [ }, [
h('div.cp-support-message-from' + (fromMe ? '.cp-support-fromme' : ''), [ h('div.cp-support-message-from' + (fromMe ? '.cp-support-fromme' : ''), [
@ -219,6 +221,7 @@ define([
common: common, common: common,
isAdmin: isAdmin, isAdmin: isAdmin,
pinUsage: pinUsage || false, pinUsage: pinUsage || false,
adminKeys: Array.isArray(ApiConfig.adminKeys)? ApiConfig.adminKeys.slice(): [],
}; };
ui.sendForm = function (id, form, dest) { ui.sendForm = function (id, form, dest) {

Loading…
Cancel
Save