cloud-ide-core 2.0.114 → 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.
@@ -15336,33 +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, show success notification
15341
- this.notificationService.success(`${userTypeLabel} updated successfully! All changes have been saved.`, {
15342
- title: `${userTypeLabel} Updated`,
15343
- duration: 5000
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
- // In create mode, show success notification and navigate to listing page
15349
- this.notificationService.success(`${userTypeLabel} created successfully!`, {
15350
- title: `${userTypeLabel} Created`,
15351
- duration: 5000
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
15352
15380
  });
15353
- // Navigate to appropriate listing page based on user type
15354
- if (userType === 'TEACHER' || userType === 'FACULTY') {
15355
- // Navigate to teacher listing page
15356
- this.router.navigate(['/control-panel/teacher']);
15357
- }
15358
- else if (userType === 'STUDENT') {
15359
- // Navigate to student listing page
15360
- this.router.navigate(['/control-panel/student']);
15381
+ console.log('🎯 Create mode - Extracted values:', {
15382
+ generatedId: responseGeneratedId,
15383
+ responseUserType,
15384
+ formUserType
15385
+ });
15386
+ // If a type-specific ID was auto-generated/returned, show it in a confirmation popup
15387
+ if (responseGeneratedId && (responseUserType === 'STUDENT' || responseUserType === 'TEACHER' || responseUserType === 'FACULTY')) {
15388
+ const idLabel = responseUserType === 'STUDENT' ? 'Student ID' : 'Faculty ID';
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}`, {
15392
+ title: `${userTypeLabel} Created Successfully`,
15393
+ duration: 10000
15394
+ });
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
15361
15408
  }
15362
15409
  else {
15363
- // Default to user management listing page (if exists) or stay on page
15364
- // For now, navigate back - you can update this to a specific user listing route if it exists
15365
- this.router.navigate(['/control-panel']);
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
+ }
15366
15431
  }
15367
15432
  }
15368
15433
  },