Skip to content

feat: automatically create a teamfolder upon team creation - #2675

Open
stediefan wants to merge 1 commit into
nextcloud:masterfrom
Dataport:feature/teams-auto-folder-creation
Open

feat: automatically create a teamfolder upon team creation#2675
stediefan wants to merge 1 commit into
nextcloud:masterfrom
Dataport:feature/teams-auto-folder-creation

Conversation

@stediefan

@stediefan stediefan commented Jul 24, 2026

Copy link
Copy Markdown

feat: introduce a function to upgrade existing teams to include the special teamfolder
feat: add settings page to configure a default quota for new teamfolders

Assisted by: GitHub Copilot:Claude Sonnet 5
Assisted by: GitHub Copilot:GPT-5.6 Terra
Assisted by: GitHub Copilot:Kimi K2.7 Code

Summary

This is a aggregated feature that integrates teams with teamfolders. The teams feature aims to provide a space for team owned apps. This provides the base as the linked groupfolder is the proposed solution.

TODO

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Screenshots before/after for front-end changes
    The newly introduced feature to set a default Quota for the auto created folders:
Groupfolder Quota Setting The view for teams with a linked folder: Team-Folderview
  • Documentation (manuals or wiki) has been updated or is not required
    see todo
  • Backports requested where applicable (ex: critical bugfixes)
    no
  • Labels added where applicable (ex: bug/enhancement, 3. to review, feature component)
  • Milestone added for target branch/version (ex: 32.x for stable32)

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread lib/Controller/TeamFolderController.php Outdated
@alimmroth alimmroth moved this from Backlog to In review in 👥 Teams Jul 27, 2026
@marcoambrosini
marcoambrosini requested a review from artonge July 27, 2026 08:10
feat: introduce a function to upgrade existing teams to include the special teamfolder
feat: add settings page to configure a default quota for new teamfolders

Assisted by: GitHub Copilot:Claude Sonnet 5
Assisted by: GitHub Copilot:GPT-5.6 Terra
Assisted by: GitHub Copilot:Kimi K2.7 Code
Signed-off-by: Stefan Dietrich <5716289+stediefan@users.noreply.github.com>
@stediefan
stediefan force-pushed the feature/teams-auto-folder-creation branch from a52e6da to 6ab835a Compare July 27, 2026 08:20
}
}

private function requireMember(string $circleId): void {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to make it more explicit. Same with the two other methods.

Suggested change
private function requireMember(string $circleId): void {
private function assertAuthenticatedUserIsMember(string $circleId): void {

* @return list<string>
*/
private function filterExistingCircleColumns(array $fields): array {
static $columns = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is a static variable really needed? IIRC, we are trying to get rid of them.

* @param list<string> $fields
* @return list<string>
*/
private function filterExistingCircleColumns(array $fields): array {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the goal of this method?

}

$circle = $event->getCircle();
$provider->unlinkTeamFolder($circle->getSingleId());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will the team folder be visible to an admin to be deleted afterward?

*
* Implementation: {@see TeamFolderService} in the circles app.
*/
interface TeamFolderPolicy {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
interface TeamFolderPolicy {
interface ITeamFolderPolicy {

* The Groupfolders provider owns the durable `team_circle_id` linkage. Circles
* never persists a Groupfolders identifier.
*/
class TeamFolderService implements TeamFolderPolicy {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
class TeamFolderService implements TeamFolderPolicy {
class TeamFolderPolicy implements ITeamFolderPolicy {

Comment on lines +24 to +27
* The `@nextcloud/files` Node class exposes the same public interface, but
* TypeScript requires us to keep the private fields when using the class
* type directly. Using our own interface keeps the template code simple.
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not sure to get that comment. What was the problem?
I think nowadays, we are using the INode, IFile, IFolder interface instead of the classes. Maybe that would help.

Comment on lines +29 to +35
function bytesToMb(bytes: number): string {
if (bytes === 0) {
return '0'
}
const mb = bytes / BYTES_PER_MB
return String(parseFloat(mb.toFixed(2)))
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Create team-folder when creating a team

4 participants