From fa2d148df422d6775285ed12f910ecf7650a25d9 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 11 Sep 2019 16:23:58 +0200 Subject: [PATCH] Display a team drive --- www/common/outer/team.js | 14 +-- www/team/app-team.less | 21 ++-- www/team/inner.html | 3 +- www/team/inner.js | 232 ++++++++++++++++++++++++--------------- www/team/main.js | 8 ++ 5 files changed, 167 insertions(+), 111 deletions(-) diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 5cb94e11c..fb4d876ff 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -40,6 +40,7 @@ define([ Pinpad.create(ctx.store.network, data, function (e, call) { if (e) { return void cb(e); } team.rpc = call; + cb(); // XXX get pin limit? }); }); @@ -159,7 +160,6 @@ define([ }); } delete ctx.onReadyHandlers[id]; - console.log(cb); cb(); }); @@ -171,7 +171,7 @@ define([ var cfg = { data: {}, - readOnly: Boolean(secret.keys.signKey), + readOnly: !Boolean(secret.keys.signKey), network: ctx.store.network, channel: secret.channel, crypto: crypto, @@ -192,15 +192,13 @@ define([ var createTeam = function (ctx, data, cId, _cb) { var cb = Util.once(_cb); -console.log(data); - var password = Hash.createChannelId(); var hash = Hash.createRandomHash('team', password); var secret = Hash.getSecrets('team', hash, password); var keyPair = Nacl.sign.keyPair(); // keyPair.secretKey , keyPair.publicKey var membersSecret = Hash.getSecrets('members'); - var membersHashes = Hash.getHashes(secret); + var membersHashes = Hash.getHashes(membersSecret); var config = { network: ctx.store.network, @@ -231,8 +229,8 @@ console.log(data); // Store keys in our drive var id = Util.createRandomInteger(); var keys = { - edPrivate: keyPair.secretKey, - edPublic: keyPair.publicKey + edPrivate: Nacl.util.encodeBase64(keyPair.secretKey), + edPublic: Nacl.util.encodeBase64(keyPair.publicKey) }; ctx.store.proxy.teams[id] = { hash: hash, @@ -249,7 +247,7 @@ console.log(data); members: membersHashes.viewHash, }; // Add rpc key - proxy.edPublic = keyPair.publicKey; + proxy.edPublic = Nacl.util.encodeBase64(keyPair.publicKey); onReady(ctx, id, lm, { edPrivate: keyPair.secretKey, diff --git a/www/team/app-team.less b/www/team/app-team.less index 00f3e3b38..4a25cefe3 100644 --- a/www/team/app-team.less +++ b/www/team/app-team.less @@ -12,19 +12,18 @@ .drive_main(); .sidebar-layout_main(); - .cp-app-team-container { - flex: 1; - display: flex; - width: 100%; - flex-flow: row; - .cp-app-team-drive { - flex: 1; - display: flex; - &.hidden { - display: none; + #cp-sidebarlayout-container { + div#cp-sidebarlayout-rightside.cp-rightside-drive { + padding: 0; + & > .cp-team-drive { + display: flex; + height: 100%; + margin: 0; + .cp-app-drive-container { + height: 100%; + } } } - } } diff --git a/www/team/inner.html b/www/team/inner.html index cd965c3c2..e053dd789 100644 --- a/www/team/inner.html +++ b/www/team/inner.html @@ -12,7 +12,8 @@
-