RajalashmiNagarajan
commited on
Commit
·
b1efa3a
1
Parent(s):
36dc6fe
signin-update
Browse files
src/app/homepage/sign-in/sign-in.component.ts
CHANGED
|
@@ -222,6 +222,17 @@ export class SignInComponent {
|
|
| 222 |
...userData
|
| 223 |
}));
|
| 224 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
this.redirectBasedOnRole(userRole);
|
| 226 |
}
|
| 227 |
|
|
@@ -262,4 +273,13 @@ export class SignInComponent {
|
|
| 262 |
// ensure template updates under OnPush
|
| 263 |
this.cdr.markForCheck();
|
| 264 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
}
|
|
|
|
| 222 |
...userData
|
| 223 |
}));
|
| 224 |
|
| 225 |
+
// Ensure any auth modal/backdrop is closed before navigating
|
| 226 |
+
try {
|
| 227 |
+
window.dispatchEvent(new CustomEvent('auth-close'));
|
| 228 |
+
this.close.emit();
|
| 229 |
+
document.body.classList.remove('modal-open');
|
| 230 |
+
const modal = document.querySelector('.modal');
|
| 231 |
+
if (modal && modal.parentElement) modal.parentElement.removeChild(modal);
|
| 232 |
+
const backdrop = document.querySelector('.modal-backdrop');
|
| 233 |
+
if (backdrop && backdrop.parentElement) backdrop.parentElement.removeChild(backdrop);
|
| 234 |
+
} catch { /* ignore */ }
|
| 235 |
+
|
| 236 |
this.redirectBasedOnRole(userRole);
|
| 237 |
}
|
| 238 |
|
|
|
|
| 273 |
// ensure template updates under OnPush
|
| 274 |
this.cdr.markForCheck();
|
| 275 |
}
|
| 276 |
+
|
| 277 |
+
ngOnDestroy() {
|
| 278 |
+
// Defensive cleanup so returning to homepage never keeps a blurred overlay
|
| 279 |
+
try {
|
| 280 |
+
document.body.classList.remove('modal-open');
|
| 281 |
+
const backdrop = document.querySelector('.modal-backdrop');
|
| 282 |
+
if (backdrop && backdrop.parentElement) backdrop.parentElement.removeChild(backdrop);
|
| 283 |
+
} catch { /* ignore */ }
|
| 284 |
+
}
|
| 285 |
}
|
src/app/homepage/sign-up/sign-up.component.html
CHANGED
|
@@ -53,6 +53,7 @@
|
|
| 53 |
<div class="form-field role-field-wrapper">
|
| 54 |
<label for="roleGroup">Role Group <span class="required-star">*</span>
|
| 55 |
<span class="label-cross" *ngIf="submitted && controlHasError('roleGroup')" aria-hidden="true">✖</span>
|
|
|
|
| 56 |
</label>
|
| 57 |
<select id="roleGroup" formControlName="roleGroup" (change)="onRoleGroupChange($any($event.target).value)" aria-label="Role group" [class.input-invalid]="submitted && controlHasError('roleGroup')">
|
| 58 |
<option value="">-- Select role group --</option>
|
|
@@ -183,9 +184,9 @@
|
|
| 183 |
</div>
|
| 184 |
|
| 185 |
<!-- Floating Info Popup -->
|
| 186 |
-
<div *ngIf="showInfo" class="info-popup-bg">
|
| 187 |
-
<div class="info-popup">
|
| 188 |
-
<button class="info-close" type="button" (click)="showInfo = false">×</button>
|
| 189 |
<div class="info-title">Role Information</div>
|
| 190 |
|
| 191 |
<div class="info-text">
|
|
|
|
| 53 |
<div class="form-field role-field-wrapper">
|
| 54 |
<label for="roleGroup">Role Group <span class="required-star">*</span>
|
| 55 |
<span class="label-cross" *ngIf="submitted && controlHasError('roleGroup')" aria-hidden="true">✖</span>
|
| 56 |
+
<button type="button" class="info-btn" (click)="showInfo = true" aria-label="Role info">i</button>
|
| 57 |
</label>
|
| 58 |
<select id="roleGroup" formControlName="roleGroup" (change)="onRoleGroupChange($any($event.target).value)" aria-label="Role group" [class.input-invalid]="submitted && controlHasError('roleGroup')">
|
| 59 |
<option value="">-- Select role group --</option>
|
|
|
|
| 184 |
</div>
|
| 185 |
|
| 186 |
<!-- Floating Info Popup -->
|
| 187 |
+
<div *ngIf="showInfo" class="info-popup-bg" (click)="showInfo = false">
|
| 188 |
+
<div class="info-popup" (click)="$event.stopPropagation()">
|
| 189 |
+
<button class="info-close" type="button" (click)="showInfo = false" aria-label="Close">×</button>
|
| 190 |
<div class="info-title">Role Information</div>
|
| 191 |
|
| 192 |
<div class="info-text">
|
src/environments/environment.ts
CHANGED
|
@@ -9,7 +9,7 @@ const isLocal =
|
|
| 9 |
|
| 10 |
// Decide API URL based on where the app is running
|
| 11 |
const pyDetectApiUrl = isLocal
|
| 12 |
-
? 'http://127.0.0.1:
|
| 13 |
: 'https://pykara-Py-detect-backend.hf.space'; // Hugging Face backend
|
| 14 |
|
| 15 |
export const environment = {
|
|
|
|
| 9 |
|
| 10 |
// Decide API URL based on where the app is running
|
| 11 |
const pyDetectApiUrl = isLocal
|
| 12 |
+
? 'http://127.0.0.1:5002' // your local Flask
|
| 13 |
: 'https://pykara-Py-detect-backend.hf.space'; // Hugging Face backend
|
| 14 |
|
| 15 |
export const environment = {
|