-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Users & Roles #35
Users & Roles #35
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.
Good work, the only additional point is in the future divide the interfaces on other files besides types/index.ts
canManageInfrastructure, | ||
canUploadData | ||
}) => { | ||
const permissions = [ |
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.
Extract permissions out of the component. Maybe this could be in a JSON somewhere?
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.
Solid! Some minor changes needed. I'll see what it looks like!
src/pages/users/index.tsx
Outdated
const {data: groupsData} = useQuery<Record<string, IGroup>, Error>('groups', fetchGroups) | ||
const {data: rolesData} = useQuery<Record<string, IRole>, Error>('roles', fetchRoles) | ||
|
||
useEffect(() => { |
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.
I failed to see why we need to keep states to track the total. Is it possible to replace this effect with a direct call to each of the deps?
src/pages/users/index.tsx
Outdated
))} | ||
</section> | ||
<section className="space-y-6"> | ||
{Object.keys(usersData).map(userId => ( |
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.
usersData
is undefined by default and will remain undefined if fetching fails.isLoading
will resolve to false
and Object.keys(undefined)
throws.
Description
Add users overview + list and roles page.
Add API Integration + Object and Response Types support
Issues
#22 #15
Affected Dependencies
Checklist