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

Feat/members actions #25

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Feat/members actions #25

wants to merge 7 commits into from

Conversation

perryr16
Copy link
Contributor

@perryr16 perryr16 commented Mar 7, 2025

Adds the members actions

  • adds user authorization to user service
  • "Invite Member" if user.can_invite_member
  • "Reset all passwords" if user.can_remove_member & user.can_invite_member

Screenshot 2025-03-07 at 3 25 18 PM

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.

The create modal is not working at the moment.

@@ -1,14 +1,22 @@
<h2 mat-dialog-title class="text-3xl font-extrabold capitalize leading-7 tracking-tight sm:leading-10 md:text-4xl">Edit Member</h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is always 'Edit', even when the form is blank for the invite member action.

fn()
}

createMember() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Because this is called from outside the form in the modal, it can't read from the form. I get an error in console:

hook.js:608 ERROR TypeError: Cannot read properties of undefined (reading 'form')
    at createMember (form-modal.component.ts:100:83)
    at _FormModalComponent.onSubmit (form-modal.component.ts:95:5)
    at FormModalComponent_Template_button_click_37_listener (form-modal.component.html:53:56)

I think if you either use an [ngSubmit] in the form definition, or use arrow notation here, it will work.

* Create user
*/
createUser(orgId: number, params: CreateUserRequest): Observable<CurrentUser> {
return this._httpClient.post<CurrentUser>(`/api/v3/users/?organization_id=${orgId}`, params).pipe(
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't fully test this because the create modal doesn't work, but I have a sneaking suspicion that a pipe without a subscribe won't actually fire off the httpClient request. But maybe it does with the subscribe in the modal ts? Like I said, I couldn't actually test it because the modal isn't working properly.

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