From f84538ab6c1454b1185e689dce00efa311ea69a9 Mon Sep 17 00:00:00 2001 From: Remko Date: Wed, 14 Oct 2026 10:42:24 +0200 Subject: [PATCH 1/2] feat(applications): tables, members and stats on the overview - the overview lists every table the application uses, through its own resources, a page or a widget, and says what uses it - the owner sees who the application is shared with - a short line counts the pages, tables and, for the owner, the members - a filter appears once an application has more than six pages Signed-off-by: Remko Assisted-by: ClaudeCode:claude-opus-5-5 --- playwright/e2e/application.spec.ts | 29 ++++ src/pages/Context.vue | 259 ++++++++++++++++++++++++++++- 2 files changed, 286 insertions(+), 2 deletions(-) diff --git a/playwright/e2e/application.spec.ts b/playwright/e2e/application.spec.ts index 01441819d6..946d54a616 100644 --- a/playwright/e2e/application.spec.ts +++ b/playwright/e2e/application.spec.ts @@ -50,6 +50,35 @@ test.describe('Applications', () => { expect(await page.evaluate(() => document.activeElement?.id ?? '')).not.toBe('app-content-vue') }) + test('The overview lists the tables the application uses and counts its pages', async ({ userPage: { page, user } }) => { + const tableResponse = await ocsRequest(page.request, user, { + method: 'POST', + url: '/ocs/v2.php/apps/tables/api/2/tables?format=json', + data: { title: 'Requests', template: 'custom' }, + }) + const table = (await tableResponse.json()).ocs.data + const contextResponse = await ocsRequest(page.request, user, { + method: 'POST', + url: '/ocs/v2.php/apps/tables/api/2/contexts?format=json', + data: { + name: 'used tables application', + iconName: 'star', + menuItems: [ + { label: 'All requests', targetType: 'table', targetId: table.id }, + { label: 'Docs', targetType: 'url', url: 'https://docs.nextcloud.com' }, + ], + }, + }) + const context = (await contextResponse.json()).ocs.data + + await page.goto(`/index.php/apps/tables/#/application/${context.id}`) + + await expect(page.locator('[data-cy="context-stats"]')).toContainText('2 pages') + await expect(page.locator('[data-cy="context-stats"]')).toContainText('1 table') + const row = page.locator('[data-cy="context-table-row"]').filter({ hasText: 'Requests' }) + await expect(row).toContainText('All requests') + }) + test('A page with widgets added on the overview gets a menu entry and opens', async ({ userPage: { page } }) => { await page.goto('/index.php/apps/tables') await createContext(page, 'overview application') diff --git a/src/pages/Context.vue b/src/pages/Context.vue index 2a732acd8a..dd6e639e6b 100644 --- a/src/pages/Context.vue +++ b/src/pages/Context.vue @@ -121,11 +121,21 @@ +

+ + {{ stat.label }} + +

{{ t('tables', 'Pages') }}

+