Skip to content

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.

@perryr16 perryr16 requested a review from crutan April 1, 2025 20:37
@perryr16 perryr16 marked this pull request as ready for review April 11, 2025 19:50
@perryr16 perryr16 requested review from crutan and removed request for crutan April 11, 2025 19:51
.subscribe()
}

close(message: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can just use dismiss here - right? Doesn't look like any of the functions that open the dialog are waiting for a return value from it.

@perryr16 perryr16 merged commit ed510f5 into main Apr 14, 2025
2 checks passed
@perryr16 perryr16 deleted the feat/members-actions branch April 14, 2025 15:44
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.

3 participants