Skip to content
Prev Previous commit
Next Next commit
chore: resolve ESLint issues
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Aug 21, 2025
commit 51067b62e3e08edd21767e8b063f308a8f152d62
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"private": true,
"name": "teams",
"version": "32.0.0",
"type": "module",
"private": true,
"license": "AGPL-3.0-or-later",
"author": "Nextcloud GmbH and Nextcloud contributors",
"type": "module",
"scripts": {
"build": "vite --mode production build",
"lint": "eslint",
Expand Down
56 changes: 32 additions & 24 deletions src/views/DashboardTeamsWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<NcIconSvgWrapper class="external-link-icon" :path="mdiOpenInNew" />
</a>
</div>

<!-- Team Members -->
<div v-if="team.members && team.members.length > 0" class="team-members">
<div class="members-row">
Expand All @@ -51,35 +51,38 @@
<!-- Team Resources -->
<div v-if="team.resources && team.resources.length > 0" class="team-resources">
<div class="resources-row">
<div v-for="resource in team.resources.slice(0, 5)"
<div
v-for="resource in team.resources.slice(0, 5)"
:key="resource.id"
class="resource-box"
:title="resource.name"
:style="{ '--fallback-icon': `url('${resource.fallbackIcon}')` }">
<a :href="resource.url" class="resource-link">
<img :src="resource.iconUrl"
<img
:src="resource.iconUrl"
class="resource-icon"
:alt="resource.name" />
:alt="resource.name">
</a>
</div>
<a v-if="team.resources.length > 5"
:href="team.url"
class="more-resources-box more-resources-link">
<a
v-if="team.resources.length > 5"
:href="team.url"
class="more-resources-box more-resources-link">
+{{ team.resources.length - 5 }}
</a>
</div>
</div>
</div>
</div>

<!-- Show More Button -->
<div v-if="hasMoreTeams" class="show-more-container">
<NcButton
@click="loadMoreTeams"
<NcButton
:disabled="loading"
type="secondary"
class="show-more-button">
{{ loading ? t('circles', 'Loading...') : t('circles', 'Show more teams') }}
variant="secondary"
class="show-more-button"
@click="loadMoreTeams">
{{ loading ? t('circles', 'Loading…') : t('circles', 'Show more teams') }}
</NcButton>
</div>
</div>
Expand All @@ -90,18 +93,17 @@
<script setup lang="ts">
import type { OCSResponse } from '@nextcloud/typings/ocs'

import { generateUrl, generateOcsUrl } from '@nextcloud/router'
import { t } from '@nextcloud/l10n'
import { mdiAccountGroupOutline, mdiOpenInNew } from '@mdi/js'
import axios from '@nextcloud/axios'
import { t } from '@nextcloud/l10n'
import { generateOcsUrl, generateUrl } from '@nextcloud/router'
import { NcIconSvgWrapper } from '@nextcloud/vue'
import { nextTick, onMounted, ref, useTemplateRef } from 'vue'

import NcAvatar from '@nextcloud/vue/components/NcAvatar'
import NcButton from '@nextcloud/vue/components/NcButton'
import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'
import { logger } from '../logger.ts'
import { NcIconSvgWrapper } from '@nextcloud/vue'
import { mdiAccountGroupOutline, mdiOpenInNew } from '@mdi/js'

const LOADING_LIMIT = 3
const createTeamHref = generateUrl('/apps/contacts/#/circles')
Expand All @@ -116,7 +118,10 @@ const hasMoreTeams = ref(true)

onMounted(() => loadTeams())

async function loadTeams(isLoadMore = false) {
/**
* @param isLoadMore - If more teams should be appended or the content should be replaced
*/
async function loadTeams(isLoadMore: boolean = false) {
loading.value = true
loadingError.value = undefined

Expand All @@ -139,7 +144,7 @@ async function loadTeams(isLoadMore = false) {
displayName: member.displayName,
type: member.type,
isUser: member.type === 1, // TYPE_USER = 1
url: generateUrl(`/u/${member.userId || member.singleId}`)
url: generateUrl(`/u/${member.userId || member.singleId}`),
})),
resources: team.resources || [],
}))
Expand Down Expand Up @@ -172,6 +177,9 @@ async function loadTeams(isLoadMore = false) {
}
}

/**
* Trigger loading more teams
*/
async function loadMoreTeams() {
if (!hasMoreTeams.value || loading.value) {
return
Expand Down Expand Up @@ -391,17 +399,17 @@ async function loadMoreTeams() {
.members-row {
gap: 3px;
}

.resources-row {
gap: 6px;
}

.resource-box,
.more-resources-box {
width: 28px;
height: 28px;
}

.resource-icon {
width: 16px;
height: 16px;
Expand All @@ -419,4 +427,4 @@ async function loadMoreTeams() {
width: 100% !important;
font-size: 0.9em;
}
</style>
</style>