refactor: split dashboard.page.ts into per-concern sections

Each dashboard section (Mijn aanvragen, Wat moet ik regelen, Mijn
registratie, Specialismen, Wat wilt u doen, Beheer) now owns its own
store access, async state, and template. DashboardPage becomes pure
composition.

Extract the repeated RemoteData Success-narrowing pattern into
successOf() and the dashboard sort/split logic into
sortForDashboard/concepten/ingediend, both with tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
eho
2026-09-04 15:17:02 +02:00
co-authored by Claude Sonnet 5
parent 42e7a1e927
commit 5977efe044
17 changed files with 725 additions and 334 deletions
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'vitest';
import { RemoteData, map2, map } from './remote-data';
import { loading, failure, success } from '../testing/remote-data';
import { RemoteData, map2, map, successOf } from './remote-data';
import { loading, failure, empty, success } from '../testing/remote-data';
const loadingRd: RemoteData<string, number> = loading();
const failureRd: RemoteData<string, number> = failure('x');
@@ -21,3 +21,15 @@ describe('RemoteData combinators', () => {
expect(map2(ok(2), ok(3), add)).toEqual({ tag: 'Success', value: 5 });
});
});
describe('successOf', () => {
it('unwraps a Success value', () => {
expect(successOf(ok(2))).toBe(2);
});
it('is undefined for every other state', () => {
expect(successOf(loadingRd)).toBeUndefined();
expect(successOf(failureRd)).toBeUndefined();
expect(successOf(empty())).toBeUndefined();
});
});