refactor: add successOr, sweep remaining inline unwraps (RD-17)

Eight sites hand-rolled `rd.tag === 'Success' ? rd.value : fallback`. Six
take the new `successOr(rd, fallback)`, one takes the existing `successOf`,
and one (`big-profile.store.ts`) uses the existing `map`, since it returns a
RemoteData rather than an unwrapped value.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
eho
2026-09-04 20:33:56 +02:00
co-authored by Claude Sonnet 5
parent c36d9e3ff0
commit e221834f6e
13 changed files with 212 additions and 37 deletions
+2 -4
View File
@@ -5,6 +5,7 @@ import { AlertComponent } from '@shared/ui/alert/alert.component';
import { ButtonComponent } from '@shared/ui/button/button.component';
import { ASYNC } from '@shared/ui/async/async.component';
import { AccessStore } from '@shared/application/access.store';
import { successOr } from '@shared/application/remote-data';
import { AuditStore } from '@beheer/application/audit.store';
/**
@@ -94,10 +95,7 @@ export class AuditPage {
protected access = inject(AccessStore);
protected canRead = computed(() => this.access.can('cases:manage'));
protected entries = computed(() => {
const rd = this.store.entries();
return rd.tag === 'Success' ? rd.value : [];
});
protected entries = computed(() => successOr(this.store.entries(), []));
protected heading = $localize`:@@audit.heading:Auditlog`;
protected intro = $localize`:@@audit.intro:Toegangs- en inzagebeslissingen (autorisatie en het tonen van afgeschermde gegevens). Vastgelegd zonder persoonsgegevens.`;