From 5cb8fcdf583465e9269043538ab0f641d0694a35 Mon Sep 17 00:00:00 2001
From: Ruben van der Linde
Date: Sun, 15 Nov 2026 00:32:35 +0000
Subject: [PATCH 1/7] feat(stackiq): build
gemma-plate-views-peers-and-definitions [skip ci]
Task 1: a GEMMA view picker on the plate. The plate lists the imported
views with their release, fetches the chosen one through useViewStore with
include_gebruik, draws its reference components in the view's own groups
with the coverage states kept, and keeps the choice in the URL as ?view=.
Coverage rows now carry the element identifier that view nodes name.
Assisted-by: ClaudeCode:claude-opus-5-5
---
l10n/en.js | 7 +-
l10n/en.json | 5 +-
l10n/nl.js | 7 +-
l10n/nl.json | 5 +-
.../ReferenceComponentCoverageDerivation.php | 8 +-
.../tasks.md | 4 +-
src/utils/referenceComponentCoverage.js | 192 +++++++++++++++
src/views/organisaties/GemmaPlate.vue | 145 ++++++++++-
...eComponentCoverageDerivationGoldenTest.php | 2 +-
tests/fixtures/coverage/build.json | 12 +-
tests/fixtures/coverage/derive.json | 6 +
tests/vitest/gemmaPlateRender.cases.spec.js | 4 +
tests/vitest/gemmaPlateRender.spec.js | 4 +
tests/vitest/gemmaPlateViews.spec.js | 233 ++++++++++++++++++
14 files changed, 616 insertions(+), 18 deletions(-)
create mode 100644 tests/vitest/gemmaPlateViews.spec.js
diff --git a/l10n/en.js b/l10n/en.js
index 45bdddb85..f92e5793f 100644
--- a/l10n/en.js
+++ b/l10n/en.js
@@ -5,8 +5,8 @@
OC.L10N.register(
"stackiq",
{
- "No mail transport is set, so registration, activation and account mails are not sent.": "No mail transport is set, so registration, activation and account mails are not sent.",
"Set up the mail transport": "Set up the mail transport",
+ "No mail transport is set, so registration, activation and account mails are not sent.": "No mail transport is set, so registration, activation and account mails are not sent.",
"Licence metric": "Licence metric",
"What one licence covers, as the contract with the supplier states it.": "What one licence covers, as the contract with the supplier states it.",
"Licences bought": "Licences bought",
@@ -1336,7 +1336,10 @@ OC.L10N.register(
"Software catalogue": "Software catalogue",
"Shared": "Shared",
"{name}, shared by {partner}": "{name}, shared by {partner}",
- "+{count} more": "+{count} more"
+ "+{count} more": "+{count} more",
+ "GEMMA view": "GEMMA view",
+ "The whole GEMMA model": "The whole GEMMA model",
+ "Import the GEMMA model to pick a GEMMA view.": "Import the GEMMA model to pick a GEMMA view."
},
"nplurals=2; plural=(n != 1);"
)
diff --git a/l10n/en.json b/l10n/en.json
index ae796f560..d4b5a6ad8 100644
--- a/l10n/en.json
+++ b/l10n/en.json
@@ -1331,6 +1331,9 @@
"Software catalogue": "Software catalogue",
"Shared": "Shared",
"{name}, shared by {partner}": "{name}, shared by {partner}",
- "+{count} more": "+{count} more"
+ "+{count} more": "+{count} more",
+ "GEMMA view": "GEMMA view",
+ "The whole GEMMA model": "The whole GEMMA model",
+ "Import the GEMMA model to pick a GEMMA view.": "Import the GEMMA model to pick a GEMMA view."
}
}
diff --git a/l10n/nl.js b/l10n/nl.js
index 6b4693a02..c59ecfacf 100644
--- a/l10n/nl.js
+++ b/l10n/nl.js
@@ -5,8 +5,8 @@
OC.L10N.register(
"stackiq",
{
- "No mail transport is set, so registration, activation and account mails are not sent.": "Er is geen mailtransport ingesteld, dus registratie-, activatie- en accountmails worden niet verstuurd.",
"Set up the mail transport": "Mailtransport instellen",
+ "No mail transport is set, so registration, activation and account mails are not sent.": "Er is geen mailtransport ingesteld, dus registratie-, activatie- en accountmails worden niet verstuurd.",
"Licence metric": "Licentiemetriek",
"What one licence covers, as the contract with the supplier states it.": "Waar één licentie voor geldt, zoals het contract met de leverancier het vastlegt.",
"Licences bought": "Gekochte licenties",
@@ -1404,7 +1404,10 @@ OC.L10N.register(
"Software catalogue": "Softwarecatalogus",
"Shared": "Gedeeld",
"{name}, shared by {partner}": "{name}, gedeeld door {partner}",
- "+{count} more": "+{count} meer"
+ "+{count} more": "+{count} meer",
+ "GEMMA view": "GEMMA-view",
+ "The whole GEMMA model": "Het hele GEMMA-model",
+ "Import the GEMMA model to pick a GEMMA view.": "Importeer het GEMMA-model om een GEMMA-view te kiezen."
},
"nplurals=2; plural=(n != 1);"
)
diff --git a/l10n/nl.json b/l10n/nl.json
index 4a283a4ed..204157c80 100644
--- a/l10n/nl.json
+++ b/l10n/nl.json
@@ -1399,6 +1399,9 @@
"Software catalogue": "Softwarecatalogus",
"Shared": "Gedeeld",
"{name}, shared by {partner}": "{name}, gedeeld door {partner}",
- "+{count} more": "+{count} meer"
+ "+{count} more": "+{count} meer",
+ "GEMMA view": "GEMMA-view",
+ "The whole GEMMA model": "Het hele GEMMA-model",
+ "Import the GEMMA model to pick a GEMMA view.": "Importeer het GEMMA-model om een GEMMA-view te kiezen."
}
}
diff --git a/lib/Service/ReferenceComponentCoverageDerivation.php b/lib/Service/ReferenceComponentCoverageDerivation.php
index 147e58859..5bcbc3c19 100644
--- a/lib/Service/ReferenceComponentCoverageDerivation.php
+++ b/lib/Service/ReferenceComponentCoverageDerivation.php
@@ -208,15 +208,19 @@ private function componentCoverage(string $id, CoverageIndex $index): array {
}//end componentCoverage()
/**
- * What a component is: its name, group and documentation.
+ * What a component is: its name, group, documentation and its GEMMA
+ * element identifier, which a GEMMA view's nodes name it by.
*
* @param array $component The reference component.
*
- * @return array{name: string, group: string, documentation: string}
+ * @return array{name: string, identifier: string, group: string, documentation: string}
+ *
+ * @spec openspec/changes/gemma-plate-views-peers-and-definitions/specs/gemma-plate/spec.md#requirement-the-plate-draws-the-gemma-view-the-user-picks-req-gpl-001
*/
private static function componentFacts(array $component): array {
return [
'name' => (string)($component['name'] ?? ''),
+ 'identifier' => (string)($component['identifier'] ?? ''),
'group' => (string)($component['grouping'] ?? ''),
'documentation' => (string)($component['documentation'] ?? ''),
];
diff --git a/openspec/changes/gemma-plate-views-peers-and-definitions/tasks.md b/openspec/changes/gemma-plate-views-peers-and-definitions/tasks.md
index 73f3791e1..eedbc811c 100644
--- a/openspec/changes/gemma-plate-views-peers-and-definitions/tasks.md
+++ b/openspec/changes/gemma-plate-views-peers-and-definitions/tasks.md
@@ -9,8 +9,8 @@
- GIVEN imported GEMMA views WHEN the plate loads THEN a picker lists them with the GEMMA release, and `useViewStore` fetches the chosen view with `include_gebruik`
- GIVEN a chosen view WHEN it renders THEN reference components are grouped by the view's groups, keeping the gap, covered and overlap states
- GIVEN `?view=` in the URL WHEN the page opens THEN that view is chosen
-- [ ] Implement
-- [ ] Test (vitest `gemmaPlateViews.spec.js`)
+- [x] Implement
+- [x] Test (vitest `gemmaPlateViews.spec.js`)
### Task 2: Inhabitants on the organisation
- **spec_ref**: openspec/changes/gemma-plate-views-peers-and-definitions/specs/gemma-plate/spec.md#requirement-the-plate-shows-what-comparable-organisations-use-req-gpl-002
diff --git a/src/utils/referenceComponentCoverage.js b/src/utils/referenceComponentCoverage.js
index 43344c1fe..546640ece 100644
--- a/src/utils/referenceComponentCoverage.js
+++ b/src/utils/referenceComponentCoverage.js
@@ -44,3 +44,195 @@ export function groupCoverage(components, fallback) {
? [...named, { name: fallback, components: groups.get('') }]
: named
}
+
+/**
+ * A view's id, whichever shape the views endpoint gives it in.
+ *
+ * @param {object} view A view from `GET /api/views`.
+ * @return {string} The id, or '' when it has none.
+ * @spec openspec/changes/gemma-plate-views-peers-and-definitions/specs/gemma-plate/spec.md#requirement-the-plate-draws-the-gemma-view-the-user-picks-req-gpl-001
+ */
+export function viewId(view) {
+ return String(view?.id ?? view?.['@self']?.id ?? view?.uuid ?? '')
+}
+
+/**
+ * The GEMMA release a view belongs to, or '' when the import recorded none.
+ *
+ * @param {object} view A view.
+ * @return {string} The release.
+ * @spec openspec/changes/gemma-plate-views-peers-and-definitions/specs/gemma-plate/spec.md#requirement-the-plate-draws-the-gemma-view-the-user-picks-req-gpl-001
+ */
+export function viewRelease(view) {
+ return String(view?.release ?? view?.gemmaRelease ?? view?.version ?? '')
+}
+
+/**
+ * Picker options for the views, by name, each labelled with its release.
+ *
+ * @param {Array
-
+
+
+
+
+ {{ t('stackiq', 'What the reference components are') }}
+
+
+
+ {{ value.label || value.value }}
+
+
+
+
+
} The facet values.
+ * @spec openspec/changes/gemma-plate-views-peers-and-definitions/specs/gemma-plate/spec.md#requirement-gemma-terms-show-their-definition-where-they-appear-req-gpl-003
+ */
+ referenceComponentDefinitions() {
+ return (
+ this.facetStore.facetDataFor(this.schema)?.referenceComponent?.values || []
+ ).filter((value) => value && value.value)
+ },
+
/**
* `CnFacetSidebar`'s `schema` prop — a schema-shaped document whose
* facetable properties are the four GEMMA dimensions.
@@ -665,6 +707,35 @@ export default {
flex-shrink: 0;
}
+.faceted-catalog-index__aside {
+ flex-shrink: 0;
+ display: flex;
+ flex-direction: column;
+}
+
+.faceted-catalog-index__definitions {
+ padding: calc(var(--default-grid-baseline, 4px) * 4);
+ border-right: 1px solid var(--color-border);
+}
+
+.faceted-catalog-index__definitions-title {
+ margin: 0 0 calc(var(--default-grid-baseline, 4px) * 2);
+ font-size: 1rem;
+}
+
+.faceted-catalog-index__definitions-list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.faceted-catalog-index__definitions-list li {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--default-grid-baseline, 4px);
+}
+
.faceted-catalog-index__list {
flex: 1;
min-width: 0;
diff --git a/tests/Unit/Service/FacetServiceDefinitionTest.php b/tests/Unit/Service/FacetServiceDefinitionTest.php
new file mode 100644
index 000000000..d5366fc8a
--- /dev/null
+++ b/tests/Unit/Service/FacetServiceDefinitionTest.php
@@ -0,0 +1,192 @@
+
+ * @copyright 2026 Conduction B.V.
+ * @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
+ * @link https://github.com/ConductionNL/stackiq
+ *
+ * SPDX-FileCopyrightText: 2026 Conduction B.V.
+ * SPDX-License-Identifier: EUPL-1.2
+ *
+ * @spec openspec/changes/gemma-plate-views-peers-and-definitions/specs/gemma-plate/spec.md#requirement-gemma-terms-show-their-definition-where-they-appear-req-gpl-003
+ */
+
+declare(strict_types=1);
+
+namespace OCA\Stackiq\Tests\Unit\Service;
+
+use OCA\OpenRegister\Contract\ObjectServiceInterface;
+use OCA\OpenRegister\Service\ObjectService;
+use OCA\Stackiq\Service\ArchiMateService;
+use OCA\Stackiq\Service\DimensionResolution;
+use OCA\Stackiq\Service\FacetService;
+use OCA\Stackiq\Service\Settings\CatalogueLocator;
+use OCA\Stackiq\Service\ViewQueryBuilder;
+use OCP\ICache;
+use OCP\ICacheFactory;
+use OCP\IUser;
+use OCP\IUserSession;
+use PHPUnit\Framework\Attributes\CoversClass;
+use PHPUnit\Framework\Attributes\UsesClass;
+use PHPUnit\Framework\TestCase;
+use Psr\Container\ContainerInterface;
+use Psr\Log\LoggerInterface;
+
+/**
+ * The definitions FacetService adds to the referenceComponent buckets.
+ *
+ * @spec openspec/changes/gemma-plate-views-peers-and-definitions/specs/gemma-plate/spec.md#requirement-gemma-terms-show-their-definition-where-they-appear-req-gpl-003
+ */
+#[CoversClass(FacetService::class)]
+#[UsesClass(DimensionResolution::class)]
+#[UsesClass(ViewQueryBuilder::class)]
+class FacetServiceDefinitionTest extends TestCase {
+
+ /**
+ * Every element lookup the service made.
+ *
+ * @var array
+ */
+ private array $elementQueries = [];
+
+ /**
+ * A FacetService over these modules and elements.
+ *
+ * @param array $modules The module objects the base query returns.
+ * @param array $elements The element objects the lookup returns.
+ *
+ * @return FacetService
+ */
+ private function service(array $modules, array $elements): FacetService {
+ $objectService = $this->createMock(ObjectServiceInterface::class);
+ $objectService->method('searchObjectsPaginated')->willReturn(
+ ['results' => $modules, 'total' => count($modules), 'page' => 1, 'pages' => 1]
+ );
+ $objectService->method('searchObjects')->willReturn([]);
+
+ $organisationService = new class {
+ /**
+ * No active organisation.
+ *
+ * @return null
+ */
+ public function getActiveOrganisation() {
+ return null;
+ }
+ };
+ $container = $this->createMock(ContainerInterface::class);
+ $container->method('get')->willReturnCallback(
+ static fn (string $id) => ($id === ObjectService::class ? $objectService : $organisationService)
+ );
+
+ $catalogue = $this->createMock(CatalogueLocator::class);
+ $catalogue->method('getVoorzieningenConfig')->willReturn(['register' => '10', 'module_schema' => '20', 'dienst_schema' => '21']);
+
+ $archiMate = $this->createMock(ArchiMateService::class);
+ $archiMate->method('getElementObjects')->willReturnCallback(
+ function (array $query) use ($elements): array {
+ $this->elementQueries[] = $query;
+ return $elements;
+ }
+ );
+ $archiMate->method('getRelationshipObjects')->willReturn([]);
+
+ $cache = $this->createMock(ICache::class);
+ $cache->method('get')->willReturn(null);
+ $cacheFactory = $this->createMock(ICacheFactory::class);
+ $cacheFactory->method('createDistributed')->willReturn($cache);
+
+ $user = $this->createMock(IUser::class);
+ $user->method('getUID')->willReturn('alice');
+ $session = $this->createMock(IUserSession::class);
+ $session->method('getUser')->willReturn($user);
+
+ return new FacetService(
+ container: $container,
+ catalogue: $catalogue,
+ archiMateService: $archiMate,
+ queryBuilder: new ViewQueryBuilder(),
+ userSession: $session,
+ logger: $this->createMock(LoggerInterface::class),
+ cacheFactory: $cacheFactory
+ );
+ }//end service()
+
+ /**
+ * Each referenceComponent bucket carries the trimmed documentation and
+ * GEMMA Online link of its element, from the one element lookup.
+ *
+ * @return void
+ */
+ public function testEachReferenceComponentBucketCarriesItsDefinition(): void {
+ $service = $this->service(
+ modules: [
+ ['id' => 'm1', 'referenceComponents' => ['rc-zs', 'rc-kb'], 'standardVersions' => [['name' => 'StUF']]],
+ ['id' => 'm2', 'referenceComponents' => ['rc-zs'], 'standardVersions' => []],
+ ],
+ elements: [
+ ['identifier' => 'rc-zs', 'name' => 'Zaaksysteem', 'documentation' => " Ondersteunt het zaakgericht werken.\n", 'gemmaUrl' => 'https://www.gemmaonline.nl/zaaksysteem'],
+ ['identifier' => 'rc-kb', 'name' => 'Kennisbank', 'documentation' => ['not', 'a', 'string'], 'gemmaUrl' => null],
+ ]
+ );
+
+ $result = $service->getFacets(schema: 'module');
+
+ $this->assertSame(
+ [
+ ['value' => 'Zaaksysteem', 'label' => 'Zaaksysteem', 'count' => 2, 'documentation' => 'Ondersteunt het zaakgericht werken.', 'gemmaUrl' => 'https://www.gemmaonline.nl/zaaksysteem'],
+ ['value' => 'Kennisbank', 'label' => 'Kennisbank', 'count' => 1, 'documentation' => '', 'gemmaUrl' => ''],
+ ],
+ $result['referenceComponent']
+ );
+ $this->assertCount(1, $this->elementQueries);
+ $this->assertSame([['value' => 'StUF', 'label' => 'StUF', 'count' => 1]], $result['standard']);
+ }//end testEachReferenceComponentBucketCarriesItsDefinition()
+
+ /**
+ * A component whose element is not found keeps its identifier as value and
+ * gets an empty definition and link.
+ *
+ * @return void
+ */
+ public function testAnUnresolvedComponentHasAnEmptyDefinition(): void {
+ $service = $this->service(
+ modules: [['id' => 'm1', 'referenceComponents' => ['rc-gone'], 'standardVersions' => []]],
+ elements: []
+ );
+
+ $this->assertSame(
+ [['value' => 'rc-gone', 'label' => 'rc-gone', 'count' => 1, 'documentation' => '', 'gemmaUrl' => '']],
+ $service->getFacets(schema: 'module')['referenceComponent']
+ );
+ }//end testAnUnresolvedComponentHasAnEmptyDefinition()
+
+ /**
+ * Two elements with the same name share one bucket; the first keeps its definition.
+ *
+ * @return void
+ */
+ public function testTheFirstElementOfANameKeepsTheDefinition(): void {
+ $service = $this->service(
+ modules: [['id' => 'm1', 'referenceComponents' => ['rc-a', 'rc-b'], 'standardVersions' => []]],
+ elements: [
+ ['identifier' => 'rc-a', 'name' => 'Portaal', 'documentation' => 'Eerste', 'gemmaUrl' => 'https://a'],
+ ['identifier' => 'rc-b', 'name' => 'Portaal', 'documentation' => 'Tweede', 'gemmaUrl' => 'https://b'],
+ ]
+ );
+
+ $this->assertSame(
+ [['value' => 'Portaal', 'label' => 'Portaal', 'count' => 1, 'documentation' => 'Eerste', 'gemmaUrl' => 'https://a']],
+ $service->getFacets(schema: 'module')['referenceComponent']
+ );
+ }//end testTheFirstElementOfANameKeepsTheDefinition()
+}//end class
diff --git a/tests/Unit/Service/FacetServiceDimensionMapGoldenTest.php b/tests/Unit/Service/FacetServiceDimensionMapGoldenTest.php
index d2560c90b..e446f806f 100644
--- a/tests/Unit/Service/FacetServiceDimensionMapGoldenTest.php
+++ b/tests/Unit/Service/FacetServiceDimensionMapGoldenTest.php
@@ -3,7 +3,7 @@
/**
* Golden test of the per-object GEMMA dimension values of the facet service.
*
- * Pins buildDimensionValueMap for objects whose modules carry repeated,
+ * Pins the dimension map (dimensionValuesAndDefinitions) for objects whose modules carry repeated,
* unresolved and nameless referenceComponents, padded and empty domains,
* standards with empty names, and application services linked by relation.
*
@@ -71,9 +71,9 @@ private function map(array $modulesByObjectId, array $relations): array {
$cacheFactory
);
- $method = new \ReflectionMethod(FacetService::class, 'buildDimensionValueMap');
+ $method = new \ReflectionMethod(FacetService::class, 'dimensionValuesAndDefinitions');
$method->setAccessible(true);
- return $method->invoke($service, $modulesByObjectId);
+ return $method->invoke($service, $modulesByObjectId)[0];
}//end map()
/**
diff --git a/tests/vitest/gemmaDefinitionPopover.spec.js b/tests/vitest/gemmaDefinitionPopover.spec.js
new file mode 100644
index 000000000..da748566a
--- /dev/null
+++ b/tests/vitest/gemmaDefinitionPopover.spec.js
@@ -0,0 +1,124 @@
+// @vitest-environment jsdom
+
+/**
+ * SPDX-FileCopyrightText: 2026 Conduction B.V.
+ * SPDX-License-Identifier: EUPL-1.2
+ *
+ * GEMMA definitions in place: the popover shows ", from GEMMA", the
+ * definition and the GEMMA Online link (only the name and the link without a
+ * definition), and the reference component facet gives each value one.
+ *
+ * @spec openspec/changes/gemma-plate-views-peers-and-definitions/specs/gemma-plate/spec.md#requirement-gemma-terms-show-their-definition-where-they-appear-req-gpl-003
+ */
+
+import { mount } from '@vue/test-utils'
+import { createPinia, setActivePinia } from 'pinia'
+import { describe, expect, it, vi } from 'vitest'
+import { defineComponent, h } from 'vue'
+
+vi.mock('@nextcloud/l10n', () => ({
+ translate: (app, text, vars = {}) => String(text).replace(/\{(\w+)\}/g, (m, k) => (k in vars ? String(vars[k]) : m)),
+ translatePlural: (app, one, many, count) => (count === 1 ? one : many),
+ getLanguage: () => 'en',
+ getLocale: () => 'en',
+}))
+vi.mock('@conduction/nextcloud-vue', () => ({
+ CnFacetSidebar: defineComponent({ name: 'CnFacetSidebar', render: () => h('div') }),
+ CnIndexPage: defineComponent({ name: 'CnIndexPage', render: () => h('div') }),
+}))
+vi.mock('../../src/modals/SaveFacetViewModal.vue', () => ({
+ default: defineComponent({ name: 'SaveFacetViewModal', render: () => h('div') }),
+}))
+
+const { default: GemmaDefinitionPopover } = await import('../../src/components/gemma/GemmaDefinitionPopover.vue')
+const { default: FacetedCatalogIndexView } = await import('../../src/views/FacetedCatalogIndexView.vue')
+
+const stubs = {
+ NcPopover: { template: '
' },
+ NcButton: { props: ['ariaLabel'], template: '' },
+ InformationOutline: true,
+ OpenInNew: true,
+}
+
+describe('GemmaDefinitionPopover', () => {
+ it('shows the name from GEMMA, the definition and the GEMMA Online link', () => {
+ const wrapper = mount(GemmaDefinitionPopover, {
+ props: { name: 'Zaaksysteem', documentation: 'Ondersteunt zaakgericht werken.', gemmaUrl: 'https://www.gemmaonline.nl/zaaksysteem' },
+ global: { stubs },
+ })
+
+ expect(wrapper.find('[data-testid="gemma-definition-button"]').attributes('aria-label')).toBe('What is Zaaksysteem?')
+ expect(wrapper.find('.gemma-definition__name').text()).toBe('Zaaksysteem, from GEMMA')
+ expect(wrapper.find('.gemma-definition__text').text()).toBe('Ondersteunt zaakgericht werken.')
+ const link = wrapper.find('a.gemma-definition__link')
+ expect(link.text()).toBe('More in GEMMA Online')
+ expect(link.attributes('href')).toBe('https://www.gemmaonline.nl/zaaksysteem')
+ expect(link.attributes('target')).toBe('_blank')
+ expect(link.attributes('rel')).toBe('noopener noreferrer')
+ })
+
+ it('shows only the name and the link for a component without documentation', () => {
+ const wrapper = mount(GemmaDefinitionPopover, {
+ props: { name: 'Kennisbank', gemmaUrl: 'https://www.gemmaonline.nl/kennisbank' },
+ global: { stubs },
+ })
+
+ const body = wrapper.find('[data-testid="gemma-definition"]')
+ expect(body.find('.gemma-definition__text').exists()).toBe(false)
+ expect(body.find('.gemma-definition__name').text()).toBe('Kennisbank, from GEMMA')
+ expect(body.find('a').text()).toBe('More in GEMMA Online')
+ })
+
+ it('leaves the link out when the element has no GEMMA Online page', () => {
+ const wrapper = mount(GemmaDefinitionPopover, { props: { name: 'Eigen' }, global: { stubs } })
+ expect(wrapper.find('a').exists()).toBe(false)
+ })
+})
+
+describe('the reference component facet', () => {
+ /**
+ * Mount the Applications page with these reference component buckets.
+ *
+ * @param {Array} values The buckets.
+ * @return {object} The wrapper.
+ */
+ function mountPage(values) {
+ setActivePinia(createPinia())
+ const wrapper = mount(FacetedCatalogIndexView, {
+ props: { schema: 'module', register: 'voorzieningen', title: 'Applications' },
+ global: {
+ mocks: { $route: { query: {} }, $router: { push: vi.fn(), replace: vi.fn(async () => {}) } },
+ stubs: { ...stubs, NcActions: true, NcActionButton: true, NcActionCaption: true },
+ plugins: [
+ (app) => {
+ app.config.globalProperties.t = (a, text) => text
+ },
+ ],
+ },
+ })
+ wrapper.vm.facetStore.module.data = { referenceComponent: values }
+ return wrapper
+ }
+
+ it('gives each value an information button with its definition', async () => {
+ const wrapper = mountPage([
+ { value: 'Zaaksysteem', label: 'Zaaksysteem', count: 4, documentation: 'Zaken', gemmaUrl: 'https://g/zs' },
+ { value: 'Kennisbank', label: 'Kennisbank', count: 1, documentation: '', gemmaUrl: '' },
+ ])
+ await wrapper.vm.$nextTick()
+
+ const items = wrapper.findAll('[data-testid="gemma-definitions"] li')
+ expect(items).toHaveLength(2)
+ expect(items[0].find('.gemma-definition__name').text()).toBe('Zaaksysteem, from GEMMA')
+ expect(items[0].find('.gemma-definition__text').text()).toBe('Zaken')
+ expect(items[0].find('a').attributes('href')).toBe('https://g/zs')
+ expect(items[1].find('.gemma-definition__text').exists()).toBe(false)
+ expect(items[1].find('a').exists()).toBe(false)
+ })
+
+ it('shows no definitions section without reference component values', async () => {
+ const wrapper = mountPage([])
+ await wrapper.vm.$nextTick()
+ expect(wrapper.find('[data-testid="gemma-definitions"]').exists()).toBe(false)
+ })
+})
From 00d1ef122b76de548dde6fc1b433cbf21458607b Mon Sep 17 00:00:00 2001
From: Ruben van der Linde
Date: Sun, 15 Nov 2026 00:39:40 +0000
Subject: [PATCH 4/7] feat(stackiq): build
gemma-plate-views-peers-and-definitions [skip ci]
Task 6: the feature doc for the GEMMA plate: the view picker, the layer
of what comparable organisations use with its anonymity rule, and the
GEMMA definitions in the facet. The capability rows move to built when
the change is archived.
Assisted-by: ClaudeCode:claude-opus-5-5
---
docs/features/README.md | 1 +
docs/features/reference-component-coverage.md | 34 +++++++++++++++++++
.../tasks.md | 2 +-
3 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 docs/features/reference-component-coverage.md
diff --git a/docs/features/README.md b/docs/features/README.md
index fc46aac3c..770b31dbc 100644
--- a/docs/features/README.md
+++ b/docs/features/README.md
@@ -11,6 +11,7 @@ All data is stored as OpenRegister objects (no own database tables). OpenRegiste
| [Software Registration](#software-registration) | Register and manage applications (voorzieningen) in the landscape |
| [GEMMA Faceted Search](#gemma-faceted-search) | Filter the application/service catalogue by GEMMA architecture dimension, with live counts |
| [Supplier Facet](supplier-facet.md) | Narrow applications and services by supplier, next to the GEMMA facets |
+| [GEMMA Plate](reference-component-coverage.md) | The GEMMA reference components with an organisation's applications, per GEMMA view, with what comparable organisations use |
| [Module Tracking](#module-tracking) | Break applications down into functional modules |
| [Connection Mapping](#connection-mapping) | Map integrations (koppelingen) between applications and modules |
| [Organisation and Contact Management](#organisation-and-contact-management) | Manage organisations and their contact persons |
diff --git a/docs/features/reference-component-coverage.md b/docs/features/reference-component-coverage.md
new file mode 100644
index 000000000..38b4fc772
--- /dev/null
+++ b/docs/features/reference-component-coverage.md
@@ -0,0 +1,34 @@
+
+
+# GEMMA plate
+
+The GEMMA plate shows the GEMMA reference components with the applications one organisation uses for each of them. Every component has a state: **Covered** (one application), **Gap** (none) or **Overlap** (more than one). A gap is **fillable** when an application the organisation already uses offers that component.
+
+Specifications: [`reference-component-coverage`](https://github.com/ConductionNL/stackiq/blob/development/openspec/changes/architecture-reference-component-coverage/specs/reference-component-coverage/spec.md) and [`gemma-plate`](https://github.com/ConductionNL/stackiq/blob/development/openspec/changes/gemma-plate-views-peers-and-definitions/specs/gemma-plate/spec.md).
+
+## Choosing the organisation
+
+Pick the organisation at the top of the page. With only one organisation to choose from, the plate opens on it straight away. **Download** gives the same coverage as a CSV file.
+
+## Choosing a GEMMA view
+
+The **GEMMA view** picker lists the GEMMA views imported with the GEMMA model, each with its GEMMA release when the import recorded one. Pick a view, for example *GEMMA Applicatiearchitectuur, gemeentebreed*, and the plate draws that view's reference components in the view's own groups (such as Front-office, Mid-office, Back-office en basisregistraties), each with its state and the organisation's applications. Clear the picker to see the whole model grouped by the components' own GEMMA grouping.
+
+The chosen view is kept in the address as `?view=`, so a link opens the same plate. Without an imported GEMMA model the picker is empty and the page says the model is needed.
+
+## What comparable organisations use
+
+Under **Layers**, switch on **What comparable organisations use**. The table below the plate then shows per reference component your own applications and the applications comparable organisations use for it, with how many organisations use each. Select a component on the plate and its side panel lists the same applications with their counts, so a gap shows what others fill it with.
+
+Comparable means the same organisation type (for example municipality) and the same inhabitants band: under 30,000; 30,000 to 60,000; 60,000 to 100,000; 100,000 to 250,000; above 250,000. Set the number of inhabitants on the organisation's page. An organisation without that number is compared with every organisation of its type. The table's heading names the type and band compared with.
+
+### The anonymity rule
+
+The counts are computed on the server over all usages, and the answer never contains another organisation's id or name. An application used by fewer than 3 comparable organisations shows **fewer than 3** instead of a count, so a single organisation's choice cannot be read off the table. Only members of the organisation can open its comparison.
+
+## GEMMA definitions in place
+
+Select a reference component on the plate and the side panel shows its GEMMA definition. On the **Applications** and **Services** pages, the list *What the reference components are* under the GEMMA filters gives each reference component an information button. It opens the component's name *from GEMMA*, its definition, and a link **More in GEMMA Online**. A component without a definition shows only its name and the link.
diff --git a/openspec/changes/gemma-plate-views-peers-and-definitions/tasks.md b/openspec/changes/gemma-plate-views-peers-and-definitions/tasks.md
index bdfa3a0ab..a9d5fbf13 100644
--- a/openspec/changes/gemma-plate-views-peers-and-definitions/tasks.md
+++ b/openspec/changes/gemma-plate-views-peers-and-definitions/tasks.md
@@ -56,4 +56,4 @@
- **acceptance_criteria**:
- GIVEN the feature doc WHEN read THEN it explains the view picker, the comparable organisations layer and the anonymity rule
- GIVEN the tasks are done WHEN the change is archived THEN the three rows move back to built with new evidence
-- [ ] Implement
+- [x] Implement
From 85b958afe2500509af13a9cea86c61e392585cf3 Mon Sep 17 00:00:00 2001
From: Ruben van der Linde
Date: Sun, 15 Nov 2026 00:42:19 +0000
Subject: [PATCH 5/7] feat(stackiq): build
gemma-plate-views-peers-and-definitions [skip ci]
Read the view store defensively on the plate, so a plate built without
its setup (as the portfolio harness test does) still computes its groups.
Assisted-by: ClaudeCode:claude-opus-5-5
---
src/views/organisaties/GemmaPlate.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/organisaties/GemmaPlate.vue b/src/views/organisaties/GemmaPlate.vue
index 887e59858..4aefc1278 100644
--- a/src/views/organisaties/GemmaPlate.vue
+++ b/src/views/organisaties/GemmaPlate.vue
@@ -441,7 +441,7 @@ export default {
* @spec openspec/changes/gemma-plate-views-peers-and-definitions/specs/gemma-plate/spec.md#requirement-the-plate-draws-the-gemma-view-the-user-picks-req-gpl-001
*/
viewChoices() {
- return viewOptions(this.viewStore.views)
+ return viewOptions(this.viewStore?.views)
},
/**
@@ -451,7 +451,7 @@ export default {
* @spec openspec/changes/gemma-plate-views-peers-and-definitions/specs/gemma-plate/spec.md#requirement-the-plate-draws-the-gemma-view-the-user-picks-req-gpl-001
*/
shownView() {
- const active = this.viewStore.activeView
+ const active = this.viewStore?.activeView
if (!this.selectedView || !active) {
return null
}
From b8d7fdb714be727f1064b786da85f31d62783ab2 Mon Sep 17 00:00:00 2001
From: Ruben van der Linde
Date: Fri, 20 Nov 2026 20:43:52 +0000
Subject: [PATCH 6/7] fix(gemma-plate): satisfy the diff gates after the
development merge
Named arguments and short lines in the definition test, viewGroups split
into rowsByKey and a shared groupsInOrder, the peer table's headings from
one list, viewOptions refusing a non-list, and the plate specs mock the
graph canvas the coverage map now brings in.
cloud-merge-stackiq
Assisted-by: ClaudeCode:claude-opus-5-5
---
src/components/gemma/PeerUsageTable.vue | 24 ++++--
src/utils/referenceComponentCoverage.js | 75 +++++++++++--------
src/views/organisaties/GemmaPlate.vue | 4 +-
.../Service/FacetServiceDefinitionTest.php | 61 +++++++++------
tests/vitest/gemmaPlateViews.spec.js | 1 +
tests/vitest/peerUsageTable.spec.js | 1 +
6 files changed, 105 insertions(+), 61 deletions(-)
diff --git a/src/components/gemma/PeerUsageTable.vue b/src/components/gemma/PeerUsageTable.vue
index 292abf3a1..b79e13934 100644
--- a/src/components/gemma/PeerUsageTable.vue
+++ b/src/components/gemma/PeerUsageTable.vue
@@ -24,14 +24,8 @@