From 8d2292320c1ef1033e00c3eed92845d5c9a41647 Mon Sep 17 00:00:00 2001 From: sylenien Date: Fri, 4 Nov 2022 15:22:09 +0100 Subject: [PATCH] fix(ui): some design fixes; add report header/bottom --- frontend/app/assets/img/report-head.png | Bin 0 -> 5158 bytes .../Session_/BugReport/BugReportModal.tsx | 14 +++- .../components/StepsComponents/EventStep.tsx | 79 +++++++++--------- .../components/StepsComponents/SubModal.tsx | 2 +- .../components/StepsComponents/XRay.tsx | 2 - frontend/app/mstore/bugReportStore.ts | 19 +++-- 6 files changed, 61 insertions(+), 55 deletions(-) create mode 100644 frontend/app/assets/img/report-head.png diff --git a/frontend/app/assets/img/report-head.png b/frontend/app/assets/img/report-head.png new file mode 100644 index 0000000000000000000000000000000000000000..2164cadbae5928f19f45a808e63bb52adaabaea8 GIT binary patch literal 5158 zcmV+>6xr*EP)r_7jpqQ0xmNL?8CA^EQ>sxIM}o|mWbVxi%;P8C+O-=K>HK8IBaYL zOhlLAz+7f5b~b?F;`RY9LxhDdaKZG3*#n+&Y4TrE(pgWLQkJSpRYm77BEy!HN@b?1 z-^=&%WeNxc0)apv5C{YUfj}S-2m}IaKx7`gaw)&6{@GC}Ru>MDx`03+u(CW}bL~i_Q{r5lN4TMs*lxao3oB+l zv91Y<(J|9gDt&{Z9fv3cQos)TE>`JW`G5J|*@qd5e#{UE1Of}hshA!;hGgRrE=Pqc zL=s0M+$rGz| zfWqnutT$UI6q>KKb<$w}@OS=p`TszBI5>D)qza9SNuw0h;Ij{-vpFq|$RVgA94PnR zjj@%rSZJNSXgN<;-DQ=|mWh98E`{1xsVhagPSBe8HIDo6Y8&`PP!Y zcjTq;eHJGR_JysF9$NBh1s<4im>jx-=tIc(H1Jli~oMhOSJyiQKLG%1xV0rw(l0H=FzhHMw{T3&S zFJSK@_RpVDxbaLl;(s22g)+5bBHFzdZH!0JnJte}Tz$ItUcH$2Fkh}(&iTxB^i{ep z&QU4tATSMmR9$<)owt6_BH&=-OL3lpH@K?`IIr|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BH-Vy0)j>c3q7MGZey*+P{awEyVwy5_y>DLK$Fs zg(L$QbeVk7pLmuzEK?7~C@O}1`yMUSQgJ@D-KMbJfuTzV3G--$9CE0J2W~MTLAI&Yi_#>rMgxl4o8D zs{3Vpd349nC3QyBgBHOT4Q1LsgYj*79~FW8R6^~(oDOI${7#&sV(?i^ z{5woq8*J|%VDC2_%t7V#wBbl)S zvup9+#j$TcnsuhC@wm9x$3nKHoH;Y0G zR4NNCRCGvk+j^K~p2o4eM+<#vQMC+VQ6;^6GgRv!C?*iP^4c(4PPSj(3Uw z5$!A*Qz@EdO;fkF{V3~TedkWa^q6wfym~Po=I&5ghJRBbr3eH9CLF}c;Ey4GS!j!E zR?LVj{%ad`%kbv!u|CYJpG?{+q(zt22J1U_u45XFFi_TzO(`+_dr!IT&IhFw2w0KU z60N)e0us7&IR98TcXArl`K7MD8x>d*(?#V)7%F9T?F6{(0)bihrCUq$fXawL0<@U; zRb46@bE8zAXLz$MeEFnoFneM-R!p2LazxujIqr-e!%nb}0)a+itXDMNvf#Xt88Yk} zdd|u5WxAdM9q_Ya`n$4(9%nSvT%SOHfl3_hq=ejQgy7X*e z(3&>k(CdyZT)fLoVV6#XKp+rU4H)R4L#uT(+eviWZDP{R**3&H5C{YUfxtZY2i&f! UFAEfbS^xk507*qoM6N<$f|T1P-v9sr literal 0 HcmV?d00001 diff --git a/frontend/app/components/Session_/BugReport/BugReportModal.tsx b/frontend/app/components/Session_/BugReport/BugReportModal.tsx index d898eb0f5..34f264d96 100644 --- a/frontend/app/components/Session_/BugReport/BugReportModal.tsx +++ b/frontend/app/components/Session_/BugReport/BugReportModal.tsx @@ -115,23 +115,29 @@ function BugReportModal({ hideModal, session, width, height, account, xrayProps, }).then((canvas) => { const imgData = canvas.toDataURL('img/png'); - var imgWidth = 210; + var imgWidth = 200; var pageHeight = 295; var imgHeight = (canvas.height * imgWidth) / canvas.width; var heightLeft = imgHeight; var position = 0; - doc.addImage(imgData, 'PNG', 0, 0, imgWidth, imgHeight); - heightLeft -= pageHeight; + + doc.addImage(imgData, 'PNG', 5, 5, imgWidth, imgHeight); + + doc.addImage('/assets/img/report-head.png', 'png', 210/2 - 40/2, 2, 45, 5); + + heightLeft -= pageHeight - 7; while (heightLeft >= 0) { position = heightLeft - imgHeight + 10; doc.addPage(); - doc.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight); + doc.addImage(imgData, 'PNG', 5, position, imgWidth, imgHeight); + doc.addImage('/assets/img/report-head.png', 'png', 210/2 - 40/2, pageHeight - 5, 45, 5); heightLeft -= pageHeight; } doc.link(5, 295 - Math.abs(heightLeft) - 25, 200, 30, { url: sessionUrl }); + if (position === 0) doc.addImage('/assets/img/report-head.png', 'png', 210/2 - 40/2, pageHeight - 5, 45, 5); doc.save('Bug Report: ' + sessionId + '.pdf'); setRendering(false); diff --git a/frontend/app/components/Session_/BugReport/components/StepsComponents/EventStep.tsx b/frontend/app/components/Session_/BugReport/components/StepsComponents/EventStep.tsx index da0b79fde..65bccd397 100644 --- a/frontend/app/components/Session_/BugReport/components/StepsComponents/EventStep.tsx +++ b/frontend/app/components/Session_/BugReport/components/StepsComponents/EventStep.tsx @@ -6,8 +6,8 @@ const STEP_NAMES = { CLICKRAGE: 'Multiple click', CLICK: 'Clicked', LOCATION: 'V import { useStore } from 'App/mstore'; import cn from 'classnames'; import { ErrorComp, NetworkComp, NoteComp } from './SubModalItems'; -import { durationFromMs } from 'App/date' -import { Tooltip } from 'react-tippy' +import { durationFromMs } from 'App/date'; +import { Tooltip } from 'react-tippy'; const SUBSTEP = { network: NetworkComp, @@ -52,11 +52,9 @@ function Step({ step, ind, isDefault }: { step: IStep; ind: number; isDefault?:
{ind + 1}
-
- {durationFromMs(step.time)} -
+
{durationFromMs(step.time)}
{/* @ts-ignore */} - + {/* @ts-ignore */}
{STEP_NAMES[step.type]}
{step.details}
@@ -68,20 +66,24 @@ function Step({ step, ind, isDefault }: { step: IStep; ind: number; isDefault?: > {/* @ts-ignore */} - - } - items={menuItems} - flat - onToggle={(isOpen) => setMenu(isOpen)} - /> + + } + items={menuItems} + flat + onToggle={(isOpen) => setMenu(isOpen)} + /> {/* @ts-ignore */} -
bugReportStore.removeStep(step)}> - -
+
bugReportStore.removeStep(step)}> + +
@@ -90,28 +92,27 @@ function Step({ step, ind, isDefault }: { step: IStep; ind: number; isDefault?: {step.substeps.map((subStep) => { const Component = SUBSTEP[subStep.type]; return ( -
-
- {/* @ts-ignore */} - -
-
+
+
+ {/* @ts-ignore */} + +
+
); })} diff --git a/frontend/app/components/Session_/BugReport/components/StepsComponents/SubModal.tsx b/frontend/app/components/Session_/BugReport/components/StepsComponents/SubModal.tsx index afbc25e6d..e70f19150 100644 --- a/frontend/app/components/Session_/BugReport/components/StepsComponents/SubModal.tsx +++ b/frontend/app/components/Session_/BugReport/components/StepsComponents/SubModal.tsx @@ -98,7 +98,7 @@ function ModalActions() { return (