@acorex/connectivity 20.3.0-next.5 → 20.3.0-next.7

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.
@@ -2,7 +2,7 @@ import { AXSafePipe } from '@acorex/core/pipes';
2
2
  import * as i2$1 from '@acorex/platform/auth';
3
3
  import { AXPAuthStrategy, AXP_TENANT_LOADER, AXP_APPLICATION_LOADER, AXP_FEATURE_LOADER, AXP_PERMISSION_LOADER, AXPSessionService, AXPAuthModule } from '@acorex/platform/auth';
4
4
  import * as i1$1 from '@acorex/platform/core';
5
- import { AXPDataGenerator, AXPActivityLogProvider, AXP_ACTIVITY_LOG_PROVIDER, AXP_DATASOURCE_DEFINITION_PROVIDER, objectKeyValueTransforms, AXPSystemActionType, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, applySortArray, applyFilterArray } from '@acorex/platform/core';
5
+ import { AXPDataGenerator, AXPActivityLogProvider, AXP_ACTIVITY_LOG_PROVIDER, AXP_DATASOURCE_DEFINITION_PROVIDER, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, objectKeyValueTransforms, AXPSystemActionType, applySortArray, applyFilterArray } from '@acorex/platform/core';
6
6
  import { AXPEntityDefinitionRegistryService, AXPEntityStorageService, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_STORAGE_BACKEND, AXPMiddlewareEntityStorageService, eventDispatchMiddleware, AXP_ENTITY_STORAGE_MIDDLEWARE, AXPDataSeederService } from '@acorex/platform/layout/entity';
7
7
  import * as i0 from '@angular/core';
8
8
  import { inject, Injectable, NgModule, Injector } from '@angular/core';
@@ -22,7 +22,7 @@ import { AXPBarChartWidget, AXPDonutChartWidget, AXPGaugeChartWidget, AXPLineCha
22
22
  import { AXPTaskBoardShortcut, AXPTaskBoardWidget, RootConfig as RootConfig$h } from '@acorex/modules/task-management';
23
23
  import { AXPMyNotificationDashboardWidget, RootConfig as RootConfig$b, AXMNotificationEntityServiceImpl, AXMNotificationEntityService } from '@acorex/modules/notification-management';
24
24
  import { RootConfig as RootConfig$5 } from '@acorex/modules/data-management';
25
- import { provideQuerySetups, provideCommandSetups, AXPQueryService, AXPRuntimeModule, AXPCommandService } from '@acorex/platform/runtime';
25
+ import { provideQuerySetups, AXPCommandService, provideCommandSetups, AXPQueryService, AXPRuntimeModule } from '@acorex/platform/runtime';
26
26
  import { AXMDistributionServiceImpl, AXMDocumentService, AXMDistributionInteractionService, RootConfig as RootConfig$6, AXMFolderServiceImpl, AXMDocumentServiceImpl, AXMReviewService, AXMReviewServiceImpl, AXMDistributionInteractionServiceImpl, AXMFolderService, AXMDistributionService } from '@acorex/modules/document-management';
27
27
  import { AXDataSource } from '@acorex/cdk/common';
28
28
  import { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
@@ -21270,10 +21270,11 @@ class AXMOrgChartGenerateCommand {
21270
21270
  const tenant = this.session.tenant;
21271
21271
  const root = {
21272
21272
  id: AXPDataGenerator.uuid(),
21273
- title: tenant?.name || 'Demo Organization',
21273
+ title: tenant?.title || 'Demo Organization',
21274
21274
  type: AXMOrgChartNodeType.Company,
21275
21275
  entity: tenant ? { id: tenant.id, source: 'tenant' } : undefined,
21276
21276
  isExpanded: true,
21277
+ icon: 'fa-building',
21277
21278
  children: [],
21278
21279
  };
21279
21280
  // Load sources
@@ -23097,6 +23098,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
23097
23098
  type: Injectable
23098
23099
  }] });
23099
23100
 
23101
+ //#region ---- Imports ----
23102
+ //#endregion
23103
+ //#region ---- Org Chart Event Listener ----
23104
+ const AXCMockOrgChartEventListener = {
23105
+ key: 'entity.updated',
23106
+ async execute(data) {
23107
+ // Check if the updated entity is relevant for org chart generation
23108
+ const entityName = data?.entityName;
23109
+ if (!entityName)
23110
+ return;
23111
+ // Relevant entities that should trigger org chart regeneration
23112
+ const relevantEntities = [
23113
+ `${RootConfig$c.module.name}.${RootConfig$c.entities.businessUnit.name}`,
23114
+ `${RootConfig$c.module.name}.${RootConfig$c.entities.position.name}`,
23115
+ `${RootConfig$d.module.name}.${RootConfig$d.entities.employee.name}`,
23116
+ `${RootConfig$d.module.name}.${RootConfig$d.entities.positionAssignment.name}`
23117
+ ];
23118
+ if (!relevantEntities.includes(entityName)) {
23119
+ return; // Not a relevant entity, skip processing
23120
+ }
23121
+ try {
23122
+ // Execute org chart generation command via command service
23123
+ const commandService = inject(AXPCommandService);
23124
+ const result = await commandService.execute('organization.chart.generate', {
23125
+ includeEmployees: true,
23126
+ preferPrimary: true
23127
+ });
23128
+ // Log successful regeneration
23129
+ // eslint-disable-next-line no-console
23130
+ console.log('[Mock Org Chart Event]', {
23131
+ triggeredBy: entityName,
23132
+ operation: data?.operation,
23133
+ chartId: result?.id,
23134
+ version: result?.version,
23135
+ timestamp: new Date().toISOString()
23136
+ });
23137
+ }
23138
+ catch (error) {
23139
+ // Log error but don't throw to avoid breaking the event system
23140
+ // eslint-disable-next-line no-console
23141
+ console.error('[Mock Org Chart Event] Error generating chart:', {
23142
+ triggeredBy: entityName,
23143
+ error: error instanceof Error ? error.message : String(error),
23144
+ timestamp: new Date().toISOString()
23145
+ });
23146
+ }
23147
+ },
23148
+ };
23149
+ //#endregion
23150
+
23100
23151
  class AXCOrganizationManagementMockModule {
23101
23152
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXCOrganizationManagementMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
23102
23153
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.8", ngImport: i0, type: AXCOrganizationManagementMockModule }); }
@@ -23130,6 +23181,11 @@ class AXCOrganizationManagementMockModule {
23130
23181
  useClass: AXMTeamDataSeeder,
23131
23182
  multi: true,
23132
23183
  },
23184
+ {
23185
+ provide: AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER,
23186
+ useValue: AXCMockOrgChartEventListener,
23187
+ multi: true,
23188
+ },
23133
23189
  // Commands
23134
23190
  provideCommandSetups([
23135
23191
  { key: 'organization.chart.generate', command: () => AXMOrgChartGenerateCommand },
@@ -23172,6 +23228,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
23172
23228
  useClass: AXMTeamDataSeeder,
23173
23229
  multi: true,
23174
23230
  },
23231
+ {
23232
+ provide: AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER,
23233
+ useValue: AXCMockOrgChartEventListener,
23234
+ multi: true,
23235
+ },
23175
23236
  // Commands
23176
23237
  provideCommandSetups([
23177
23238
  { key: 'organization.chart.generate', command: () => AXMOrgChartGenerateCommand },