From eaf94f69abcdb9d55c26f7771bbbc0275b1cc337 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 6 Mar 2024 15:39:22 +0100 Subject: [PATCH] New support: fix UI issues --- customize.dist/src/less2/include/sidebar-layout.less | 3 +++ customize.dist/src/less2/include/support.less | 4 ---- www/common/outer/support.js | 1 - www/moderation/inner.js | 4 ++-- www/support/ui.js | 8 ++++---- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/customize.dist/src/less2/include/sidebar-layout.less b/customize.dist/src/less2/include/sidebar-layout.less index ccc540195..7963c3d34 100644 --- a/customize.dist/src/less2/include/sidebar-layout.less +++ b/customize.dist/src/less2/include/sidebar-layout.less @@ -205,6 +205,9 @@ } button.btn { margin: 0 0.5rem 0 0; + &:last-child { + margin-right: 0; + } } span.cp-password-container { margin-bottom: 1rem; diff --git a/customize.dist/src/less2/include/support.less b/customize.dist/src/less2/include/support.less index 1886cc79a..2e40946ef 100644 --- a/customize.dist/src/less2/include/support.less +++ b/customize.dist/src/less2/include/support.less @@ -164,10 +164,6 @@ display: none; } } - button { - margin-left: 2px; - margin-right: 5px; - } } } } diff --git a/www/common/outer/support.js b/www/common/outer/support.js index c69757f09..a229c536a 100644 --- a/www/common/outer/support.js +++ b/www/common/outer/support.js @@ -651,7 +651,6 @@ define([ if (!ctx.adminRdyEvt) { return void cb({ error: 'EFORBIDDEN' }); } let tags = data.tags || []; let text = (data.text || '').toLowerCase(); - console.error(tags, text); ctx.adminRdyEvt.reg(() => { let doc = ctx.adminDoc.proxy; let t = doc.tickets; diff --git a/www/moderation/inner.js b/www/moderation/inner.js index 2359b18fe..872262589 100644 --- a/www/moderation/inner.js +++ b/www/moderation/inner.js @@ -145,7 +145,6 @@ define([ APP.module.execCommand('LIST_TICKETS_ADMIN', { type: type }, (tickets) => { - console.error(tickets); if (tickets.error) { cb(); if (tickets.error === 'EFORBIDDEN') { @@ -259,6 +258,7 @@ define([ refreshAll(); }); }; + onMove.disableMove = type === 'closed'; onMove.isTicketActive = type === 'active'; const onTag = (channel, tags) => { @@ -928,7 +928,7 @@ Attachments:${JSON.stringify(msg.attachments, 0, 2)}`; }); }; if (!$ticket.length) { - content.category = 'closed'; // Consider ticket closed + content.category = 'legacy'; // Hide invalid features $ticket = APP.support.makeTicket({id, content, onMove}); $div.append($ticket); } diff --git a/www/support/ui.js b/www/support/ui.js index bb76ec7c4..7f09db5d4 100644 --- a/www/support/ui.js +++ b/www/support/ui.js @@ -416,12 +416,13 @@ define([ let url = h('button.btn.fa.fa-link', { title: Messages.share_linkCopy, }); $(url).click(function (e) { e.stopPropagation(); - var link = privateData.origin + privateData.pathname + '#' + 'open-' + linkId; + let cat = content.category === 'closed' ? 'closed' : 'open'; + var link = privateData.origin + privateData.pathname + `#${cat}-${linkId}`; Clipboard.copy(link, (err) => { if (!err) { UI.log(Messages.shareSuccess); } }); }); - if (content.category === 'closed') { url = undefined; } + if (content.category === 'legacy') { url = undefined; } // Load & open ticket @@ -453,7 +454,7 @@ define([ // Move active/pending let move; - if (onMove) { + if (onMove && !onMove.disableMove) { let text = onMove.isTicketActive ? Messages.support_movePending : Messages.support_moveActive; move = h('button.btn.btn-secondary.fa.fa-archive', { title: text }); @@ -478,7 +479,6 @@ define([ }); }; redrawTags(content.tags); - console.error(content.tags); let $tags = $(tagsContainer).hide(); let input = UI.dialog.textInput({id: `cp-${Util.uid()}`});