From e7c13be3a13f489c11d82ef715dd9a2856f84762 Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Fri, 6 Nov 2026 01:33:27 +0100 Subject: [PATCH] fix(flows): open a flow from its row on the flow list Flows is an index over the flows source without a rowRoute, so a row click opened nothing. It now names FlowDetail. Assisted-by: ClaudeCode:claude-opus-5-5 --- src/manifest.json | 4 ++-- tests/vitest/flowPages.spec.js | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 tests/vitest/flowPages.spec.js diff --git a/src/manifest.json b/src/manifest.json index 3a578ef10..5c441bd83 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1099,8 +1099,8 @@ "route": "/flows", "type": "index", "title": "Flows", - "config": { "entitySource": "flows", "app": "stackiq" }, - "_note": "ADR-110 Decision 4: a flow is app-specific, so the authoring surface lives here rather than behind a deep link to another app's list. An ordinary index over the named `flows` source (config.entitySource) rather than the deprecated `flows` page type, reading OpenRegister's one native flow store (ADR-065), scoped to this app by config.app." + "config": { "entitySource": "flows", "app": "stackiq", "rowRoute": "FlowDetail" }, + "_note": "ADR-110 Decision 4: a flow is app-specific, so the authoring surface lives here rather than behind a deep link to another app's list. An ordinary index over the named `flows` source (config.entitySource) rather than the deprecated `flows` page type, reading OpenRegister's one native flow store (ADR-065), scoped to this app by config.app. rowRoute names the FlowDetail page (a route name, not a path): a named-source page has no register and schema, so without it a row click opens nothing and Edit falls back to the source's own /flows path." }, { "id": "FlowDetail", diff --git a/tests/vitest/flowPages.spec.js b/tests/vitest/flowPages.spec.js new file mode 100644 index 000000000..cc2283c2a --- /dev/null +++ b/tests/vitest/flowPages.spec.js @@ -0,0 +1,43 @@ +/** + * SPDX-FileCopyrightText: 2026 Conduction B.V. + * SPDX-License-Identifier: EUPL-1.2 + * + * The flow pages use the canonical form: an index over the `flows` source whose + * rows open a page of type `flow`, on the addresses links already point at. + * + * @spec exclude Structural invariant of the shipped manifest; no behavioural spec. + */ +import * as fs from 'fs' +import * as path from 'path' +import { describe, expect, it } from 'vitest' +import { createMemoryHistory, createRouter } from 'vue-router' + +const { pages } = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../../src/manifest.json'), 'utf8')) +const byId = new Map(pages.map((page) => [page.id, page])) +const router = createRouter({ + history: createMemoryHistory(), + routes: pages.map((page) => ({ name: page.id, path: page.route, component: {} })), +}) + +describe('flow pages', () => { + it('names no deprecated flow page type', () => { + expect(pages.filter((page) => ['flows', 'flow-detail'].includes(page.type)).map((page) => page.id)).toEqual([]) + }) + + it('Flows is an index over the flows source, scoped to this app', () => { + const { type, config } = byId.get('Flows') + expect(type).toBe('index') + expect(config.entitySource).toBe('flows') + expect(config.app).toBe('stackiq') + }) + + it('Flows opens its rows on a flow page', () => { + expect(byId.get(byId.get('Flows').config.rowRoute).type).toBe('flow') + }) + + it('keeps the flow addresses on the flow pages', () => { + expect(router.resolve('/flows').name).toBe('Flows') + expect(router.resolve('/flows/new').name).toBe('FlowDetail') + expect(router.resolve('/flows/abc').name).toBe('FlowDetail') + }) +})