From cef44db8c73c27c1da8dc5e0a9f2e47e0c096075 Mon Sep 17 00:00:00 2001 From: Lena Date: Fri, 5 Mar 2021 18:54:10 +0100 Subject: Add popup menu fpr user informations #12 --- .../CurrentIdentity/CurrentIdentity.graphql | 2 + .../components/CurrentIdentity/CurrentIdentity.tsx | 63 ++++++++++++++++++++-- 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.graphql b/webui/src/components/CurrentIdentity/CurrentIdentity.graphql index 2794a40f..9af786b7 100644 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.graphql +++ b/webui/src/components/CurrentIdentity/CurrentIdentity.graphql @@ -1,6 +1,8 @@ query CurrentIdentity { repository { userIdentity { + humanId + email displayName avatarUrl } diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx index 8cd3585b..68e65a99 100644 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx +++ b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx @@ -1,5 +1,14 @@ import React from 'react'; +import { + Button, + ClickAwayListener, + Grow, + MenuItem, + MenuList, + Paper, + Popper, +} from '@material-ui/core'; import Avatar from '@material-ui/core/Avatar'; import { makeStyles } from '@material-ui/core/styles'; @@ -15,14 +24,62 @@ const CurrentIdentity = () => { const classes = useStyles(); const { loading, error, data } = useCurrentIdentityQuery(); + const [open, setOpen] = React.useState(false); + const anchorRef = React.useRef(null); + if (error || loading || !data?.repository?.userIdentity) return null; const user = data.repository.userIdentity; + const handleToggle = () => { + setOpen((prevOpen) => !prevOpen); + }; + + const handleClose = (event: any) => { + if (anchorRef.current && anchorRef.current.contains(event.target)) { + return; + } + setOpen(false); + }; + return ( <> - - {user.displayName.charAt(0).toUpperCase()} - + + + {({ TransitionProps, placement }) => ( + + + + + Display Name: {user.displayName} + Human Id: {user.humanId} + Email: {user.email} + + + + + )} +
{user.displayName}
); -- cgit From e55761b2f8bdbb92ff77a7780bdd3b894d2a59ce Mon Sep 17 00:00:00 2001 From: Lena Date: Mon, 8 Mar 2021 17:39:23 +0100 Subject: Add fields, id as tooltip, and display none if value not set #12 --- webui/src/components/CurrentIdentity/CurrentIdentity.graphql | 6 +++++- webui/src/components/CurrentIdentity/CurrentIdentity.tsx | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.graphql b/webui/src/components/CurrentIdentity/CurrentIdentity.graphql index 9af786b7..5a1786f7 100644 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.graphql +++ b/webui/src/components/CurrentIdentity/CurrentIdentity.graphql @@ -1,10 +1,14 @@ query CurrentIdentity { repository { userIdentity { + id humanId - email displayName + email + name avatarUrl + isProtected + login } } } diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx index 68e65a99..2921e2bf 100644 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx +++ b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx @@ -71,9 +71,15 @@ const CurrentIdentity = () => { - Display Name: {user.displayName} - Human Id: {user.humanId} - Email: {user.email} + Name: {user.name ? user.name : 'none'} + + Id: {user.humanId ? user.humanId : 'none'} + + Email: {user.email ? user.email : 'none'} + Login: {user.login ? user.login : 'none'} + + Protected: {user.isProtected ? user.login : 'not set'} + -- cgit From 134ac8aacd218630722a88bd0daaf346270edbff Mon Sep 17 00:00:00 2001 From: Lena Date: Thu, 11 Mar 2021 15:57:54 +0100 Subject: 12 Add code to dynamically switch depending on valuue for isProtected --- webui/src/components/CurrentIdentity/CurrentIdentity.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx index 2921e2bf..bec8d14f 100644 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx +++ b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx @@ -11,6 +11,7 @@ import { } from '@material-ui/core'; import Avatar from '@material-ui/core/Avatar'; import { makeStyles } from '@material-ui/core/styles'; +import LockIcon from '@material-ui/icons/Lock'; import { useCurrentIdentityQuery } from './CurrentIdentity.generated'; @@ -18,6 +19,9 @@ const useStyles = makeStyles((theme) => ({ displayName: { marginLeft: theme.spacing(2), }, + hidden: { + display: 'none', + }, })); const CurrentIdentity = () => { @@ -30,6 +34,7 @@ const CurrentIdentity = () => { if (error || loading || !data?.repository?.userIdentity) return null; const user = data.repository.userIdentity; + const handleToggle = () => { setOpen((prevOpen) => !prevOpen); }; @@ -53,6 +58,7 @@ const CurrentIdentity = () => { {user.displayName.charAt(0).toUpperCase()} + { Email: {user.email ? user.email : 'none'} Login: {user.login ? user.login : 'none'} - - Protected: {user.isProtected ? user.login : 'not set'} + + Protected: {user.isProtected} -- cgit From 454f4e5962647115b8871ede29fc29d4da5fe289 Mon Sep 17 00:00:00 2001 From: Lena Date: Fri, 12 Mar 2021 00:55:47 +0100 Subject: 12 Setup Identity Page --- webui/src/App.tsx | 2 ++ webui/src/pages/identity/Identity.tsx | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 webui/src/pages/identity/Identity.tsx diff --git a/webui/src/App.tsx b/webui/src/App.tsx index 4c81913c..0b77a892 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -3,6 +3,7 @@ import { Route, Switch } from 'react-router'; import Layout from './components/Header'; import BugPage from './pages/bug'; +import IdentityPage from './pages/identity/Identity'; import ListPage from './pages/list'; import NewBugPage from './pages/new/NewBugPage'; import NotFoundPage from './pages/notfound/NotFoundPage'; @@ -14,6 +15,7 @@ export default function App() { + diff --git a/webui/src/pages/identity/Identity.tsx b/webui/src/pages/identity/Identity.tsx new file mode 100644 index 00000000..d936068b --- /dev/null +++ b/webui/src/pages/identity/Identity.tsx @@ -0,0 +1,17 @@ +import React from 'react'; + +import { makeStyles } from '@material-ui/core/styles'; + +import { useCurrentIdentityQuery } from '../../components/CurrentIdentity/CurrentIdentity.generated'; + +const useStyles = makeStyles((theme) => ({})); + +const Identity = () => { + const classes = useStyles(); + const { loading, error, data } = useCurrentIdentityQuery(); + const user = data?.repository?.userIdentity; + console.log(user); + return
; +}; + +export default Identity; -- cgit From 1808ff432b48d10bc14eaf17471289d19f3e1b0d Mon Sep 17 00:00:00 2001 From: Lena Date: Fri, 12 Mar 2021 02:06:09 +0100 Subject: Add very badly styled user details #12 --- webui/src/pages/identity/Identity.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/webui/src/pages/identity/Identity.tsx b/webui/src/pages/identity/Identity.tsx index d936068b..ef23e46d 100644 --- a/webui/src/pages/identity/Identity.tsx +++ b/webui/src/pages/identity/Identity.tsx @@ -1,5 +1,7 @@ import React from 'react'; +import { MenuItem, MenuList } from '@material-ui/core'; +import Avatar from '@material-ui/core/Avatar'; import { makeStyles } from '@material-ui/core/styles'; import { useCurrentIdentityQuery } from '../../components/CurrentIdentity/CurrentIdentity.generated'; @@ -11,7 +13,21 @@ const Identity = () => { const { loading, error, data } = useCurrentIdentityQuery(); const user = data?.repository?.userIdentity; console.log(user); - return
; + return ( +
+

Profile

+ + {user?.displayName.charAt(0).toUpperCase()} + +
    +
  • Name: {user?.name ? user?.name : 'none'}
  • +
  • Id: {user?.humanId ? user?.humanId : 'none'}
  • +
  • Email: {user?.email ? user?.email : 'none'}
  • +
  • Login: {user?.login ? user?.login : 'none'}
  • +
  • Protected: {user?.isProtected}
  • +
+
+ ); }; export default Identity; -- cgit From cdbb083d196333a1a09ec5c903c584d2ef7443fb Mon Sep 17 00:00:00 2001 From: Lena Date: Sun, 14 Mar 2021 18:10:47 +0100 Subject: #12 Style user page --- webui/src/pages/identity/Identity.tsx | 127 ++++++++++++++++++++++++++++++---- 1 file changed, 112 insertions(+), 15 deletions(-) diff --git a/webui/src/pages/identity/Identity.tsx b/webui/src/pages/identity/Identity.tsx index ef23e46d..c089f2b7 100644 --- a/webui/src/pages/identity/Identity.tsx +++ b/webui/src/pages/identity/Identity.tsx @@ -1,31 +1,128 @@ import React from 'react'; -import { MenuItem, MenuList } from '@material-ui/core'; +import { + Checkbox, + Divider, + FormControl, + FormControlLabel, + FormGroup, + FormLabel, + Paper, + TextField, +} from '@material-ui/core'; import Avatar from '@material-ui/core/Avatar'; import { makeStyles } from '@material-ui/core/styles'; import { useCurrentIdentityQuery } from '../../components/CurrentIdentity/CurrentIdentity.generated'; - -const useStyles = makeStyles((theme) => ({})); +const useStyles = makeStyles((theme) => ({ + main: { + maxWidth: 1200, + margin: 'auto', + marginTop: theme.spacing(4), + }, + container: { + display: 'flex', + marginBottom: theme.spacing(1), + marginRight: theme.spacing(2), + marginLeft: theme.spacing(2), + }, + leftSidebar: { + marginTop: theme.spacing(2), + marginRight: theme.spacing(2), + }, + content: { + marginTop: theme.spacing(5), + marginRight: theme.spacing(4), + padding: theme.spacing(3, 2), + minWidth: 800, + display: 'flex', + backgroundColor: theme.palette.background.paper, + }, + rightSidebar: { + marginTop: theme.spacing(5), + flex: '0 0 200px', + }, + large: { + width: theme.spacing(20), + height: theme.spacing(20), + }, + control: { + paddingBottom: theme.spacing(3), + }, +})); const Identity = () => { + // eslint-disable-next-line const classes = useStyles(); + // eslint-disable-next-line const { loading, error, data } = useCurrentIdentityQuery(); const user = data?.repository?.userIdentity; console.log(user); return ( -
-

