View pending invitation links and remove them (if admin)

pull/1/head
yflory 5 years ago
parent 35dbfe0bb5
commit 6a712a7b52

@ -763,10 +763,19 @@ define([
}); });
var pending = Object.keys(roster).filter(function (k) { var pending = Object.keys(roster).filter(function (k) {
if (!roster[k].pending) { return; } if (!roster[k].pending) { return; }
if (roster[k].inviteChannel) { return; }
return roster[k].role === "MEMBER" || roster[k].role === "VIEWER" || !roster[k].role; return roster[k].role === "MEMBER" || roster[k].role === "VIEWER" || !roster[k].role;
}).map(function (k) { }).map(function (k) {
return makeMember(common, roster[k], me); return makeMember(common, roster[k], me);
}); });
var links = Object.keys(roster).filter(function (k) {
if (!roster[k].pending) { return; }
if (!roster[k].inviteChannel) { return; }
roster[k].curvePublic = k; // XXX "if (!data.curvePublic) { return; }" in makeMember
return roster[k].role === "VIEWER" || !roster[k].role;
}).map(function (k) {
return makeMember(common, roster[k], me);
});
var header = h('div.cp-app-team-roster-header'); var header = h('div.cp-app-team-roster-header');
var $header = $(header); var $header = $(header);
@ -820,6 +829,7 @@ define([
$header.append(table); $header.append(table);
var noPending = pending.length ? '' : '.cp-hidden'; var noPending = pending.length ? '' : '.cp-hidden';
var noLinks = links.length ? '' : '.cp-hidden';
return [ return [
header, header,
@ -832,7 +842,9 @@ define([
h('h3', Messages.team_viewers || 'VIEWERS'), h('h3', Messages.team_viewers || 'VIEWERS'),
h('div', viewers), h('div', viewers),
h('h3'+noPending, Messages.team_pending), h('h3'+noPending, Messages.team_pending),
h('div'+noPending, pending) h('div'+noPending, pending),
h('h3'+noLinks, Messages.team_links),
h('div'+noLinks, links)
]; ];
}; };
makeBlock('roster', function (common, cb) { makeBlock('roster', function (common, cb) {

Loading…
Cancel
Save