aboutsummaryrefslogtreecommitdiffstats
path: root/webui
diff options
context:
space:
mode:
authorQuentin Gliech <quentingliech@gmail.com>2019-03-13 21:16:02 +0100
committerQuentin Gliech <quentingliech@gmail.com>2019-03-30 20:50:48 +0100
commit850b9db8744c47b3f42b877078678f62ce77e38d (patch)
tree9d0afada836b96c4efad0b6c1c19803e3b015dfa /webui
parent0a71e6d269e60f844a2d08069ca5bdee9b91b388 (diff)
downloadgit-bug-850b9db8744c47b3f42b877078678f62ce77e38d.tar.gz
webui: Use Timeline API instead of raw operations
Diffstat (limited to 'webui')
-rw-r--r--webui/src/bug/LabelChange.js4
-rw-r--r--webui/src/bug/Message.js14
-rw-r--r--webui/src/bug/SetStatus.js4
-rw-r--r--webui/src/bug/SetTitle.js4
-rw-r--r--webui/src/bug/Timeline.js10
-rw-r--r--webui/src/bug/TimelineQuery.js10
6 files changed, 23 insertions, 23 deletions
diff --git a/webui/src/bug/LabelChange.js b/webui/src/bug/LabelChange.js
index b1bed4a5..9b19959e 100644
--- a/webui/src/bug/LabelChange.js
+++ b/webui/src/bug/LabelChange.js
@@ -36,8 +36,8 @@ const LabelChange = ({ op, classes }) => {
};
LabelChange.fragment = gql`
- fragment LabelChange on Operation {
- ... on LabelChangeOperation {
+ fragment LabelChange on TimelineItem {
+ ... on LabelChangeTimelineItem {
date
author {
name
diff --git a/webui/src/bug/Message.js b/webui/src/bug/Message.js
index a4e3eeb0..e858e003 100644
--- a/webui/src/bug/Message.js
+++ b/webui/src/bug/Message.js
@@ -32,7 +32,7 @@ const Message = ({ op, classes }) => (
<div className={classes.header}>
<Author className={classes.author} author={op.author} bold />
<span> commented </span>
- <Date date={op.date} />
+ <Date date={op.createdAt} />
</div>
<div className={classes.message}>
<Typography>{op.message}</Typography>
@@ -41,9 +41,9 @@ const Message = ({ op, classes }) => (
);
Message.createFragment = gql`
- fragment Create on Operation {
- ... on CreateOperation {
- date
+ fragment Create on TimelineItem {
+ ... on CreateTimelineItem {
+ createdAt
author {
name
email
@@ -55,9 +55,9 @@ Message.createFragment = gql`
`;
Message.commentFragment = gql`
- fragment Comment on Operation {
- ... on AddCommentOperation {
- date
+ fragment AddComment on TimelineItem {
+ ... on AddCommentTimelineItem {
+ createdAt
author {
name
email
diff --git a/webui/src/bug/SetStatus.js b/webui/src/bug/SetStatus.js
index 332c8352..4e03fff7 100644
--- a/webui/src/bug/SetStatus.js
+++ b/webui/src/bug/SetStatus.js
@@ -21,8 +21,8 @@ const SetStatus = ({ op, classes }) => {
};
SetStatus.fragment = gql`
- fragment SetStatus on Operation {
- ... on SetStatusOperation {
+ fragment SetStatus on TimelineItem {
+ ... on SetStatusTimelineItem {
date
author {
name
diff --git a/webui/src/bug/SetTitle.js b/webui/src/bug/SetTitle.js
index 5b17c431..a32cf791 100644
--- a/webui/src/bug/SetTitle.js
+++ b/webui/src/bug/SetTitle.js
@@ -27,8 +27,8 @@ const SetTitle = ({ op, classes }) => {
};
SetTitle.fragment = gql`
- fragment SetTitle on Operation {
- ... on SetTitleOperation {
+ fragment SetTitle on TimelineItem {
+ ... on SetTitleTimelineItem {
date
author {
name
diff --git a/webui/src/bug/Timeline.js b/webui/src/bug/Timeline.js
index d331d11d..f5990711 100644
--- a/webui/src/bug/Timeline.js
+++ b/webui/src/bug/Timeline.js
@@ -27,15 +27,15 @@ class Timeline extends React.Component {
<div className={classes.main}>
{ops.map((op, index) => {
switch (op.__typename) {
- case 'CreateOperation':
+ case 'CreateTimelineItem':
return <Message key={index} op={op} />;
- case 'AddCommentOperation':
+ case 'AddCommentTimelineItem':
return <Message key={index} op={op} />;
- case 'LabelChangeOperation':
+ case 'LabelChangeTimelineItem':
return <LabelChange key={index} op={op} />;
- case 'SetTitleOperation':
+ case 'SetTitleTimelineItem':
return <SetTitle key={index} op={op} />;
- case 'SetStatusOperation':
+ case 'SetStatusTimelineItem':
return <SetStatus key={index} op={op} />;
default:
diff --git a/webui/src/bug/TimelineQuery.js b/webui/src/bug/TimelineQuery.js
index 78658a6f..ebb20f9d 100644
--- a/webui/src/bug/TimelineQuery.js
+++ b/webui/src/bug/TimelineQuery.js
@@ -12,13 +12,13 @@ const QUERY = gql`
query($id: String!, $first: Int = 10, $after: String) {
defaultRepository {
bug(prefix: $id) {
- operations(first: $first, after: $after) {
+ timeline(first: $first, after: $after) {
nodes {
- ...Create
- ...Comment
...LabelChange
- ...SetTitle
...SetStatus
+ ...SetTitle
+ ...AddComment
+ ...Create
}
pageInfo {
hasNextPage
@@ -42,7 +42,7 @@ const TimelineQuery = ({ id }) => (
if (error) return <p>Error: {error}</p>;
return (
<Timeline
- ops={data.defaultRepository.bug.operations.nodes}
+ ops={data.defaultRepository.bug.timeline.nodes}
fetchMore={fetchMore}
/>
);