Skip to content

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

Merged
merged 26 commits into from
Jul 15, 2025

Conversation

niemyjski
Copy link
Member

This commit introduces the new organization management features, including:

image

  • CRUD operations for organizations.
  • User management within organizations.
  • View Invoices and usage tracking.
  • UI components for managing organizations, users, and billing information.

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.
@niemyjski niemyjski requested a review from Copilot July 7, 2025 02:00
@niemyjski niemyjski self-assigned this Jul 7, 2025
Copilot

This comment was marked as outdated.

Copy link

github-actions bot commented Jul 7, 2025

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.AppHost 18% 6% 87
Exceptionless.Insulation 27% 24% 231
Exceptionless.Core 66% 44% 8566
Exceptionless.Web 44% 32% 2938
Summary 57% (9897 / 17222) 40% (3908 / 9690) 11822

niemyjski added 17 commits July 7, 2025 22:29
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.
@niemyjski niemyjski requested review from Copilot and ejsmith July 14, 2025 02:11
Copilot

This comment was marked as outdated.

niemyjski and others added 4 commits July 13, 2025 21:15
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.
@niemyjski niemyjski requested a review from Copilot July 14, 2025 02:31
@niemyjski niemyjski marked this pull request as ready for review July 14, 2025 02:31
Copilot

This comment was marked as outdated.

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.
@niemyjski niemyjski requested a review from Copilot July 15, 2025 01:53
Copy link
Contributor

@Copilot Copilot AI left a 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}">

Comment on lines +33 to +34
// HACK: This is to prevent sveltekit from stealing focus
result.type = 'failure';
Copy link
Preview

Copilot AI Jul 15, 2025

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.

Suggested change
// 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.

@niemyjski niemyjski merged commit 7d705c0 into main Jul 15, 2025
4 of 6 checks passed
@niemyjski niemyjski deleted the feature/next-organization-management branch July 15, 2025 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant