From 7e1c7c481e3d0221a1b6233a2e4eb7aa17a6f54d Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 21 Dec 2020 15:15:08 +0100 Subject: [PATCH 1/4] Fix support panel UI issue --- www/support/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/support/ui.js b/www/support/ui.js index 6fd118d0d..b85197f63 100644 --- a/www/support/ui.js +++ b/www/support/ui.js @@ -307,7 +307,7 @@ define([ var form = makeForm(ctx, function () { var sent = sendForm(ctx, content.id, form, content.sender); if (sent) { - $(actions).show(); + $(actions).css('display', ''); $(form).remove(); } }, content.title); From 9f02df0b314b29937b5bfb219dcd24063d3eca77 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 21 Dec 2020 16:02:53 +0100 Subject: [PATCH 2/4] Correctly move tickets after closing them --- www/admin/app-admin.less | 10 ++++++---- www/admin/inner.js | 8 +++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/www/admin/app-admin.less b/www/admin/app-admin.less index 9f2c950a0..77e13af43 100644 --- a/www/admin/app-admin.less +++ b/www/admin/app-admin.less @@ -89,10 +89,6 @@ .cp-support-list-actions { margin: 10px 0px 10px 2px; - .cp-support-close { - order: 20; - margin-left: auto !important; - } } .cp-support-list-ticket { @@ -119,6 +115,12 @@ } .cp-support-list-ticket:not(.cp-support-list-closed) { + .cp-support-list-actions { + .cp-button-confirm, .cp-support-close { + order: 20; + margin-left: auto !important; + } + } .cp-support-list-message { &:last-child:not(.cp-support-fromadmin) { color: @colortheme_cp-red; diff --git a/www/admin/inner.js b/www/admin/inner.js index eabd997ff..755b60ddc 100644 --- a/www/admin/inner.js +++ b/www/admin/inner.js @@ -767,6 +767,7 @@ define([ if (!$ticket.length) { return; } $ticket.addClass('cp-support-list-closed'); $ticket.append(APP.support.makeCloseMessage(content, hash)); + reorder(); return; } if (msg.type !== 'TICKET') { return; } @@ -787,7 +788,12 @@ define([ })); }); }).nThen(function () { - if (!error) { return void $ticket.remove(); } + if (!error) { + $ticket.remove(); + delete hashesById[id]; + reorder(); + return; + } // if deletion failed then reactivate the button and warn hideButton.removeAttribute('disabled'); // and show a generic error message From 8cb19cdc764371b7de70661e0da9f50280a18f26 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 23 Dec 2020 11:55:54 +0100 Subject: [PATCH 3/4] Fix invalid LKH in roster --- www/common/outer/roster.js | 18 +++++++++++++----- www/common/outer/team.js | 6 +++++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/www/common/outer/roster.js b/www/common/outer/roster.js index 2c2675037..7dbf544c2 100644 --- a/www/common/outer/roster.js +++ b/www/common/outer/roster.js @@ -1,5 +1,5 @@ (function () { -var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto) { +var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto, Feedback) { var Roster = {}; // this constant is somewhat arbitrary. @@ -587,6 +587,11 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto) { // deleted while you are open // emit an event var onChannelError = function (info) { + Feedback.send('ROSTER_CHANNEL_ERROR='+info.type); + if (info.type === "EUNKNOWN") { + // chainpad-netflux should recover by itself + return; + } if (!ready) { return void cb(info); } console.error("CHANNEL_ERROR", info); }; @@ -870,7 +875,8 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto) { require("../../bower_components/chainpad-netflux/chainpad-netflux.js"), require("../../bower_components/json.sortify"), require("nthen"), - require("../../bower_components/chainpad-crypto/crypto") + require("../../bower_components/chainpad-crypto/crypto"), + null // no feedback here ); } else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) { require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); @@ -880,16 +886,18 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto) { '/bower_components/chainpad-netflux/chainpad-netflux.js', 'json.sortify', '/bower_components/nthen/index.js', - '/bower_components/chainpad-crypto/crypto.js' + '/bower_components/chainpad-crypto/crypto.js', + '/common/common-feedback.js', //'/bower_components/tweetnacl/nacl-fast.min.js', - ], function (Util, Hash, CPNF, Sortify, nThen, Crypto) { + ], function (Util, Hash, CPNF, Sortify, nThen, Crypto, Feedback) { return factory.apply(null, [ Util, Hash, CPNF, Sortify, nThen, - Crypto + Crypto, + Feedback ]); }); } else { diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 1099b4de7..26bd32f3c 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -1796,7 +1796,11 @@ define([ teams[id].keys.mailbox = deriveMailbox(teams[id]); } openChannel(ctx, teams[id], id, waitFor(function (err) { - if (err) { return void console.error(err); } + if (err) { + var txt = typeof(err) === "string" ? err : (err.type || err.message); + Feedback.send("TEAM_LOADING_ERROR="+txt); + return void console.error(err); + } console.debug('Team '+id+' ready'); })); }); From 32669dc099b6e6d75d55c677b54c6934292cd0bf Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 23 Dec 2020 12:00:17 +0100 Subject: [PATCH 4/4] Fix type error --- www/common/outer/roster.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/common/outer/roster.js b/www/common/outer/roster.js index 7dbf544c2..72f343477 100644 --- a/www/common/outer/roster.js +++ b/www/common/outer/roster.js @@ -587,8 +587,8 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto, Feedback) // deleted while you are open // emit an event var onChannelError = function (info) { - Feedback.send('ROSTER_CHANNEL_ERROR='+info.type); - if (info.type === "EUNKNOWN") { + if (Feedback) { Feedback.send('ROSTER_CHANNEL_ERROR='+(info && info.type)); } + if (info && info.type === "EUNKNOWN") { // chainpad-netflux should recover by itself return; }