fix(clients): remove leftover unresolved git conflict markers on Last Name field
An unresolved git stash conflict had been committed as-is, leaving literal <<<<<<< Updated upstream / ======= / >>>>>>> Stashed changes markers inside the template. Angular rendered them as plain text right in the create-client form. Kept the blur-triggered capitalizeControl() version (matches First/Middle Name) and dropped the now-unused formatName() left behind by the other side of the conflict.
This commit is contained in:
@@ -263,7 +263,6 @@
|
|||||||
<mat-form-field appearance="outline" class="name-field last-name">
|
<mat-form-field appearance="outline" class="name-field last-name">
|
||||||
<mat-label>{{ 'labels.inputs.Last Name' | translate }}</mat-label>
|
<mat-label>{{ 'labels.inputs.Last Name' | translate }}</mat-label>
|
||||||
<span matPrefix class="field-prefix-icon"><mat-icon>person</mat-icon></span>
|
<span matPrefix class="field-prefix-icon"><mat-icon>person</mat-icon></span>
|
||||||
<<<<<<< Updated upstream
|
|
||||||
<input
|
<input
|
||||||
matInput
|
matInput
|
||||||
required
|
required
|
||||||
@@ -272,9 +271,6 @@
|
|||||||
(blur)="capitalizeControl('lastname')"
|
(blur)="capitalizeControl('lastname')"
|
||||||
style="text-transform: capitalize"
|
style="text-transform: capitalize"
|
||||||
/>
|
/>
|
||||||
=======
|
|
||||||
<input matInput required formControlName="lastname" autocomplete="off" (input)="formatName('lastname')" />
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
@if (createClientForm.controls.lastname.hasError('required')) {
|
@if (createClientForm.controls.lastname.hasError('required')) {
|
||||||
<mat-error>Last name is <strong>required</strong></mat-error>
|
<mat-error>Last name is <strong>required</strong></mat-error>
|
||||||
} @else if (createClientForm.controls.lastname.hasError('pattern')) {
|
} @else if (createClientForm.controls.lastname.hasError('pattern')) {
|
||||||
|
|||||||
@@ -2590,28 +2590,6 @@ export class ClientGeneralStepComponent implements OnInit, OnDestroy, OnChanges
|
|||||||
dormantFlag: 'ACTIVE'
|
dormantFlag: 'ACTIVE'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Automatically capitalizes the first letter of each word and lowercases the rest.
|
|
||||||
* e.g., "sri rAm" -> "Sri Ram"
|
|
||||||
*/
|
|
||||||
formatName(controlName: string): void {
|
|
||||||
const control = this.createClientForm.get(controlName);
|
|
||||||
if (!control || typeof control.value !== 'string') return;
|
|
||||||
|
|
||||||
const val = control.value;
|
|
||||||
const formatted = val
|
|
||||||
.split(' ')
|
|
||||||
.map((word: string) => {
|
|
||||||
if (!word) return '';
|
|
||||||
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
|
|
||||||
})
|
|
||||||
.join(' ');
|
|
||||||
|
|
||||||
if (formatted !== val) {
|
|
||||||
control.setValue(formatted, { emitEvent: false });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user