feat: add id+members count+icon to teams table

This commit is contained in:
2026-03-16 17:09:36 +02:00
parent 0fb78f7d76
commit 6fb4e4fd54
4 changed files with 59 additions and 4 deletions

View File

@@ -46,7 +46,7 @@ class TeamController extends OCSController {
/**
* List all available teams (circles)
*
* @return DataResponse<Http::STATUS_OK, list<array{id: string, displayName: string, owner: string, ownerDisplayName: string}>, array{}>
* @return DataResponse<Http::STATUS_OK, list<array{id: string, displayName: string, owner: string, ownerDisplayName: string, memberCount: int}>, array{}>
*
* 200: Teams returned
*/
@@ -82,6 +82,7 @@ class TeamController extends OCSController {
'displayName' => $circle->getDisplayName() ?: $circle->getName(),
'owner' => $owner,
'ownerDisplayName' => $ownerDisplayName,
'memberCount' => $circle->getPopulation(),
];
}, $circles);

View File

@@ -7884,7 +7884,8 @@
"id",
"displayName",
"owner",
"ownerDisplayName"
"ownerDisplayName",
"memberCount"
],
"properties": {
"id": {
@@ -7898,6 +7899,10 @@
},
"ownerDisplayName": {
"type": "string"
},
"memberCount": {
"type": "integer",
"format": "int64"
}
}
}

View File

@@ -213,4 +213,5 @@ export interface Team {
displayName: string
owner: string
ownerDisplayName: string
memberCount: number
}

View File

@@ -125,8 +125,19 @@
:has-actions="true"
:actions-label="strings.actions"
>
<template #cell-id="{ row }">
<span class="team-id" :title="row.id">{{ row.id }}</span>
</template>
<template #cell-displayName="{ row }">
<span>{{ row.displayName }}</span>
<span class="team-name">
<AccountGroupIcon :size="20" class="team-icon" />
{{ row.displayName }}
</span>
</template>
<template #cell-memberCount="{ row }">
<span>{{ row.memberCount }}</span>
</template>
<template #cell-ownerDisplayName="{ row }">
@@ -169,6 +180,7 @@ import RoleBadge from '@/components/RoleBadge'
import PlusIcon from '@icons/Plus.vue'
import PencilIcon from '@icons/Pencil.vue'
import DeleteIcon from '@icons/Delete.vue'
import AccountGroupIcon from '@icons/AccountGroup.vue'
import PageWrapper from '@/components/PageWrapper'
import PageHeader from '@/components/PageHeader'
import AppToolbar from '@/components/AppToolbar'
@@ -190,6 +202,7 @@ export default defineComponent({
PlusIcon,
PencilIcon,
DeleteIcon,
AccountGroupIcon,
PageWrapper,
PageHeader,
AppToolbar,
@@ -234,6 +247,7 @@ export default defineComponent({
loadingTeams: t('forum', 'Loading teams …'),
teamsErrorTitle: t('forum', 'Error loading teams'),
teamsEmptyTitle: t('forum', 'No teams found'),
memberCount: t('forum', 'Members'),
teamsEmptyDesc: t('forum', 'No Nextcloud Teams are available'),
},
}
@@ -249,8 +263,20 @@ export default defineComponent({
},
teamTableColumns(): TableColumn[] {
return [
{ key: 'id', label: this.strings.id, minWidth: '150px' },
{ key: 'displayName', label: this.strings.displayName, minWidth: '200px' },
{ key: 'ownerDisplayName', label: this.strings.owner, minWidth: '150px' },
{
key: 'memberCount',
label: this.strings.memberCount,
minWidth: '100px',
maxWidth: '150px',
},
{
key: 'ownerDisplayName',
label: this.strings.owner,
minWidth: '100px',
maxWidth: '200px',
},
]
},
},
@@ -362,5 +388,27 @@ export default defineComponent({
color: var(--color-text-lighter);
font-size: 0.9rem;
}
:deep(.team-id) {
font-weight: 600;
font-family: monospace;
font-size: 0.9rem;
color: var(--color-text-maxcontrast);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 100%;
}
:deep(.team-name) {
display: flex;
align-items: center;
gap: 8px;
.team-icon {
color: var(--color-primary-element);
flex-shrink: 0;
}
}
}
</style>