refactor: strip WP-/RB- ticket refs from apps and libs (RD-18)

204 WP-NN/RB-NN comments named a closed ticket instead of the code they
sit next to. git blame already records history and stays correct when
code moves; the comment does not. This sweep removes the reference and
keeps the sentence, across 95 files in apps/ and libs/ plus the
behaviour-spec generator's header text.

Eleven references stay: five story files justify an a11y disable per
the README's rule, and one line in a11y.mdx documents that convention.
Two sentences needed a rewrite, not a deletion, so the reference's
meaning survives its removal. behaviour-spec.mdx is regenerated, not
hand-edited.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
eho
2026-09-04 21:23:07 +02:00
co-authored by Claude Sonnet 5
parent 3895588b9a
commit dd11eafe50
102 changed files with 361 additions and 197 deletions
@@ -1,7 +1,7 @@
import { describe, it, expect } from 'vitest';
import { stripDevParams } from './dev-params';
describe('stripDevParams (WP-37)', () => {
describe('stripDevParams', () => {
it('removes ?scenario and ?role so the stored dev value wins on reload', () => {
expect(stripDevParams('http://localhost:4200/dashboard?scenario=slow&role=admin')).toBe(
'http://localhost:4200/dashboard',
+1 -1
View File
@@ -1,5 +1,5 @@
/**
* Remove the dev-only `?scenario=` and `?role=` params from a URL (WP-37). Once the
* Remove the dev-only `?scenario=` and `?role=` params from a URL. Once the
* dev switcher (debug-state) has been used, sessionStorage is the authoritative source
* for both — `currentScenario()`/`currentRole()` read the URL FIRST, so a stale param
* left in the address bar would override the switcher on reload (the "stuck on slow"
@@ -4,7 +4,7 @@ import { ApiClient } from '@shared/infrastructure/api-client';
import { FeatureFlag } from '@shared/domain/feature-flag';
/**
* Infrastructure adapter for feature flags (WP-47): `GET /flags` (resolved set, drives FE gating)
* Infrastructure adapter for feature flags: `GET /flags` (resolved set, drives FE gating)
* and the admin `PUT /admin/flags/{key}`. The single place the ApiClient lives for flags; the
* store parses at the boundary.
*/
@@ -11,18 +11,18 @@ describe('parseMe (trust boundary)', () => {
expect(parseMe({ capabilities: [] })).toEqual({ ok: true, value: [] });
});
it('recognizes the admin org-template capability (WP-23)', () => {
it('recognizes the admin org-template capability', () => {
expect(parseMe({ capabilities: ['orgtemplate:edit'] })).toEqual({
ok: true,
value: ['orgtemplate:edit'],
});
});
// Regression: WP-66's `aanvraag:beoordelen` (behandelportal) shipped on the `Capability`
// Regression: `aanvraag:beoordelen` (behandelportal) shipped on the `Capability`
// type but was never added to this trust-boundary's runtime KNOWN list, so a real
// behandelaar's `/me` response had the capability silently dropped and the werkvoorraad
// page always denied — every `Capability` union member belongs in KNOWN too.
it('recognizes the behandelportal besluit capability (WP-66)', () => {
it('recognizes the behandelportal besluit capability', () => {
expect(parseMe({ capabilities: ['aanvraag:beoordelen'] })).toEqual({
ok: true,
value: ['aanvraag:beoordelen'],
@@ -41,7 +41,7 @@ describe('roleInterceptor', () => {
it.each([
'/api/v1/brief',
'/api/v1/admin/org-template',
'/api/v1/stamdata', // WP-29: the admin stamdata reads 403 without X-Role
'/api/v1/stamdata', // the admin stamdata reads 403 without X-Role
'/api/v1/stamdata/professions?peildatum=1999-01-01',
'/api/v1/me',
])('stamps X-Role on the role-aware endpoint %s', (url) => {
@@ -4,9 +4,9 @@ import { currentRole } from './role';
/**
* Dev-only: stamps role-aware requests with the current `?role=` as an `X-Role`
* header so the backend can enforce the drafter/approver/admin rules. Only the
* brief, org-template, stamdata and /me endpoints carry it (WP-23 widened the set —
* /me must see the role or `AccessStore` could never learn a capability; WP-29 added
* /stamdata, whose admin-only reads 403 without it); everything else is untouched.
* brief, org-template, stamdata and /me endpoints carry it (the set was widened —
* /me must see the role or `AccessStore` could never learn a capability; /stamdata was
* added later, since its admin-only reads 403 without it); everything else is untouched.
* A new admin-gated endpoint MUST be added here or its page silently 403s.
*/
const ROLE_AWARE = [
+1 -1
View File
@@ -40,7 +40,7 @@ export function currentRole(): Role {
return isRole(stored) ? stored : 'drafter';
}
/** Dev switcher entry point: persist the chosen role for the tab (WP-33). */
/** Dev switcher entry point: persist the chosen role for the tab. */
export function setRole(r: Role): void {
sessionStorage.setItem(STORAGE_KEY, r);
}
+1 -1
View File
@@ -39,7 +39,7 @@ export function currentScenario(): Scenario {
return isScenario(stored) ? stored : 'default';
}
/** Dev switcher entry point: persist the chosen scenario for the tab (WP-33). */
/** Dev switcher entry point: persist the chosen scenario for the tab. */
export function setScenario(s: Scenario): void {
sessionStorage.setItem(STORAGE_KEY, s);
}
@@ -42,7 +42,7 @@ describe('subjectInterceptor', () => {
expect(forward('/api/v1/registratie/concept').headers.get('X-Subject')).toBe('111222333');
});
it('keeps stamping later requests on the same tab after the query param is gone (WP-33-style stickiness)', () => {
it('keeps stamping later requests on the same tab after the query param is gone (sticky per tab)', () => {
window.history.replaceState({}, '', '/?subject=111222333');
forward('/api/v1/me');
window.history.replaceState({}, '', '/dashboard'); // navigation drops the query param
@@ -2,7 +2,7 @@ import { HttpInterceptorFn } from '@angular/common/http';
import { currentSubject } from './subject';
/**
* Dev-only (WP-74): stamps every API request with `X-Subject`, the BSN
* Dev-only: stamps every API request with `X-Subject`, the BSN
* `StubIdentityProvider` (backend) resolves the caller's `ZorgverlenerCaller` from —
* every owner-keyed store (`ApplicationStore`, `DocumentStore`, `BriefStore`) reads
* off that resolved identity, so this is the seam that lets e2e specs log in as
+1 -1
View File
@@ -8,7 +8,7 @@ import { isDevMode } from '@angular/core';
* comment) — so `subject.interceptor.ts` can't reach it without a layering
* violation (`libs/shared` may not depend on an app-local `auth` context). Instead a
* `?subject=<bsn>` query param, seen once on any navigation, is remembered for the
* tab in sessionStorage — the exact `?role=` trick `role.ts` already uses (WP-33).
* tab in sessionStorage — the exact `?role=` trick `role.ts` already uses.
*
* Two consumers read this, both dev/e2e-only: `subject.interceptor.ts` (every
* `HttpClient` request) and `letter-preview.adapter.ts` (`/brief/preview`'s
@@ -139,7 +139,7 @@ export class UploadAdapter {
});
xhr.open('POST', `${environment.apiBaseUrl}/api/v1/uploads`);
// WP-74: this XHR bypasses `HttpClient`'s `subjectInterceptor` (the same reason
// This XHR bypasses `HttpClient`'s `subjectInterceptor` (the same reason
// `letter-preview.adapter.ts` sets `X-Role` explicitly) — without `X-Subject` a
// document always uploaded under `DocumentStore.DemoOwner` regardless of who was
// actually logged in, so a submission attempted under any other BSN would find