Profile

- - {user?.displayName.charAt(0).toUpperCase()} - -
    -
  • Name: {user?.name ? user?.name : 'none'}
  • -
  • Id: {user?.humanId ? user?.humanId : 'none'}
  • -
  • Email: {user?.email ? user?.email : 'none'}
  • -
  • Login: {user?.login ? user?.login : 'none'}
  • -
  • Protected: {user?.isProtected}
  • -
+
+
+
+

{user?.displayName ? user?.displayName : 'none'}

+ + {user?.displayName.charAt(0).toUpperCase()} + +
+ + + + + + Your account + + + + + + + } + /> + + + +
+ + {user?.displayName.charAt(0).toUpperCase()} + +
+
); }; -- cgit From ad51d884a6926bc69073d1d5aaf584acd7db2c34 Mon Sep 17 00:00:00 2001 From: Lena Date: Mon, 15 Mar 2021 02:03:26 +0100 Subject: Make Link to User Page in Popup Menu #12 --- .../components/CurrentIdentity/CurrentIdentity.tsx | 25 ++++++++++++++-------- webui/src/pages/identity/Identity.tsx | 11 ++++++---- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx index bec8d14f..f3dff5ed 100644 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx +++ b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx @@ -4,6 +4,7 @@ import { Button, ClickAwayListener, Grow, + Link, MenuItem, MenuList, Paper, @@ -22,6 +23,9 @@ const useStyles = makeStyles((theme) => ({ hidden: { display: 'none', }, + profileLink: { + ...theme.typography.button, + }, })); const CurrentIdentity = () => { @@ -58,7 +62,10 @@ const CurrentIdentity = () => { {user.displayName.charAt(0).toUpperCase()} - + { - Name: {user.name ? user.name : 'none'} - - Id: {user.humanId ? user.humanId : 'none'} - - Email: {user.email ? user.email : 'none'} - Login: {user.login ? user.login : 'none'} - - Protected: {user.isProtected} + + + Open profile + diff --git a/webui/src/pages/identity/Identity.tsx b/webui/src/pages/identity/Identity.tsx index c089f2b7..22691b1c 100644 --- a/webui/src/pages/identity/Identity.tsx +++ b/webui/src/pages/identity/Identity.tsx @@ -49,20 +49,23 @@ const useStyles = makeStyles((theme) => ({ control: { paddingBottom: theme.spacing(3), }, + header: { + ...theme.typography.h5, + }, })); const Identity = () => { - // eslint-disable-next-line const classes = useStyles(); - // eslint-disable-next-line - const { loading, error, data } = useCurrentIdentityQuery(); + const { data } = useCurrentIdentityQuery(); const user = data?.repository?.userIdentity; console.log(user); return (
-

