fix(headers): add missing MPL-2.0 license headers on merged files
Files restored from dev during the demo-backup merge were missing the standard license header (dev's copies predate that fix, which had only been applied on the demo line previously). Also fixed pre-existing lint debt surfaced by the edit: wrong component selector prefix and constructor-injection pattern in client-family-member-child-dialog.
This commit is contained in:
+99
-79
@@ -1,90 +1,110 @@
|
|||||||
|
<!--
|
||||||
|
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="fm-dialog">
|
<div class="fm-dialog">
|
||||||
<div class="fm-dialog__header" style="display: flex; align-items: center; gap: 8px;">
|
<div class="fm-dialog__header" style="display: flex; align-items: center; gap: 8px">
|
||||||
<mat-icon class="fm-dialog__icon">people</mat-icon>
|
<mat-icon class="fm-dialog__icon">people</mat-icon>
|
||||||
<span style="font-weight: 500; font-size: 18px;">CHILDREN</span>
|
<span style="font-weight: 500; font-size: 18px">CHILDREN</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<mat-dialog-content>
|
<mat-dialog-content>
|
||||||
<form [formGroup]="childrenForm">
|
<form [formGroup]="childrenForm">
|
||||||
<div formArrayName="children" style="margin-top: 12px; background: #fff; padding: 12px;">
|
<div formArrayName="children" style="margin-top: 12px; background: #fff; padding: 12px">
|
||||||
@for (child of children.controls; track $index) {
|
@for (child of children.controls; track $index) {
|
||||||
<div [formGroupName]="$index"
|
<div
|
||||||
style="position: relative; padding: 24px 16px 16px; margin-top: 16px; margin-bottom: 24px; border: 1px solid #e0e0e0; border-radius: 8px; background: #fff;">
|
[formGroupName]="$index"
|
||||||
<div class="fm-grid">
|
style="
|
||||||
<mat-form-field appearance="outline">
|
position: relative;
|
||||||
<mat-label>Child Full Name*</mat-label>
|
padding: 24px 16px 16px;
|
||||||
<input matInput formControlName="fullName" required placeholder="Child Full Name*" />
|
margin-top: 16px;
|
||||||
</mat-form-field>
|
margin-bottom: 24px;
|
||||||
<mat-form-field appearance="outline">
|
border: 1px solid #e0e0e0;
|
||||||
<mat-label>Gender*</mat-label>
|
border-radius: 8px;
|
||||||
<mat-select formControlName="genderId" required>
|
background: #fff;
|
||||||
@for (g of genderIdOptions; track g.id) {
|
"
|
||||||
<mat-option [value]="g.id">{{ g.name }}</mat-option>
|
>
|
||||||
|
<div class="fm-grid">
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>Child Full Name*</mat-label>
|
||||||
|
<input matInput formControlName="fullName" required placeholder="Child Full Name*" />
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>Gender*</mat-label>
|
||||||
|
<mat-select formControlName="genderId" required>
|
||||||
|
@for (g of genderIdOptions; track g.id) {
|
||||||
|
<mat-option [value]="g.id">{{ g.name }}</mat-option>
|
||||||
|
}
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline" (click)="childDobPicker.open()">
|
||||||
|
<mat-label>Date of Birth</mat-label>
|
||||||
|
<input matInput [max]="maxDate" [matDatepicker]="childDobPicker" formControlName="dateOfBirth" />
|
||||||
|
<mat-datepicker-toggle matSuffix [for]="childDobPicker"></mat-datepicker-toggle>
|
||||||
|
<mat-datepicker #childDobPicker></mat-datepicker>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>Nationality</mat-label>
|
||||||
|
<mat-select formControlName="nationality">
|
||||||
|
<mat-option value="INDIAN">Indian</mat-option>
|
||||||
|
<mat-option value="NRI">NRI</mat-option>
|
||||||
|
<mat-option value="FOREIGN_NATIONAL">Foreign National</mat-option>
|
||||||
|
<mat-option value="OTHER">Other</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>Aadhaar Number (Optional)</mat-label>
|
||||||
|
<input
|
||||||
|
matInput
|
||||||
|
formControlName="aadhaarNumber"
|
||||||
|
maxlength="12"
|
||||||
|
placeholder="12-digit Aadhaar"
|
||||||
|
(keypress)="$event.charCode >= 48 && $event.charCode <= 57 ? true : $event.preventDefault()"
|
||||||
|
/>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>PAN Number (Optional)</mat-label>
|
||||||
|
<input
|
||||||
|
matInput
|
||||||
|
formControlName="panNumber"
|
||||||
|
maxlength="10"
|
||||||
|
placeholder="ABCDE1234F"
|
||||||
|
style="text-transform: uppercase"
|
||||||
|
(input)="
|
||||||
|
$any(children.at($index))
|
||||||
|
.get('panNumber')
|
||||||
|
?.setValue($any($event.target).value.toUpperCase(), { emitEvent: false })
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
@if (
|
||||||
|
$any(children.at($index)).get('panNumber')?.hasError('pattern') &&
|
||||||
|
$any(children.at($index)).get('panNumber')?.touched
|
||||||
|
) {
|
||||||
|
<mat-error>Invalid PAN format</mat-error>
|
||||||
}
|
}
|
||||||
</mat-select>
|
</mat-form-field>
|
||||||
</mat-form-field>
|
</div>
|
||||||
<mat-form-field appearance="outline" (click)="childDobPicker.open()">
|
|
||||||
<mat-label>Date of Birth</mat-label>
|
|
||||||
<input matInput [max]="maxDate" [matDatepicker]="childDobPicker" formControlName="dateOfBirth" />
|
|
||||||
<mat-datepicker-toggle matSuffix [for]="childDobPicker"></mat-datepicker-toggle>
|
|
||||||
<mat-datepicker #childDobPicker></mat-datepicker>
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field appearance="outline">
|
|
||||||
<mat-label>Nationality</mat-label>
|
|
||||||
<mat-select formControlName="nationality">
|
|
||||||
<mat-option value="INDIAN">Indian</mat-option>
|
|
||||||
<mat-option value="NRI">NRI</mat-option>
|
|
||||||
<mat-option value="FOREIGN_NATIONAL">Foreign National</mat-option>
|
|
||||||
<mat-option value="OTHER">Other</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field appearance="outline">
|
|
||||||
<mat-label>Aadhaar Number (Optional)</mat-label>
|
|
||||||
<input
|
|
||||||
matInput
|
|
||||||
formControlName="aadhaarNumber"
|
|
||||||
maxlength="12"
|
|
||||||
placeholder="12-digit Aadhaar"
|
|
||||||
(keypress)="$event.charCode >= 48 && $event.charCode <= 57 ? true : $event.preventDefault()"
|
|
||||||
/>
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field appearance="outline">
|
|
||||||
<mat-label>PAN Number (Optional)</mat-label>
|
|
||||||
<input
|
|
||||||
matInput
|
|
||||||
formControlName="panNumber"
|
|
||||||
maxlength="10"
|
|
||||||
placeholder="ABCDE1234F"
|
|
||||||
style="text-transform: uppercase"
|
|
||||||
(input)="
|
|
||||||
$any(children.at($index)).get('panNumber')
|
|
||||||
?.setValue($any($event.target).value.toUpperCase(), { emitEvent: false })
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
@if (
|
|
||||||
$any(children.at($index)).get('panNumber')?.hasError('pattern') && $any(children.at($index)).get('panNumber')?.touched
|
|
||||||
) {
|
|
||||||
<mat-error>Invalid PAN format</mat-error>
|
|
||||||
}
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
@if ($index < children.controls.length - 1) {
|
||||||
@if ($index < children.controls.length - 1) { <div style="border-bottom: 1px dashed #ccc; margin-bottom: 16px;">
|
<div style="border-bottom: 1px dashed #ccc; margin-bottom: 16px"></div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<div style="border-bottom: 1px dashed #ccc; margin-bottom: 16px"></div>
|
||||||
|
<button mat-stroked-button type="button" color="primary" (click)="addChild()">
|
||||||
|
<mat-icon>add</mat-icon> Add Another Child
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
}
|
</form>
|
||||||
}
|
</mat-dialog-content>
|
||||||
<div style="border-bottom: 1px dashed #ccc; margin-bottom: 16px;"></div>
|
|
||||||
<button mat-stroked-button type="button" color="primary" (click)="addChild()">
|
|
||||||
<mat-icon>add</mat-icon> Add Another Child
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</mat-dialog-content>
|
|
||||||
|
|
||||||
<mat-dialog-actions align="end">
|
<mat-dialog-actions align="end">
|
||||||
<button mat-stroked-button mat-dialog-close type="button">Cancel</button>
|
<button mat-stroked-button mat-dialog-close type="button">Cancel</button>
|
||||||
<button mat-flat-button color="primary" type="button" [disabled]="childrenForm.invalid" (click)="submit()">
|
<button mat-flat-button color="primary" type="button" [disabled]="childrenForm.invalid" (click)="submit()">
|
||||||
Add Member
|
Add Member
|
||||||
</button>
|
</button>
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+48
-22
@@ -1,4 +1,12 @@
|
|||||||
import { Component, Inject, OnInit } from '@angular/core';
|
/**
|
||||||
|
* 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 { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { UntypedFormBuilder, UntypedFormGroup, UntypedFormArray, Validators } from '@angular/forms';
|
import { UntypedFormBuilder, UntypedFormGroup, UntypedFormArray, Validators } from '@angular/forms';
|
||||||
|
|
||||||
@@ -13,7 +21,7 @@ import { ReactiveFormsModule } from '@angular/forms';
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'cbs-client-family-member-child-dialog',
|
selector: 'mifosx-client-family-member-child-dialog',
|
||||||
templateUrl: './client-family-member-child-dialog.component.html',
|
templateUrl: './client-family-member-child-dialog.component.html',
|
||||||
styleUrls: ['../client-family-member-dialog/client-family-member-dialog.component.scss'],
|
styleUrls: ['../client-family-member-dialog/client-family-member-dialog.component.scss'],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@@ -30,18 +38,17 @@ import { CommonModule } from '@angular/common';
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ClientFamilyMemberChildDialogComponent implements OnInit {
|
export class ClientFamilyMemberChildDialogComponent implements OnInit {
|
||||||
|
dialogRef = inject(MatDialogRef<ClientFamilyMemberChildDialogComponent>);
|
||||||
|
data = inject(MAT_DIALOG_DATA);
|
||||||
|
private formBuilder = inject(UntypedFormBuilder);
|
||||||
|
|
||||||
childrenForm: UntypedFormGroup;
|
childrenForm: UntypedFormGroup;
|
||||||
genderIdOptions: any[];
|
genderIdOptions: any[];
|
||||||
maxDate: Date = new Date();
|
maxDate: Date = new Date();
|
||||||
|
|
||||||
constructor(
|
constructor() {
|
||||||
public dialogRef: MatDialogRef<ClientFamilyMemberChildDialogComponent>,
|
this.genderIdOptions = this.data.genderIdOptions;
|
||||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
|
||||||
private formBuilder: UntypedFormBuilder
|
|
||||||
) {
|
|
||||||
this.genderIdOptions = data.genderIdOptions;
|
|
||||||
|
|
||||||
this.childrenForm = this.formBuilder.group({
|
this.childrenForm = this.formBuilder.group({
|
||||||
children: this.formBuilder.array([])
|
children: this.formBuilder.array([])
|
||||||
});
|
});
|
||||||
@@ -50,15 +57,26 @@ export class ClientFamilyMemberChildDialogComponent implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if (this.data.children && this.data.children.length > 0) {
|
if (this.data.children && this.data.children.length > 0) {
|
||||||
this.data.children.forEach((child: any) => {
|
this.data.children.forEach((child: any) => {
|
||||||
this.children.push(this.formBuilder.group({
|
this.children.push(
|
||||||
id: [child.id],
|
this.formBuilder.group({
|
||||||
fullName: [child.fullName, Validators.required],
|
id: [child.id],
|
||||||
genderId: [child.genderId, Validators.required],
|
fullName: [
|
||||||
dateOfBirth: [child.dateOfBirth ? new Date(child.dateOfBirth) : ''],
|
child.fullName,
|
||||||
nationality: [child.nationality || 'INDIAN'],
|
Validators.required
|
||||||
aadhaarNumber: [child.aadhaarNumber || ''],
|
],
|
||||||
panNumber: [child.panNumber || '', Validators.pattern(/^[A-Z]{5}[0-9]{4}[A-Z]{1}$/)]
|
genderId: [
|
||||||
}));
|
child.genderId,
|
||||||
|
Validators.required
|
||||||
|
],
|
||||||
|
dateOfBirth: [child.dateOfBirth ? new Date(child.dateOfBirth) : ''],
|
||||||
|
nationality: [child.nationality || 'INDIAN'],
|
||||||
|
aadhaarNumber: [child.aadhaarNumber || ''],
|
||||||
|
panNumber: [
|
||||||
|
child.panNumber || '',
|
||||||
|
Validators.pattern(/^[A-Z]{5}[0-9]{4}[A-Z]{1}$/)
|
||||||
|
]
|
||||||
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.addChild();
|
this.addChild();
|
||||||
@@ -72,12 +90,21 @@ export class ClientFamilyMemberChildDialogComponent implements OnInit {
|
|||||||
createChildFormGroup(): UntypedFormGroup {
|
createChildFormGroup(): UntypedFormGroup {
|
||||||
return this.formBuilder.group({
|
return this.formBuilder.group({
|
||||||
id: [''],
|
id: [''],
|
||||||
fullName: ['', Validators.required],
|
fullName: [
|
||||||
genderId: ['', Validators.required],
|
'',
|
||||||
|
Validators.required
|
||||||
|
],
|
||||||
|
genderId: [
|
||||||
|
'',
|
||||||
|
Validators.required
|
||||||
|
],
|
||||||
dateOfBirth: [''],
|
dateOfBirth: [''],
|
||||||
nationality: ['INDIAN'],
|
nationality: ['INDIAN'],
|
||||||
aadhaarNumber: [''],
|
aadhaarNumber: [''],
|
||||||
panNumber: ['', Validators.pattern(/^[A-Z]{5}[0-9]{4}[A-Z]{1}$/)]
|
panNumber: [
|
||||||
|
'',
|
||||||
|
Validators.pattern(/^[A-Z]{5}[0-9]{4}[A-Z]{1}$/)
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,5 +121,4 @@ export class ClientFamilyMemberChildDialogComponent implements OnInit {
|
|||||||
this.dialogRef.close(this.children.value);
|
this.dialogRef.close(this.children.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-9
@@ -1,6 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright since 2025 Mifos Initiative
|
* Copyright since 2025 Mifos Initiative
|
||||||
* MPL-2.0
|
*
|
||||||
|
* 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/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
:host {
|
:host {
|
||||||
@@ -35,14 +38,14 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
padding: 0 4px;
|
padding: 0 4px;
|
||||||
font-family: 'Roboto', 'Inter', sans-serif; /* Gmail-like typography */
|
font-family: Roboto, Inter, sans-serif; /* Gmail-like typography */
|
||||||
}
|
}
|
||||||
|
|
||||||
.ced-gmail-subject {
|
.ced-gmail-subject {
|
||||||
font-size: 1.35rem;
|
font-size: 1.35rem;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #202124;
|
color: #202124;
|
||||||
margin: 0 0 24px 0;
|
margin: 0 0 24px;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,13 +156,19 @@
|
|||||||
&--sent {
|
&--sent {
|
||||||
background: #e8f5e9;
|
background: #e8f5e9;
|
||||||
color: #1b5e20;
|
color: #1b5e20;
|
||||||
.ced-chip__dot { background: #43a047; }
|
|
||||||
|
.ced-chip__dot {
|
||||||
|
background: #43a047;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&--notsent {
|
&--notsent {
|
||||||
background: #f5f5f5;
|
background: #f5f5f5;
|
||||||
color: #757575;
|
color: #757575;
|
||||||
.ced-chip__dot { background: #bdbdbd; }
|
|
||||||
|
.ced-chip__dot {
|
||||||
|
background: #bdbdbd;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&--seen {
|
&--seen {
|
||||||
@@ -176,7 +185,7 @@
|
|||||||
/* ── Divider ────────────────────────────────────────────────────────────── */
|
/* ── Divider ────────────────────────────────────────────────────────────── */
|
||||||
.ced-divider {
|
.ced-divider {
|
||||||
border: none;
|
border: none;
|
||||||
border-top: 1px solid #eeeeee;
|
border-top: 1px solid #eee;
|
||||||
margin: 12px 0;
|
margin: 12px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,13 +206,19 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
td, th {
|
td,
|
||||||
|
th {
|
||||||
padding: 6px 12px;
|
padding: 6px 12px;
|
||||||
border: 1px solid #e0e0e0;
|
border: 1px solid #e0e0e0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p { margin: 0 0 10px; }
|
p {
|
||||||
ul { padding-left: 20px; }
|
margin: 0 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Empty state ────────────────────────────────────────────────────────── */
|
/* ── Empty state ────────────────────────────────────────────────────────── */
|
||||||
|
|||||||
Reference in New Issue
Block a user