Skip to content
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

Add organization members page #10

Merged
merged 15 commits into from
Feb 13, 2025
Merged

Add organization members page #10

merged 15 commits into from
Feb 13, 2025

Conversation

perryr16
Copy link
Contributor

@perryr16 perryr16 commented Feb 12, 2025

  • Members page to update or delete org users
  • fetches and formats access level tree
  • creates a reusable error handler that accurately passes backend error messages to the frontend via an error service
  • general tweaks
    Screenshot 2025-02-12 at 3 48 39 PM
    Screenshot 2025-02-12 at 3 48 31 PM
    Screenshot 2025-02-12 at 3 48 18 PM

handleError(error: HttpErrorResponse, defaultMessage: string) {
const errorMessage = (error.error as { message: string })?.message || defaultMessage
this._snackBar.alert(errorMessage, 'OK', true)
return throwError(() => new Error(error?.message || defaultMessage))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the backend error responses come in as

{ status: 'error', message: 'some descriptive error message' } 

This should reduce a lot of duplicate code and make service catchErrors much simpler going forward

@perryr16 perryr16 requested a review from crutan February 12, 2025 22:54
@crutan
Copy link
Contributor

crutan commented Feb 13, 2025

I'm getting a warning in console when I open the member modal:

NG0956: The configured tracking expression (track by identity) caused re-creation of the entire collection of size 1. This is an expensive operation requiring destruction and subsequent creation of DOM nodes, directives, components etc. Please review the "track expression" and make sure that it uniquely identifies items in a collection. Find more at https://angular.dev/errors/NG0956

I think if you update form-modal's iterator for accessLevelInstance to track by ali.id instead of ali it will fix the issue.

Otherwise, this looks good, glad you pulled the table out to a component, and the error service is a really good idea!

Copy link
Contributor

@crutan crutan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending the fix for that NG0956 error, this looks good to me.

@perryr16 perryr16 requested a review from crutan February 13, 2025 15:20
@perryr16 perryr16 changed the title Feat/members Add organization members page Feb 13, 2025
@perryr16 perryr16 merged commit 5be8c03 into main Feb 13, 2025
1 check passed
@perryr16 perryr16 deleted the feat/members branch February 13, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants