diff --git a/webui/src/Author.js b/webui/src/Author.js
new file mode 100644
index 0000000000000000000000000000000000000000..37de7aa7ffa6a77da870192405be678822f46025
--- /dev/null
+++ b/webui/src/Author.js
@@ -0,0 +1,24 @@
+import Tooltip from '@material-ui/core/Tooltip/Tooltip'
+import React from 'react'
+import { withStyles } from '@material-ui/core/styles'
+
+const styles = theme => ({
+ author: {
+ ...theme.typography.body2,
+ },
+ bold: {
+ fontWeight: 'bold'
+ }
+})
+
+const Author = ({author, bold, classes}) => {
+ const klass = bold ? [classes.author, classes.bold] : [classes.author]
+
+ return (
+
+ {author.name}
+
+ )
+}
+
+export default withStyles(styles)(Author)
diff --git a/webui/src/Date.js b/webui/src/Date.js
new file mode 100644
index 0000000000000000000000000000000000000000..b20fd274087a6f11ceb5d66199e52d1536e7f180
--- /dev/null
+++ b/webui/src/Date.js
@@ -0,0 +1,11 @@
+import Tooltip from '@material-ui/core/Tooltip/Tooltip'
+import * as moment from 'moment'
+import React from 'react'
+
+const Date = ({date}) => (
+
+ {moment(date).fromNow()}
+
+)
+
+export default Date
diff --git a/webui/src/Label.js b/webui/src/Label.js
new file mode 100644
index 0000000000000000000000000000000000000000..93a9a358d6b4d6cd80284b692ea912f78047baaa
--- /dev/null
+++ b/webui/src/Label.js
@@ -0,0 +1,15 @@
+import React from 'react'
+import { withStyles } from '@material-ui/core/styles'
+
+const styles = theme => ({
+ label: {
+ padding: '0 4px',
+ margin: '0 1px',
+ backgroundColor: '#da9898',
+ borderRadius: '3px'
+ },
+})
+
+const Label = ({label, classes}) => {label}
+
+export default withStyles(styles)(Label)
diff --git a/webui/src/bug/Bug.js b/webui/src/bug/Bug.js
index 3847c755dc668bf115b520a32c044c8127f80404..34fc3ad411370ec3bb3b5926c5e386853525aae9 100644
--- a/webui/src/bug/Bug.js
+++ b/webui/src/bug/Bug.js
@@ -1,9 +1,9 @@
import { withStyles } from '@material-ui/core/styles'
-import Tooltip from '@material-ui/core/Tooltip/Tooltip'
import Typography from '@material-ui/core/Typography/Typography'
import gql from 'graphql-tag'
-import * as moment from 'moment'
import React from 'react'
+import Author from '../Author'
+import Date from '../Date'
import TimelineQuery from './TimelineQuery'
const styles = theme => ({
@@ -21,7 +21,8 @@ const styles = theme => ({
marginLeft: 15,
},
container: {
- display: 'flex'
+ display: 'flex',
+ marginBottom: 30
},
timeline: {
width: '70%',
@@ -47,11 +48,9 @@ const Bug = ({bug, classes}) => (
{bug.humanId}
- {bug.author.name}
+
opened this bug
-
- {moment(bug.createdAt).fromNow()}
-
+
diff --git a/webui/src/bug/LabelChange.js b/webui/src/bug/LabelChange.js
new file mode 100644
index 0000000000000000000000000000000000000000..f954372a5b1618d8860ccb5aee57ede6ed1ec2bf
--- /dev/null
+++ b/webui/src/bug/LabelChange.js
@@ -0,0 +1,44 @@
+import { withStyles } from '@material-ui/core/styles'
+import gql from 'graphql-tag'
+import React from 'react'
+import Author from '../Author'
+import Date from '../Date'
+import Label from '../Label'
+
+const styles = theme => ({
+ main: {
+ ...theme.typography.body2
+ },
+})
+
+const LabelChange = ({op, classes}) => {
+ const {added, removed} = op
+ return (
+
+
+ { added.length > 0 &&
added the }
+ { added.map((label, index) =>
)}
+ { (added.length > 0 && removed.length > 0) &&
and}
+ { removed.length > 0 &&
removed the }
+ { removed.map((label, index) =>
)}
+
label{ (added.length + removed.length > 1) && 's'}
+
+
+ )
+}
+
+LabelChange.fragment = gql`
+ fragment LabelChange on Operation {
+ ... on LabelChangeOperation {
+ date
+ author {
+ name
+ email
+ }
+ added
+ removed
+ }
+ }
+`
+
+export default withStyles(styles)(LabelChange)
diff --git a/webui/src/bug/Message.js b/webui/src/bug/Message.js
index 04c7dfabd2abd3562c8da4253638c243e7db92cf..612a9563ff3810144db9208ae72474d64d5f266a 100644
--- a/webui/src/bug/Message.js
+++ b/webui/src/bug/Message.js
@@ -1,9 +1,9 @@
import { withStyles } from '@material-ui/core/styles'
-import Tooltip from '@material-ui/core/Tooltip/Tooltip'
import Typography from '@material-ui/core/Typography'
import gql from 'graphql-tag'
-import * as moment from 'moment'
import React from 'react'
+import Author from '../Author'
+import Date from '../Date'
const styles = theme => ({
header: {
@@ -14,10 +14,6 @@ const styles = theme => ({
borderTopLeftRadius: 3,
borderTopRightRadius: 3,
},
- author: {
- ...theme.typography.body2,
- fontWeight: 'bold'
- },
message: {
borderLeft: '1px solid #d1d5da',
borderRight: '1px solid #d1d5da',
@@ -25,23 +21,20 @@ const styles = theme => ({
borderBottomLeftRadius: 3,
borderBottomRightRadius: 3,
backgroundColor: '#fff',
- minHeight: 50
+ minHeight: 50,
+ padding: 5,
}
})
-const Message = ({message, classes}) => (
+const Message = ({op, classes}) => (
-
- {message.author.name}
-
+
commented
-
- {moment(message.date).fromNow()}
-
+
- {message.message}
+ {op.message}
)
diff --git a/webui/src/bug/Timeline.js b/webui/src/bug/Timeline.js
index 0c4100ec55aea08c8094d2e3646ce40721dbd449..72c0712137a883d1db1fe734e6d016844554ab73 100644
--- a/webui/src/bug/Timeline.js
+++ b/webui/src/bug/Timeline.js
@@ -1,5 +1,6 @@
import { withStyles } from '@material-ui/core/styles'
import React from 'react'
+import LabelChange from './LabelChange'
import Message from './Message'
const styles = theme => ({
@@ -26,9 +27,11 @@ class Timeline extends React.Component {
{ ops.map((op, index) => {
switch (op.__typename) {
case 'CreateOperation':
- return
+ return
case 'AddCommentOperation':
- return
+ return
+ case 'LabelChangeOperation':
+ return
default:
console.log('unsupported operation type ' + op.__typename)
diff --git a/webui/src/bug/TimelineQuery.js b/webui/src/bug/TimelineQuery.js
index e773aac0b3400ab200f862256b05643641e1f975..ad4d00b0dab0a11fd2b345b7e11f3a65c2c3570b 100644
--- a/webui/src/bug/TimelineQuery.js
+++ b/webui/src/bug/TimelineQuery.js
@@ -2,6 +2,7 @@ import CircularProgress from '@material-ui/core/CircularProgress'
import gql from 'graphql-tag'
import React from 'react'
import { Query } from 'react-apollo'
+import LabelChange from './LabelChange'
import Timeline from './Timeline'
import Message from './Message'
@@ -13,6 +14,7 @@ const QUERY = gql`
nodes {
...Create
...Comment
+ ...LabelChange
}
pageInfo {
hasNextPage
@@ -24,10 +26,11 @@ const QUERY = gql`
}
${Message.createFragment}
${Message.commentFragment}
+ ${LabelChange.fragment}
`
const TimelineQuery = ({id}) => (
-
+
{({loading, error, data, fetchMore}) => {
if (loading) return
if (error) return Error: {error}
diff --git a/webui/src/list/BugRow.js b/webui/src/list/BugRow.js
index 1ce5ea069d1efa1cda537be0bb38a358180717eb..dba498d22be062711d786f7078cb43b898f023a0 100644
--- a/webui/src/list/BugRow.js
+++ b/webui/src/list/BugRow.js
@@ -5,9 +5,10 @@ import Tooltip from '@material-ui/core/Tooltip/Tooltip'
import Typography from '@material-ui/core/Typography'
import ErrorOutline from '@material-ui/icons/ErrorOutline'
import gql from 'graphql-tag'
-import * as moment from 'moment'
import React from 'react'
import { Link } from 'react-router-dom'
+import Date from '../Date'
+import Label from '../Label'
const Open = ({className}) =>
@@ -46,12 +47,6 @@ const styles = theme => ({
labels: {
display: 'inline-block',
paddingLeft: theme.spacing.unit,
- '&>span': {
- padding: '0 4px',
- margin: '0 1px',
- backgroundColor: '#da9898',
- borderRadius: '3px'
- }
}
})
@@ -68,16 +63,14 @@ const BugRow = ({bug, classes}) => (
{bug.labels.map(l => (
- {l})
- )}
+
{bug.humanId} opened
-
- {moment(bug.createdAt).fromNow()}
-
+
by {bug.author.name}