diff options
author | Quentin Gliech <quentingliech@gmail.com> | 2020-02-11 21:49:19 +0100 |
---|---|---|
committer | Quentin Gliech <quentingliech@gmail.com> | 2020-02-11 21:49:19 +0100 |
commit | 465f7ca73d7093eeeecb6553c804d8cfb06e6652 (patch) | |
tree | 28a19ae87252e776efa3bd0bb94b154131b866d7 /webui/src/list | |
parent | 1effc91556c4567673c68329722bd415ec648a12 (diff) | |
download | git-bug-465f7ca73d7093eeeecb6553c804d8cfb06e6652.tar.gz |
webui: stop using defaultRepository
Diffstat (limited to 'webui/src/list')
-rw-r--r-- | webui/src/list/FilterToolbar.graphql | 2 | ||||
-rw-r--r-- | webui/src/list/FilterToolbar.tsx | 4 | ||||
-rw-r--r-- | webui/src/list/ListQuery.graphql | 2 | ||||
-rw-r--r-- | webui/src/list/ListQuery.tsx | 8 |
4 files changed, 8 insertions, 8 deletions
diff --git a/webui/src/list/FilterToolbar.graphql b/webui/src/list/FilterToolbar.graphql index 644a4eed..cd103f44 100644 --- a/webui/src/list/FilterToolbar.graphql +++ b/webui/src/list/FilterToolbar.graphql @@ -1,5 +1,5 @@ query BugCount($query: String) { - defaultRepository { + repository { bugs: allBugs(query: $query) { totalCount } diff --git a/webui/src/list/FilterToolbar.tsx b/webui/src/list/FilterToolbar.tsx index df295054..b95b10bc 100644 --- a/webui/src/list/FilterToolbar.tsx +++ b/webui/src/list/FilterToolbar.tsx @@ -41,9 +41,9 @@ function CountingFilter({ query, children, ...props }: CountingFilterProps) { var prefix; if (loading) prefix = '...'; - else if (error || !data?.defaultRepository) prefix = '???'; + else if (error || !data?.repository) prefix = '???'; // TODO: better prefixes & error handling - else prefix = data.defaultRepository.bugs.totalCount; + else prefix = data.repository.bugs.totalCount; return ( <Filter {...props}> diff --git a/webui/src/list/ListQuery.graphql b/webui/src/list/ListQuery.graphql index bf9ea80a..ded60c8a 100644 --- a/webui/src/list/ListQuery.graphql +++ b/webui/src/list/ListQuery.graphql @@ -7,7 +7,7 @@ query ListBugs( $before: String $query: String ) { - defaultRepository { + repository { bugs: allBugs( first: $first last: $last diff --git a/webui/src/list/ListQuery.tsx b/webui/src/list/ListQuery.tsx index c91264e1..84b72431 100644 --- a/webui/src/list/ListQuery.tsx +++ b/webui/src/list/ListQuery.tsx @@ -203,8 +203,8 @@ function ListQuery() { let nextPage = null; let previousPage = null; let count = 0; - if (!loading && !error && data?.defaultRepository?.bugs) { - const bugs = data.defaultRepository.bugs; + if (!loading && !error && data?.repository?.bugs) { + const bugs = data.repository.bugs; count = bugs.totalCount; // This computes the URL for the next page if (bugs.pageInfo.hasNextPage) { @@ -250,8 +250,8 @@ function ListQuery() { content = <Placeholder count={10} />; } else if (error) { content = <Error error={error} />; - } else if (data?.defaultRepository) { - const bugs = data.defaultRepository.bugs; + } else if (data?.repository) { + const bugs = data.repository.bugs; if (bugs.totalCount === 0) { content = <NoBug />; |