mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 17:51:44 +03:00
webui: display status change in the timeline
This commit is contained in:
parent
17aa40505b
commit
11b792608f
37
webui/src/bug/SetStatus.js
Normal file
37
webui/src/bug/SetStatus.js
Normal file
@ -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 (
|
||||
<div className={classes.main}>
|
||||
<Author author={op.author} bold />
|
||||
<span> {op.status.toLowerCase()} this</span>
|
||||
<Date date={op.date} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
SetStatus.fragment = gql`
|
||||
fragment SetStatus on Operation {
|
||||
... on SetStatusOperation {
|
||||
date
|
||||
author {
|
||||
name
|
||||
email
|
||||
}
|
||||
status
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export default withStyles(styles)(SetStatus)
|
@ -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 <LabelChange key={index} op={op}/>
|
||||
case 'SetTitleOperation':
|
||||
return <SetTitle key={index} op={op}/>
|
||||
case 'SetStatusOperation':
|
||||
return <SetStatus key={index} op={op}/>
|
||||
|
||||
default:
|
||||
console.log('unsupported operation type ' + op.__typename)
|
||||
|
@ -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}) => (
|
||||
|
Loading…
Reference in New Issue
Block a user