cloud-ide-core 2.0.116 → 2.0.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/cloud-ide-core.mjs +80 -26
- package/fesm2022/cloud-ide-core.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -15336,44 +15336,98 @@ class CideCoreUserCreateComponent {
|
|
|
15336
15336
|
this.loading.set(false);
|
|
15337
15337
|
const userTypeLabel = this.getUserTypeLabel();
|
|
15338
15338
|
const userType = this.userType()?.toUpperCase();
|
|
15339
|
+
const responseData = response;
|
|
15340
|
+
const responseGeneratedId = responseData?.data?.syutm_type_specific_id;
|
|
15341
|
+
const responseUserType = responseData?.data?.syutm_user_type || formUserType;
|
|
15339
15342
|
if (this.isEditMode()) {
|
|
15340
|
-
// In edit mode,
|
|
15341
|
-
|
|
15342
|
-
|
|
15343
|
-
|
|
15343
|
+
// In edit mode, check if we received a reference ID that wasn't in the payload
|
|
15344
|
+
const payloadTypeSpecificId = formTypeSpecificId || '';
|
|
15345
|
+
const hasIdInPayload = !!payloadTypeSpecificId && payloadTypeSpecificId.trim() !== '';
|
|
15346
|
+
console.log('🔍 Edit mode - Checking for reference ID:', {
|
|
15347
|
+
payloadId: payloadTypeSpecificId,
|
|
15348
|
+
responseId: responseGeneratedId,
|
|
15349
|
+
hasIdInPayload,
|
|
15350
|
+
responseUserType
|
|
15344
15351
|
});
|
|
15352
|
+
// If we didn't have an ID in payload but received one in response, show popup
|
|
15353
|
+
if (!hasIdInPayload && responseGeneratedId &&
|
|
15354
|
+
(responseUserType === 'STUDENT' || responseUserType === 'TEACHER' || responseUserType === 'FACULTY')) {
|
|
15355
|
+
const idLabel = responseUserType === 'STUDENT' ? 'Student ID' : 'Faculty ID';
|
|
15356
|
+
console.log('✅ Showing confirmation popup for edit with generated ID:', { idLabel, responseGeneratedId });
|
|
15357
|
+
this.notificationService.success(`${userTypeLabel} updated successfully!\n\n${idLabel}: ${responseGeneratedId}`, {
|
|
15358
|
+
title: `${userTypeLabel} Updated Successfully`,
|
|
15359
|
+
duration: 10000
|
|
15360
|
+
});
|
|
15361
|
+
}
|
|
15362
|
+
else {
|
|
15363
|
+
// Regular update notification
|
|
15364
|
+
this.notificationService.success(`${userTypeLabel} updated successfully! All changes have been saved.`, {
|
|
15365
|
+
title: `${userTypeLabel} Updated`,
|
|
15366
|
+
duration: 5000
|
|
15367
|
+
});
|
|
15368
|
+
}
|
|
15345
15369
|
console.log(`${userTypeLabel} updated successfully`);
|
|
15346
15370
|
}
|
|
15347
15371
|
else {
|
|
15348
|
-
//
|
|
15349
|
-
|
|
15350
|
-
|
|
15351
|
-
|
|
15372
|
+
// Create mode - Debug logging to see what we're getting
|
|
15373
|
+
console.log('🔍 Create mode - Response data for confirmation popup:', {
|
|
15374
|
+
fullResponse: response,
|
|
15375
|
+
responseData: responseData,
|
|
15376
|
+
dataObject: responseData?.data,
|
|
15377
|
+
generatedId: responseGeneratedId,
|
|
15378
|
+
userType: responseUserType,
|
|
15379
|
+
formUserType: formUserType
|
|
15380
|
+
});
|
|
15381
|
+
console.log('🎯 Create mode - Extracted values:', {
|
|
15382
|
+
generatedId: responseGeneratedId,
|
|
15383
|
+
responseUserType,
|
|
15384
|
+
formUserType
|
|
15352
15385
|
});
|
|
15353
|
-
const responseData = response;
|
|
15354
|
-
const generatedId = responseData?.data?.syutm_type_specific_id || responseData?.syutm_type_specific_id;
|
|
15355
|
-
const responseUserType = responseData?.data?.syutm_user_type || responseData?.syutm_user_type || formUserType;
|
|
15356
15386
|
// If a type-specific ID was auto-generated/returned, show it in a confirmation popup
|
|
15357
|
-
if (
|
|
15387
|
+
if (responseGeneratedId && (responseUserType === 'STUDENT' || responseUserType === 'TEACHER' || responseUserType === 'FACULTY')) {
|
|
15358
15388
|
const idLabel = responseUserType === 'STUDENT' ? 'Student ID' : 'Faculty ID';
|
|
15359
|
-
|
|
15389
|
+
console.log('✅ Showing confirmation popup with:', { idLabel, generatedId: responseGeneratedId, userTypeLabel });
|
|
15390
|
+
// Show a prominent confirmation popup with the generated ID
|
|
15391
|
+
this.notificationService.success(`${userTypeLabel} created successfully!\n\n${idLabel}: ${responseGeneratedId}`, {
|
|
15360
15392
|
title: `${userTypeLabel} Created Successfully`,
|
|
15361
|
-
duration:
|
|
15393
|
+
duration: 10000
|
|
15362
15394
|
});
|
|
15363
|
-
|
|
15364
|
-
|
|
15365
|
-
|
|
15366
|
-
|
|
15367
|
-
|
|
15368
|
-
|
|
15369
|
-
|
|
15370
|
-
|
|
15371
|
-
|
|
15395
|
+
// Delay navigation to ensure the notification is visible
|
|
15396
|
+
setTimeout(() => {
|
|
15397
|
+
// Navigate to appropriate listing page based on user type
|
|
15398
|
+
if (userType === 'TEACHER' || userType === 'FACULTY') {
|
|
15399
|
+
this.router.navigate(['/control-panel/teacher']);
|
|
15400
|
+
}
|
|
15401
|
+
else if (userType === 'STUDENT') {
|
|
15402
|
+
this.router.navigate(['/control-panel/student']);
|
|
15403
|
+
}
|
|
15404
|
+
else {
|
|
15405
|
+
this.router.navigate(['/control-panel']);
|
|
15406
|
+
}
|
|
15407
|
+
}, 2000); // Wait 2 seconds before navigating
|
|
15372
15408
|
}
|
|
15373
15409
|
else {
|
|
15374
|
-
|
|
15375
|
-
|
|
15376
|
-
|
|
15410
|
+
console.warn('⚠️ Confirmation popup not shown. Reason:', {
|
|
15411
|
+
hasGeneratedId: !!responseGeneratedId,
|
|
15412
|
+
responseUserType,
|
|
15413
|
+
formUserType,
|
|
15414
|
+
condition: responseUserType === 'STUDENT' || responseUserType === 'TEACHER' || responseUserType === 'FACULTY'
|
|
15415
|
+
});
|
|
15416
|
+
// Show basic success notification if no ID to show
|
|
15417
|
+
this.notificationService.success(`${userTypeLabel} created successfully!`, {
|
|
15418
|
+
title: `${userTypeLabel} Created`,
|
|
15419
|
+
duration: 5000
|
|
15420
|
+
});
|
|
15421
|
+
// Navigate to appropriate listing page based on user type
|
|
15422
|
+
if (userType === 'TEACHER' || userType === 'FACULTY') {
|
|
15423
|
+
this.router.navigate(['/control-panel/teacher']);
|
|
15424
|
+
}
|
|
15425
|
+
else if (userType === 'STUDENT') {
|
|
15426
|
+
this.router.navigate(['/control-panel/student']);
|
|
15427
|
+
}
|
|
15428
|
+
else {
|
|
15429
|
+
this.router.navigate(['/control-panel']);
|
|
15430
|
+
}
|
|
15377
15431
|
}
|
|
15378
15432
|
}
|
|
15379
15433
|
},
|