feat: redesign all dialogs, file upload, address/nominee/identifier tabs

- File upload: compact dashed zone (54px height), inline icon+filename+change
- Dialogs: no scroll, rounded close button (red on hover), 700px width
- Identifier dialog: 2-column grid, section divider, outline fields
- Nominee: new NomineeDialogComponent popup (replaces page navigation)
- Address tab: card panels, status badges, 3-column grid
- Nominee tab: accordion with badges, 3-column grid
- Shared form dialog: outline fields, fixed close button

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Aditya
2026-03-21 00:09:59 +05:30
co-authored by Claude Opus 4.6
parent b7f612c2f6
commit 97f30ac3c1
17 changed files with 1589 additions and 281 deletions
@@ -6,74 +6,111 @@
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.Address' | translate }}</h3>
</div>
<div class="action-button m-b-10 gap-25px">
<button mat-raised-button color="primary" (click)="addAddress()">
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
<div class="addr-container mat-typography">
<!-- Header -->
<div class="addr-header">
<div class="addr-header__left">
<i class="fa fa-map-marker addr-header__icon"></i>
<h3 class="addr-header__title">{{ 'labels.heading.Address' | translate }}</h3>
<span class="addr-header__badge">{{ clientAddressData?.length || 0 }}</span>
</div>
<button mat-flat-button color="primary" class="addr-header__btn" (click)="addAddress()">
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
</div>
<mat-accordion>
<!-- Address Cards -->
@if (!clientAddressData || clientAddressData.length === 0) {
<div class="addr-empty">
<i class="fa fa-map-o addr-empty__icon"></i>
<p class="addr-empty__text">No addresses added yet</p>
</div>
}
<mat-accordion multi>
@for (address of clientAddressData; track address.addressId; let i = $index) {
<mat-expansion-panel class="address">
<mat-expansion-panel-header>
<mat-panel-title>
{{ address.addressType }}
<mat-expansion-panel class="addr-panel">
<mat-expansion-panel-header class="addr-panel__header">
<mat-panel-title class="addr-panel__title">
<i class="fa fa-home addr-panel__type-icon"></i>
<span class="addr-panel__type">{{ address.addressType }}</span>
<span class="addr-panel__status" [class.addr-panel__status--active]="address.isActive" [class.addr-panel__status--inactive]="!address.isActive">
{{ address.isActive ? 'Active' : 'Inactive' }}
</span>
</mat-panel-title>
<mat-panel-description>
{{ address.relationship }}
<mat-panel-description class="addr-panel__desc">
{{ address.city || address.townVillage || '' }}{{ address.city || address.townVillage ? ', ' : '' }}{{ getSelectedValue('stateProvinceIdOptions', address.stateProvinceId)?.name || '' }}
</mat-panel-description>
</mat-expansion-panel-header>
<mat-divider [inset]="true"></mat-divider>
<div class="address-actions layout-row align-end align-items-center">
<button mat-button color="primary" (click)="editAddress(address, i)">
<fa-icon icon="edit"></fa-icon>
<!-- Actions Bar -->
<div class="addr-actions">
<button mat-stroked-button color="primary" class="addr-actions__edit" (click)="editAddress(address, i)">
<fa-icon icon="edit" class="m-r-10"></fa-icon>{{ 'labels.buttons.Edit' | translate }}
</button>
<mat-slide-toggle [checked]="address.isActive" (change)="toggleAddress(address)"></mat-slide-toggle>
<div class="addr-actions__toggle">
<span class="addr-actions__toggle-label">{{ 'labels.inputs.Active Status' | translate }}</span>
<mat-slide-toggle [checked]="address.isActive" (change)="toggleAddress(address)"></mat-slide-toggle>
</div>
</div>
<p>
@if (isFieldEnabled('street')) {
<span>{{ 'labels.inputs.Street' | translate }} : {{ address.street }}<br /></span>
<!-- Address Details Grid -->
<div class="addr-grid">
@if (isFieldEnabled('street') && address.street) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Street' | translate }}</div>
<div class="addr-field__value">{{ address.street }}</div>
</div>
}
@if (isFieldEnabled('addressLine1')) {
<span>{{ 'labels.inputs.Address Line' | translate }} 1 : {{ address.addressLine1 }}<br /></span>
@if (isFieldEnabled('addressLine1') && address.addressLine1) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Address Line' | translate }} 1</div>
<div class="addr-field__value">{{ address.addressLine1 }}</div>
</div>
}
@if (isFieldEnabled('addressLine2')) {
<span>{{ 'labels.inputs.Address Line' | translate }} 2 : {{ address.addressLine2 }}<br /></span>
@if (isFieldEnabled('addressLine2') && address.addressLine2) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Address Line' | translate }} 2</div>
<div class="addr-field__value">{{ address.addressLine2 }}</div>
</div>
}
@if (isFieldEnabled('addressLine3')) {
<span>{{ 'labels.inputs.Address Line' | translate }} 3 : {{ address.addressLine3 }}<br /></span>
@if (isFieldEnabled('addressLine3') && address.addressLine3) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Address Line' | translate }} 3</div>
<div class="addr-field__value">{{ address.addressLine3 }}</div>
</div>
}
@if (isFieldEnabled('townVillage')) {
<span>{{ 'labels.inputs.Town / Village' | translate }} : {{ address.townVillage }}<br /></span>
@if (isFieldEnabled('townVillage') && address.townVillage) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Town / Village' | translate }}</div>
<div class="addr-field__value">{{ address.townVillage }}</div>
</div>
}
@if (isFieldEnabled('city')) {
<span>{{ 'labels.inputs.City' | translate }} : {{ address.city }}<br /></span>
@if (isFieldEnabled('city') && address.city) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.City' | translate }}</div>
<div class="addr-field__value">{{ address.city }}</div>
</div>
}
@if (isFieldEnabled('stateProvinceId')) {
<span
>{{ 'labels.inputs.State / Province' | translate }} :
{{ getSelectedValue('stateProvinceIdOptions', address.stateProvinceId)?.name }}<br
/></span>
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.State / Province' | translate }}</div>
<div class="addr-field__value">{{ getSelectedValue('stateProvinceIdOptions', address.stateProvinceId)?.name || '-' }}</div>
</div>
}
@if (isFieldEnabled('countryId')) {
<span
>{{ 'labels.inputs.Country' | translate }} :
{{ getSelectedValue('countryIdOptions', address.countryId)?.name }}<br
/></span>
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Country' | translate }}</div>
<div class="addr-field__value">{{ getSelectedValue('countryIdOptions', address.countryId)?.name || '-' }}</div>
</div>
}
@if (isFieldEnabled('postalCode')) {
<span>{{ 'labels.inputs.Postal Code' | translate }} : {{ address.postalCode }}<br /></span>
@if (isFieldEnabled('postalCode') && address.postalCode) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Postal Code' | translate }}</div>
<div class="addr-field__value addr-field__value--mono">{{ address.postalCode }}</div>
</div>
}
@if (isFieldEnabled('isActive')) {
<span>{{ 'labels.inputs.Active Status' | translate }} : {{ address.isActive }}<br /></span>
}
</p>
</div>
</mat-expansion-panel>
}
</mat-accordion>
@@ -6,30 +6,236 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
.tab-container {
padding: 1%;
margin: 1%;
$primary: #1a73e8;
$primary-light: #e8f0fe;
$gray-50: #f8f9fa;
$gray-100: #f1f3f4;
$gray-200: #e8eaed;
$gray-500: #9aa0a6;
$gray-700: #5f6368;
$gray-900: #202124;
$white: #fff;
$green: #34a853;
$green-light: #e6f4ea;
$red: #ea4335;
$red-light: #fce8e6;
.action-button {
margin-left: auto;
.addr-container {
padding: 20px 24px;
}
// Header
.addr-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
&__left {
display: flex;
align-items: center;
gap: 10px;
}
.address {
.address-actions {
margin-top: 1%;
&__icon {
font-size: 18px;
color: $primary;
}
button {
margin-right: 1%;
}
&__title {
margin: 0;
font-size: 16px;
font-weight: 600;
color: $gray-900;
}
&__badge {
background: $primary-light;
color: $primary;
font-size: 11px;
font-weight: 700;
padding: 2px 8px;
border-radius: 10px;
}
&__btn {
border-radius: 8px !important;
font-size: 13px !important;
font-weight: 600 !important;
height: 36px !important;
}
}
// Empty state
.addr-empty {
text-align: center;
padding: 48px 20px;
background: $gray-50;
border-radius: 10px;
border: 1px dashed $gray-200;
&__icon {
font-size: 36px;
color: $gray-500;
margin-bottom: 10px;
}
&__text {
color: $gray-500;
font-size: 14px;
margin: 0;
}
}
// Expansion panels
.addr-panel {
margin-bottom: 12px !important;
border-radius: 10px !important;
border: 1px solid $gray-200 !important;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
&::ng-deep .mat-expansion-panel-body {
padding: 0 20px 20px !important;
}
&__header {
height: auto !important;
min-height: 56px !important;
padding: 8px 20px !important;
}
&__title {
display: flex !important;
align-items: center;
gap: 10px;
flex: 1;
}
&__type-icon {
font-size: 16px;
color: $primary;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
background: $primary-light;
border-radius: 6px;
}
&__type {
font-size: 14px;
font-weight: 600;
color: $gray-900;
text-transform: uppercase;
letter-spacing: 0.3px;
}
&__status {
font-size: 11px;
font-weight: 600;
padding: 2px 10px;
border-radius: 10px;
&--active {
background: $green-light;
color: $green;
}
h3 {
margin: 1% auto;
&--inactive {
background: $red-light;
color: $red;
}
}
p {
line-height: 30px;
margin-left: 2%;
&__desc {
font-size: 12px;
color: $gray-500 !important;
flex: 0 !important;
white-space: nowrap;
}
}
// Actions bar inside panel
.addr-actions {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 0;
margin-bottom: 12px;
border-bottom: 1px solid $gray-100;
&__edit {
border-radius: 6px !important;
font-size: 12px !important;
font-weight: 600 !important;
height: 32px !important;
}
&__toggle {
display: flex;
align-items: center;
gap: 8px;
}
&__toggle-label {
font-size: 12px;
color: $gray-500;
font-weight: 500;
}
}
// Address details grid
.addr-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0;
border: 1px solid $gray-100;
border-radius: 8px;
overflow: hidden;
@media (max-width: 768px) {
grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 480px) {
grid-template-columns: 1fr;
}
}
.addr-field {
padding: 10px 14px;
border-bottom: 1px solid $gray-100;
border-right: 1px solid $gray-100;
transition: background 0.15s ease;
&:hover {
background: $gray-50;
}
&:nth-child(3n) {
border-right: none;
}
&__label {
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: $gray-500;
margin-bottom: 3px;
}
&__value {
font-size: 13.5px;
font-weight: 500;
color: $gray-900;
word-break: break-word;
&--mono {
font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
font-size: 13px;
letter-spacing: 0.5px;
}
}
}
@@ -94,7 +94,8 @@ export class AddressTabComponent {
this.translateService.instant('labels.catalogs.Client') +
' ' +
this.translateService.instant('labels.heading.Address'),
formfields: this.getAddressFormFields('add')
formfields: this.getAddressFormFields('add'),
layout: { columns: 2, columnWidth: 350 }
};
const addAddressDialogRef = this.dialog.open(FormDialogComponent, { data });
addAddressDialogRef.afterClosed().subscribe((response: any) => {
@@ -126,7 +127,7 @@ export class AddressTabComponent {
' ' +
this.translateService.instant('labels.heading.Address'),
formfields: this.getAddressFormFields('edit', address),
layout: { addButtonText: 'Edit' }
layout: { columns: 2, columnWidth: 350, addButtonText: 'Edit' }
};
const editAddressDialogRef = this.dialog.open(FormDialogComponent, { data });
editAddressDialogRef.afterClosed().subscribe((response: any) => {
@@ -6,99 +6,146 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<h1 mat-dialog-title>
@if (documentIdentifier) {
{{ 'labels.heading.Add Client Identifier' | translate }}
} @else {
{{ 'labels.heading.Upload' | translate }} {{ entityType }} {{ 'labels.heading.Documents' | translate }}
}
</h1>
<div class="m-l-10 m-r-10">
<form [formGroup]="uploadDocumentForm" class="layout-column">
<!-- Identity-specific fields -->
@if (documentIdentifier) {
<mat-form-field class="flex-fill">
<mat-label>{{ 'labels.inputs.Document Type' | translate }}</mat-label>
<mat-select formControlName="documentTypeId" required>
@for (docType of allowedDocumentTypes; track docType) {
<mat-option [value]="docType.id">
{{ docType.name }}
</mat-option>
}
</mat-select>
@if (uploadDocumentForm.controls.documentTypeId?.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Document Type' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field class="flex-fill">
<mat-label>{{ 'labels.inputs.Status' | translate }}</mat-label>
<mat-select formControlName="status" required>
@for (status of statusOptions; track status) {
<mat-option [value]="status.value">
{{ status.label }}
</mat-option>
}
</mat-select>
@if (uploadDocumentForm.controls.status?.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Status' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field class="flex-fill">
<mat-label>{{ 'labels.inputs.Document Key' | translate }}</mat-label>
<input formControlName="documentKey" required matInput />
@if (uploadDocumentForm.controls.documentKey?.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Document Key' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field class="flex-fill">
<mat-label>{{ 'labels.inputs.Description' | translate }}</mat-label>
<input formControlName="description" matInput />
</mat-form-field>
}
<mat-form-field class="flex-fill">
<mat-label>{{ 'labels.inputs.File Name' | translate }}</mat-label>
<input formControlName="fileName" required matInput />
@if (uploadDocumentForm.controls.fileName.hasError('required')) {
<mat-error>
{{ 'labels.inputs.File Name' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
<div class="fd-dialog">
<div class="fd-header">
<h1 mat-dialog-title class="fd-title">
@if (documentIdentifier) {
<i class="fa fa-id-card fd-title__icon"></i>
{{ 'labels.heading.Add Client Identifier' | translate }}
} @else {
<i class="fa fa-upload fd-title__icon"></i>
{{ 'labels.heading.Upload' | translate }} {{ entityType }} {{ 'labels.heading.Documents' | translate }}
}
</mat-form-field>
</h1>
<button mat-icon-button mat-dialog-close class="fd-close" aria-label="Close">
<i class="fa fa-times"></i>
</button>
</div>
@if (!documentIdentifier) {
<mat-form-field class="flex-fill">
<mat-label>{{ 'labels.inputs.Description' | translate }}</mat-label>
<input formControlName="description" matInput />
</mat-form-field>
}
<div class="fd-content">
<form [formGroup]="uploadDocumentForm" class="fd-form">
@if (documentIdentifier) {
<!-- Identifier fields in 2-column grid -->
<div class="fd-grid fd-grid--cols-2">
<div class="fd-field">
<mat-form-field class="flex-fill" appearance="outline">
<mat-label>{{ 'labels.inputs.Document Type' | translate }}</mat-label>
<mat-select formControlName="documentTypeId" required>
@for (docType of allowedDocumentTypes; track docType) {
<mat-option [value]="docType.id">
{{ docType.name }}
</mat-option>
}
</mat-select>
@if (uploadDocumentForm.controls.documentTypeId?.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Document Type' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
</div>
<div class="fd-field">
<mat-form-field class="flex-fill" appearance="outline">
<mat-label>{{ 'labels.inputs.Status' | translate }}</mat-label>
<mat-select formControlName="status" required>
@for (status of statusOptions; track status) {
<mat-option [value]="status.value">
{{ status.label }}
</mat-option>
}
</mat-select>
</mat-form-field>
</div>
<div class="fd-field">
<mat-form-field class="flex-fill" appearance="outline">
<mat-label>{{ 'labels.inputs.Document Key' | translate }}</mat-label>
<input formControlName="documentKey" required matInput />
@if (uploadDocumentForm.controls.documentKey?.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Document Key' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
</div>
<div class="fd-field">
<mat-form-field class="flex-fill" appearance="outline">
<mat-label>{{ 'labels.inputs.Description' | translate }}</mat-label>
<input formControlName="description" matInput />
</mat-form-field>
</div>
</div>
<mifosx-file-upload flex="60%" (change)="onFileSelect($event)"></mifosx-file-upload>
<!-- File section -->
<div class="fd-section-divider">
<span class="fd-section-divider__text">
<i class="fa fa-paperclip"></i> {{ 'labels.heading.Documents' | translate }}
</span>
</div>
<div class="fd-grid fd-grid--cols-2">
<div class="fd-field">
<mat-form-field class="flex-fill" appearance="outline">
<mat-label>{{ 'labels.inputs.File Name' | translate }}</mat-label>
<input formControlName="fileName" required matInput />
@if (uploadDocumentForm.controls.fileName.hasError('required')) {
<mat-error>
{{ 'labels.inputs.File Name' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
</div>
<div class="fd-field fd-field--file">
<mifosx-file-upload flex="100%" (change)="onFileSelect($event)"></mifosx-file-upload>
</div>
</div>
} @else {
<!-- Standard upload form -->
<div class="fd-grid fd-grid--cols-2">
<div class="fd-field">
<mat-form-field class="flex-fill" appearance="outline">
<mat-label>{{ 'labels.inputs.File Name' | translate }}</mat-label>
<input formControlName="fileName" required matInput />
@if (uploadDocumentForm.controls.fileName.hasError('required')) {
<mat-error>
{{ 'labels.inputs.File Name' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
</div>
<div class="fd-field">
<mat-form-field class="flex-fill" appearance="outline">
<mat-label>{{ 'labels.inputs.Description' | translate }}</mat-label>
<input formControlName="description" matInput />
</mat-form-field>
</div>
</div>
<div class="fd-field fd-field--file">
<mifosx-file-upload flex="100%" (change)="onFileSelect($event)"></mifosx-file-upload>
</div>
}
</form>
</div>
<mat-dialog-actions align="end">
<button mat-raised-button mat-dialog-close>{{ 'labels.buttons.Cancel' | translate }}</button>
<button
mat-raised-button
color="primary"
[disabled]="!uploadDocumentForm.valid"
[mat-dialog-close]="uploadDocumentForm.value"
>
@if (documentIdentifier) {
{{ 'labels.buttons.Add' | translate }}
} @else {
{{ 'labels.buttons.Upload' | translate }}
}
</button>
</mat-dialog-actions>
</form>
<mat-dialog-actions class="fd-actions" align="end">
<button mat-stroked-button mat-dialog-close class="fd-btn fd-btn--cancel">
{{ 'labels.buttons.Cancel' | translate }}
</button>
<button
mat-flat-button
color="primary"
[disabled]="!uploadDocumentForm.valid"
[mat-dialog-close]="uploadDocumentForm.value"
class="fd-btn fd-btn--submit"
>
<i class="fa fa-check fd-btn__icon"></i>
@if (documentIdentifier) {
{{ 'labels.buttons.Add' | translate }}
} @else {
{{ 'labels.buttons.Upload' | translate }}
}
</button>
</mat-dialog-actions>
</div>
@@ -5,3 +5,179 @@
* 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/.
*/
$primary: #1a73e8;
$gray-50: #f8f9fa;
$gray-100: #f1f3f4;
$gray-200: #e8eaed;
$gray-500: #9aa0a6;
$gray-700: #5f6368;
$gray-900: #202124;
$white: #fff;
.fd-dialog {
display: flex;
flex-direction: column;
min-width: 0;
}
.fd-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 24px 12px;
border-bottom: 1px solid $gray-200;
}
.fd-title {
margin: 0 !important;
padding: 0 !important;
font-size: 17px !important;
font-weight: 600 !important;
color: $gray-900;
display: flex;
align-items: center;
gap: 10px;
&__icon {
font-size: 18px;
color: $primary;
}
}
.fd-close {
width: 36px !important;
height: 36px !important;
min-width: 36px !important;
padding: 0 !important;
display: flex !important;
align-items: center;
justify-content: center;
color: $gray-500;
border: 1px solid $gray-200;
border-radius: 8px !important;
background: $white;
cursor: pointer;
transition: all 0.15s ease;
flex-shrink: 0;
&:hover {
color: $white;
background: #ea4335;
border-color: #ea4335;
}
i {
font-size: 13px;
line-height: 1;
}
}
.fd-content {
padding: 20px 24px !important;
overflow: visible !important;
max-height: none !important;
}
.fd-form {
display: flex;
flex-direction: column;
gap: 4px;
}
.fd-grid {
display: flex;
flex-direction: column;
gap: 4px;
&--cols-2 {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 4px 16px;
}
}
.fd-field {
min-width: 0;
::ng-deep {
.mat-mdc-form-field {
width: 100%;
}
.mat-mdc-text-field-wrapper {
background: $gray-50;
border-radius: 8px;
}
}
&--file {
display: flex;
align-items: center;
padding-top: 4px;
::ng-deep mifosx-file-upload {
width: 100%;
}
}
}
.fd-section-divider {
margin: 8px 0 12px;
border-bottom: 1px solid $gray-200;
padding-bottom: 8px;
&__text {
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: $gray-500;
i {
margin-right: 6px;
color: $primary;
}
}
}
.fd-actions {
padding: 12px 24px 16px !important;
border-top: 1px solid $gray-200;
gap: 10px;
margin: 0 !important;
}
.fd-btn {
min-width: 100px;
border-radius: 8px !important;
font-size: 13px !important;
font-weight: 600 !important;
letter-spacing: 0.2px;
padding: 0 20px !important;
height: 38px !important;
&--cancel {
color: $gray-700 !important;
border-color: $gray-200 !important;
&:hover {
background: $gray-50 !important;
}
}
&--submit {
box-shadow: 0 1px 3px rgba($primary, 0.3) !important;
}
&__icon {
margin-right: 6px;
font-size: 12px;
}
}
@media (max-width: 600px) {
.fd-grid--cols-2 {
grid-template-columns: 1fr;
}
}
@@ -16,6 +16,7 @@ import {
} from '@angular/material/dialog';
import { UntypedFormGroup, UntypedFormBuilder, Validators, FormControl, ReactiveFormsModule } from '@angular/forms';
import { FileUploadComponent } from '../../../../shared/file-upload/file-upload.component';
import { MatIconButton } from '@angular/material/button';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
@Component({
@@ -27,7 +28,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
MatDialogTitle,
FileUploadComponent,
MatDialogActions,
MatDialogClose
MatDialogClose,
MatIconButton
]
})
export class UploadDocumentDialogComponent implements OnInit {
@@ -6,83 +6,124 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<div class="tab-container mat-typography">
<router-outlet>
<div class="layout-row align-start">
<div class="m-b-10">
<h3>{{ 'labels.heading.Family Members' | translate }}</h3>
</div>
<div class="action-button m-b-10 gap-25px">
<button mat-raised-button color="primary" [routerLink]="['./add']">
<fa-icon icon="plus" class="m-r-10" aria-hidden="true"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
</div>
<div class="nom-container mat-typography">
<!-- Header -->
<div class="nom-header">
<div class="nom-header__left">
<i class="fa fa-users nom-header__icon"></i>
<h3 class="nom-header__title">{{ 'labels.heading.Family Members' | translate }}</h3>
<span class="nom-header__badge">{{ clientFamilyMembers?.length || 0 }}</span>
</div>
<button mat-flat-button color="primary" class="nom-header__btn" (click)="addNominee()">
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
</div>
<mat-accordion>
@for (member of clientFamilyMembers; track member.id; let i = $index) {
<mat-expansion-panel class="family-member">
<mat-expansion-panel-header>
<mat-panel-title>
{{ displayName(member) }}
</mat-panel-title>
<mat-panel-description>
{{ member.relationship }}
</mat-panel-description>
</mat-expansion-panel-header>
<mat-divider [inset]="true"></mat-divider>
<div class="family-member-actions layout-row align-end">
<button
mat-raised-button
color="primary"
[routerLink]="[member.id, 'edit']"
[title]="'labels.buttons.Edit' | translate"
>
<fa-icon icon="edit" class="m-r-10" aria-hidden="true"></fa-icon>{{ 'labels.buttons.Edit' | translate }}
<!-- Empty State -->
@if (!clientFamilyMembers || clientFamilyMembers.length === 0) {
<div class="nom-empty">
<i class="fa fa-user-o nom-empty__icon"></i>
<p class="nom-empty__text">{{ 'labels.text.No nominees added yet' | translate }}</p>
</div>
}
<!-- Nominee Cards -->
<mat-accordion multi>
@for (member of clientFamilyMembers; track member.id; let i = $index) {
<mat-expansion-panel class="nom-panel">
<mat-expansion-panel-header class="nom-panel__header">
<mat-panel-title class="nom-panel__title">
<i class="fa fa-user nom-panel__type-icon"></i>
<span class="nom-panel__name">{{ displayName(member) }}</span>
@if (member.relationship) {
<span class="nom-panel__badge nom-panel__badge--relation">{{ member.relationship }}</span>
}
@if (member.nominationType) {
<span class="nom-panel__badge nom-panel__badge--type">{{ member.nominationType }}</span>
}
</mat-panel-title>
<mat-panel-description class="nom-panel__desc">
@if (member.percentageShare != null) {
{{ member.percentageShare }}%
}
</mat-panel-description>
</mat-expansion-panel-header>
<!-- Actions Bar -->
<div class="nom-actions">
<div class="nom-actions__buttons">
<button mat-stroked-button color="primary" class="nom-actions__edit" (click)="editNominee(member, i)">
<fa-icon icon="edit" class="m-r-10"></fa-icon>{{ 'labels.buttons.Edit' | translate }}
</button>
<button
mat-raised-button
mat-stroked-button
color="warn"
class="nom-actions__delete"
(click)="deleteFamilyMember(member.clientId, member.id, member.firstName, i)"
[title]="'labels.buttons.Delete' | translate"
>
<fa-icon icon="trash" class="m-r-10" aria-hidden="true"></fa-icon
>{{ 'labels.buttons.Delete' | translate }}
<fa-icon icon="trash" class="m-r-10"></fa-icon>{{ 'labels.buttons.Delete' | translate }}
</button>
</div>
<p>
@if (member.nominationType) {
<span>{{ 'labels.inputs.Nomination Type' | translate }} : {{ member.nominationType }}<br /></span>
}
@if (member.firstName) {
<span>{{ 'labels.inputs.Nominee Name' | translate }} : {{ member.firstName }}<br /></span>
}
@if (member.relationship) {
<span>{{ 'labels.inputs.Relationship' | translate }} : {{ member.relationship }}<br /></span>
}
@if (member.dateOfBirth) {
<span>{{ 'labels.inputs.Date Of Birth' | translate }} : {{ member.dateOfBirth | dateFormat }}<br /></span>
}
@if (member.percentageShare != null) {
<span>{{ 'labels.inputs.Percentage Share' | translate }} : {{ member.percentageShare }}%<br /></span>
}
@if (member.isDependent) {
<span>{{ 'labels.inputs.Nominee is Minor' | translate }} : {{ member.isDependent | yesNo }}<br /></span>
}
@if (member.guardianName) {
<span>{{ 'labels.inputs.Guardian Name' | translate }} : {{ member.guardianName }}<br /></span>
}
@if (member.guardianRelationship) {
<span
>{{ 'labels.inputs.Relationship with Minor' | translate }} : {{ member.guardianRelationship }}<br
/></span>
}
@if (member.remarks) {
<span>{{ 'labels.inputs.Remarks' | translate }} : {{ member.remarks }}<br /></span>
}
</p>
</mat-expansion-panel>
}
</mat-accordion>
</router-outlet>
</div>
<!-- Details Grid -->
<div class="nom-grid">
@if (member.nominationType) {
<div class="nom-field">
<div class="nom-field__label">{{ 'labels.inputs.Nomination Type' | translate }}</div>
<div class="nom-field__value">{{ member.nominationType }}</div>
</div>
}
@if (member.firstName) {
<div class="nom-field">
<div class="nom-field__label">{{ 'labels.inputs.Nominee Name' | translate }}</div>
<div class="nom-field__value">{{ member.firstName }}</div>
</div>
}
@if (member.relationship) {
<div class="nom-field">
<div class="nom-field__label">{{ 'labels.inputs.Relationship' | translate }}</div>
<div class="nom-field__value">{{ member.relationship }}</div>
</div>
}
@if (member.dateOfBirth) {
<div class="nom-field">
<div class="nom-field__label">{{ 'labels.inputs.Date Of Birth' | translate }}</div>
<div class="nom-field__value">{{ member.dateOfBirth | dateFormat }}</div>
</div>
}
@if (member.percentageShare != null) {
<div class="nom-field">
<div class="nom-field__label">{{ 'labels.inputs.Percentage Share' | translate }}</div>
<div class="nom-field__value nom-field__value--mono">{{ member.percentageShare }}%</div>
</div>
}
@if (member.isDependent != null) {
<div class="nom-field">
<div class="nom-field__label">{{ 'labels.inputs.Nominee is Minor' | translate }}</div>
<div class="nom-field__value">{{ member.isDependent | yesNo }}</div>
</div>
}
@if (member.guardianName) {
<div class="nom-field">
<div class="nom-field__label">{{ 'labels.inputs.Guardian Name' | translate }}</div>
<div class="nom-field__value">{{ member.guardianName }}</div>
</div>
}
@if (member.guardianRelationship) {
<div class="nom-field">
<div class="nom-field__label">{{ 'labels.inputs.Relationship with Minor' | translate }}</div>
<div class="nom-field__value">{{ member.guardianRelationship }}</div>
</div>
}
@if (member.remarks) {
<div class="nom-field">
<div class="nom-field__label">{{ 'labels.inputs.Remarks' | translate }}</div>
<div class="nom-field__value">{{ member.remarks }}</div>
</div>
}
</div>
</mat-expansion-panel>
}
</mat-accordion>
</div>
@@ -6,30 +6,232 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
.tab-container {
padding: 1%;
margin: 1%;
$primary: #1a73e8;
$primary-light: #e8f0fe;
$gray-50: #f8f9fa;
$gray-100: #f1f3f4;
$gray-200: #e8eaed;
$gray-500: #9aa0a6;
$gray-700: #5f6368;
$gray-900: #202124;
$white: #fff;
$green: #34a853;
$green-light: #e6f4ea;
$red: #ea4335;
$red-light: #fce8e6;
$blue-light: #e3f2fd;
$blue: #1565c0;
$orange: #e65100;
$orange-light: #fff3e0;
.action-button {
margin-left: auto;
.nom-container {
padding: 20px 24px;
}
// Header
.nom-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
&__left {
display: flex;
align-items: center;
gap: 10px;
}
.family-member {
.family-member-actions {
margin-top: 1%;
&__icon {
font-size: 18px;
color: $primary;
}
button {
margin-right: 1%;
}
&__title {
margin: 0;
font-size: 16px;
font-weight: 600;
color: $gray-900;
}
&__badge {
background: $primary-light;
color: $primary;
font-size: 11px;
font-weight: 700;
padding: 2px 8px;
border-radius: 10px;
}
&__btn {
border-radius: 8px !important;
font-size: 13px !important;
font-weight: 600 !important;
height: 36px !important;
}
}
// Empty state
.nom-empty {
text-align: center;
padding: 48px 20px;
background: $gray-50;
border-radius: 10px;
border: 1px dashed $gray-200;
&__icon {
font-size: 36px;
color: $gray-500;
margin-bottom: 10px;
}
&__text {
color: $gray-500;
font-size: 14px;
margin: 0;
}
}
// Expansion panels
.nom-panel {
margin-bottom: 12px !important;
border-radius: 10px !important;
border: 1px solid $gray-200 !important;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
&::ng-deep .mat-expansion-panel-body {
padding: 0 20px 20px !important;
}
&__header {
height: auto !important;
min-height: 56px !important;
padding: 8px 20px !important;
}
&__title {
display: flex !important;
align-items: center;
gap: 10px;
flex: 1;
}
&__type-icon {
font-size: 16px;
color: $primary;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
background: $primary-light;
border-radius: 6px;
}
&__name {
font-size: 14px;
font-weight: 600;
color: $gray-900;
}
&__badge {
font-size: 11px;
font-weight: 600;
padding: 2px 10px;
border-radius: 10px;
&--relation {
background: $blue-light;
color: $blue;
}
h3 {
margin: 1% auto;
&--type {
background: $orange-light;
color: $orange;
}
}
p {
line-height: 30px;
margin-left: 2%;
&__desc {
font-size: 12px;
color: $gray-500 !important;
flex: 0 !important;
white-space: nowrap;
}
}
// Actions bar inside panel
.nom-actions {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 0;
margin-bottom: 12px;
border-bottom: 1px solid $gray-100;
&__buttons {
display: flex;
gap: 8px;
}
&__edit,
&__delete {
border-radius: 6px !important;
font-size: 12px !important;
font-weight: 600 !important;
height: 32px !important;
}
}
// Details grid
.nom-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0;
border: 1px solid $gray-100;
border-radius: 8px;
overflow: hidden;
@media (max-width: 768px) {
grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 480px) {
grid-template-columns: 1fr;
}
}
.nom-field {
padding: 10px 14px;
border-bottom: 1px solid $gray-100;
border-right: 1px solid $gray-100;
transition: background 0.15s ease;
&:hover {
background: $gray-50;
}
&:nth-child(3n) {
border-right: none;
}
&__label {
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: $gray-500;
margin-bottom: 3px;
}
&__value {
font-size: 13.5px;
font-weight: 500;
color: $gray-900;
word-break: break-word;
&--mono {
font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
font-size: 13px;
letter-spacing: 0.5px;
}
}
}
@@ -8,14 +8,19 @@
/** Angular Imports */
import { Component, inject } from '@angular/core';
import { ActivatedRoute, RouterOutlet, RouterLink } from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
/** Custom Components */
import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component';
import { NomineeDialogComponent } from './nominee-dialog/nominee-dialog.component';
/** Custom Services */
import { ClientsService } from '../../clients.service';
import { TranslateService } from '@ngx-translate/core';
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import {
MatAccordion,
@@ -38,7 +43,6 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
styleUrls: ['./family-members-tab.component.scss'],
imports: [
...STANDALONE_SHARED_IMPORTS,
RouterOutlet,
FaIconComponent,
MatAccordion,
MatExpansionPanel,
@@ -53,24 +57,79 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
export class FamilyMembersTabComponent {
private route = inject(ActivatedRoute);
private clientsService = inject(ClientsService);
dialog = inject(MatDialog);
private dialog = inject(MatDialog);
private translateService = inject(TranslateService);
private settingsService = inject(SettingsService);
private dateUtils = inject(Dates);
/** Client Family Members */
clientFamilyMembers: any;
/** Client ID */
clientId: string;
/** Family member template options (loaded on first dialog open) */
familyMemberOptions: any;
/**
* @param {ActivatedRoute} route Activated Route
* @param {ClientsService} clientsService Clients Service
* @param {MatDialog }dialog Mat Dialog
*/
constructor() {
this.route.data.subscribe((data: { clientFamilyMembers: any }) => {
this.clientFamilyMembers = data.clientFamilyMembers;
});
this.clientId = this.route.parent.snapshot.params['clientId'];
}
/**
* Deletes the family member and redirects to family members tab.
* Opens the nominee dialog in Add mode.
*/
addNominee() {
this.ensureTemplateLoaded().then(() => {
const dialogRef = this.dialog.open(NomineeDialogComponent, {
width: '700px',
data: {
title: this.translateService.instant('labels.buttons.Add') + ' ' + this.translateService.instant('labels.heading.Nominee'),
familyMemberOptions: this.familyMemberOptions
}
});
dialogRef.afterClosed().subscribe((result: any) => {
if (result) {
this.clientsService.addFamilyMember(this.clientId, result).subscribe((res: any) => {
// Refresh the list by fetching the member details
this.clientsService.getClientFamilyMember(this.clientId, res.resourceId).subscribe((member: any) => {
this.clientFamilyMembers.push(member);
});
});
}
});
});
}
/**
* Opens the nominee dialog in Edit mode, pre-filled with member data.
*/
editNominee(member: any, index: number) {
this.ensureTemplateLoaded().then(() => {
const dialogRef = this.dialog.open(NomineeDialogComponent, {
width: '700px',
data: {
title: this.translateService.instant('labels.buttons.Edit') + ' ' + this.translateService.instant('labels.heading.Nominee'),
familyMemberOptions: this.familyMemberOptions,
member
}
});
dialogRef.afterClosed().subscribe((result: any) => {
if (result) {
this.clientsService.editFamilyMember(member.clientId, member.id, result).subscribe(() => {
this.clientsService.getClientFamilyMember(this.clientId, member.id).subscribe((updated: any) => {
this.clientFamilyMembers[index] = updated;
});
});
}
});
});
}
/**
* Deletes the family member.
*/
deleteFamilyMember(clientId: string, id: string, name: string, index: number) {
const deleteFamilyMemberDialogRef = this.dialog.open(DeleteDialogComponent, {
@@ -88,4 +147,19 @@ export class FamilyMembersTabComponent {
displayName(member: any): string {
return member.firstName || '';
}
/**
* Lazily loads family member template options from the API.
*/
private ensureTemplateLoaded(): Promise<void> {
if (this.familyMemberOptions) {
return Promise.resolve();
}
return new Promise((resolve) => {
this.clientsService.getClientTemplate().subscribe((template: any) => {
this.familyMemberOptions = template.familyMemberOptions;
resolve();
});
});
}
}
@@ -0,0 +1,147 @@
<!--
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="fd-dialog">
<!-- Header -->
<div class="fd-header">
<h2 class="fd-title">{{ data.title }}</h2>
<button mat-icon-button class="fd-close" (click)="onCancel()">
<i class="fa fa-times"></i>
</button>
</div>
<!-- Content -->
<div class="fd-content">
<form [formGroup]="nomineeForm" (ngSubmit)="onSubmit()">
<div class="fd-grid fd-grid--cols-2">
<!-- Nomination Type -->
<div class="fd-field">
<mat-form-field appearance="outline">
<mat-label>{{ 'labels.inputs.Nomination Type' | translate }}</mat-label>
<mat-select formControlName="nominationType">
<mat-option value="DA1">{{ 'labels.inputs.DA1 - Add Nominee' | translate }}</mat-option>
<mat-option value="DA5">{{ 'labels.inputs.DA5 - Modify / Cancel Nominee' | translate }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<!-- Nominee Name -->
<div class="fd-field">
<mat-form-field appearance="outline">
<mat-label>{{ 'labels.inputs.Nominee Name' | translate }}</mat-label>
<input formControlName="firstName" required matInput />
@if (nomineeForm.controls['firstName'].hasError('required')) {
<mat-error>
{{ 'labels.inputs.Nominee Name' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
</div>
<!-- Relationship -->
<div class="fd-field">
<mat-form-field appearance="outline">
<mat-label>{{ 'labels.inputs.Relationship' | translate }}</mat-label>
<mat-select formControlName="relationshipId" required>
@for (relation of data.familyMemberOptions?.relationshipIdOptions; track relation) {
<mat-option [value]="relation.id">
{{ relation.name | translateKey: 'catalogs' }}
</mat-option>
}
</mat-select>
@if (nomineeForm.controls['relationshipId'].hasError('required')) {
<mat-error>
{{ 'labels.inputs.Relationship' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
</div>
<!-- Date of Birth -->
<div class="fd-field">
<mat-form-field appearance="outline" (click)="dobPicker.open()">
<mat-label>{{ 'labels.inputs.Date Of Birth' | translate }}</mat-label>
<input
formControlName="dateOfBirth"
matInput
[max]="maxDate"
[matDatepicker]="dobPicker"
placeholder="{{ 'labels.text.Optional' | translate }}"
/>
<mat-datepicker-toggle matSuffix [for]="dobPicker"></mat-datepicker-toggle>
<mat-datepicker #dobPicker></mat-datepicker>
</mat-form-field>
</div>
<!-- Percentage Share -->
<div class="fd-field">
<mat-form-field appearance="outline">
<mat-label>{{ 'labels.inputs.Percentage Share' | translate }} (%)</mat-label>
<input type="number" formControlName="percentageShare" matInput min="0" max="100" />
</mat-form-field>
</div>
<!-- Nominee is Minor -->
<div class="fd-field fd-field--checkbox">
<mat-checkbox formControlName="isDependent" labelPosition="before">
{{ 'labels.inputs.Nominee is Minor' | translate }}?
</mat-checkbox>
</div>
</div>
<!-- Guardian Details (shown when minor) -->
@if (nomineeForm.get('isDependent')?.value) {
<h4 class="fd-section-title">{{ 'labels.heading.Guardian Details (If Minor)' | translate }}</h4>
<div class="fd-grid fd-grid--cols-2">
<div class="fd-field">
<mat-form-field appearance="outline">
<mat-label>{{ 'labels.inputs.Guardian Name' | translate }}</mat-label>
<input formControlName="guardianName" matInput />
</mat-form-field>
</div>
<div class="fd-field">
<mat-form-field appearance="outline">
<mat-label>{{ 'labels.inputs.Relationship with Minor' | translate }}</mat-label>
<input formControlName="guardianRelationship" matInput />
</mat-form-field>
</div>
</div>
}
<!-- Remarks (full width) -->
<div class="fd-grid">
<div class="fd-field fd-field--full">
<mat-form-field appearance="outline">
<mat-label>{{ 'labels.inputs.Remarks' | translate }}</mat-label>
<input formControlName="remarks" matInput />
</mat-form-field>
</div>
</div>
</form>
</div>
<!-- Actions -->
<div class="fd-actions" mat-dialog-actions align="end">
<button mat-stroked-button class="fd-btn fd-btn--cancel" (click)="onCancel()">
{{ 'labels.buttons.Cancel' | translate }}
</button>
<button
mat-flat-button
color="primary"
class="fd-btn fd-btn--submit"
[disabled]="!nomineeForm.valid"
(click)="onSubmit()"
>
<i class="fa fa-check fd-btn__icon"></i>
{{ 'labels.buttons.Submit' | translate }}
</button>
</div>
</div>
@@ -0,0 +1,191 @@
/**
* 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/.
*/
$primary: #1a73e8;
$gray-50: #f8f9fa;
$gray-100: #f1f3f4;
$gray-200: #e8eaed;
$gray-500: #9aa0a6;
$gray-700: #5f6368;
$gray-900: #202124;
$white: #fff;
.fd-dialog {
display: flex;
flex-direction: column;
min-width: 0;
}
// Header
.fd-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 24px 12px;
border-bottom: 1px solid $gray-200;
}
.fd-title {
margin: 0 !important;
padding: 0 !important;
font-size: 17px !important;
font-weight: 600 !important;
color: $gray-900;
letter-spacing: -0.2px;
}
.fd-close {
width: 32px !important;
height: 32px !important;
line-height: 32px !important;
color: $gray-500;
transition: color 0.15s ease, background 0.15s ease;
&:hover {
color: $gray-900;
background: $gray-100;
border-radius: 50%;
}
i {
font-size: 14px;
}
}
// Content area
.fd-content {
padding: 20px 24px !important;
max-height: 75vh;
overflow-y: auto;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-thumb {
background: $gray-200;
border-radius: 4px;
}
}
.fd-grid {
display: flex;
flex-direction: column;
gap: 4px;
&--cols-2 {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 4px 16px;
}
}
.fd-field {
min-width: 0;
&--full {
grid-column: 1 / -1;
}
&--checkbox {
display: flex;
align-items: center;
padding-top: 10px;
}
::ng-deep {
.mat-mdc-form-field {
width: 100%;
}
.mat-mdc-text-field-wrapper {
background: $gray-50;
border-radius: 8px;
}
.mdc-text-field--outlined .mdc-notched-outline__leading,
.mdc-text-field--outlined .mdc-notched-outline__trailing,
.mdc-text-field--outlined .mdc-notched-outline__notch {
border-color: $gray-200;
}
.mdc-text-field--outlined:not(.mdc-text-field--disabled):hover .mdc-notched-outline__leading,
.mdc-text-field--outlined:not(.mdc-text-field--disabled):hover .mdc-notched-outline__trailing,
.mdc-text-field--outlined:not(.mdc-text-field--disabled):hover .mdc-notched-outline__notch {
border-color: $primary;
}
.mat-mdc-floating-label {
font-size: 13px;
color: $gray-700;
}
input.mat-mdc-input-element {
font-size: 14px;
color: $gray-900;
}
}
}
.fd-section-title {
margin: 12px 0 4px;
font-size: 14px;
font-weight: 600;
color: $gray-700;
}
// Actions
.fd-actions {
padding: 12px 24px 16px !important;
border-top: 1px solid $gray-200;
gap: 10px;
margin: 0 !important;
}
.fd-btn {
min-width: 100px;
border-radius: 8px !important;
font-size: 13px !important;
font-weight: 600 !important;
letter-spacing: 0.2px;
padding: 0 20px !important;
height: 38px !important;
&--cancel {
color: $gray-700 !important;
border-color: $gray-200 !important;
&:hover {
background: $gray-50 !important;
}
}
&--submit {
box-shadow: 0 1px 3px rgba($primary, 0.3) !important;
}
&__icon {
margin-right: 6px;
font-size: 12px;
}
}
// Responsive
@media (max-width: 600px) {
.fd-grid--cols-2 {
grid-template-columns: 1fr;
}
.fd-content {
padding: 16px !important;
}
.fd-actions {
padding: 12px 16px !important;
}
}
@@ -0,0 +1,87 @@
/**
* 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/.
*/
import { Component, OnInit, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { MatCheckbox } from '@angular/material/checkbox';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
export interface NomineeDialogData {
title: string;
familyMemberOptions: any;
member?: any;
}
@Component({
selector: 'mifosx-nominee-dialog',
templateUrl: './nominee-dialog.component.html',
styleUrls: ['./nominee-dialog.component.scss'],
imports: [
...STANDALONE_SHARED_IMPORTS,
MatCheckbox
]
})
export class NomineeDialogComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private dialogRef = inject(MatDialogRef<NomineeDialogComponent>);
private settingsService = inject(SettingsService);
private dateUtils = inject(Dates);
data: NomineeDialogData = inject(MAT_DIALOG_DATA);
nomineeForm: UntypedFormGroup;
maxDate = new Date();
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.createForm();
}
createForm() {
const member = this.data.member;
this.nomineeForm = this.formBuilder.group({
nominationType: [member?.nominationType || 'DA1'],
firstName: [member?.firstName || '', Validators.required],
relationshipId: [member?.relationshipId || '', Validators.required],
dateOfBirth: [member?.dateOfBirth ? this.dateUtils.formatDate(member.dateOfBirth, 'yyyy-MM-dd') : null],
percentageShare: [member?.percentageShare ?? 100],
isDependent: [member?.isDependent || false],
guardianName: [member?.guardianName || ''],
guardianRelationship: [member?.guardianRelationship || ''],
remarks: [member?.remarks || '']
});
}
onSubmit() {
if (this.nomineeForm.valid) {
const formValue = { ...this.nomineeForm.value };
const locale = this.settingsService.language.code;
const dateFormat = this.settingsService.dateFormat;
if (formValue.dateOfBirth) {
if (formValue.dateOfBirth instanceof Date) {
formValue.dateOfBirth = this.dateUtils.formatDate(formValue.dateOfBirth, dateFormat);
}
} else {
delete formValue.dateOfBirth;
}
this.dialogRef.close({
...formValue,
dateFormat,
locale
});
}
}
onCancel() {
this.dialogRef.close(null);
}
}
@@ -159,6 +159,7 @@ export class IdentitiesTabComponent implements OnDestroy {
];
const dialogRef = this.dialog.open(UploadDocumentDialogComponent, {
width: '700px',
data: {
documentIdentifier: true,
allowedDocumentTypes: translatedDocTypes,
@@ -6,23 +6,20 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<div class="layout-row layout-lt-md-column gap-2percent">
<mat-form-field [ngStyle]="{ flex: '0 0 ' + (flex || '83%') }">
<input
matInput
[readonly]="true"
[value]="fileName || ''"
placeholder="{{ 'labels.text.NoFileSelected' | translate }}"
/>
</mat-form-field>
<span class="flex-10 align-center">
<button mat-button (click)="uploadFile.click()">
<fa-icon icon="folder-open" size="lg"></fa-icon>
&nbsp;&nbsp;
{{ 'labels.buttons.Browse' | translate }}
</button>
</span>
<div class="file-upload-zone" (click)="uploadFile.click()">
@if (fileName) {
<div class="file-upload-zone__selected">
<i class="fa fa-file-o file-upload-zone__file-icon"></i>
<span class="file-upload-zone__filename">{{ fileName }}</span>
<span class="file-upload-zone__change">Change</span>
</div>
} @else {
<div class="file-upload-zone__empty">
<i class="fa fa-cloud-upload file-upload-zone__upload-icon"></i>
<span class="file-upload-zone__text">{{ 'labels.buttons.Browse' | translate }}</span>
<span class="file-upload-zone__hint">{{ 'labels.text.NoFileSelected' | translate }}</span>
</div>
}
</div>
<input type="file" #uploadFile accept="{{ acceptFilter }}" (change)="onFileSelect($event)" [style.display]="'none'" />
@@ -5,3 +5,83 @@
* 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/.
*/
$primary: #1a73e8;
$primary-light: #e8f0fe;
$gray-50: #f8f9fa;
$gray-100: #f1f3f4;
$gray-200: #e8eaed;
$gray-500: #9aa0a6;
$gray-700: #5f6368;
$gray-900: #202124;
.file-upload-zone {
border: 1.5px dashed $gray-200;
border-radius: 8px;
padding: 10px 14px;
cursor: pointer;
transition: all 0.15s ease;
background: $gray-50;
height: 54px;
display: flex;
align-items: center;
justify-content: center;
&:hover {
border-color: $primary;
background: $primary-light;
}
&__empty {
display: flex;
align-items: center;
gap: 8px;
}
&__upload-icon {
font-size: 16px;
color: $primary;
}
&__text {
font-size: 12px;
font-weight: 600;
color: $primary;
}
&__hint {
font-size: 11px;
color: $gray-500;
margin-left: 4px;
}
&__selected {
display: flex;
align-items: center;
gap: 8px;
}
&__file-icon {
font-size: 14px;
color: $primary;
}
&__filename {
font-size: 12px;
font-weight: 500;
color: $gray-900;
max-width: 180px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&__change {
font-size: 10px;
font-weight: 600;
color: $primary;
padding: 1px 6px;
background: $primary-light;
border-radius: 3px;
}
}
@@ -40,28 +40,47 @@ $white: #fff;
}
.fd-close {
width: 32px !important;
height: 32px !important;
line-height: 32px !important;
width: 36px !important;
height: 36px !important;
min-width: 36px !important;
padding: 0 !important;
display: flex !important;
align-items: center;
justify-content: center;
color: $gray-500;
transition: color 0.15s ease, background 0.15s ease;
border: 1px solid $gray-200;
border-radius: 8px !important;
background: $white;
cursor: pointer;
transition: all 0.15s ease;
flex-shrink: 0;
&:hover {
color: $gray-900;
background: $gray-100;
border-radius: 50%;
color: $white;
background: #ea4335;
border-color: #ea4335;
}
i {
font-size: 14px;
font-size: 13px;
line-height: 1;
}
}
// Content area
.fd-content {
padding: 20px 24px !important;
max-height: 65vh;
overflow-y: auto;
overflow: visible !important;
max-height: none !important;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-thumb {
background: $gray-200;
border-radius: 4px;
}
}
.fd-grid {
@@ -9,7 +9,7 @@
<div [formGroup]="form" class="flex-fill">
@if (formfield.controlType === 'input' || formfield.controlType === 'select') {
<div class="flex-fill">
<mat-form-field class="flex-fill">
<mat-form-field class="flex-fill" appearance="outline">
<mat-label>{{ formfield.label }}</mat-label>
@if (formfield.controlType === 'input') {
<input