feat: non-individual entity UI improvements — hide individual-only sections, fix legal form display, send extended fields to API

- Hide Family Members tab/section for non-individual entities in client view, create flow, and preview
- Hide Financial & Classification section for non-individual entities in personal data and preview
- Fix legal form column in clients list — fetch legalForm from client API for correct display
- Add person/business icon before client name in list rows
- Remove unsupportedNpd filter — send authorizedSignatory, additionalInfo, dateOfRegistration to API
- Add registration number format hint (mat-hint) based on constitution type
- Add spacing between verification row and constitution type dropdowns
- Reduce table cell padding and prevent action buttons from being clipped
- Add missing MPL-2.0 license headers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Aditya
2026-04-04 15:10:51 +05:30
co-authored by Claude Opus 4.6
parent ab01111424
commit b890d24bb7
522 changed files with 51991 additions and 21885 deletions
@@ -6,134 +6,100 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<div class="tab-container mat-typography">
<div class="layout-row align-start">
<div class="m-b-10">
<h3>{{ 'labels.heading.Identities' | translate }}</h3>
</div>
<div class="action-button m-b-10 gap-25px">
<button
mat-raised-button
color="primary"
(click)="addIdentifier()"
*mifosxHasPermission="'CREATE_CLIENTIDENTIFIER'"
>
<fa-icon icon="plus" class="m-r-10"></fa-icon>
{{ 'labels.buttons.Add' | translate }}
</button>
<div class="idt-container">
<!-- Header -->
<div class="idt-header">
<div class="idt-header__left">
<i class="fa fa-id-card idt-header__icon"></i>
<h3 class="idt-header__title">{{ 'labels.heading.Identities' | translate }}</h3>
<span class="idt-header__badge">{{ clientIdentities?.length || 0 }}</span>
</div>
<button mat-flat-button color="primary" class="idt-header__btn" (click)="addIdentifier()" *mifosxHasPermission="'CREATE_CLIENTIDENTIFIER'">
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
</div>
<table mat-table #identifiersTable [dataSource]="clientIdentities" [ngStyle]="{ 'margin-top': '3%' }">
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Id' | translate }}</th>
<td mat-cell *matCellDef="let identity">{{ identity.id }}</td>
</ng-container>
<!-- Empty State -->
@if (!clientIdentities || clientIdentities.length === 0) {
<div class="idt-empty">
<i class="fa fa-id-badge idt-empty__icon"></i>
<p class="idt-empty__text">{{ 'labels.messages.No Identities Available' | translate }}</p>
</div>
}
<ng-container matColumnDef="type">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Type' | translate }}</th>
<td mat-cell *matCellDef="let identity">{{ identity.documentType.name }}</td>
</ng-container>
<ng-container matColumnDef="documentKey">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Document Key' | translate }}</th>
<td mat-cell *matCellDef="let identity">{{ identity.documentKey }}</td>
</ng-container>
<ng-container matColumnDef="description">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Description' | translate }}</th>
<td mat-cell *matCellDef="let identity">{{ identity.description }}</td>
</ng-container>
<ng-container matColumnDef="documents">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Identity Documents' | translate }}</th>
<td mat-cell *matCellDef="let identity">
@if (identity.documents?.length) {
<div class="document-grid">
@for (document of identity.documents; track trackByDocumentId($index, document)) {
<div class="document-card">
<div
class="thumb"
[class.clickable]="isPreviewable(document)"
role="button"
tabindex="0"
[attr.aria-label]="('labels.buttons.Preview' | translate) + ': ' + document.name"
(keydown.enter)="isPreviewable(document) && openDocumentPreview(identity, document)"
(keydown.space)="isPreviewable(document) && openDocumentPreview(identity, document)"
(click)="isPreviewable(document) && openDocumentPreview(identity, document)"
>
@if (previewThumbnails[document.id]) {
<img
[src]="previewThumbnails[document.id]"
[alt]="document.name"
[title]="document.name"
loading="lazy"
/>
} @else {
<div class="placeholder">
<fa-icon icon="file"></fa-icon>
<span>{{ document.fileName || document.name }}</span>
</div>
}
@if (isPreviewable(document)) {
<div class="preview-overlay">
<fa-icon icon="eye"></fa-icon>
</div>
}
</div>
<div class="card-body">
<div class="title">{{ document.name }}</div>
@if (document.fileName) {
<div class="meta">{{ document.fileName }}</div>
}
</div>
</div>
}
</div>
} @else {
<span class="muted">{{ 'labels.text.NoDocuments' | translate }}</span>
}
</td>
</ng-container>
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Status' | translate }}</th>
<td mat-cell *matCellDef="let identity">
{{ identity.status === 'clientIdentifierStatusType.active' ? 'active' : 'inactive' }}
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let identity; let i = index">
<button
class="identity-action-button"
mat-raised-button
color="warn"
[title]="'labels.buttons.Delete' | translate"
[attr.aria-label]="'labels.buttons.Delete' | translate"
(click)="deleteIdentifier(identity.clientId, identity.id, i)"
*mifosxHasPermission="'DELETE_CLIENTIDENTIFIER'"
>
<fa-icon icon="times"></fa-icon>
</button>
</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="identitiesColumns.length">
<div class="table-empty-state">
<p>{{ 'labels.messages.No Identities Available' | translate }}</p>
<!-- Identity Cards -->
@for (identity of clientIdentities; track identity.id; let i = $index) {
<div class="idt-card">
<!-- Card Header -->
<div class="idt-card__header">
<div class="idt-card__title">
<i class="fa fa-file-text idt-card__type-icon"></i>
<span class="idt-card__type">{{ identity.documentType?.name }}</span>
<span class="idt-card__status" [class.idt-card__status--active]="identity.status === 'clientIdentifierStatusType.active'" [class.idt-card__status--inactive]="identity.status !== 'clientIdentifierStatusType.active'">
{{ identity.status === 'clientIdentifierStatusType.active' ? 'Active' : 'Inactive' }}
</span>
</div>
</td>
</ng-container>
<button mat-stroked-button color="warn" class="idt-card__delete" (click)="deleteIdentifier(identity.clientId, identity.id, i)" *mifosxHasPermission="'DELETE_CLIENTIDENTIFIER'">
<i class="fa fa-trash"></i>
</button>
</div>
<tr mat-header-row *matHeaderRowDef="identitiesColumns"></tr>
<tr mat-row *matRowDef="let row; columns: identitiesColumns"></tr>
@if (clientIdentities?.length === 0) {
<tr mat-footer-row *matFooterRowDef="['no-data']"></tr>
}
</table>
<!-- Card Body -->
<div class="idt-card__body">
<div class="idt-grid">
<div class="idt-field">
<div class="idt-field__label">{{ 'labels.inputs.Id' | translate }}</div>
<div class="idt-field__value idt-field__value--mono">{{ identity.id }}</div>
</div>
<div class="idt-field">
<div class="idt-field__label">{{ 'labels.inputs.Document Key' | translate }}</div>
<div class="idt-field__value idt-field__value--mono">{{ identity.documentKey }}</div>
</div>
@if (identity.description) {
<div class="idt-field">
<div class="idt-field__label">{{ 'labels.inputs.Description' | translate }}</div>
<div class="idt-field__value">{{ identity.description }}</div>
</div>
}
</div>
<!-- Documents -->
@if (identity.documents?.length) {
<div class="idt-docs">
<div class="idt-docs__title">
<i class="fa fa-paperclip"></i> {{ 'labels.inputs.Identity Documents' | translate }}
</div>
<div class="idt-docs__grid">
@for (document of identity.documents; track trackByDocumentId($index, document)) {
<div class="idt-doc" [class.idt-doc--clickable]="isPreviewable(document)"
(click)="isPreviewable(document) && openDocumentPreview(identity, document)"
(keydown.enter)="isPreviewable(document) && openDocumentPreview(identity, document)"
tabindex="0" role="button"
[attr.aria-label]="('labels.buttons.Preview' | translate) + ': ' + document.name">
@if (previewThumbnails[document.id]) {
<img [src]="previewThumbnails[document.id]" [alt]="document.name" class="idt-doc__thumb" loading="lazy" />
} @else {
<div class="idt-doc__placeholder">
<i class="fa fa-file-o"></i>
</div>
}
<div class="idt-doc__info">
<span class="idt-doc__name">{{ document.name }}</span>
@if (document.fileName) {
<span class="idt-doc__file">{{ document.fileName }}</span>
}
</div>
@if (isPreviewable(document)) {
<i class="fa fa-eye idt-doc__preview"></i>
}
</div>
}
</div>
</div>
}
</div>
</div>
}
</div>
<div #identityLightbox class="document-lightbox-host"></div>