Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes significant changes to the tenant management and user management features of the application. The changes involve the addition of new routes, modifications to existing routes, and the introduction of new components for managing tenants and users. The pull request also includes the implementation of error handling and authorization checks in several parts of the application.
Changes in tenant management:
src/app/api/tenant/[tenantId]/administrators/route.ts
: Added a new route for managing tenant administrators. The route includes a POST method for updating tenant administrators with validation and authorization checks. (src/app/api/tenant/[tenantId]/administrators/route.tsR1-R59)src/app/api/tenant/[tenantId]/details/route.ts
: Modified the existing route for tenant details. The route now includes tenantId as a parameter and uses the isAdmin function for authorization checks. The route's POST method has been updated to handle tenant updates more efficiently. (src/app/api/tenant/[tenantId]/details/route.tsL1-R4, src/app/api/tenant/[tenantId]/details/route.tsL20-R33, src/app/api/tenant/[tenantId]/details/route.tsL62-L67, src/app/api/tenant/[tenantId]/details/route.tsL78-R70, src/app/api/tenant/[tenantId]/details/route.tsL87-L98, src/app/api/tenant/[tenantId]/details/route.tsR96-R97)src/app/api/tenant/[tenantId]/smart-tools/[smartToolName]/route.ts
: Added a new route for managing smart tools of a tenant. The route includes a POST method for updating the configuration of a smart tool with validation and authorization checks. (src/app/api/tenant/[tenantId]/smart-tools/[smartToolName]/route.tsR1-R50)src/app/api/tenant/[tenantId]/smart-tools/route.ts
: Added a new route for fetching the configuration of all smart tools of a tenant. The route includes a GET method with authorization checks. (src/app/api/tenant/[tenantId]/smart-tools/route.tsR1-R20)src/app/api/tenant/tools/route.ts
: Removed the existing route for fetching the configuration of all smart tools. The functionality has been moved to the new routesrc/app/api/tenant/[tenantId]/smart-tools/route.ts
.src/app/settings/admin/[tenantId]/page.tsx
: Added a new page for managing the details of a tenant. The page includes components for managing tenant details, domain details, support email, department name, administrators, login management, group list, and smart tools configuration. (src/app/settings/admin/[tenantId]/page.tsxR1-R42)Changes in user management:
src/app/settings/admin/[tenantId]/[personaId]/page.tsx
: Added a new page for managing the details of a user. The page includes a form for updating user details. (src/app/settings/admin/[tenantId]/[personaId]/page.tsxR1-R31)src/app/settings/admin/selectors.tsx
: Added a new component for selecting a tenant and a user. The component includes two dropdowns for selecting a tenant and a user. The selections are stored in the context and reflected in the URL.Other changes:
src/app/settings/admin/layout.tsx
: Added a new layout for the admin settings page. The layout includes an ErrorBoundary for error handling and an AdminProvider for providing tenant and user data to its children.src/app/settings/admin/page.tsx
: Added a new page for the admin settings. The page includes a welcome message and a fancy quote.src/app/settings/admin/loading.tsx
: Added a new component for displaying a loading state. The component includes a loading skeleton.src/app/settings/details/layout.tsx
: Modified the existing layout for the settings details page. The layout now includes a grid layout for its children.