@openmfp/portal-ui-lib 0.189.6 → 0.191.0

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.
@@ -1483,7 +1483,9 @@ class LocalConfigurationServiceImpl {
1483
1483
  this.luigiConfigService = inject(LocalNodesService);
1484
1484
  this.i18nService = inject(I18nService);
1485
1485
  this.luigiCoreService = inject(LuigiCoreService);
1486
+ this.nodeUtilsService = inject(NodeUtilsService);
1486
1487
  this.customLocalConfigurationService = inject(LOCAL_CONFIGURATION_SERVICE_INJECTION_TOKEN, { optional: true });
1488
+ this.localNodesRead = false;
1487
1489
  }
1488
1490
  async getLocalNodes() {
1489
1491
  const localDevelopmentSettings = localDevelopmentSettingsLocalStorage.read();
@@ -1491,8 +1493,8 @@ class LocalConfigurationServiceImpl {
1491
1493
  return ((await this.customLocalConfigurationService?.getLocalNodes()) || []);
1492
1494
  }
1493
1495
  this.addLocalDevelopmentModeOnIndicator();
1494
- if (this.cachedLocalNodes?.length) {
1495
- return [...this.cachedLocalNodes];
1496
+ if (this.localNodesRead) {
1497
+ return this.cachedLocalNodes;
1496
1498
  }
1497
1499
  try {
1498
1500
  const configurations = await this.getLocalConfigurations(localDevelopmentSettings);
@@ -1509,7 +1511,8 @@ class LocalConfigurationServiceImpl {
1509
1511
  },
1510
1512
  };
1511
1513
  });
1512
- return [...(this.cachedLocalNodes = result.nodes || [])];
1514
+ this.localNodesRead = true;
1515
+ return (this.cachedLocalNodes = result.nodes || []);
1513
1516
  }