{user?.displayName ? user?.displayName : 'none'}

+

+ {user?.displayName ? user?.displayName : 'none'} +

{user?.displayName.charAt(0).toUpperCase()} -- cgit From cf1e13b6837d6dda794b9c0dca5af1bb8e095794 Mon Sep 17 00:00:00 2001 From: Lena Date: Thu, 18 Mar 2021 19:13:57 +0100 Subject: Add basic bug listing --- api/graphql/schema/repository.graphql | 6 ++++- webui/src/pages/identity/BugList.tsx | 32 ++++++++++++++++++++++++++ webui/src/pages/identity/GetBugsByUser.graphql | 10 ++++++++ webui/src/pages/identity/Identity.tsx | 5 ++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 webui/src/pages/identity/BugList.tsx create mode 100644 webui/src/pages/identity/GetBugsByUser.graphql 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 ; + if (error) return

Error: {error}

; + const bugs = data?.repository?.allBugs.nodes; + + console.log(bugs); + return ( +
    +
  1. {bugs ? bugs[0].title : ''}
  2. + Klick +
+ ); +} + +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 (
@@ -126,6 +130,7 @@ const Identity = () => {
+
); }; -- cgit From ba893ee5539c29b3e760ea994208afaa70913512 Mon Sep 17 00:00:00 2001 From: Lena Date: Thu, 18 Mar 2021 23:57:14 +0100 Subject: Style user site and adjust popup button #12 --- .../components/CurrentIdentity/CurrentIdentity.tsx | 11 +- webui/src/pages/identity/BugList.tsx | 52 +++++++-- webui/src/pages/identity/GetBugsByUser.graphql | 2 + webui/src/pages/identity/Identity.tsx | 118 +++++++++------------ 4 files changed, 107 insertions(+), 76 deletions(-) diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx index f3dff5ed..b68b84e5 100644 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx +++ b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx @@ -26,6 +26,9 @@ const useStyles = makeStyles((theme) => ({ profileLink: { ...theme.typography.button, }, + popupButton: { + textTransform: 'none', + }, })); const CurrentIdentity = () => { @@ -57,15 +60,14 @@ const CurrentIdentity = () => { aria-controls={open ? 'menu-list-grow' : undefined} aria-haspopup="true" onClick={handleToggle} + className={classes.popupButton} > {user.displayName.charAt(0).toUpperCase()} +
{user.displayName}
+ - { )} -
{user.displayName}
); }; diff --git a/webui/src/pages/identity/BugList.tsx b/webui/src/pages/identity/BugList.tsx index e1083cfb..623deda5 100644 --- a/webui/src/pages/identity/BugList.tsx +++ b/webui/src/pages/identity/BugList.tsx @@ -1,18 +1,37 @@ import React from 'react'; -import { Link } from '@material-ui/core'; +import { Card, Link, Typography } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; +import { makeStyles } from '@material-ui/core/styles'; + +import Date from '../../components/Date'; import { useGetBugsByUserQuery } from './GetBugsByUser.generated'; +const useStyles = makeStyles((theme) => ({ + main: { + ...theme.typography.body2, + }, + bugLink: { + ...theme.typography.button, + }, + cards: { + backgroundColor: theme.palette.background.default, + color: theme.palette.info.contrastText, + padding: theme.spacing(1), + margin: theme.spacing(1), + }, +})); + type Props = { humanId: string; }; function BugList({ humanId }: Props) { + const classes = useStyles(); const { loading, error, data } = useGetBugsByUserQuery({ variables: { - query: 'author:' + humanId, + query: 'author:' + humanId + ' sort:creation', }, }); @@ -22,10 +41,31 @@ function BugList({ humanId }: Props) { console.log(bugs); return ( -
    -
  1. {bugs ? bugs[0].title : ''}
  2. - Klick -
+
+ {bugs?.map((bug, index) => { + return ( + + + + {bug.title} + + + + Created  + + + + Last edited  + + + + ); + })} +
); } diff --git a/webui/src/pages/identity/GetBugsByUser.graphql b/webui/src/pages/identity/GetBugsByUser.graphql index 0be85578..0f170dc1 100644 --- a/webui/src/pages/identity/GetBugsByUser.graphql +++ b/webui/src/pages/identity/GetBugsByUser.graphql @@ -4,6 +4,8 @@ query GetBugsByUser ($query: String){ nodes { id title + createdAt + lastEdit } } } diff --git a/webui/src/pages/identity/Identity.tsx b/webui/src/pages/identity/Identity.tsx index 43925f4f..8261c0f4 100644 --- a/webui/src/pages/identity/Identity.tsx +++ b/webui/src/pages/identity/Identity.tsx @@ -2,16 +2,15 @@ import React from 'react'; import { Checkbox, - Divider, - FormControl, FormControlLabel, - FormGroup, - FormLabel, + Link, Paper, - TextField, + Typography, } from '@material-ui/core'; import Avatar from '@material-ui/core/Avatar'; import { makeStyles } from '@material-ui/core/styles'; +import InfoIcon from '@material-ui/icons/Info'; +import MailOutlineIcon from '@material-ui/icons/MailOutline'; import { useCurrentIdentityQuery } from '../../components/CurrentIdentity/CurrentIdentity.generated'; @@ -19,26 +18,24 @@ import BugList from './BugList'; const useStyles = makeStyles((theme) => ({ main: { - maxWidth: 1200, + maxWidth: 1000, margin: 'auto', marginTop: theme.spacing(4), + padding: theme.spacing(3, 2), + display: 'flex', }, container: { display: 'flex', marginBottom: theme.spacing(1), - marginRight: theme.spacing(2), - marginLeft: theme.spacing(2), }, leftSidebar: { marginTop: theme.spacing(2), - marginRight: theme.spacing(2), + flex: '0 0 200px', }, content: { marginTop: theme.spacing(5), - marginRight: theme.spacing(4), padding: theme.spacing(3, 2), minWidth: 800, - display: 'flex', backgroundColor: theme.palette.background.paper, }, rightSidebar: { @@ -53,7 +50,7 @@ const useStyles = makeStyles((theme) => ({ paddingBottom: theme.spacing(3), }, header: { - ...theme.typography.h5, + ...theme.typography.h4, }, })); @@ -70,67 +67,58 @@ const Identity = () => {

{user?.displayName ? user?.displayName : 'none'}

- - {user?.displayName.charAt(0).toUpperCase()} - - - - - - - - Your account - - - - - - - } - /> - - - -
{user?.displayName.charAt(0).toUpperCase()} + + Your account + + + Name: {user?.name ? user?.name : '---'} + + + Id (truncated): {user?.humanId ? user?.humanId : '---'} + + + + Login: {user?.login ? user?.login : '---'} + + + + + {user?.email ? user?.email : '---'} + + + } + />
+ + + Bugs authored by {user?.displayName} + + + +
-
); }; -- cgit From 7e368421d8329fadc748873e86e6bae61d99e6e3 Mon Sep 17 00:00:00 2001 From: Lena Date: Fri, 19 Mar 2021 00:11:05 +0100 Subject: Remove lock icon if not protected #12 --- webui/src/components/CurrentIdentity/CurrentIdentity.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx index b68b84e5..f37cc0e4 100644 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx +++ b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx @@ -66,7 +66,10 @@ const CurrentIdentity = () => { {user.displayName.charAt(0).toUpperCase()}
{user.displayName}
- + Date: Fri, 19 Mar 2021 17:09:13 +0100 Subject: Fix warning missing key and color user name #12 --- webui/src/components/CurrentIdentity/CurrentIdentity.tsx | 1 + webui/src/pages/identity/BugList.tsx | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx index f37cc0e4..962ce9ec 100644 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx +++ b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx @@ -28,6 +28,7 @@ const useStyles = makeStyles((theme) => ({ }, popupButton: { textTransform: 'none', + color: theme.palette.primary.contrastText, }, })); diff --git a/webui/src/pages/identity/BugList.tsx b/webui/src/pages/identity/BugList.tsx index 623deda5..e74c11d4 100644 --- a/webui/src/pages/identity/BugList.tsx +++ b/webui/src/pages/identity/BugList.tsx @@ -39,12 +39,11 @@ function BugList({ humanId }: Props) { if (error) return

