-
-
Notifications
You must be signed in to change notification settings - Fork 516
Next: Adds organization management features #1919
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
Conversation
This commit introduces the new organization management features, including: - CRUD operations for organizations. - User management within organizations. - View Invoices and usage tracking. - UI components for managing organizations, users, and billing information.
Refactors the handling of 401 errors to a central location to ensure consistent user authentication across the application. This change centralizes the logic for handling 401 Unauthorized responses. Instead of checking for 401 errors in specific routes, it now checks in the main layout. It also prevents unnecessary error propagation for expected 401 errors. svecosystem/runed#267 (comment)
Adds getter and setter for the `time` query parameter to the route parameters. This allows components to easily access and modify the time filter.
Updates the "Go To Issues" button to navigate to the new issues page with the appropriate filter applied. This change ensures users are directed to the correct issues list with relevant project or organization filters pre-selected, improving the user experience.
Improves the usage page by simplifying the data mapping and removes a redundant loading check. Also, updates the invite user dialog to use a more descriptive placeholder for the email address field. Removes the unused "leave organization" dialog.
Improves table rendering performance by disabling sorting on columns that don't require it. The sorting feature was enabled by default, causing unnecessary overhead. This change disables sorting for the Plan, Projects, Stacks, and Events columns on the organization and project tables.
Updates the date and time formatter component to use a consistent and readable format. The component now displays date and time with month, day, year, hour, minute, and second with am/pm format. This ensures a uniform presentation of date and time values across the application, enhancing user experience.
Introduces a new component to manage content visibility based on the user's global role. Replaces direct role checks within the billing page with the new component. This simplifies role-based rendering logic and promotes code reusability across the application.
Co-authored-by: Copilot <[email protected]>
Updates the onSuccess handlers in various API queries to correctly handle the `FetchClientResponse` object. This ensures that the `data` property within the response is properly accessed when setting query data, preventing potential errors and ensuring data consistency across the application.
Replaces the toLocaleString method with the Number component for formatting the remaining event limit. This ensures a consistent number formatting style across the application.
Refactors email verification resend logic to use dedicated mutation for improved handling of loading state and error management. This streamlines the user experience by providing clearer feedback during the verification process.
Increases versions of multiple dependencies, including bits-ui, runed, shiki, @storybook/addon-svelte-csf, @sveltejs/kit, @sveltejs/vite-plugin-svelte, svelte, and typescript-eslint. This likely includes bug fixes, performance improvements, and new features from the updated libraries.
Ensures the current organization context is correctly initialized when the organization page is loaded, using the `organizationId` parameter. This fixes an issue where the organization was not being set correctly when navigating directly to an organization's page.
…he parent layout Redirects users to the next page if they are not authenticated, if the organization context is missing, or if there is an error retrieving the invoice. Also redirects if the invoice does not belong to the current organization.
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 full organization management support to the SPA, including CRUD operations for organizations, user invitations, usage reporting, and billing views. Key changes include:
- New Svelte routes and components for listing, adding, managing, and billing organizations
- Updated routing and navigation trees to include organization sections
- Extended API client methods, types, and table utilities for organizations and users
Reviewed Changes
Copilot reviewed 47 out of 48 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/routes/(app)/organization/list/+page.svelte | Added organization list page and data table |
src/routes/(app)/organization/add/+page.svelte | Implemented “Add Organization” form with server handling |
src/routes/(app)/organization/[organizationId]/manage/+page.svelte | Manage organization details and delete UI |
src/routes/(app)/organization/[organizationId]/usage/+page.svelte | Organization usage charts and limit messaging |
src/routes/(app)/organization/[organizationId]/billing/+page.svelte | Billing table with invoice actions |
src/lib/features/organizations/api.svelte.ts | CRUD and query/mutation methods for organizations |
Files not reviewed (1)
- src/Exceptionless.Web/ClientApp/package-lock.json: Language not supported
Comments suppressed due to low confidence (3)
src/Exceptionless.Web/ClientApp/src/routes/(app)/organization/list/+page.svelte:1
- New organization listing functionality should have corresponding component and end-to-end tests to ensure paging and row clicks behave correctly.
<script lang="ts">
src/Exceptionless.Web/ClientApp/src/lib/features/organizations/api.svelte.ts:96
- [nitpick] This mutation invalidates queries but does not document which query keys are affected. Adding JSDoc comments will help future maintainers understand the cache invalidation strategy.
export function addOrganizationUser(request: AddOrganizationUserRequest) {
src/Exceptionless.Web/ClientApp/src/routes/(app)/project/[projectId]/manage/+page.svelte:145
- The href uses a literal
{projectId}
instead of injecting the variable. It should use a template string or Svelte expression, e.g.,href={
/next/issues?filter=project:${projectId}}
.
<Button variant="secondary" href="/next/issues?filter=project:{projectId}">
// HACK: This is to prevent sveltekit from stealing focus | ||
result.type = 'failure'; |
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] This workaround (result.type = 'failure'
) is not self-explanatory. Consider extracting it into a helper with a descriptive name or referencing a linked issue for future cleanup.
// HACK: This is to prevent sveltekit from stealing focus | |
result.type = 'failure'; | |
// Prevent sveltekit from stealing focus (see linked issue or cleanup note) | |
preventFocusStealing(result); |
Copilot uses AI. Check for mistakes.
This commit introduces the new organization management features, including: