-
Notifications
You must be signed in to change notification settings - Fork 2
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: Edit group info #2854
feat: Edit group info #2854
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Good start!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice code outlines and great to see the small docs and script improvements! If you create small PRs, I think that we can already merge them.
...rc/main/kotlin/org/loculus/backend/service/groupmanagement/GroupManagementDatabaseService.kt
Outdated
Show resolved
Hide resolved
I'm done with the API part of the change, next is the UI. I've also made a small change to the gradle build; next time I'll split it into a separate PR (just like the script changes). |
...rc/main/kotlin/org/loculus/backend/service/groupmanagement/GroupManagementDatabaseService.kt
Show resolved
Hide resolved
...rc/main/kotlin/org/loculus/backend/service/groupmanagement/GroupManagementDatabaseService.kt
Show resolved
Hide resolved
3ccef27
to
450873d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not blocking but there seems to be quite some probably unnecessary repetition of the group fields - already from the legacy code, but now the duplication becomes more noticeable
We could make an issue to cleanup later, it's not necessarily pressing, just a bit of code smell (not your fault by the way, legacy)
Cool! I tested and it works, you could record a quick Screencast to showcase :) |
I've refactored the field mapping a bit, but I don't have an idea for how to completely get rid of a mapping function from form data to For the repetitive form inputs, I'd say it's fine for now. It's repetitive but simple to deal with. I am of course happy to change it if you have a concrete suggestion what to do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I quickly looked over the code. Looks good from my side. But it would be good if someone has a closer look.
@corneliusroemer I think this is a good point: "Warn users that if they change group name they will change ENA center name" -- How should we do this? Maybe we can even add a little note to the edit UI if the group name is edited (some text in yellow next to the edit field maybe?) Regarding "group ID can't be changed" -- This is the definition of the endpoint: @Operation(description = "Edit a group. Only users part of the group can edit it. The updated group is returned.")
@ResponseStatus(HttpStatus.OK)
@PutMapping("/groups/{groupId}", produces = [MediaType.APPLICATION_JSON_VALUE])
fun editGroup(
@HiddenParam authenticatedUser: AuthenticatedUser,
@Parameter(
description = "The id of the group to edit.",
) @PathVariable groupId: Int,
@Parameter(description = "Updated group properties.")
@RequestBody
group: NewGroup,
): Group = groupManagementDatabaseService.updateGroup(groupId, group, authenticatedUser) The ID is part of the
|
03ce3ac
to
a70c205
Compare
This is where we use group info in cached ways:
Backend tests:
Website tests:
Manual tests:
Loculus docs updates:
Pathoplexus docs updates:
|
.../test/kotlin/org/loculus/backend/controller/groupmanagement/GroupManagementControllerTest.kt
Outdated
Show resolved
Hide resolved
.../test/kotlin/org/loculus/backend/controller/groupmanagement/GroupManagementControllerTest.kt
Show resolved
Hide resolved
.../test/kotlin/org/loculus/backend/controller/groupmanagement/GroupManagementControllerTest.kt
Outdated
Show resolved
Hide resolved
hey @corneliusroemer do you want to have a look at the playwright test I wrote? |
I also have a PR ready for the Pathoplexus doc changes |
…nagement/GroupManagementControllerTest.kt Co-authored-by: Cornelius Roemer <cornelius.roemer@gmail.com>
…2943) * Failing test * Add init that was missing # Conflicts: # backend/src/test/kotlin/org/loculus/backend/controller/submission/GetReleasedDataEndpointTest.kt
Co-authored-by: Cornelius Roemer <cornelius.roemer@gmail.com>
Co-authored-by: Cornelius Roemer <cornelius.roemer@gmail.com>
b9c8f09
to
bf8aeb4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff, I think all the checkboxes are ticked now!
Woops - E2E still fails it seems |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E2E test no longer works it seems
https://github.com/loculus-project/loculus/actions/runs/11384438057/job/31672159380?pr=2854#step:21:41
damn! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now tests look good!
resolves #2258
preview URL: https://feat-2258-edit-group-info.loculus.org
Summary
This PR adds a new backend API endpoint
PUT /group/<groupId>
as well as a group edit button to the group details view in the UI. Only group members can edit the group. All group info can be edited (except the group ID).Screenshot
PR Checklist