feature: Allow a team (circle) to own a board - #8266
Conversation
|
🐢 Performance warning. |
|
🐢 Performance warning. |
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
776b999 to
530539d
Compare
|
🐢 Performance warning. |
bc51800 to
f378743
Compare
|
🐢 Performance warning. |
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
f378743 to
d8f562b
Compare
|
🐢 Performance warning. |
grnd-alt
left a comment
There was a problem hiding this comment.
works well and code is clean, got some small nitpicks though otherwise looks good 🔥
| #[NoAdminRequired] | ||
| #[NoCSRFRequired] | ||
| #[CORS] | ||
| public function createForTeam(string $title, string $teamId, ?string $color = null): DataResponse { |
There was a problem hiding this comment.
would prefer to have new endpoints only in the ocs controllers.
| $circlesManager->startSuperSession(); | ||
| $circle = $circlesManager->getCircle($circleId); | ||
| $circleMembers = []; | ||
| foreach ($circle->getMembers() as $member) { |
There was a problem hiding this comment.
is there not always an admin for a team?
can't we just search for the admin and give them the ownership? then we don't have to search through all the members and sort them and all that.
There was a problem hiding this comment.
FWIW, Teams currently have an owner. Could be a temporary solution - but note that but we want to remove that role, as any role with a single person is something we want to avoid. Teams have admins and moderators - can have multiple of those.
Background that might be helpful: in the next release we will try to align team roles with roles in apps. I mean so that Team moderators would be moderators in Talk rooms owned by the team. And in the far future, we would like to be able to create and manage roles of team members (can manage ACL's, can create talk rooms, can moderate talk rooms, ...).
| } | ||
|
|
||
| #[NoAdminRequired] | ||
| public function createForTeam(string $title, string $teamId, ?string $color = null): Board { |
|
|
||
| $boards = $this->boardMapper->findAllByOwner($userId); | ||
| foreach ($boards as $board) { | ||
| if (in_array($board->getId(), $transferredBoardIds, true)) { |
There was a problem hiding this comment.
we could drop some readability to prevent doing the same db query twice (findAllByOwner)
if we drop the transferTeamBoardsFromDeletedUser function and incorporate it's logic into the for loop we already have. Not required by me though.
Either way I think the transferredBoardIds array has no effect on the logic here right? All the ids in there have a different owner by now so are not in the $boards array anyway...
|
🐢 Performance warning. |
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
Feature ticket: #8167
Summary
Allow teams to create boards belonging to them.
DONE
Since there is no FE yet, to test this API can be called to add new Team board:
/deck/api/v1.0/boards/team
body:
{
"title": "sample title",
"teamId":"sample team id",
"color": "sample color" (this filed is optional, can also not be sent since on the current design we have the board is created with no color)
}
Checklist