`npm run format:check` (a CI gate) had drifted red across 44 files — pre-existing files plus recently-added ones committed without formatting. Ran `prettier --write .`; no logic changes. Also regenerates documentation.json (compodoc reflects the reformatted component sources). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/angular';
|
|
import { LibraryPassage } from '@brief/domain/brief';
|
|
import { BesluitPanelComponent } from './besluit-panel.component';
|
|
|
|
const text = (t: string): LibraryPassage['content'] => ({
|
|
paragraphs: [{ nodes: [{ type: 'text', text: t }] }],
|
|
});
|
|
|
|
const passages: LibraryPassage[] = [
|
|
{
|
|
passageId: 'p-kern-positief',
|
|
scope: 'global',
|
|
sectionKey: 'kern',
|
|
label: 'Toewijzing',
|
|
version: 1,
|
|
besluit: 'positief',
|
|
content: text('Toegewezen.'),
|
|
},
|
|
{
|
|
passageId: 'p-kern-negatief',
|
|
scope: 'global',
|
|
sectionKey: 'kern',
|
|
label: 'Afwijzing',
|
|
version: 1,
|
|
besluit: 'negatief',
|
|
content: text('Afgewezen.'),
|
|
},
|
|
{
|
|
passageId: 'p-kern-scholing',
|
|
scope: 'global',
|
|
sectionKey: 'kern',
|
|
label: 'Onvoldoende scholing',
|
|
version: 1,
|
|
besluit: 'negatief',
|
|
reason: 'onvoldoende_scholing',
|
|
content: text('Onvoldoende scholing.'),
|
|
},
|
|
{
|
|
passageId: 'p-kern-gegevens',
|
|
scope: 'global',
|
|
sectionKey: 'kern',
|
|
label: 'Onjuiste gegevens',
|
|
version: 1,
|
|
besluit: 'negatief',
|
|
reason: 'onjuiste_gegevens',
|
|
content: text('Onjuiste gegevens.'),
|
|
},
|
|
];
|
|
|
|
const meta: Meta<BesluitPanelComponent> = {
|
|
title: 'Domein/Brief/Besluit Panel',
|
|
component: BesluitPanelComponent,
|
|
args: { passages },
|
|
};
|
|
export default meta;
|
|
type Story = StoryObj<BesluitPanelComponent>;
|
|
|
|
/** Pick a besluit; a negatief besluit reveals the reason checkboxes. Each change emits
|
|
`selectionChange` and the kern's standaardteksten follow live — no generate button. */
|
|
export const Default: Story = {};
|
|
|
|
/** Re-seeded from a persisted letter: a negatief besluit with a reden already ticked. */
|
|
export const NegatiefMetReden: Story = {
|
|
args: { besluit: 'negatief', initialRedenen: ['onvoldoende_scholing'] },
|
|
};
|