Mijn aanvragen (F2): document preview/download on completed uploads
Re-opening a Concept wizard now lets the user preview/download what they already uploaded (PRD 0001 goal 2). - document-chip: optional previewUrl input → a "Voorbeeld / Download" link (opens the stored bytes; server serves inline for pdf/image, attachment otherwise). - previewUrlFor callback threaded document-upload → document-category → single-upload (which builds the URL from a completed upload's documentId). Keeps URL-building out of the presentational atoms. - registratie + herregistratie wizards supply previewUrlFor via UploadAdapter.contentUrl, returning undefined for dev-simulation `demo-*` ids (no stored bytes → no link). - Story: DocumentChip/WithPreview. Gates green: vitest 128, lint, ng build, check:tokens; backend dotnet 56. (build-storybook has a pre-existing Compodoc/$localize issue in untouched files.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,7 @@ import { UploadStatusBannerComponent } from '../upload-status-banner/upload-stat
|
||||
[uploads]="uploadsFor(c.categoryId)"
|
||||
[channel]="channelFor(c.categoryId)"
|
||||
[rejection]="state().rejections[c.categoryId]"
|
||||
[previewUrlFor]="previewUrlFor()"
|
||||
(fileSelected)="fileSelected.emit({ categoryId: c.categoryId, files: $event })"
|
||||
(removeUpload)="removeUpload.emit($event)"
|
||||
(retryUpload)="retryUpload.emit($event)"
|
||||
@@ -36,6 +37,8 @@ import { UploadStatusBannerComponent } from '../upload-status-banner/upload-stat
|
||||
})
|
||||
export class DocumentUploadComponent {
|
||||
state = input.required<UploadState>();
|
||||
/** Optional: builds a preview/download URL for a completed upload's documentId. */
|
||||
previewUrlFor = input<(documentId: string) => string | undefined>();
|
||||
|
||||
fileSelected = output<{ categoryId: string; files: File[] }>();
|
||||
removeUpload = output<string>();
|
||||
|
||||
Reference in New Issue
Block a user