aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-05-17 12:43:17 +0200
committerQuentin Gliech <quentingliech@gmail.com>2019-05-22 20:41:03 +0200
commitaa6247ce870075922a1309718e8fafee321ef51d (patch)
tree1a4b92ce3ba7754522cf1018e712eb59067661e2 /webui/src
parent511ef0105cbc6a08298cd63320283bf41090d4e3 (diff)
downloadgit-bug-aa6247ce870075922a1309718e8fafee321ef51d.tar.gz
webui: Add Label gql fragment
Diffstat (limited to 'webui/src')
-rw-r--r--webui/src/Label.js12
-rw-r--r--webui/src/bug/Bug.js8
-rw-r--r--webui/src/bug/LabelChange.js15
-rw-r--r--webui/src/list/BugRow.js8
4 files changed, 19 insertions, 24 deletions
diff --git a/webui/src/Label.js b/webui/src/Label.js
index de2ccd61..fc8a3a22 100644
--- a/webui/src/Label.js
+++ b/webui/src/Label.js
@@ -1,4 +1,5 @@
import React from 'react';
+import gql from 'graphql-tag';
import { makeStyles } from '@material-ui/styles';
import {
getContrastRatio,
@@ -46,4 +47,15 @@ function Label({ label }) {
);
}
+Label.fragment = gql`
+ fragment Label on Label {
+ name
+ color {
+ R
+ G
+ B
+ }
+ }
+`;
+
export default Label;
diff --git a/webui/src/bug/Bug.js b/webui/src/bug/Bug.js
index 3e003567..1b19149d 100644
--- a/webui/src/bug/Bug.js
+++ b/webui/src/bug/Bug.js
@@ -91,12 +91,7 @@ Bug.fragment = gql`
status
title
labels {
- name
- color {
- R
- G
- B
- }
+ ...Label
}
createdAt
author {
@@ -105,6 +100,7 @@ Bug.fragment = gql`
displayName
}
}
+ ${Label.fragment}
`;
export default Bug;
diff --git a/webui/src/bug/LabelChange.js b/webui/src/bug/LabelChange.js
index 73c05c43..1e05b4a6 100644
--- a/webui/src/bug/LabelChange.js
+++ b/webui/src/bug/LabelChange.js
@@ -50,23 +50,14 @@ LabelChange.fragment = gql`
displayName
}
added {
- name
- color {
- R
- G
- B
- }
+ ...Label
}
removed {
- name
- color {
- R
- G
- B
- }
+ ...Label
}
}
}
+ ${Label.fragment}
`;
export default LabelChange;
diff --git a/webui/src/list/BugRow.js b/webui/src/list/BugRow.js
index 81cccc5e..cfac4616 100644
--- a/webui/src/list/BugRow.js
+++ b/webui/src/list/BugRow.js
@@ -95,18 +95,14 @@ BugRow.fragment = gql`
status
createdAt
labels {
- name
- color {
- R
- G
- B
- }
+ ...Label
}
author {
name
displayName
}
}
+ ${Label.fragment}
`;
export default BugRow;