From cd4b1adebbb009caba47b7dc4f543c4d951841f2 Mon Sep 17 00:00:00 2001 From: Sascha Date: Wed, 17 Mar 2021 12:28:45 +0100 Subject: [PATCH] Pass BugFragment as prop to EditComment --- webui/src/pages/bug/.Bug.tsx.swp | Bin 0 -> 12288 bytes webui/src/pages/bug/.TimelineQuery.tsx.swp | Bin 0 -> 12288 bytes webui/src/pages/bug/Bug.tsx | 2 +- webui/src/pages/bug/Message.tsx | 13 ++++++++++++- webui/src/pages/bug/Timeline.tsx | 8 +++++--- webui/src/pages/bug/TimelineQuery.tsx | 9 +++++---- 6 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 webui/src/pages/bug/.Bug.tsx.swp create mode 100644 webui/src/pages/bug/.TimelineQuery.tsx.swp diff --git a/webui/src/pages/bug/.Bug.tsx.swp b/webui/src/pages/bug/.Bug.tsx.swp new file mode 100644 index 0000000000000000000000000000000000000000..4a312e0daab61c565eabd8c7b582a50e81add559 GIT binary patch literal 12288 zcmeI2&x;#n7{}j=sIAsY6+MXXZiP*<+L`RONXbqXZA)Qg`@6OWMV(~cOr|?C?=bUD zHz7p5i3ckPDqiZv_GCR-5kx4I1-*!15j}WOD%Ajevzxtc8GFqR)r(R@Dg|)RKYCR z32tsDwE ze4d2eUpm5lM!QTHx-^|Wr^|d>v}wIwr&T&TTbS60-AQvKYg%z4(a*azriBza7HgQ{ zDMz@hzm$X*jYnl5i<73x#^xp(OSsJNa%+X#HnWz;mbp>2;>|Kp*f_vFkNM&d4?T)> z)MZX4rFcq^&C&2&pwfGlZbXUAg}b|*(MO(c;G9Zo*Yu*rRa+F>Cq zNxJ$mISrIslBj7~Omp34rj_`WZVg$XlhP^ACsBq>#G#Ly4PhXvNTk**qIDWa?4;V;6;+=!?*NG>Ig#VM!M}wQ#?jVUFE~PNfESt;9B8&qZ^WbzoRU zBUz|cgHE>QG@c0ySV&fwxhr_`9RG}Ci8j(x&6bgRIgtiaR4Vl|P;=@;l(v!p=cO)# znki13yDv7I;x?k#Jg1|ZLxz;-G_1`D5#7do>CIdWdQXKu0RiQ5)AB61=I2=0a`_rE z)^;q5`L{~f-og!uVP-7&a8M^p*nBn3m@IWUUs~P6nnpQ#=IWrp%Spg#k3`kY>3|-H zB8v9$>`9uo0iw^%;d_pk{990LldX_@w4~{Uv!%s>alWq)OmpW(hP{0EpnWmIQbCEtmIB}w2uI#QN*l0Kc7`5XxsKsk;NU#_qg^CKTt{x literal 0 HcmV?d00001 diff --git a/webui/src/pages/bug/.TimelineQuery.tsx.swp b/webui/src/pages/bug/.TimelineQuery.tsx.swp new file mode 100644 index 0000000000000000000000000000000000000000..0ad00f67d95d7c71c00c040dcd1cfd134b06d80a GIT binary patch literal 12288 zcmeI2%Wl&^6o#j)DXjpB?I|qUNUfcgO_ekaqJRVvh$1d45EFainmV?b8PislVaE~{ z>{x-|5fCdLf`#6jQjuPT|UC`Y~^twrm=nlse{OMHTwIuM zmLx8mpQ1CT?;Ud}JU$a(0!)AjFaajO1egF5I9>#7IwoFVl@eO(py@Q@Yx1dRA z0us>nDItDAKcO$sODKapXcf8vU4d4hbI>+={DwY3AE7tUYv>gup-0d|sPysx;)@9| z0Vco%m;e)C0!)AjFaaj;4-rtCX`(IpsxPz1(!PVqZ6S)bAkxZaI;N%3CMBuqG-CML9r-s(Ci z*mdmil(bXDRmICXO6x>7c3h>)SIdPK<<&;9`mJ(UC-m!;XHti<7b%0zNUA5wY1nd>DmSy$Y*b*# z%%~B->e%;8F6x|ps|cLQ%RW@J2rg68pw2Qn)UN^?ExMcq*R%`6S*+wEzGB literal 0 HcmV?d00001 diff --git a/webui/src/pages/bug/Bug.tsx b/webui/src/pages/bug/Bug.tsx index d85c52966139658fe79ef1d1d9ac7fcdc6a06401..46a443d5649b4604653488980af86d08beb0ca4f 100644 --- a/webui/src/pages/bug/Bug.tsx +++ b/webui/src/pages/bug/Bug.tsx @@ -78,7 +78,7 @@ function Bug({ bug }: Props) {
- + {() => (
diff --git a/webui/src/pages/bug/Message.tsx b/webui/src/pages/bug/Message.tsx index 390f369e5829ec5a41c7a6dfb8aef670344b1299..3993b5f71d64ee2e53f32901fc6a803a04638fee 100644 --- a/webui/src/pages/bug/Message.tsx +++ b/webui/src/pages/bug/Message.tsx @@ -9,7 +9,10 @@ import EditIcon from '@material-ui/icons/Edit'; import Author, { Avatar } from 'src/components/Author'; import Content from 'src/components/Content'; import Date from 'src/components/Date'; +import IfLoggedIn from 'src/components/IfLoggedIn/IfLoggedIn'; +import { BugFragment } from './Bug.generated'; +import CommentForm from './CommentForm'; import { AddCommentFragment } from './MessageCommentFragment.generated'; import { CreateFragment } from './MessageCreateFragment.generated'; @@ -65,10 +68,11 @@ const useStyles = makeStyles((theme) => ({ })); type Props = { + bug: BugFragment; op: AddCommentFragment | CreateFragment; }; -function Message({ op }: Props) { +function Message({ bug, op }: Props) { const classes = useStyles(); const editComment = (id: String) => { @@ -101,6 +105,13 @@ function Message({ op }: Props) { + + {() => ( +
+ +
+ )} +
); } diff --git a/webui/src/pages/bug/Timeline.tsx b/webui/src/pages/bug/Timeline.tsx index 6e1d242e074f6abdd4608029300ccd82c2956e90..60459a532505375c8d8a50a6b8e84dbc165beb39 100644 --- a/webui/src/pages/bug/Timeline.tsx +++ b/webui/src/pages/bug/Timeline.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; +import { BugFragment } from './Bug.generated'; import LabelChange from './LabelChange'; import Message from './Message'; import SetStatus from './SetStatus'; @@ -18,9 +19,10 @@ const useStyles = makeStyles((theme) => ({ type Props = { ops: Array; + bug: BugFragment; }; -function Timeline({ ops }: Props) { +function Timeline({ bug, ops }: Props) { const classes = useStyles(); return ( @@ -28,9 +30,9 @@ function Timeline({ ops }: Props) { {ops.map((op, index) => { switch (op.__typename) { case 'CreateTimelineItem': - return ; + return ; case 'AddCommentTimelineItem': - return ; + return ; case 'LabelChangeTimelineItem': return ; case 'SetTitleTimelineItem': diff --git a/webui/src/pages/bug/TimelineQuery.tsx b/webui/src/pages/bug/TimelineQuery.tsx index 74eed52b213d12c7166515f2b6b7408a0fdaff8b..d66c665b83b2f019fcbe8c58df781d3fd7e63ad3 100644 --- a/webui/src/pages/bug/TimelineQuery.tsx +++ b/webui/src/pages/bug/TimelineQuery.tsx @@ -2,17 +2,18 @@ import React from 'react'; import CircularProgress from '@material-ui/core/CircularProgress'; +import { BugFragment } from './Bug.generated'; import Timeline from './Timeline'; import { useTimelineQuery } from './TimelineQuery.generated'; type Props = { - id: string; + bug: BugFragment; }; -const TimelineQuery = ({ id }: Props) => { +const TimelineQuery = ({ bug }: Props) => { const { loading, error, data } = useTimelineQuery({ variables: { - id, + id: bug.id, first: 100, }, }); @@ -25,7 +26,7 @@ const TimelineQuery = ({ id }: Props) => { return null; } - return ; + return ; }; export default TimelineQuery;