Files
cbsnexora/src/app/clients/shared/document-preview-dialog/document-preview-dialog.component.html
T
niteshandClaude Sonnet 5 79fedb66e5 fix(clients): minor-age threshold to 18, senior/PWD doc reload, in-app document preview dialog
- Raise isMinor threshold from age <10 to <18 (legal definition), cascading correctly to
  guardian requirement, KYC document filtering, and Education Level/Degree Qualification
  visibility (now shown for all ages, not hidden for minors).
- Load and display previously-uploaded Senior Citizen proof / PWD certificate documents on
  edit (view/replace/remove), instead of always showing an empty upload prompt.
- Fix seniorPwdDocsComplete to accept an existing certificate, not just a freshly-picked file.
- Add DocumentPreviewDialogComponent: a reusable in-app modal (image/PDF/download) used in
  place of window.open() for saved KYC/address/senior-citizen/PWD documents — avoids popup
  blockers (fired only after the async download resolved) and Chrome/Edge's failure to paint
  large base64 data: URLs on first open.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-28 15:49:53 +05:30

25 lines
912 B
HTML

<!--
Copyright since 2025 Mifos Initiative
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<h1 mat-dialog-title>{{ data.title || data.fileName || 'Document Preview' }}</h1>
<div mat-dialog-content class="doc-preview-content">
@if (isImage) {
<img [src]="previewUrl" [alt]="data.fileName || 'Document'" class="doc-preview-image" />
} @else if (isPdf) {
<iframe [src]="safeUrl" class="doc-preview-pdf" title="Document preview"></iframe>
} @else {
<p>Preview isn't available for this file type — use Download to view it.</p>
}
</div>
<mat-dialog-actions align="end">
<button mat-raised-button (click)="download()">Download</button>
<button mat-raised-button mat-dialog-close color="primary">Close</button>
</mat-dialog-actions>