1514
1517
  catch (e) {
1515
1518
  console.warn(`Failed to retrieve local luigi config.`, e);
@@ -1558,7 +1561,9 @@ class LocalConfigurationServiceImpl {
1558
1561
  const localReplacingNodes = [];
1559
1562
  const filteredServerNodes = serverLuigiNodes.filter((serverNode) => {
1560
1563
  const index = localNodes.findIndex((localNode) => {
1561
- return this.localNodeMatchesServerNode(localNode, serverNode);
1564
+ return (this.localNodeMatchesServerNode(localNode, serverNode) &&
1565
+ this.nodeUtilsService.isVisible(serverNode) &&
1566
+ this.nodeUtilsService.isVisible(localNode));
1562
1567
  });
1563
1568
  if (index !== -1) {
1564
1569
  const [localFoundNode] = localNodes.splice(index, 1);
@@ -1916,6 +1921,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
1916
1921
  args: [{ standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"fd-page\">\n <link rel=\"stylesheet\" href=\"/fundamental-styles/fundamental-styles.css\" />\n <div class=\"fd-page__content\">\n <div class=\"fd-container fd-container--centered\">\n <div class=\"content\">\n <span class=\"sap-icon--log\"></span>\n\n <div class=\"info\" data-e2e=\"logout-headline\">{{ headline() }}</div>\n <div class=\"hint\" data-e2e=\"logout-message\">{{ hint() }}</div>\n\n <p class=\"fd-has-text-align-center\">\n <button\n class=\"fd-button fd-button--action-bar fd-button--l\"\n (click)=\"login()\"\n >\n {{ btnText() }}\n </button>\n </p>\n </div>\n </div>\n </div>\n</div>\n", styles: ["@font-face{font-family:\"72\";src:url(/fundamental-styles/72-Light-full.woff) format(\"woff\");font-weight:300;font-style:normal}@font-face{font-family:\"72\";src:url(/fundamental-styles/72-Light-full.woff2) format(\"woff2\");font-weight:300;font-style:normal}@font-face{font-family:\"72\";src:url(/fundamental-styles/72-Bold-full.woff) format(\"woff\");font-weight:700;font-style:normal}@font-face{font-family:\"72\";src:url(/fundamental-styles/72-Bold-full.woff2) format(\"woff2\");font-weight:700;font-style:normal}@font-face{font-family:\"72\";src:url(/fundamental-styles/72-Regular-full.woff) format(\"woff\");font-weight:400;font-style:normal}@font-face{font-family:\"72\";src:url(/fundamental-styles/72-Regular-full.woff2) format(\"woff2\");font-weight:400;font-style:normal}@font-face{font-family:SAP-icons;src:url(/fundamental-styles/SAP-icons.woff) format(\"woff\");font-weight:400;font-style:normal}@font-face{font-family:SAP-icons;src:url(/fundamental-styles/SAP-icons.woff2) format(\"woff2\");font-weight:400;font-style:normal}body{margin:0}.sap-icon--log:before{font-size:150px;color:#a0a0a0}.fd-container--centered{text-align:center}a.fd-button{color:#fff}.fd-page{margin-top:32px;height:100vh;overflow-y:auto;overflow-x:hidden}.content{width:100%}.fd-has-text-align-center{text-align:center}.info,.hint{text-align:center;margin:0}.info{padding-top:30px;font-size:36px}.hint{font-size:18px;color:#6f7275;padding-bottom:30px}\n"] }]
1917
1922
  }], ctorParameters: () => [{ type: i1$1.ActivatedRoute }, { type: LuigiCoreService }, { type: I18nService }, { type: LoginEventService }] });
1918
1923
 
1924
+ class FeatureTogglesService {
1925
+ constructor() {
1926
+ this.configService = inject(ConfigService);
1927
+ this.envConfigService = inject(EnvConfigService);
1928
+ this.luigiCoreService = inject(LuigiCoreService);
1929
+ }
1930
+ async initFeatureToggles() {
1931
+ try {
1932
+ const { uiOptions } = await this.envConfigService.getEnvConfig();
1933
+ const { featureToggles } = await this.configService.getPortalConfig();
1934
+ if (uiOptions?.includes('enableFeatureToggleSetting')) {
1935
+ const featureToggleSettings = featureToggleLocalStorage.read();
1936
+ this.luigiCoreService.setFeatureToggles({
1937
+ ...featureToggles,
1938
+ ...featureToggleSettings,
1939
+ });
1940
+ return;
1941
+ }
1942
+ this.luigiCoreService.setFeatureToggles(featureToggles);
1943
+ }
1944
+ catch (e) {
1945
+ console.error('Failed to initialize feature toggles', e);
1946
+ }
1947
+ }
1948
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: FeatureTogglesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1949
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: FeatureTogglesService, providedIn: 'root' }); }
1950
+ }
1951
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: FeatureTogglesService, decorators: [{
1952
+ type: Injectable,
1953
+ args: [{ providedIn: 'root' }]
1954
+ }] });
1955
+
1919
1956
  const buildViewGroups = (nodes) => {
1920
1957
  const viewGroups = {};
1921
1958
  nodes.forEach((node) => {
@@ -2051,11 +2088,11 @@ class NodeSortingService {
2051
2088
  });
2052
2089
  }
2053
2090
  nodeComparison(a, b) {
2054
- // set default order to the end if not defined
2055
- a.order = a.dxpOrder || a.order || '999';
2056
- b.order = b.dxpOrder || b.order || '999';
2057
- const orderA = isNaN(parseFloat(a?.order)) ? 999 : parseFloat(a.order);
2058
- const orderB = isNaN(parseFloat(b?.order)) ? 999 : parseFloat(b.order);
2091
+ // set a default order to the end if not defined
2092
+ a.order = a.dxpOrder ?? a.order ?? 999;
2093
+ b.order = b.dxpOrder ?? b.order ?? 999;
2094
+ const orderA = a.order;
2095
+ const orderB = b.order;
2059
2096
  if (orderA < orderB) {
2060
2097
  return -1;
2061
2098
  }
@@ -2426,9 +2463,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
2426
2463
  }] });
2427
2464
 
