Frontend counterpart to the backend dual-OTP contact-change feature:
- New ContactOtpBlockComponent (6-box segmented OTP input) used up to 4x in
Edit Client (old/new mobile, old/new email — grouped under per-field
sub-headers) and once each for mobile/email in Create Client, gating
Save/Save & Next until every required box is verified.
- edit-client.component.ts: detects mobile/email/DOB changes against the
loaded snapshot using local-date comparison (not `.toISOString()`, which
false-triggers a day-shift in positive-UTC-offset timezones) and
trimmed/case-insensitive email comparison (autofill whitespace or re-typed
casing no longer reads as a change the masked preview can't explain).
- client-kyc-step.component.ts: new `invalidFieldLabels` getter names every
currently-invalid required KYC field, surfaced via the Save & Next tooltip
in both create-client and edit-client so a greyed-out button always
explains what's still missing instead of a generic message.
- CaptureImageDialogComponent generalized for both profile photo and
signature (photograph-a-paper-signature) capture:
- Frame aspect now matches the requested getUserMedia resolution
(4:3 profile / 16:9 signature) with object-fit: cover, eliminating the
pillarboxing (black bars) a mismatched box previously caused.
- Suppresses Chromium's auto-injected PiP/cast corner overlay icons.
- Frame height capped in vh (not just px) so the dialog fits short
viewports instead of pushing Cancel/Upload below the fold.
- upload-document-dialog.component.ts: generic Documents-tab upload now also
offers "Capture from Webcam" alongside Browse, reusing the same capture
dialog.
- New client History tab (reuses the existing Audit Trail data, scoped to
this client) and dataUrlToFile/dataUrlToBlob util for routing webcam
captures through the same upload pipelines as a picked file.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
54 lines
2.0 KiB
HTML
54 lines
2.0 KiB
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/.
|
|
-->
|
|
|
|
<div class="layout-column gap-2px capture-dialog">
|
|
<h1 mat-dialog-title align="center" class="capture-title">
|
|
<fa-icon [icon]="isSignatureCapture ? 'signature' : 'camera'"></fa-icon>
|
|
<span>{{ dialogTitle }}</span>
|
|
</h1>
|
|
<p class="capture-instructions" align="center">{{ dialogInstructions }}</p>
|
|
|
|
<div class="capture-frame" [class.capture-frame--signature]="isSignatureCapture">
|
|
<video
|
|
#video
|
|
class="capture-video"
|
|
autoplay
|
|
playsinline
|
|
disablepictureinpicture
|
|
disableremoteplayback
|
|
controlslist="nodownload noremoteplayback nofullscreen"
|
|
></video>
|
|
</div>
|
|
|
|
<!-- Using a class will break renderer changes -->
|
|
<canvas #canvas [ngStyle]="{ display: 'none' }"></canvas>
|
|
|
|
<!-- Using a class will break renderer changes -->
|
|
<p #fallback [ngStyle]="{ display: 'none' }" align="center"></p>
|
|
|
|
<div class="capture-actions-row">
|
|
@if (!isCaptured) {
|
|
<button #captureButton mat-stroked-button color="primary" class="capture-btn" (click)="capture()">
|
|
<fa-icon icon="camera" size="sm" class="m-r-10"></fa-icon>{{ 'labels.buttons.Capture' | translate }}
|
|
</button>
|
|
}
|
|
@if (isCaptured) {
|
|
<button mat-stroked-button color="primary" class="capture-btn" (click)="recapture()">
|
|
<fa-icon icon="undo" size="sm" class="m-r-10"></fa-icon>{{ 'labels.buttons.Recapture' | translate }}
|
|
</button>
|
|
}
|
|
</div>
|
|
|
|
<mat-dialog-actions align="end" class="capture-dialog-footer">
|
|
<button mat-raised-button mat-dialog-close>{{ 'labels.buttons.Cancel' | translate }}</button>
|
|
<button [disabled]="!isCaptured" mat-raised-button color="primary" [mat-dialog-close]="clientImageDataURL">
|
|
{{ 'labels.buttons.Upload' | translate }}
|
|
</button>
|
|
</mat-dialog-actions>
|
|
</div>
|