From 8a4e373e7b1c093abeb967d9a6a43c5ed533edb8 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Tue, 31 Jul 2018 00:18:55 +0200 Subject: [PATCH] webui: Use the new schema --- webui/src/Bug.js | 13 +++++++++---- webui/src/BugPage.js | 10 ++++++---- webui/src/ListPage.js | 17 ++++++++++++----- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/webui/src/Bug.js b/webui/src/Bug.js index 28558a1388056356725873d73683ef6dcb915791..f8699fc46060340b1f803c2b90534552b869e179 100644 --- a/webui/src/Bug.js +++ b/webui/src/Bug.js @@ -17,8 +17,8 @@ const Bug = ({ bug, classes }) => (
- {bug.comments.map((comment, index) => ( - + {bug.comments.edges.map(({ cursor, node }) => ( + ))}
); @@ -26,8 +26,13 @@ const Bug = ({ bug, classes }) => ( Bug.fragment = gql` fragment Bug on Bug { ...BugSummary - comments { - ...Comment + comments(input: { first: 10 }) { + edges { + cursor + node { + ...Comment + } + } } } diff --git a/webui/src/BugPage.js b/webui/src/BugPage.js index ec0872eb76252a40ba8bf10bbabadfd82aa27ff1..0f4158410a393a6a52cfda326312d35bf06e5f7b 100644 --- a/webui/src/BugPage.js +++ b/webui/src/BugPage.js @@ -7,9 +7,11 @@ import CircularProgress from "@material-ui/core/CircularProgress"; import Bug from "./Bug"; const QUERY = gql` - query GetBug($id: BugID!) { - bug(id: $id) { - ...Bug + query GetBug($id: String!) { + defaultRepository { + bug(prefix: $id) { + ...Bug + } } } @@ -21,7 +23,7 @@ const BugPage = ({ match }) => ( {({ loading, error, data }) => { if (loading) return ; if (error) return

Error.

; - return ; + return ; }} ); diff --git a/webui/src/ListPage.js b/webui/src/ListPage.js index c873eefa273de0e818c5c73837046cf038536e12..836acda5af1ef4660893b4ad7461d6dee691205c 100644 --- a/webui/src/ListPage.js +++ b/webui/src/ListPage.js @@ -9,8 +9,15 @@ import BugSummary from "./BugSummary"; const QUERY = gql` { - bugs: allBugs { - ...BugSummary + defaultRepository { + bugs: allBugs(input: { first: 10 }) { + edges { + cursor + node { + ...BugSummary + } + } + } } } @@ -27,8 +34,8 @@ const styles = theme => ({ const List = withStyles(styles)(({ bugs, classes }) => (
- {bugs.map(bug => ( - + {bugs.edges.map(({ cursor, node }) => ( + ))}
)); @@ -38,7 +45,7 @@ const ListPage = () => ( {({ loading, error, data }) => { if (loading) return ; if (error) return

Error.

; - return ; + return ; }} );