2428
2465
  class NavigationConfigService {
2429
- constructor(configService, luigiCoreService, luigiNodesService, intentNavigationService, navigationGlobalContextConfigService, userProfileConfigService, appSwitcherConfigService, nodeChangeHookConfigService, nodesProcessingService, headerBarService) {
2430
- this.configService = configService;
2431
- this.luigiCoreService = luigiCoreService;
2466
+ constructor(envConfigService, luigiNodesService, intentNavigationService, navigationGlobalContextConfigService, userProfileConfigService, appSwitcherConfigService, nodeChangeHookConfigService, nodesProcessingService, headerBarService) {
2467
+ this.envConfigService = envConfigService;
2432
2468
  this.luigiNodesService = luigiNodesService;
2433
2469
  this.intentNavigationService = intentNavigationService;
2434
2470
  this.navigationGlobalContextConfigService = navigationGlobalContextConfigService;
@@ -2438,10 +2474,9 @@ class NavigationConfigService {
2438
2474
  this.nodesProcessingService = nodesProcessingService;
2439
2475
  this.headerBarService = headerBarService;
2440
2476
  }
2441
- async getNavigationConfig(childrenByEntity, envConfig) {
2477
+ async getNavigationConfig(childrenByEntity) {
2478
+ const envConfig = await this.envConfigService.getEnvConfig();
2442
2479
  const allNodes = Object.values(childrenByEntity).reduce((accumulator, value) => accumulator.concat(value), []);
2443
- const portalConfig = await this.configService.getPortalConfig();
2444
- this.initFeatureToggles(portalConfig.featureToggles, envConfig);
2445
2480
  const context = await this.navigationGlobalContextConfigService.getGlobalContext();
2446
2481
  const luigiNodes = await this.nodesProcessingService.processNodes(childrenByEntity);
2447
2482
  return {
@@ -2461,24 +2496,13 @@ class NavigationConfigService {
2461
2496
  breadcrumbs: await this.headerBarService.getConfig(),
2462
2497
  };
2463
2498
  }
2464
- initFeatureToggles(configFeatureToggles, envConfig) {
2465
- if (envConfig.uiOptions?.includes('enableFeatureToggleSetting')) {
2466
- const featureToggleSettings = featureToggleLocalStorage.read();
2467
- this.luigiCoreService.setFeatureToggles({
2468
- ...configFeatureToggles,
2469
- ...featureToggleSettings,
2470
- });
2471
- return;
2472
- }
2473
- this.luigiCoreService.setFeatureToggles(configFeatureToggles);
2474
- }
2475
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NavigationConfigService, deps: [{ token: ConfigService }, { token: LuigiCoreService }, { token: LuigiNodesService }, { token: IntentNavigationService }, { token: GlobalContextConfigService }, { token: LUIGI_USER_PROFILE_CONFIG_SERVICE_INJECTION_TOKEN, optional: true }, { token: LUIGI_APP_SWITCHER_CONFIG_SERVICE_INJECTION_TOKEN, optional: true }, { token: LUIGI_NODE_CHANGE_HOOK_SERVICE_INJECTION_TOKEN, optional: true }, { token: NodesProcessingService }, { token: HeaderBarService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2499
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NavigationConfigService, deps: [{ token: EnvConfigService }, { token: LuigiNodesService }, { token: IntentNavigationService }, { token: GlobalContextConfigService }, { token: LUIGI_USER_PROFILE_CONFIG_SERVICE_INJECTION_TOKEN, optional: true }, { token: LUIGI_APP_SWITCHER_CONFIG_SERVICE_INJECTION_TOKEN, optional: true }, { token: LUIGI_NODE_CHANGE_HOOK_SERVICE_INJECTION_TOKEN, optional: true }, { token: NodesProcessingService }, { token: HeaderBarService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2476
2500
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NavigationConfigService, providedIn: 'root' }); }
2477
2501
  }
2478
2502
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NavigationConfigService, decorators: [{
2479
2503
  type: Injectable,
2480
2504
  args: [{ providedIn: 'root' }]
2481
- }], ctorParameters: () => [{ type: ConfigService }, { type: LuigiCoreService }, { type: LuigiNodesService }, { type: IntentNavigationService }, { type: GlobalContextConfigService }, { type: undefined, decorators: [{
2505
+ }], ctorParameters: () => [{ type: EnvConfigService }, { type: LuigiNodesService }, { type: IntentNavigationService }, { type: GlobalContextConfigService }, { type: undefined, decorators: [{
2482
2506
  type: Optional
2483
2507
  }, {
2484
2508
  type: Inject,
@@ -2497,9 +2521,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
2497
2521
 
2498
2522
  class LifecycleHooksConfigService {
2499
2523
  constructor() {
2524
+ this.featureTogglesService = inject(FeatureTogglesService);
2500
2525
  this.authConfigService = inject(AuthConfigService);
2501
2526
  this.customMessageListenersService = inject(CustomMessageListenersService);
2502
- this.envConfigService = inject(EnvConfigService);
2503
2527
  this.i18nService = inject(I18nService);
2504
2528
  this.luigiNodesService = inject(LuigiNodesService);
2505
2529
  this.luigiCoreService = inject(LuigiCoreService);
@@ -2518,7 +2542,7 @@ class LifecycleHooksConfigService {
2518
2542
  }
2519
2543
  async constructLuigiConfiguration() {
2520
2544
  this.i18nService.afterInit();
2521
- const envConfig = await this.envConfigService.getEnvConfig();
2545
+ await this.featureTogglesService.initFeatureToggles();
2522
2546
  let childrenByEntity;
2523
2547
  try {
2524
2548
  childrenByEntity =
@@ -2533,7 +2557,7 @@ class LifecycleHooksConfigService {
2533
2557
  auth: await this.authConfigService.getAuthConfig(),
2534
2558
  settings: await this.staticSettingsConfigService.getStaticSettingsConfig(),
2535
2559
  communication: this.customMessageListenersService.getMessageListeners(),
2536
- navigation: await this.navigationConfigService.getNavigationConfig(childrenByEntity, envConfig),
2560
+ navigation: await this.navigationConfigService.getNavigationConfig(childrenByEntity),
2537
2561
  routing: this.routingConfigService.getRoutingConfig(),
2538
2562
  userSettings: await this.userSettingsConfigService.getUserSettings(childrenByEntity),
2539
2563
  globalSearch: this.globalSearchConfigService?.getGlobalSearchConfig(),