aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/graphql/schema/repository.graphql6
-rw-r--r--webui/src/pages/identity/BugList.tsx32
-rw-r--r--webui/src/pages/identity/GetBugsByUser.graphql10
-rw-r--r--webui/src/pages/identity/Identity.tsx5
4 files changed, 52 insertions, 1 deletions
diff --git a/api/graphql/schema/repository.graphql b/api/graphql/schema/repository.graphql
index 2b98fe37..5ce932b7 100644
--- a/api/graphql/schema/repository.graphql
+++ b/api/graphql/schema/repository.graphql
@@ -17,6 +17,10 @@ type Repository {
query: String
): BugConnection!
+ allBugsDetail(
+ query: String
+ ): [Bug]!
+
bug(prefix: String!): Bug
"""All the identities"""
@@ -47,4 +51,4 @@ type Repository {
"""Returns the last _n_ elements from the list."""
last: Int
): LabelConnection!
-} \ No newline at end of file
+}
diff --git a/webui/src/pages/identity/BugList.tsx b/webui/src/pages/identity/BugList.tsx
new file mode 100644
index 00000000..e1083cfb
--- /dev/null
+++ b/webui/src/pages/identity/BugList.tsx
@@ -0,0 +1,32 @@
+import React from 'react';
+
+import { Link } from '@material-ui/core';
+import CircularProgress from '@material-ui/core/CircularProgress';
+
+import { useGetBugsByUserQuery } from './GetBugsByUser.generated';
+
+type Props = {
+ humanId: string;
+};
+
+function BugList({ humanId }: Props) {
+ const { loading, error, data } = useGetBugsByUserQuery({
+ variables: {
+ query: 'author:' + humanId,
+ },
+ });
+
+ if (loading) return <CircularProgress />;
+ if (error) return <p>Error: {error}</p>;
+ const bugs = data?.repository?.allBugs.nodes;
+
+ console.log(bugs);
+ return (
+ <ol>
+ <li>{bugs ? bugs[0].title : ''}</li>
+ <Link href={'/bug/' + (bugs ? bugs[0].id : '')}>Klick</Link>
+ </ol>
+ );
+}
+
+export default BugList;
diff --git a/webui/src/pages/identity/GetBugsByUser.graphql b/webui/src/pages/identity/GetBugsByUser.graphql
new file mode 100644
index 00000000..0be85578
--- /dev/null
+++ b/webui/src/pages/identity/GetBugsByUser.graphql
@@ -0,0 +1,10 @@
+query GetBugsByUser ($query: String){
+ repository {
+ allBugs(query: $query) {
+ nodes {
+ id
+ title
+ }
+ }
+ }
+}
diff --git a/webui/src/pages/identity/Identity.tsx b/webui/src/pages/identity/Identity.tsx
index 22691b1c..43925f4f 100644
--- a/webui/src/pages/identity/Identity.tsx
+++ b/webui/src/pages/identity/Identity.tsx
@@ -14,6 +14,9 @@ import Avatar from '@material-ui/core/Avatar';
import { makeStyles } from '@material-ui/core/styles';
import { useCurrentIdentityQuery } from '../../components/CurrentIdentity/CurrentIdentity.generated';
+
+import BugList from './BugList';
+
const useStyles = makeStyles((theme) => ({
main: {
maxWidth: 1200,
@@ -59,6 +62,7 @@ const Identity = () => {
const { data } = useCurrentIdentityQuery();
const user = data?.repository?.userIdentity;
console.log(user);
+
return (
<main className={classes.main}>
<div className={classes.container}>
@@ -126,6 +130,7 @@ const Identity = () => {
</Avatar>
</div>
</div>
+ <BugList humanId={user?.humanId ? user?.humanId : ''} />
</main>
);
};