-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User Management Page #771
base: main
Are you sure you want to change the base?
User Management Page #771
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments based on what you currently have written.
@@ -21,6 +22,7 @@ const navigation = [ | |||
{ name: PageNavItem.createQuest, href: '/createQuest', icon: CommandLineIcon, internal: true }, | |||
{ name: PageNavItem.dashboard, href: '/dashboard', icon: PresentationChartBarIcon, internal: true }, | |||
{ name: PageNavItem.hosts, href: '/hosts', icon: BugAntIcon, internal: true }, | |||
{ name: PageNavItem.users, href: '/users', icon: UserIcon, internal: true }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want to display this view if a user is an Admin.
Also we should change the endpoint to something like /admin-settings
@@ -0,0 +1,92 @@ | |||
import { Badge, Image, Button } from "@chakra-ui/react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use tavern-ui version of badge and button instead of chakra-ui
</div> | ||
</Badge>} | ||
{!rowData?.isActivated && <Badge> | ||
<div className="flex flex-row gap-1 justify-center items-center p-1" > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This nested div doesn't seem needed
const rowData = cellData.getValue(); | ||
return ( | ||
<div className="flex flex-row flex-wrap gap-1"> | ||
{!rowData?.isActivated && <Button size={"sm"}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you are missing onClick for something to occur with these buttons?
import { convertArrayOfObjectsToObject, getOfflineOnlineStatus } from "../../../utils/utils"; | ||
|
||
export const useUserTable = () => { | ||
const [users, setUsers] = useState([]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure you need this.
Instead you could just return data?.users || []
@@ -16,6 +16,7 @@ export enum PageNavItem { | |||
tasks='Tasks', | |||
createQuest= 'Create new quest', | |||
hosts="Hosts", | |||
users="User Management", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change these to be related to admin settings since we expect more kinds of admin controls on this page in the future.
]; | ||
|
||
return ( | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure you need this extra div?
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds a User Management page. Instead of needing to use the GraphQL Playground, you can approve/promote users in the website.
Which issue(s) this PR fixes:
N/A