cloud-ide-core 2.0.55 → 2.0.58
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 +166 -114
- package/fesm2022/cloud-ide-core.mjs.map +1 -1
- package/index.d.ts +15 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { authGuard, CideSharedOrgStructureComponent } from 'cloud-ide-shared';
|
|
1
|
+
import { authGuard, SharedObjectIdService, CideSharedOrgStructureComponent } from 'cloud-ide-shared';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Injectable, Component, inject, DestroyRef, viewChild, signal, computed, input, output, ChangeDetectorRef, ViewChild } from '@angular/core';
|
|
4
4
|
import * as i1$1 from '@angular/common';
|
|
@@ -9613,6 +9613,8 @@ class CideCoreEntityCreateComponent {
|
|
|
9613
9613
|
breadcrumbData = signal([], ...(ngDevMode ? [{ debugName: "breadcrumbData" }] : []));
|
|
9614
9614
|
// Reactive form
|
|
9615
9615
|
entityForm;
|
|
9616
|
+
// Generated entity ID - created during form initialization
|
|
9617
|
+
generatedEntityId = null;
|
|
9616
9618
|
entityTypes = signal([], ...(ngDevMode ? [{ debugName: "entityTypes" }] : []));
|
|
9617
9619
|
currencies = signal([], ...(ngDevMode ? [{ debugName: "currencies" }] : []));
|
|
9618
9620
|
users = signal([], ...(ngDevMode ? [{ debugName: "users" }] : []));
|
|
@@ -9726,6 +9728,7 @@ class CideCoreEntityCreateComponent {
|
|
|
9726
9728
|
route = inject(ActivatedRoute);
|
|
9727
9729
|
router = inject(Router);
|
|
9728
9730
|
fileManagerService = inject(CideEleFileManagerService);
|
|
9731
|
+
sharedObjectIdService = inject(SharedObjectIdService);
|
|
9729
9732
|
destroy$ = new Subject();
|
|
9730
9733
|
globalErrorHandler;
|
|
9731
9734
|
globalRejectionHandler;
|
|
@@ -9796,6 +9799,8 @@ class CideCoreEntityCreateComponent {
|
|
|
9796
9799
|
// Store handlers for cleanup
|
|
9797
9800
|
this.globalErrorHandler = errorHandler;
|
|
9798
9801
|
this.globalRejectionHandler = rejectionHandler;
|
|
9802
|
+
// Generate entity ID during form initialization
|
|
9803
|
+
this.generateEntityId();
|
|
9799
9804
|
// Initialize dropdown options
|
|
9800
9805
|
// this.initializeDropdownOptions(); // Removed - using shared wrapper breadcrumb system
|
|
9801
9806
|
// Check for entity ID in query parameters
|
|
@@ -10073,80 +10078,96 @@ class CideCoreEntityCreateComponent {
|
|
|
10073
10078
|
}
|
|
10074
10079
|
});
|
|
10075
10080
|
}
|
|
10081
|
+
/**
|
|
10082
|
+
* Generate entity ID during form initialization
|
|
10083
|
+
* This ID will be used for the entity and its mappings
|
|
10084
|
+
*/
|
|
10085
|
+
generateEntityId() {
|
|
10086
|
+
this.sharedObjectIdService.generateObjectId().subscribe({
|
|
10087
|
+
next: (response) => {
|
|
10088
|
+
if (response?.success && response?.data?.objectId) {
|
|
10089
|
+
this.generatedEntityId = response.data.objectId;
|
|
10090
|
+
console.log('🆔 [EntityCreate] Generated entity ID during initialization:', this.generatedEntityId);
|
|
10091
|
+
}
|
|
10092
|
+
else {
|
|
10093
|
+
console.error('❌ [EntityCreate] Failed to generate entity ID');
|
|
10094
|
+
}
|
|
10095
|
+
},
|
|
10096
|
+
error: (error) => {
|
|
10097
|
+
console.error('❌ [EntityCreate] Error generating entity ID:', error);
|
|
10098
|
+
}
|
|
10099
|
+
});
|
|
10100
|
+
}
|
|
10076
10101
|
addUserMapping() {
|
|
10077
10102
|
if (this.userMappingForm.valid) {
|
|
10078
10103
|
const formValue = this.userMappingForm.value;
|
|
10079
|
-
//
|
|
10080
|
-
this.
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
error: (err) => {
|
|
10138
|
-
console.error('Error generating mapping ID:', err);
|
|
10139
|
-
this.notificationService.error('Failed to generate mapping ID');
|
|
10140
|
-
}
|
|
10104
|
+
// Check if entity ID is available
|
|
10105
|
+
if (!this.generatedEntityId) {
|
|
10106
|
+
console.error('❌ [EntityCreate] Entity ID not generated yet');
|
|
10107
|
+
this.notificationService.error('Entity ID not ready. Please try again.');
|
|
10108
|
+
return;
|
|
10109
|
+
}
|
|
10110
|
+
// Generate mapping ID using shared service
|
|
10111
|
+
this.sharedObjectIdService.generateObjectId().subscribe({
|
|
10112
|
+
next: (mappingResponse) => {
|
|
10113
|
+
if (mappingResponse?.success && mappingResponse?.data?.objectId) {
|
|
10114
|
+
const generatedMappingId = mappingResponse.data.objectId;
|
|
10115
|
+
// Check if user is already mapped to any entity
|
|
10116
|
+
const existingMapping = this.userEntityMappings().find(m => m.syenm_id_user === formValue.syenm_id_user);
|
|
10117
|
+
if (existingMapping) {
|
|
10118
|
+
this.notificationService.error('This user is already mapped to an entity');
|
|
10119
|
+
return;
|
|
10120
|
+
}
|
|
10121
|
+
// Find user details from available users
|
|
10122
|
+
const selectedUser = this.availableUsers().find(u => u.value === formValue.syenm_id_user);
|
|
10123
|
+
if (!selectedUser) {
|
|
10124
|
+
this.notificationService.error('Selected user not found');
|
|
10125
|
+
return;
|
|
10126
|
+
}
|
|
10127
|
+
const newMapping = {
|
|
10128
|
+
_id: generatedMappingId, // Use generated mapping ID
|
|
10129
|
+
syenm_id_user: formValue.syenm_id_user, // Store user ID as string
|
|
10130
|
+
_displayUserName: selectedUser.label, // Store user name for display
|
|
10131
|
+
syenm_id_logses: '',
|
|
10132
|
+
syenm_entity_id_syen: this.generatedEntityId, // Use pre-generated entity ID
|
|
10133
|
+
syenm_role_id_syusrol: undefined, // Set to undefined as requested
|
|
10134
|
+
syenm_designation_id_sydsg: undefined, // Set to undefined as requested
|
|
10135
|
+
syenm_department_id_sydept: undefined, // Set to undefined as requested
|
|
10136
|
+
syenm_activefrom: new Date().toISOString().split('T')[0], // Default to today
|
|
10137
|
+
syenm_activeupto: '', // Default to empty
|
|
10138
|
+
syenm_isdefault: false, // Always false
|
|
10139
|
+
syenm_isactive: true, // Always active
|
|
10140
|
+
syenm_isloggedin: false // Always false
|
|
10141
|
+
};
|
|
10142
|
+
console.log('🍞 Selected user:', newMapping);
|
|
10143
|
+
// Add to existing mappings
|
|
10144
|
+
const currentMappings = this.userEntityMappings();
|
|
10145
|
+
const updatedMappings = [...currentMappings, newMapping];
|
|
10146
|
+
// Update signal first
|
|
10147
|
+
this.userEntityMappings.set(updatedMappings);
|
|
10148
|
+
// Update grid config data - create new reference to trigger change detection
|
|
10149
|
+
this.userMappingsGridConfig = {
|
|
10150
|
+
...this.userMappingsGridConfig,
|
|
10151
|
+
data: updatedMappings
|
|
10152
|
+
};
|
|
10153
|
+
// Reset form
|
|
10154
|
+
this.userMappingForm.reset({
|
|
10155
|
+
syenm_id_user: ''
|
|
10156
|
+
});
|
|
10157
|
+
this.notificationService.success('User mapping added successfully');
|
|
10158
|
+
console.log('✅ [EntityCreate] User mapped successfully:', {
|
|
10159
|
+
userId: formValue.syenm_id_user,
|
|
10160
|
+
entityId: this.generatedEntityId,
|
|
10161
|
+
mappingId: generatedMappingId
|
|
10141
10162
|
});
|
|
10142
10163
|
}
|
|
10143
10164
|
else {
|
|
10144
|
-
this.notificationService.error('Failed to generate
|
|
10165
|
+
this.notificationService.error('Failed to generate mapping ID');
|
|
10145
10166
|
}
|
|
10146
10167
|
},
|
|
10147
10168
|
error: (err) => {
|
|
10148
|
-
console.error('Error generating
|
|
10149
|
-
this.notificationService.error('Failed to generate
|
|
10169
|
+
console.error('Error generating mapping ID:', err);
|
|
10170
|
+
this.notificationService.error('Failed to generate mapping ID');
|
|
10150
10171
|
}
|
|
10151
10172
|
});
|
|
10152
10173
|
}
|
|
@@ -11474,7 +11495,6 @@ class CideCoreOrgStructureComponent {
|
|
|
11474
11495
|
allowSwitching = input(true, ...(ngDevMode ? [{ debugName: "allowSwitching" }] : [])); // Allow entity switching (default: true)
|
|
11475
11496
|
showActions = input(true, ...(ngDevMode ? [{ debugName: "showActions" }] : [])); // Show action buttons (default: true)
|
|
11476
11497
|
mode = input('view', ...(ngDevMode ? [{ debugName: "mode" }] : [])); // Mode: selection or view-only
|
|
11477
|
-
useSharedWrapper = input(true, ...(ngDevMode ? [{ debugName: "useSharedWrapper" }] : [])); // Use shared wrapper (default: true)
|
|
11478
11498
|
// Output events
|
|
11479
11499
|
entityClick = output(); // Emit when entity is clicked
|
|
11480
11500
|
entitySelect = output(); // Emit when entity is selected for switching
|
|
@@ -11484,6 +11504,12 @@ class CideCoreOrgStructureComponent {
|
|
|
11484
11504
|
ngOnInit() {
|
|
11485
11505
|
// No initialization needed - shared component handles everything
|
|
11486
11506
|
}
|
|
11507
|
+
/**
|
|
11508
|
+
* Navigate back to entity list
|
|
11509
|
+
*/
|
|
11510
|
+
onBack() {
|
|
11511
|
+
this.router.navigate(['/control-panel/entity-list']);
|
|
11512
|
+
}
|
|
11487
11513
|
/**
|
|
11488
11514
|
* Handle entity click event from shared org structure
|
|
11489
11515
|
*/
|
|
@@ -11503,33 +11529,67 @@ class CideCoreOrgStructureComponent {
|
|
|
11503
11529
|
this.entityView.emit(entity);
|
|
11504
11530
|
}
|
|
11505
11531
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideCoreOrgStructureComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11506
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: CideCoreOrgStructureComponent, isStandalone: true, selector: "cide-core-org-structure", inputs: { allowSwitching: { classPropertyName: "allowSwitching", publicName: "allowSwitching", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }
|
|
11507
|
-
<cide-shared-
|
|
11508
|
-
|
|
11509
|
-
|
|
11510
|
-
|
|
11511
|
-
|
|
11512
|
-
|
|
11513
|
-
|
|
11514
|
-
|
|
11515
|
-
|
|
11516
|
-
|
|
11532
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: CideCoreOrgStructureComponent, isStandalone: true, selector: "cide-core-org-structure", inputs: { allowSwitching: { classPropertyName: "allowSwitching", publicName: "allowSwitching", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { entityClick: "entityClick", entitySelect: "entitySelect", entityView: "entityView" }, ngImport: i0, template: `
|
|
11533
|
+
<cide-lyt-shared-wrapper [shared_wrapper_setup_param]="{ sypg_page_code: 'org_structure' }">
|
|
11534
|
+
|
|
11535
|
+
<!-- Back Button using standard content projection -->
|
|
11536
|
+
<div breadcrumb-actions>
|
|
11537
|
+
<button
|
|
11538
|
+
cideEleButton
|
|
11539
|
+
variant="outline"
|
|
11540
|
+
size="xs"
|
|
11541
|
+
(click)="onBack()"
|
|
11542
|
+
class="tw-whitespace-nowrap tw-flex tw-items-center">
|
|
11543
|
+
<cide-ele-icon size="xs" class="tw-w-6 tw-h-5">arrow_back</cide-ele-icon>
|
|
11544
|
+
Back to Entities
|
|
11545
|
+
</button>
|
|
11546
|
+
</div>
|
|
11547
|
+
|
|
11548
|
+
<!-- Shared Org Structure Component -->
|
|
11549
|
+
<cide-shared-org-structure
|
|
11550
|
+
[allowSwitching]="allowSwitching()"
|
|
11551
|
+
[showActions]="showActions()"
|
|
11552
|
+
[mode]="mode()"
|
|
11553
|
+
(entityClick)="onEntityClick($event)"
|
|
11554
|
+
(entitySelect)="onEntitySelect($event)"
|
|
11555
|
+
(entityView)="onEntityView($event)">
|
|
11556
|
+
</cide-shared-org-structure>
|
|
11557
|
+
</cide-lyt-shared-wrapper>
|
|
11558
|
+
`, isInline: true, styles: [":host{height:100%;display:flex;flex-direction:column}.tw-overflow-y-auto::-webkit-scrollbar{width:6px}.tw-overflow-y-auto::-webkit-scrollbar-track{background:#f1f5f9;border-radius:3px}.tw-overflow-y-auto::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:3px}.tw-overflow-y-auto::-webkit-scrollbar-thumb:hover{background:#94a3b8}.tw-transition-shadow{transition:box-shadow .2s ease-in-out}.tw-shadow-lg:hover{box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a;transform:translateY(-2px);transition:all .2s ease-in-out}.tw-bg-purple-300,.tw-bg-purple-400{transition:all .3s ease-in-out}.connection-line-compact{display:block;overflow:visible}.connection-line-compact path,.connection-line-compact line{stroke-linecap:round;stroke-linejoin:round;transition:stroke-width .2s ease}.connection-line-compact:hover path,.connection-line-compact:hover line{stroke-width:3}.connection-line-compact circle{transition:all .2s ease}.connection-line-compact circle:hover{filter:drop-shadow(0 2px 4px rgba(147,51,234,.4))}.level-0{border-color:#fb923c!important}.level-1{border-color:#60a5fa!important}.level-2{border-color:#a78bfa!important}.level-3{border-color:#4ade80!important}.level-4{border-color:#818cf8!important}.level-5{border-color:#f472b6!important}@media (max-width: 1200px){.tw-max-w-7xl{max-width:100%}.tw-gap-6{gap:1rem}.tw-min-w-64{min-width:14rem}.tw-max-w-72{max-width:16rem}}@media (max-width: 768px){.tw-min-w-64{min-width:12rem}.tw-max-w-72{max-width:14rem}.tw-max-w-7xl{max-width:100%}.tw-gap-6{gap:.75rem}.tw-p-4{padding:.75rem}.tw-mb-4{margin-bottom:.75rem}.tw-space-x-3{gap:.5rem}.tw-space-x-2{gap:.375rem}.tw-w-12{width:2.5rem}.tw-h-12{height:2.5rem}}@media (max-width: 480px){.tw-min-w-72{min-width:12rem}.tw-max-w-80{max-width:14rem}.tw-p-4{padding:.5rem}.tw-space-x-3{gap:.375rem}.tw-space-x-2{gap:.25rem}.tw-mb-3{margin-bottom:.5rem}.tw-w-12{width:2rem}.tw-h-12{height:2rem}.tw-w-8{width:1.5rem}.tw-h-8{height:1.5rem}}@media print{.tw-bg-gray-50{background:#fff!important}.tw-shadow-lg{box-shadow:none!important;border:1px solid #e5e7eb!important}.tw-bg-purple-300{background:#6b7280!important}.tw-border-purple-300{border-color:#6b7280!important}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: CideSharedOrgStructureComponent, selector: "cide-shared-org-structure", inputs: ["allowSwitching", "showActions", "mode"], outputs: ["entityClick", "entitySelect", "entityView"] }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip"] }, { kind: "component", type: CideLytSharedWrapperComponent, selector: "cide-lyt-shared-wrapper", inputs: ["shared_wrapper_setup_param", "breadcrumb_data"] }] });
|
|
11517
11559
|
}
|
|
11518
11560
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideCoreOrgStructureComponent, decorators: [{
|
|
11519
11561
|
type: Component,
|
|
11520
11562
|
args: [{ selector: 'cide-core-org-structure', standalone: true, imports: [
|
|
11521
11563
|
CommonModule,
|
|
11522
|
-
CideSharedOrgStructureComponent
|
|
11564
|
+
CideSharedOrgStructureComponent,
|
|
11565
|
+
CideIconComponent,
|
|
11566
|
+
CideLytSharedWrapperComponent
|
|
11523
11567
|
], template: `
|
|
11524
|
-
<cide-shared-
|
|
11525
|
-
|
|
11526
|
-
|
|
11527
|
-
|
|
11528
|
-
|
|
11529
|
-
|
|
11530
|
-
|
|
11531
|
-
|
|
11532
|
-
|
|
11568
|
+
<cide-lyt-shared-wrapper [shared_wrapper_setup_param]="{ sypg_page_code: 'org_structure' }">
|
|
11569
|
+
|
|
11570
|
+
<!-- Back Button using standard content projection -->
|
|
11571
|
+
<div breadcrumb-actions>
|
|
11572
|
+
<button
|
|
11573
|
+
cideEleButton
|
|
11574
|
+
variant="outline"
|
|
11575
|
+
size="xs"
|
|
11576
|
+
(click)="onBack()"
|
|
11577
|
+
class="tw-whitespace-nowrap tw-flex tw-items-center">
|
|
11578
|
+
<cide-ele-icon size="xs" class="tw-w-6 tw-h-5">arrow_back</cide-ele-icon>
|
|
11579
|
+
Back to Entities
|
|
11580
|
+
</button>
|
|
11581
|
+
</div>
|
|
11582
|
+
|
|
11583
|
+
<!-- Shared Org Structure Component -->
|
|
11584
|
+
<cide-shared-org-structure
|
|
11585
|
+
[allowSwitching]="allowSwitching()"
|
|
11586
|
+
[showActions]="showActions()"
|
|
11587
|
+
[mode]="mode()"
|
|
11588
|
+
(entityClick)="onEntityClick($event)"
|
|
11589
|
+
(entitySelect)="onEntitySelect($event)"
|
|
11590
|
+
(entityView)="onEntityView($event)">
|
|
11591
|
+
</cide-shared-org-structure>
|
|
11592
|
+
</cide-lyt-shared-wrapper>
|
|
11533
11593
|
`, styles: [":host{height:100%;display:flex;flex-direction:column}.tw-overflow-y-auto::-webkit-scrollbar{width:6px}.tw-overflow-y-auto::-webkit-scrollbar-track{background:#f1f5f9;border-radius:3px}.tw-overflow-y-auto::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:3px}.tw-overflow-y-auto::-webkit-scrollbar-thumb:hover{background:#94a3b8}.tw-transition-shadow{transition:box-shadow .2s ease-in-out}.tw-shadow-lg:hover{box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a;transform:translateY(-2px);transition:all .2s ease-in-out}.tw-bg-purple-300,.tw-bg-purple-400{transition:all .3s ease-in-out}.connection-line-compact{display:block;overflow:visible}.connection-line-compact path,.connection-line-compact line{stroke-linecap:round;stroke-linejoin:round;transition:stroke-width .2s ease}.connection-line-compact:hover path,.connection-line-compact:hover line{stroke-width:3}.connection-line-compact circle{transition:all .2s ease}.connection-line-compact circle:hover{filter:drop-shadow(0 2px 4px rgba(147,51,234,.4))}.level-0{border-color:#fb923c!important}.level-1{border-color:#60a5fa!important}.level-2{border-color:#a78bfa!important}.level-3{border-color:#4ade80!important}.level-4{border-color:#818cf8!important}.level-5{border-color:#f472b6!important}@media (max-width: 1200px){.tw-max-w-7xl{max-width:100%}.tw-gap-6{gap:1rem}.tw-min-w-64{min-width:14rem}.tw-max-w-72{max-width:16rem}}@media (max-width: 768px){.tw-min-w-64{min-width:12rem}.tw-max-w-72{max-width:14rem}.tw-max-w-7xl{max-width:100%}.tw-gap-6{gap:.75rem}.tw-p-4{padding:.75rem}.tw-mb-4{margin-bottom:.75rem}.tw-space-x-3{gap:.5rem}.tw-space-x-2{gap:.375rem}.tw-w-12{width:2.5rem}.tw-h-12{height:2.5rem}}@media (max-width: 480px){.tw-min-w-72{min-width:12rem}.tw-max-w-80{max-width:14rem}.tw-p-4{padding:.5rem}.tw-space-x-3{gap:.375rem}.tw-space-x-2{gap:.25rem}.tw-mb-3{margin-bottom:.5rem}.tw-w-12{width:2rem}.tw-h-12{height:2rem}.tw-w-8{width:1.5rem}.tw-h-8{height:1.5rem}}@media print{.tw-bg-gray-50{background:#fff!important}.tw-shadow-lg{box-shadow:none!important;border:1px solid #e5e7eb!important}.tw-bg-purple-300{background:#6b7280!important}.tw-border-purple-300{border-color:#6b7280!important}}\n"] }]
|
|
11534
11594
|
}] });
|
|
11535
11595
|
|
|
@@ -11560,6 +11620,7 @@ class CideCoreUserCreateComponent {
|
|
|
11560
11620
|
appState = inject(AppStateHelperService);
|
|
11561
11621
|
floatingFeaturesService = inject(CideEleFloatingFeaturesService);
|
|
11562
11622
|
fileManagerService = inject(CideEleFileManagerService);
|
|
11623
|
+
sharedObjectIdService = inject(SharedObjectIdService);
|
|
11563
11624
|
entityRightsService = inject(CideLytFloatingEntityRightsSharingService);
|
|
11564
11625
|
notificationService = inject(NotificationService);
|
|
11565
11626
|
userMasterForm;
|
|
@@ -14288,11 +14349,11 @@ class CideCoreUserCreateComponent {
|
|
|
14288
14349
|
console.log('📸 Profile photo preview will be loaded by file-input component for ID:', fileId);
|
|
14289
14350
|
}
|
|
14290
14351
|
addContactAddress() {
|
|
14291
|
-
// Generate a new ObjectId for the address
|
|
14292
|
-
this.
|
|
14352
|
+
// Generate a new ObjectId for the address using shared service
|
|
14353
|
+
this.sharedObjectIdService.generateObjectId().subscribe({
|
|
14293
14354
|
next: (response) => {
|
|
14294
14355
|
const newObjectId = response.data?.objectId;
|
|
14295
|
-
console.log('🆔 [UserCreate] Generated new ObjectId for address:', newObjectId);
|
|
14356
|
+
console.log('🆔 [UserCreate] Generated new ObjectId for address via SharedObjectIdService:', newObjectId);
|
|
14296
14357
|
// Create entity access pass management record with owner rights
|
|
14297
14358
|
const currentUser = this.appState.currentUser();
|
|
14298
14359
|
const currentEntity = this.appState.activeEntity();
|
|
@@ -14441,11 +14502,11 @@ class CideCoreUserCreateComponent {
|
|
|
14441
14502
|
});
|
|
14442
14503
|
}
|
|
14443
14504
|
addDocument() {
|
|
14444
|
-
// Generate a new ObjectId for the document
|
|
14445
|
-
this.
|
|
14505
|
+
// Generate a new ObjectId for the document using shared service
|
|
14506
|
+
this.sharedObjectIdService.generateObjectId().subscribe({
|
|
14446
14507
|
next: (response) => {
|
|
14447
14508
|
const newObjectId = response.data?.objectId;
|
|
14448
|
-
console.log('🆔 [UserCreate] Generated new ObjectId for document:', newObjectId);
|
|
14509
|
+
console.log('🆔 [UserCreate] Generated new ObjectId for document via SharedObjectIdService:', newObjectId);
|
|
14449
14510
|
// Create entity access pass management record with owner rights
|
|
14450
14511
|
const currentUser = this.appState.currentUser();
|
|
14451
14512
|
const currentEntity = this.appState.activeEntity();
|
|
@@ -14519,11 +14580,11 @@ class CideCoreUserCreateComponent {
|
|
|
14519
14580
|
this.applyDocumentAccessControl();
|
|
14520
14581
|
}
|
|
14521
14582
|
addFamilyDetail() {
|
|
14522
|
-
// Generate a new ObjectId for the family detail
|
|
14523
|
-
this.
|
|
14583
|
+
// Generate a new ObjectId for the family detail using shared service
|
|
14584
|
+
this.sharedObjectIdService.generateObjectId().subscribe({
|
|
14524
14585
|
next: (response) => {
|
|
14525
14586
|
const newObjectId = response.data?.objectId;
|
|
14526
|
-
console.log('🆔 [UserCreate] Generated new ObjectId for family detail:', newObjectId);
|
|
14587
|
+
console.log('🆔 [UserCreate] Generated new ObjectId for family detail via SharedObjectIdService:', newObjectId);
|
|
14527
14588
|
// Create entity access pass management record with owner rights
|
|
14528
14589
|
const currentUser = this.appState.currentUser();
|
|
14529
14590
|
const currentEntity = this.appState.activeEntity();
|
|
@@ -15205,19 +15266,14 @@ class CideCoreUserCreateComponent {
|
|
|
15205
15266
|
}
|
|
15206
15267
|
/**
|
|
15207
15268
|
* Generate Object ID for new user creation
|
|
15208
|
-
* Uses the
|
|
15269
|
+
* Uses the shared object ID service to generate a unique ObjectId
|
|
15209
15270
|
* @returns Promise<string> - The generated ObjectId
|
|
15210
15271
|
*/
|
|
15211
15272
|
async generateObjectId() {
|
|
15212
15273
|
try {
|
|
15213
|
-
const
|
|
15214
|
-
|
|
15215
|
-
|
|
15216
|
-
return response.data.objectId;
|
|
15217
|
-
}
|
|
15218
|
-
else {
|
|
15219
|
-
throw new Error('Failed to generate ObjectId: Invalid response');
|
|
15220
|
-
}
|
|
15274
|
+
const objectId = await this.sharedObjectIdService.generateObjectIdAsync();
|
|
15275
|
+
console.log('🆔 [UserCreate] Generated new ObjectId for user via SharedObjectIdService:', objectId);
|
|
15276
|
+
return objectId;
|
|
15221
15277
|
}
|
|
15222
15278
|
catch (error) {
|
|
15223
15279
|
console.error('❌ [UserCreate] Error generating ObjectId:', error);
|
|
@@ -15226,18 +15282,14 @@ class CideCoreUserCreateComponent {
|
|
|
15226
15282
|
}
|
|
15227
15283
|
/**
|
|
15228
15284
|
* Generate Object ID for user-related entities (addresses, documents, family details)
|
|
15285
|
+
* Uses the shared object ID service for consistency
|
|
15229
15286
|
* @returns Promise<string> - The generated ObjectId
|
|
15230
15287
|
*/
|
|
15231
15288
|
async generateEntityObjectId() {
|
|
15232
15289
|
try {
|
|
15233
|
-
const
|
|
15234
|
-
|
|
15235
|
-
|
|
15236
|
-
return response.data.objectId;
|
|
15237
|
-
}
|
|
15238
|
-
else {
|
|
15239
|
-
throw new Error('Failed to generate ObjectId: Invalid response');
|
|
15240
|
-
}
|
|
15290
|
+
const objectId = await this.sharedObjectIdService.generateObjectIdAsync();
|
|
15291
|
+
console.log('🆔 [UserCreate] Generated new ObjectId for entity via SharedObjectIdService:', objectId);
|
|
15292
|
+
return objectId;
|
|
15241
15293
|
}
|
|
15242
15294
|
catch (error) {
|
|
15243
15295
|
console.error('❌ [UserCreate] Error generating entity ObjectId:', error);
|