I think it is necessary to filter projects to which users belong or display their roles on the screen.
Currently, user information can't be obtained from /api/v1/projects API. So we need to call /api/v1/projects/${projectName} to get the metadata. That means 20 API calls should be made to list 20 projects in /app/projects. It will cause additional loads to servers and increase page loading time.
To resolve the N+1 query problem, I propose to add the role of a requested user to ProjectDto.
Modifications:
Add RepositoryListener abstraction that can be continuously updated when a new change is pushed to a Repository. Repository.watch() has a similar function but it can be updated only once.
Add ProjectMetadata to DefaultProject and use RepositoryListener to update ProjectMetadata in a project when new changes are made in metadata.json
Expose user roles on the Projects page of the new web application.
Refactor ControlPlanePlugin with RepositoryListener to simply the code.
Miscellaneous) Show a loading indicator when a page is loading.
Result:
The project role of a request token or user is now exposed in the project API.
Users can see their roles on the projects page.
Users can filter projects by their roles on the project page.
Motivation:
I think it is necessary to filter projects to which users belong or display their roles on the screen.
Currently, user information can't be obtained from
/api/v1/projects
API. So we need to call/api/v1/projects/${projectName}
to get the metadata. That means 20 API calls should be made to list 20 projects in/app/projects
. It will cause additional loads to servers and increase page loading time.To resolve the N+1 query problem, I propose to add the role of a requested user to
ProjectDto
.Modifications:
RepositoryListener
abstraction that can be continuously updated when a new change is pushed to aRepository
.Repository.watch()
has a similar function but it can be updated only once.ProjectMetadata
toDefaultProject
and useRepositoryListener
to updateProjectMetadata
in a project when new changes are made inmetadata.json
ControlPlanePlugin
withRepositoryListener
to simply the code.Result: