-
Notifications
You must be signed in to change notification settings - Fork 35
feat(admin-ui): add create and edit organization screen #978
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Pull Request Test Coverage Report for Build 14751453493Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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.
Pull Request Overview
This PR introduces an edit organization screen to the admin UI. Key changes include:
- Adding a new edit organization panel with its associated state management and routing.
- Updating the organization context and API server configuration to support organization types.
- Integrating the new edit organization functionality in the navigation and layout components.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
ui/src/utils/constants.ts | Added optional organization_types to config and defaultConfig. |
ui/src/pages/organizations/details/layout/navbar.tsx | Added openEditOrgPanel prop and updated menu items for organization editing. |
ui/src/pages/organizations/details/layout/index.tsx | Introduced state and functions for opening/closing the edit organization panel. |
ui/src/pages/organizations/details/index.tsx | Added an updateOrganization function to update the organization state. |
ui/src/pages/organizations/details/edit/organization.tsx | Created the new edit organization panel with form handling and API integration. |
ui/src/pages/organizations/details/edit/kyc.tsx | Updated style import for the KYC panel. |
ui/src/pages/organizations/details/contexts/organization-context.tsx | Extended the organization context with an updateOrganization method. |
pkg/server/server.go | Updated API response to include token_product_id and organization_types. |
pkg/server/config.go | Added organization_types field to the server configuration. |
Files not reviewed (1)
- ui/src/pages/organizations/details/edit/edit.module.css: Language not supported
Comments suppressed due to low confidence (1)
ui/src/pages/organizations/details/layout/navbar.tsx:292
- The component name 'OrganizationsDetailsNavabar' appears to contain a typo; consider renaming it to 'OrganizationsDetailsNavbar' for clarity.
export const OrganizationsDetailsNavabar = ({
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.
Pull Request Overview
This PR adds screens for creating and editing organizations within the admin UI. It also updates related navigation components, organization context, and server configuration to support the new organization types and additional organization data.
- Added create and edit organization panels with form validation.
- Updated navigation components to open the new panels.
- Extended server configuration and API responses to include organization types and token product IDs.
Reviewed Changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
ui/src/utils/constants.ts | Extended config interface and default config to support organization types. |
ui/src/pages/organizations/list/navbar.tsx | Added a new prop and onClick handler to launch the create organization panel. |
ui/src/pages/organizations/list/index.tsx | Introduced state management to conditionally render the create organization panel. |
ui/src/pages/organizations/list/create.tsx | New component for creating organizations with form fields and validation. |
ui/src/pages/organizations/details/layout/navbar.tsx | Updated the action menu to include an option for editing organization details. |
ui/src/pages/organizations/details/layout/index.tsx | Added state and functions to toggle the edit organization panel in the details layout. |
ui/src/pages/organizations/details/index.tsx | Provided an updateOrganization function via context for reflecting edits. |
ui/src/pages/organizations/details/edit/organization.tsx | New component for editing organization details with form validation. |
ui/src/pages/organizations/details/edit/kyc.tsx | Adjusted the imported style module for consistency with edit panels. |
ui/src/pages/organizations/details/contexts/organization-context.tsx | Added updateOrganization method to the organization context. |
pkg/server/server.go & config.go | Updated configuration to support the new organization type and token product ID. |
Files not reviewed (2)
- ui/src/pages/organizations/details/edit/edit.module.css: Language not supported
- ui/src/pages/organizations/list/list.module.css: Language not supported
Comments suppressed due to low confidence (3)
ui/src/pages/organizations/list/navbar.tsx:21
- The interface name 'OrganizationsNavabarProps' appears to have a typo; consider renaming it to 'OrganizationsNavbarProps' for clarity and consistency.
interface OrganizationsNavabarProps {
ui/src/pages/organizations/details/layout/navbar.tsx:292
- The component name 'OrganizationsDetailsNavabar' seems to contain a typographical error; renaming it to 'OrganizationsDetailsNavbar' would improve readability.
export const OrganizationsDetailsNavabar = ({
ui/src/pages/organizations/details/edit/kyc.tsx:14
- [nitpick] Please verify that the change from importing './kyc.module.css' to './edit.module.css' is intentional, ensuring that the styling remains consistent for the KYC panel.
import styles from "./edit.module.css";
const orgUpdateSchema = z.object({ | ||
avatar: z.string().optional(), | ||
title: z.string(), | ||
name: z.string(), | ||
size: z.string().transform((value) => parseInt(value)), | ||
type: z.string(), | ||
otherType: z.string(), | ||
country: z.string(), | ||
}); |
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.
[nitpick] Consider making the 'otherType' field optional in the schema if it is only applicable when the selected type is 'other', to avoid unnecessary validation errors.
const orgUpdateSchema = z.object({ | |
avatar: z.string().optional(), | |
title: z.string(), | |
name: z.string(), | |
size: z.string().transform((value) => parseInt(value)), | |
type: z.string(), | |
otherType: z.string(), | |
country: z.string(), | |
}); | |
const orgUpdateSchema = z | |
.object({ | |
avatar: z.string().optional(), | |
title: z.string(), | |
name: z.string(), | |
size: z.string().transform((value) => parseInt(value)), | |
type: z.string(), | |
otherType: z.string().optional(), | |
country: z.string(), | |
}) | |
.refine( | |
(data) => data.type !== "other" || (data.type === "other" && data.otherType), | |
{ | |
message: "otherType is required when type is 'other'.", | |
path: ["otherType"], | |
}, | |
); |
Copilot uses AI. Check for mistakes.
No description provided.