Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<h2 mat-dialog-title>{{ title }}</h2>
<mat-dialog-content>
<p>{{ message }}</p>
<form [formGroup]="form" (ngSubmit)="submit()">
<mat-form-field appearance="fill" class="full-width">
<mat-label>Name (as on Aadhaar)</mat-label>
<input matInput formControlName="name" />
<mat-error *ngIf="form.get('name')?.hasError('required')"
>Name is required</mat-error
>
</mat-form-field>

<mat-form-field appearance="fill" class="full-width">
<mat-label>Gender</mat-label>
<mat-select formControlName="gender">
<mat-option value="Male">Male</mat-option>
<mat-option value="Female">Female</mat-option>
<mat-option value="Other">Other</mat-option>
</mat-select>
</mat-form-field>

<mat-form-field appearance="fill" class="full-width">
<mat-label>Year of Birth</mat-label>
<input matInput type="number" formControlName="yearOfBirth" />
<mat-error *ngIf="form.get('yearOfBirth')?.invalid"
>Invalid year</mat-error
>
</mat-form-field>
</form>
</mat-dialog-content>

<mat-dialog-actions align="end">
<button mat-button (click)="cancel()">Cancel</button>
<button mat-flat-button color="primary" (click)="submit()">Resubmit</button>
</mat-dialog-actions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* AMRIT – Accessible Medical Records via Integrated Technology
* Integrated EHR (Electronic Health Records) Solution
*
* Copyright (C) "Piramal Swasthya Management and Research Institute"
*
* This file is part of AMRIT.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
import { Component, Inject } from "@angular/core";
import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";

@Component({
selector: "app-aadhaar-correction-dialog",
templateUrl: "aadhaar-correction-dialog.component.html",
})
export class AadhaarCorrectionDialogComponent {
form: FormGroup;
title: string;
message: string;

constructor(
private fb: FormBuilder,
private dialogRef: MatDialogRef<AadhaarCorrectionDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
) {
this.title = data?.title ?? "Aadhaar correction";
this.message = data?.message ?? "Please correct Aadhaar provided details";
const formData = data?.formData || {};
this.form = this.fb.group({
name: [
formData.name || "",
[Validators.required, Validators.minLength(1)],
],
gender: [formData.gender || "", Validators.required],
yearOfBirth: [
formData.yearOfBirth || new Date().getFullYear(),
[
Validators.required,
Validators.min(1900),
Validators.max(new Date().getFullYear()),
],
],
});
}

submit() {
if (this.form.valid) {
this.dialogRef.close(this.form.value);
} else {
this.form.markAllAsTouched();
}
}

cancel() {
this.dialogRef.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,140 @@ md2-pagination {
.overlay:root {
padding: 0px;
}


/* Aadhaar Verification Panel - Material You pastel style */

.aadhaar-verify-panel {
background: linear-gradient(135deg, #f3f8ff, #f9fbff);
border: 1px solid #dbe7ff;
border-radius: 12px;
padding: 20px;
margin-top: 20px;
box-shadow: 0 1px 4px rgba(25, 118, 210, 0.08);
transition: box-shadow 0.25s ease, background 0.25s ease;

&:hover {
background: #ffffff;
box-shadow: 0 3px 10px rgba(25, 118, 210, 0.1);
}

.aadhaar-header {
display: flex;
justify-content: space-between;
align-items: center;

.aadhaar-heading {
strong {
font-weight: 600;
color: #1a237e;
font-size: 15px;
}

.aadhaar-subtext {
font-size: 12.5px;
color: #5f6368;
margin-top: 2px;
}
}

.aadhaar-reset-btn {
color: #1976d2;
transition: transform 0.15s ease;

&:hover {
transform: rotate(90deg);
}
}
}

.aadhaar-verify-form {
display: flex;
flex-wrap: wrap;
gap: 16px;
margin-top: 14px;

.aadhaar-field {
flex: 1 1 240px;
min-width: 180px;

&.small {
width: 140px;
}

::ng-deep .mat-form-field-flex {
background: #ffffff;
border-radius: 6px;
}
}
}

.aadhaar-actions {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 10px;
margin-top: 16px;

.aadhaar-apply-btn {
background-color: #1976d2;
color: white;
font-weight: 500;
letter-spacing: 0.3px;
border-radius: 8px;
min-width: 190px;

&:hover {
background-color: #1565c0;
}

&:disabled {
background-color: #bbdefb;
color: white;
}
}

.aadhaar-reset-text-btn {
border-color: #1976d2;
color: #1976d2;

&:hover {
background: rgba(25, 118, 210, 0.05);
}
}

.aadhaar-note {
margin-left: 10px;
color: #5f6368;
font-size: 12.5px;
flex: 1 1 100%;
}
}

@media (max-width: 768px) {
padding: 12px;

.aadhaar-verify-form {
flex-direction: column;
}

.aadhaar-actions {
flex-direction: column;
align-items: stretch;

.aadhaar-apply-btn,
.aadhaar-reset-text-btn {
width: 100%;
}

.aadhaar-note {
text-align: center;
margin-top: 8px;
}
}
}
}

/* Optional: subtle transition for mat-form-field focus */
::ng-deep .mat-form-field-appearance-fill .mat-form-field-flex {
transition: box-shadow 0.15s ease;
}
Loading