Error: {error}

; const bugs = data?.repository?.allBugs.nodes; - console.log(bugs); return (
{bugs?.map((bug, index) => { return ( - + Date: Sat, 20 Mar 2021 15:13:10 +0100 Subject: Use profile page for each identity Authorcomponent links to the authors profile page. Replace pofile buglist with statistics --- api/graphql/schema/repository.graphql | 4 - webui/src/App.tsx | 4 +- webui/src/components/Author.tsx | 12 +- webui/src/components/BugTitleForm/BugTitleForm.tsx | 6 +- .../CurrentIdentity/CurrentIdentity.graphql | 14 -- .../components/CurrentIdentity/CurrentIdentity.tsx | 112 ----------- webui/src/components/Header/Header.tsx | 2 +- .../components/Identity/CurrentIdentity.graphql | 9 + webui/src/components/Identity/CurrentIdentity.tsx | 114 ++++++++++++ .../components/Identity/IdentityFragment.graphql | 10 + webui/src/components/Identity/UserIdentity.graphql | 9 + webui/src/components/IfLoggedIn/IfLoggedIn.tsx | 2 +- webui/src/graphql/fragments.graphql | 1 + webui/src/pages/bug/LabelChange.tsx | 8 +- webui/src/pages/bug/Message.tsx | 1 + webui/src/pages/bug/SetStatus.tsx | 8 +- webui/src/pages/bug/SetTitle.tsx | 8 +- webui/src/pages/identity/BugList.tsx | 4 +- webui/src/pages/identity/GetUserStatistic.graphql | 13 ++ webui/src/pages/identity/Identity.tsx | 207 ++++++++++++--------- webui/src/pages/identity/IdentityQuery.tsx | 24 +++ webui/src/pages/identity/index.tsx | 1 + webui/src/pages/list/BugRow.tsx | 4 +- webui/src/pages/list/ListQuery.tsx | 2 +- 24 files changed, 333 insertions(+), 246 deletions(-) delete mode 100644 webui/src/components/CurrentIdentity/CurrentIdentity.graphql delete mode 100644 webui/src/components/CurrentIdentity/CurrentIdentity.tsx create mode 100644 webui/src/components/Identity/CurrentIdentity.graphql create mode 100644 webui/src/components/Identity/CurrentIdentity.tsx create mode 100644 webui/src/components/Identity/IdentityFragment.graphql create mode 100644 webui/src/components/Identity/UserIdentity.graphql create mode 100644 webui/src/pages/identity/GetUserStatistic.graphql create mode 100644 webui/src/pages/identity/IdentityQuery.tsx create mode 100644 webui/src/pages/identity/index.tsx diff --git a/api/graphql/schema/repository.graphql b/api/graphql/schema/repository.graphql index 5ce932b7..d7411be7 100644 --- a/api/graphql/schema/repository.graphql +++ b/api/graphql/schema/repository.graphql @@ -17,10 +17,6 @@ type Repository { query: String ): BugConnection! - allBugsDetail( - query: String - ): [Bug]! - bug(prefix: String!): Bug """All the identities""" diff --git a/webui/src/App.tsx b/webui/src/App.tsx index 0b77a892..04da655a 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -3,7 +3,7 @@ import { Route, Switch } from 'react-router'; import Layout from './components/Header'; import BugPage from './pages/bug'; -import IdentityPage from './pages/identity/Identity'; +import IdentityPage from './pages/identity'; import ListPage from './pages/list'; import NewBugPage from './pages/new/NewBugPage'; import NotFoundPage from './pages/notfound/NotFoundPage'; @@ -15,7 +15,7 @@ export default function App() { - + diff --git a/webui/src/components/Author.tsx b/webui/src/components/Author.tsx index d60e8969..272ca5b5 100644 --- a/webui/src/components/Author.tsx +++ b/webui/src/components/Author.tsx @@ -1,6 +1,8 @@ import React from 'react'; +import { Link as RouterLink } from 'react-router-dom'; import MAvatar from '@material-ui/core/Avatar'; +import Link from '@material-ui/core/Link'; import Tooltip from '@material-ui/core/Tooltip/Tooltip'; import { AuthoredFragment } from '../graphql/fragments.generated'; @@ -11,13 +13,11 @@ type Props = AuthoredFragment & { }; const Author = ({ author, ...props }: Props) => { - if (!author.email) { - return {author.displayName}; - } - return ( - - {author.displayName} + + + {author.displayName} + ); }; diff --git a/webui/src/components/BugTitleForm/BugTitleForm.tsx b/webui/src/components/BugTitleForm/BugTitleForm.tsx index 665ecd4c..1092b203 100644 --- a/webui/src/components/BugTitleForm/BugTitleForm.tsx +++ b/webui/src/components/BugTitleForm/BugTitleForm.tsx @@ -52,6 +52,10 @@ const useStyles = makeStyles((theme) => ({ saveButton: { marginRight: theme.spacing(1), }, + author: { + fontWeight: 'bold', + color: theme.palette.text.secondary, + }, })); interface Props { @@ -182,7 +186,7 @@ function BugTitleForm({ bug }: Props) { {bugTitleEdition ? editableBugTitle() : readonlyBugTitle()}
- + {' opened this bug '} diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.graphql b/webui/src/components/CurrentIdentity/CurrentIdentity.graphql deleted file mode 100644 index 5a1786f7..00000000 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.graphql +++ /dev/null @@ -1,14 +0,0 @@ -query CurrentIdentity { - repository { - userIdentity { - id - humanId - displayName - email - name - avatarUrl - isProtected - login - } - } -} diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx deleted file mode 100644 index 962ce9ec..00000000 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import React from 'react'; - -import { - Button, - ClickAwayListener, - Grow, - Link, - MenuItem, - MenuList, - Paper, - Popper, -} from '@material-ui/core'; -import Avatar from '@material-ui/core/Avatar'; -import { makeStyles } from '@material-ui/core/styles'; -import LockIcon from '@material-ui/icons/Lock'; - -import { useCurrentIdentityQuery } from './CurrentIdentity.generated'; - -const useStyles = makeStyles((theme) => ({ - displayName: { - marginLeft: theme.spacing(2), - }, - hidden: { - display: 'none', - }, - profileLink: { - ...theme.typography.button, - }, - popupButton: { - textTransform: 'none', - color: theme.palette.primary.contrastText, - }, -})); - -const CurrentIdentity = () => { - const classes = useStyles(); - const { loading, error, data } = useCurrentIdentityQuery(); - - const [open, setOpen] = React.useState(false); - const anchorRef = React.useRef(null); - - if (error || loading || !data?.repository?.userIdentity) return null; - - const user = data.repository.userIdentity; - - const handleToggle = () => { - setOpen((prevOpen) => !prevOpen); - }; - - const handleClose = (event: any) => { - if (anchorRef.current && anchorRef.current.contains(event.target)) { - return; - } - setOpen(false); - }; - - return ( - <> - - - {({ TransitionProps, placement }) => ( - - - - - - - Open profile - - - - - - - )} - - - ); -}; - -export default CurrentIdentity; diff --git a/webui/src/components/Header/Header.tsx b/webui/src/components/Header/Header.tsx index 63146cc9..56b35968 100644 --- a/webui/src/components/Header/Header.tsx +++ b/webui/src/components/Header/Header.tsx @@ -8,7 +8,7 @@ import Toolbar from '@material-ui/core/Toolbar'; import Tooltip from '@material-ui/core/Tooltip/Tooltip'; import { makeStyles } from '@material-ui/core/styles'; -import CurrentIdentity from '../CurrentIdentity/CurrentIdentity'; +import CurrentIdentity from '../Identity/CurrentIdentity'; import { LightSwitch } from '../Themer'; const useStyles = makeStyles((theme) => ({ diff --git a/webui/src/components/Identity/CurrentIdentity.graphql b/webui/src/components/Identity/CurrentIdentity.graphql new file mode 100644 index 00000000..054190df --- /dev/null +++ b/webui/src/components/Identity/CurrentIdentity.graphql @@ -0,0 +1,9 @@ +#import "./IdentityFragment.graphql" + +query CurrentIdentity { + repository { + userIdentity { + ...Identity + } + } +} diff --git a/webui/src/components/Identity/CurrentIdentity.tsx b/webui/src/components/Identity/CurrentIdentity.tsx new file mode 100644 index 00000000..1fd424c1 --- /dev/null +++ b/webui/src/components/Identity/CurrentIdentity.tsx @@ -0,0 +1,114 @@ +import React from 'react'; +import { Link as RouterLink } from 'react-router-dom'; + +import { + Button, + ClickAwayListener, + Grow, + Link, + MenuItem, + MenuList, + Paper, + Popper, +} from '@material-ui/core'; +import Avatar from '@material-ui/core/Avatar'; +import { makeStyles } from '@material-ui/core/styles'; +import LockIcon from '@material-ui/icons/Lock'; + +import { useCurrentIdentityQuery } from './CurrentIdentity.generated'; + +const useStyles = makeStyles((theme) => ({ + displayName: { + marginLeft: theme.spacing(2), + }, + hidden: { + display: 'none', + }, + profileLink: { + ...theme.typography.button, + }, + popupButton: { + textTransform: 'none', + color: theme.palette.primary.contrastText, + }, +})); + +const CurrentIdentity = () => { + const classes = useStyles(); + const { loading, error, data } = useCurrentIdentityQuery(); + + const [open, setOpen] = React.useState(false); + const anchorRef = React.useRef(null); + + if (error || loading || !data?.repository?.userIdentity) return null; + + const user = data.repository.userIdentity; + + const handleToggle = () => { + setOpen((prevOpen) => !prevOpen); + }; + + const handleClose = (event: any) => { + if (anchorRef.current && anchorRef.current.contains(event.target)) { + return; + } + setOpen(false); + }; + + return ( + <> + + + {({ TransitionProps, placement }) => ( + + + + + + + Open profile + + + + + + + )} + + + ); +}; + +export default CurrentIdentity; diff --git a/webui/src/components/Identity/IdentityFragment.graphql b/webui/src/components/Identity/IdentityFragment.graphql new file mode 100644 index 00000000..6c4e2483 --- /dev/null +++ b/webui/src/components/Identity/IdentityFragment.graphql @@ -0,0 +1,10 @@ +fragment Identity on Identity { + id + humanId + displayName + email + name + avatarUrl + isProtected + login +} diff --git a/webui/src/components/Identity/UserIdentity.graphql b/webui/src/components/Identity/UserIdentity.graphql new file mode 100644 index 00000000..9cf10248 --- /dev/null +++ b/webui/src/components/Identity/UserIdentity.graphql @@ -0,0 +1,9 @@ +#import "./IdentityFragment.graphql" + +query GetUserById($userId: String!) { + repository { + identity(prefix: $userId) { + ...Identity + } + } +} diff --git a/webui/src/components/IfLoggedIn/IfLoggedIn.tsx b/webui/src/components/IfLoggedIn/IfLoggedIn.tsx index 2476aad8..ce120da1 100644 --- a/webui/src/components/IfLoggedIn/IfLoggedIn.tsx +++ b/webui/src/components/IfLoggedIn/IfLoggedIn.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { useCurrentIdentityQuery } from '../CurrentIdentity/CurrentIdentity.generated'; +import { useCurrentIdentityQuery } from '../Identity/CurrentIdentity.generated'; type Props = { children: () => React.ReactNode }; const IfLoggedIn = ({ children }: Props) => { diff --git a/webui/src/graphql/fragments.graphql b/webui/src/graphql/fragments.graphql index 03a235f9..d01c488a 100644 --- a/webui/src/graphql/fragments.graphql +++ b/webui/src/graphql/fragments.graphql @@ -15,5 +15,6 @@ fragment authored on Authored { email displayName avatarUrl + humanId } } diff --git a/webui/src/pages/bug/LabelChange.tsx b/webui/src/pages/bug/LabelChange.tsx index 712c33fa..868d8c9b 100644 --- a/webui/src/pages/bug/LabelChange.tsx +++ b/webui/src/pages/bug/LabelChange.tsx @@ -1,5 +1,6 @@ import React from 'react'; +import { Typography } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import Author from 'src/components/Author'; @@ -10,11 +11,12 @@ import { LabelChangeFragment } from './LabelChangeFragment.generated'; const useStyles = makeStyles((theme) => ({ main: { - ...theme.typography.body2, + color: theme.palette.text.secondary, marginLeft: theme.spacing(1) + 40, }, author: { fontWeight: 'bold', + color: theme.palette.text.secondary, }, label: { maxWidth: '50ch', @@ -31,7 +33,7 @@ function LabelChange({ op }: Props) { const { added, removed } = op; const classes = useStyles(); return ( -
+ {added.length > 0 && added the } {added.map((label, index) => ( @@ -48,7 +50,7 @@ function LabelChange({ op }: Props) { {added.length + removed.length > 1 && 's'}{' '} -
+ ); } diff --git a/webui/src/pages/bug/Message.tsx b/webui/src/pages/bug/Message.tsx index 39b11ccd..808bb525 100644 --- a/webui/src/pages/bug/Message.tsx +++ b/webui/src/pages/bug/Message.tsx @@ -21,6 +21,7 @@ import MessageHistoryDialog from './MessageHistoryDialog'; const useStyles = makeStyles((theme) => ({ author: { fontWeight: 'bold', + color: theme.palette.info.contrastText, }, container: { display: 'flex', diff --git a/webui/src/pages/bug/SetStatus.tsx b/webui/src/pages/bug/SetStatus.tsx index 855848f9..f231b917 100644 --- a/webui/src/pages/bug/SetStatus.tsx +++ b/webui/src/pages/bug/SetStatus.tsx @@ -1,5 +1,6 @@ import React from 'react'; +import { Typography } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import { Status } from '../../gqlTypes'; @@ -10,11 +11,12 @@ import { SetStatusFragment } from './SetStatusFragment.generated'; const useStyles = makeStyles((theme) => ({ main: { - ...theme.typography.body2, + color: theme.palette.text.secondary, marginLeft: theme.spacing(1) + 40, }, author: { fontWeight: 'bold', + color: theme.palette.text.secondary, }, })); @@ -29,11 +31,11 @@ function SetStatus({ op }: Props) { ]; return ( -
+ {status} this -
+ ); } diff --git a/webui/src/pages/bug/SetTitle.tsx b/webui/src/pages/bug/SetTitle.tsx index 98bea928..057062f7 100644 --- a/webui/src/pages/bug/SetTitle.tsx +++ b/webui/src/pages/bug/SetTitle.tsx @@ -1,5 +1,6 @@ import React from 'react'; +import { Typography } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import Author from 'src/components/Author'; @@ -9,11 +10,12 @@ import { SetTitleFragment } from './SetTitleFragment.generated'; const useStyles = makeStyles((theme) => ({ main: { - ...theme.typography.body2, + color: theme.palette.text.secondary, marginLeft: theme.spacing(1) + 40, }, author: { fontWeight: 'bold', + color: theme.palette.text.secondary, }, before: { fontWeight: 'bold', @@ -31,14 +33,14 @@ type Props = { function SetTitle({ op }: Props) { const classes = useStyles(); return ( -
+ changed the title from {op.was} to {op.title}  -
+ ); } diff --git a/webui/src/pages/identity/BugList.tsx b/webui/src/pages/identity/BugList.tsx index e74c11d4..c7994827 100644 --- a/webui/src/pages/identity/BugList.tsx +++ b/webui/src/pages/identity/BugList.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Card, Link, Typography } from '@material-ui/core'; +import { Card, Divider, Link, Typography } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; import { makeStyles } from '@material-ui/core/styles'; @@ -53,6 +53,7 @@ function BugList({ humanId }: Props) { {bug.title} + Created  @@ -64,6 +65,7 @@ function BugList({ humanId }: Props) { ); })} + {bugs?.length === 0 &&

No authored bugs by this user found.

}
); } diff --git a/webui/src/pages/identity/GetUserStatistic.graphql b/webui/src/pages/identity/GetUserStatistic.graphql new file mode 100644 index 00000000..318b860d --- /dev/null +++ b/webui/src/pages/identity/GetUserStatistic.graphql @@ -0,0 +1,13 @@ +query GetUserStatistic($authorQuery: String!, $participantQuery: String!, $actionQuery: String!) { + repository { + authored: allBugs(query: $authorQuery) { + totalCount + }, + participated: allBugs(query: $participantQuery) { + totalCount + } + actions: allBugs(query: $actionQuery) { + totalCount + } + } +} diff --git a/webui/src/pages/identity/Identity.tsx b/webui/src/pages/identity/Identity.tsx index 8261c0f4..5bfc87c0 100644 --- a/webui/src/pages/identity/Identity.tsx +++ b/webui/src/pages/identity/Identity.tsx @@ -1,124 +1,145 @@ import React from 'react'; +import { Link as RouterLink } from 'react-router-dom'; -import { - Checkbox, - FormControlLabel, - Link, - Paper, - Typography, -} from '@material-ui/core'; +import { Link, Paper, Typography } from '@material-ui/core'; import Avatar from '@material-ui/core/Avatar'; +import CircularProgress from '@material-ui/core/CircularProgress'; +import Grid from '@material-ui/core/Grid'; import { makeStyles } from '@material-ui/core/styles'; import InfoIcon from '@material-ui/icons/Info'; import MailOutlineIcon from '@material-ui/icons/MailOutline'; -import { useCurrentIdentityQuery } from '../../components/CurrentIdentity/CurrentIdentity.generated'; +import { IdentityFragment } from '../../components/Identity/IdentityFragment.generated'; -import BugList from './BugList'; +import { useGetUserStatisticQuery } from './GetUserStatistic.generated'; const useStyles = makeStyles((theme) => ({ main: { maxWidth: 1000, margin: 'auto', - marginTop: theme.spacing(4), - padding: theme.spacing(3, 2), - display: 'flex', - }, - container: { - display: 'flex', - marginBottom: theme.spacing(1), - }, - leftSidebar: { - marginTop: theme.spacing(2), - flex: '0 0 200px', + marginTop: theme.spacing(3), }, content: { - marginTop: theme.spacing(5), - padding: theme.spacing(3, 2), - minWidth: 800, - backgroundColor: theme.palette.background.paper, - }, - rightSidebar: { - marginTop: theme.spacing(5), - flex: '0 0 200px', + padding: theme.spacing(0.5, 2, 2, 2), + wordWrap: 'break-word', }, large: { - width: theme.spacing(20), - height: theme.spacing(20), + minWidth: 200, + minHeight: 200, + margin: 'auto', + maxWidth: '100%', + maxHeight: '100%', }, - control: { - paddingBottom: theme.spacing(3), + heading: { + marginTop: theme.spacing(3), }, header: { ...theme.typography.h4, + wordBreak: 'break-word', + }, + infoIcon: { + verticalAlign: 'bottom', }, })); -const Identity = () => { +type Props = { + identity: IdentityFragment; +}; +const Identity = ({ identity }: Props) => { const classes = useStyles(); - const { data } = useCurrentIdentityQuery(); - const user = data?.repository?.userIdentity; - console.log(user); + const user = identity; + + const { loading, error, data } = useGetUserStatisticQuery({ + variables: { + authorQuery: 'author:' + user?.humanId, + participantQuery: 'participant:' + user?.humanId, + actionQuery: 'actor:' + user?.humanId, + }, + }); + + if (loading) return ; + if (error) return

Error: {error}

; + const statistic = data?.repository; + const authoredCount = statistic?.authored?.totalCount; + const participatedCount = statistic?.participated?.totalCount; + const actionCount = statistic?.actions?.totalCount; return (
-
-
-

- {user?.displayName ? user?.displayName : 'none'} -

- - {user?.displayName.charAt(0).toUpperCase()} - - - Your account - - - Name: {user?.name ? user?.name : '---'} - - - Id (truncated): {user?.humanId ? user?.humanId : '---'} - - - - Login: {user?.login ? user?.login : '---'} - - - - - {user?.email ? user?.email : '---'} - - - } - /> -
- - - Bugs authored by {user?.displayName} - - - -
-
+ + + + + {user?.displayName.charAt(0).toUpperCase()} + + + +
+

{user?.name}

+ + Name: {user?.displayName ? user?.displayName : '---'} + + + Id (truncated): {user?.humanId ? user?.humanId : '---'} + + + {user?.email && ( + + + + {user?.email} + + + )} +
+
+ +
+

Statistics

+ + + Created {authoredCount} bugs. + + + + + Participated to {participatedCount} bugs. + + + + + Interacted with {actionCount} bugs. + + +
+
+
+
); }; diff --git a/webui/src/pages/identity/IdentityQuery.tsx b/webui/src/pages/identity/IdentityQuery.tsx new file mode 100644 index 00000000..964a9bac --- /dev/null +++ b/webui/src/pages/identity/IdentityQuery.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import { RouteComponentProps } from 'react-router-dom'; + +import CircularProgress from '@material-ui/core/CircularProgress'; + +import { useGetUserByIdQuery } from '../../components/Identity/UserIdentity.generated'; + +import Identity from './Identity'; + +type Props = RouteComponentProps<{ + id: string; +}>; + +const UserQuery: React.FC = ({ match }: Props) => { + const { loading, error, data } = useGetUserByIdQuery({ + variables: { userId: match.params.id }, + }); + if (loading) return ; + if (error) return

Error: {error}

; + if (!data?.repository?.identity) return

404.

; + return ; +}; + +export default UserQuery; diff --git a/webui/src/pages/identity/index.tsx b/webui/src/pages/identity/index.tsx new file mode 100644 index 00000000..06208687 --- /dev/null +++ b/webui/src/pages/identity/index.tsx @@ -0,0 +1 @@ +export { default } from './IdentityQuery'; diff --git a/webui/src/pages/list/BugRow.tsx b/webui/src/pages/list/BugRow.tsx index 87e45581..a1466d63 100644 --- a/webui/src/pages/list/BugRow.tsx +++ b/webui/src/pages/list/BugRow.tsx @@ -9,6 +9,7 @@ import CheckCircleOutline from '@material-ui/icons/CheckCircleOutline'; import CommentOutlinedIcon from '@material-ui/icons/CommentOutlined'; import ErrorOutline from '@material-ui/icons/ErrorOutline'; +import Author from 'src/components/Author'; import Date from 'src/components/Date'; import Label from 'src/components/Label'; import { Status } from 'src/gqlTypes'; @@ -117,7 +118,8 @@ function BugRow({ bug }: Props) {
{bug.humanId} opened  -  by {bug.author.displayName} +  by  +
diff --git a/webui/src/pages/list/ListQuery.tsx b/webui/src/pages/list/ListQuery.tsx index 2b46dca5..9aefd02d 100644 --- a/webui/src/pages/list/ListQuery.tsx +++ b/webui/src/pages/list/ListQuery.tsx @@ -14,7 +14,7 @@ import KeyboardArrowLeft from '@material-ui/icons/KeyboardArrowLeft'; import KeyboardArrowRight from '@material-ui/icons/KeyboardArrowRight'; import Skeleton from '@material-ui/lab/Skeleton'; -import { useCurrentIdentityQuery } from '../../components/CurrentIdentity/CurrentIdentity.generated'; +import { useCurrentIdentityQuery } from '../../components/Identity/CurrentIdentity.generated'; import IfLoggedIn from 'src/components/IfLoggedIn/IfLoggedIn'; import { parse, Query, stringify } from './Filter'; -- cgit From 774bae6d432c13cfa0de3ddc2f111927743243fe Mon Sep 17 00:00:00 2001 From: Sascha Date: Thu, 22 Apr 2021 14:02:43 +0200 Subject: Replace occurrences of humanId with the full Id Unless an ID must be shorted for user convenience, the full id should be used to prevent collisions. --- webui/src/components/Author.tsx | 2 +- webui/src/components/BugTitleForm/BugTitleForm.tsx | 2 +- webui/src/components/Identity/CurrentIdentity.tsx | 2 +- webui/src/graphql/fragments.graphql | 1 + webui/src/pages/identity/BugList.tsx | 6 +++--- webui/src/pages/identity/Identity.tsx | 12 ++++++------ webui/src/pages/list/BugRow.tsx | 2 +- webui/src/pages/new/NewBug.graphql | 4 ++-- webui/src/pages/new/NewBugPage.tsx | 2 +- 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/webui/src/components/Author.tsx b/webui/src/components/Author.tsx index 272ca5b5..593b5d36 100644 --- a/webui/src/components/Author.tsx +++ b/webui/src/components/Author.tsx @@ -15,7 +15,7 @@ type Props = AuthoredFragment & { const Author = ({ author, ...props }: Props) => { return ( - + {author.displayName} diff --git a/webui/src/components/BugTitleForm/BugTitleForm.tsx b/webui/src/components/BugTitleForm/BugTitleForm.tsx index 1092b203..2a3c4db0 100644 --- a/webui/src/components/BugTitleForm/BugTitleForm.tsx +++ b/webui/src/components/BugTitleForm/BugTitleForm.tsx @@ -90,7 +90,7 @@ function BugTitleForm({ bug }: Props) { setTitle({ variables: { input: { - prefix: bug.humanId, + prefix: bug.id, title: issueTitleInput.value, }, }, diff --git a/webui/src/components/Identity/CurrentIdentity.tsx b/webui/src/components/Identity/CurrentIdentity.tsx index 1fd424c1..2d62dcdb 100644 --- a/webui/src/components/Identity/CurrentIdentity.tsx +++ b/webui/src/components/Identity/CurrentIdentity.tsx @@ -96,7 +96,7 @@ const CurrentIdentity = () => { color="inherit" className={classes.profileLink} component={RouterLink} - to={`/user/${user.humanId}`} + to={`/user/${user.id}`} > Open profile diff --git a/webui/src/graphql/fragments.graphql b/webui/src/graphql/fragments.graphql index d01c488a..227d00b2 100644 --- a/webui/src/graphql/fragments.graphql +++ b/webui/src/graphql/fragments.graphql @@ -16,5 +16,6 @@ fragment authored on Authored { displayName avatarUrl humanId + id } } diff --git a/webui/src/pages/identity/BugList.tsx b/webui/src/pages/identity/BugList.tsx index c7994827..fbddb0fe 100644 --- a/webui/src/pages/identity/BugList.tsx +++ b/webui/src/pages/identity/BugList.tsx @@ -24,14 +24,14 @@ const useStyles = makeStyles((theme) => ({ })); type Props = { - humanId: string; + id: string; }; -function BugList({ humanId }: Props) { +function BugList({ id }: Props) { const classes = useStyles(); const { loading, error, data } = useGetBugsByUserQuery({ variables: { - query: 'author:' + humanId + ' sort:creation', + query: 'author:' + id + ' sort:creation', }, }); diff --git a/webui/src/pages/identity/Identity.tsx b/webui/src/pages/identity/Identity.tsx index 5bfc87c0..5170eeea 100644 --- a/webui/src/pages/identity/Identity.tsx +++ b/webui/src/pages/identity/Identity.tsx @@ -51,9 +51,9 @@ const Identity = ({ identity }: Props) => { const { loading, error, data } = useGetUserStatisticQuery({ variables: { - authorQuery: 'author:' + user?.humanId, - participantQuery: 'participant:' + user?.humanId, - actionQuery: 'actor:' + user?.humanId, + authorQuery: 'author:' + user?.id, + participantQuery: 'participant:' + user?.id, + actionQuery: 'actor:' + user?.id, }, }); @@ -111,7 +111,7 @@ const Identity = ({ identity }: Props) => {

Statistics

@@ -120,7 +120,7 @@ const Identity = ({ identity }: Props) => { @@ -129,7 +129,7 @@ const Identity = ({ identity }: Props) => { diff --git a/webui/src/pages/list/BugRow.tsx b/webui/src/pages/list/BugRow.tsx index a1466d63..562149f3 100644 --- a/webui/src/pages/list/BugRow.tsx +++ b/webui/src/pages/list/BugRow.tsx @@ -106,7 +106,7 @@ function BugRow({ bug }: Props) {
- +
{bug.title} {bug.labels.length > 0 && diff --git a/webui/src/pages/new/NewBug.graphql b/webui/src/pages/new/NewBug.graphql index 92df016e..ef024e41 100644 --- a/webui/src/pages/new/NewBug.graphql +++ b/webui/src/pages/new/NewBug.graphql @@ -1,7 +1,7 @@ mutation newBug($input: NewBugInput!) { newBug(input: $input) { bug { - humanId + id } } -} \ No newline at end of file +} diff --git a/webui/src/pages/new/NewBugPage.tsx b/webui/src/pages/new/NewBugPage.tsx index 4dc60e3c..cdec3558 100644 --- a/webui/src/pages/new/NewBugPage.tsx +++ b/webui/src/pages/new/NewBugPage.tsx @@ -62,7 +62,7 @@ function NewBugPage() { }, }, }).then(function (data) { - const id = data.data?.newBug.bug.humanId; + const id = data.data?.newBug.bug.id; history.push('/bug/' + id); }); issueTitleInput.value = ''; -- cgit