From 11b792608fadfbbc41e737b401d505ff52944907 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 15 Aug 2018 22:20:50 +0200 Subject: webui: display status change in the timeline --- webui/src/bug/SetStatus.js | 37 +++++++++++++++++++++++++++++++++++++ webui/src/bug/Timeline.js | 3 +++ webui/src/bug/TimelineQuery.js | 3 +++ 3 files changed, 43 insertions(+) create mode 100644 webui/src/bug/SetStatus.js diff --git a/webui/src/bug/SetStatus.js b/webui/src/bug/SetStatus.js new file mode 100644 index 00000000..eb41fc28 --- /dev/null +++ b/webui/src/bug/SetStatus.js @@ -0,0 +1,37 @@ +import { withStyles } from '@material-ui/core/styles' +import gql from 'graphql-tag' +import React from 'react' +import Author from '../Author' +import Date from '../Date' + +const styles = theme => ({ + main: { + ...theme.typography.body2 + }, +}) + +const SetStatus = ({op, classes}) => { + + return ( +
+ + {op.status.toLowerCase()} this + +
+ ) +} + +SetStatus.fragment = gql` + fragment SetStatus on Operation { + ... on SetStatusOperation { + date + author { + name + email + } + status + } + } +` + +export default withStyles(styles)(SetStatus) diff --git a/webui/src/bug/Timeline.js b/webui/src/bug/Timeline.js index 2881a73b..a15409ab 100644 --- a/webui/src/bug/Timeline.js +++ b/webui/src/bug/Timeline.js @@ -2,6 +2,7 @@ import { withStyles } from '@material-ui/core/styles' import React from 'react' import LabelChange from './LabelChange' import Message from './Message' +import SetStatus from './SetStatus' import SetTitle from './SetTitle' const styles = theme => ({ @@ -35,6 +36,8 @@ class Timeline extends React.Component { return case 'SetTitleOperation': return + case 'SetStatusOperation': + return default: console.log('unsupported operation type ' + op.__typename) diff --git a/webui/src/bug/TimelineQuery.js b/webui/src/bug/TimelineQuery.js index 3d7db143..3ee4cb28 100644 --- a/webui/src/bug/TimelineQuery.js +++ b/webui/src/bug/TimelineQuery.js @@ -3,6 +3,7 @@ import gql from 'graphql-tag' import React from 'react' import { Query } from 'react-apollo' import LabelChange from './LabelChange' +import SetStatus from './SetStatus' import SetTitle from './SetTitle' import Timeline from './Timeline' import Message from './Message' @@ -17,6 +18,7 @@ const QUERY = gql` ...Comment ...LabelChange ...SetTitle + ...SetStatus } pageInfo { hasNextPage @@ -30,6 +32,7 @@ const QUERY = gql` ${Message.commentFragment} ${LabelChange.fragment} ${SetTitle.fragment} + ${SetStatus.fragment} ` const TimelineQuery = ({id}) => ( -- cgit