From 1984d4343db770fc2c8e251a81f1ab997a4c4d5e Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 15 Aug 2018 20:31:53 +0200 Subject: webui: rework of the bug page with a timeline --- webui/src/bug/TimelineQuery.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 webui/src/bug/TimelineQuery.js (limited to 'webui/src/bug/TimelineQuery.js') diff --git a/webui/src/bug/TimelineQuery.js b/webui/src/bug/TimelineQuery.js new file mode 100644 index 00000000..e773aac0 --- /dev/null +++ b/webui/src/bug/TimelineQuery.js @@ -0,0 +1,39 @@ +import CircularProgress from '@material-ui/core/CircularProgress' +import gql from 'graphql-tag' +import React from 'react' +import { Query } from 'react-apollo' +import Timeline from './Timeline' +import Message from './Message' + +const QUERY = gql` + query($id: String!, $first: Int = 10, $after: String) { + defaultRepository { + bug(prefix: $id) { + operations(first: $first, after: $after) { + nodes { + ...Create + ...Comment + } + pageInfo { + hasNextPage + endCursor + } + } + } + } + } + ${Message.createFragment} + ${Message.commentFragment} +` + +const TimelineQuery = ({id}) => ( + + {({loading, error, data, fetchMore}) => { + if (loading) return + if (error) return

Error: {error}

+ return + }} +
+) + +export default TimelineQuery -- cgit