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

Improvements to the API for the "Project Members" #773

Open
3em opened this issue Jan 22, 2025 · 1 comment
Open

Improvements to the API for the "Project Members" #773

3em opened this issue Jan 22, 2025 · 1 comment
Assignees
Labels
PIPE Responsibility of PIPE team

Comments

@3em
Copy link
Collaborator

3em commented Jan 22, 2025

  1. In the response for useListPrincipalsQuery, we need to include avatar_url – canary/apps/gitness/src/pages-v2/project/project-member-list.tsx:149.
  2. The code includes functionality for changing roles. Currently, the check for members with the space_owner role (to restrict role changes for the last space_owner) is implemented on the frontend. However, this will not work correctly since the list uses pagination. In this case, the check should be added to the backend in useMembershipUpdateMutation so that it returns an error (which is currently missing). Alternatively, we could create a separate API method that returns the number of remaining space_owner roles, enabling the check on the frontend. I’ve left a TODO comment at canary/apps/gitness/src/pages-v2/project/project-member-list.tsx:160.
@3em 3em added the PIPE Responsibility of PIPE team label Jan 22, 2025
@hitesharinga
Copy link

hitesharinga commented Jan 22, 2025

Hey @3em ,

I didn't get the ask here. I was checking the latest version of gitness and we don't have any checks, My project had one user (admin) and I was able to change the role of that user.

I checked with @johannesHarness admin can access any project even if they are not members (though they wouldn’t see it in their list of projects unless they are a member), we don’t need to check that the project should have 1 member on UI, if required we can implement it later in the backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PIPE Responsibility of PIPE team
Projects
None yet
Development

No branches or pull requests

3 participants