cloud-ide-core 2.0.144 → 2.0.145
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 +27 -1
- package/fesm2022/cloud-ide-core.mjs.map +1 -1
- package/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -12343,6 +12343,8 @@ class CideCoreUserCreateComponent {
|
|
|
12343
12343
|
// User type information from route data (TEACHER, STUDENT, USER, etc.)
|
|
12344
12344
|
userType = signal(null, ...(ngDevMode ? [{ debugName: "userType" }] : []));
|
|
12345
12345
|
typeSpecificId = signal(null, ...(ngDevMode ? [{ debugName: "typeSpecificId" }] : []));
|
|
12346
|
+
// Track if userType came from query params/route data (to disable dropdown)
|
|
12347
|
+
userTypeFromQueryParams = signal(false, ...(ngDevMode ? [{ debugName: "userTypeFromQueryParams" }] : []));
|
|
12346
12348
|
userTypeOptions = [
|
|
12347
12349
|
{ value: 'STUDENT', label: 'Student' },
|
|
12348
12350
|
{ value: 'TEACHER', label: 'Faculty/Teacher' },
|
|
@@ -13252,13 +13254,37 @@ class CideCoreUserCreateComponent {
|
|
|
13252
13254
|
* Initialize component
|
|
13253
13255
|
*/
|
|
13254
13256
|
initializeComponent() {
|
|
13257
|
+
// Check query params first for userType
|
|
13258
|
+
this.route.queryParams.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(params => {
|
|
13259
|
+
const userTypeParam = params['userType'] || params['filterType'];
|
|
13260
|
+
if (userTypeParam) {
|
|
13261
|
+
const resolvedType = userTypeParam.toString().trim().toUpperCase();
|
|
13262
|
+
// Map common variations
|
|
13263
|
+
let finalType = resolvedType;
|
|
13264
|
+
if (resolvedType === 'FACULTY' || resolvedType === 'TEACHER') {
|
|
13265
|
+
finalType = 'TEACHER';
|
|
13266
|
+
}
|
|
13267
|
+
else if (resolvedType === 'STUDENT') {
|
|
13268
|
+
finalType = 'STUDENT';
|
|
13269
|
+
}
|
|
13270
|
+
this.userType.set(finalType);
|
|
13271
|
+
this.userMasterForm.patchValue({ syutm_user_type: finalType });
|
|
13272
|
+
this.userTypeFromQueryParams.set(true);
|
|
13273
|
+
// Disable the user type control when it comes from query params
|
|
13274
|
+
this.userMasterForm.get('syutm_user_type')?.disable();
|
|
13275
|
+
console.log('👤 User type from query params:', finalType);
|
|
13276
|
+
}
|
|
13277
|
+
});
|
|
13255
13278
|
// Read route data for user type (TEACHER, STUDENT, USER, etc.)
|
|
13256
13279
|
this.route.data.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(data => {
|
|
13257
13280
|
if (data['userType']) {
|
|
13258
13281
|
const type = data['userType'].toString().toUpperCase();
|
|
13259
13282
|
this.userType.set(type);
|
|
13260
13283
|
this.userMasterForm.patchValue({ syutm_user_type: type });
|
|
13261
|
-
|
|
13284
|
+
this.userTypeFromQueryParams.set(true);
|
|
13285
|
+
// Disable the user type control when it comes from route data
|
|
13286
|
+
this.userMasterForm.get('syutm_user_type')?.disable();
|
|
13287
|
+
console.log('👤 User type from route data:', type);
|
|
13262
13288
|
}
|
|
13263
13289
|
if (data['typeSpecificId']) {
|
|
13264
13290
|
this.typeSpecificId.set(data['typeSpecificId']);
|