@platform-mesh/portal-ui-lib 0.38.0 → 0.38.2

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.
@@ -3,10 +3,10 @@ import { inject, DestroyRef, Injectable } from '@angular/core';
3
3
  import { I18nService, EntityType, AuthService, LuigiCoreService, ConfigService, EnvConfigService, LocalStorageKeys } from '@openmfp/portal-ui-lib';
4
4
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
5
  import { ResourceService, GatewayService, AccountInfoService, OrganizationReadyService, ErrorHandlerService } from '@platform-mesh/portal-ui-lib/services';
6
- import { generateGraphQLFields } from '@platform-mesh/portal-ui-lib/utils';
6
+ import { isNamespacedResource, generateGraphQLFields, mergeListWithSubscriptionResult } from '@platform-mesh/portal-ui-lib/utils';
7
7
  import '@ui5/webcomponents/dist/ComboBox.js';
8
- import { of, firstValueFrom } from 'rxjs';
9
- import { shareReplay } from 'rxjs/operators';
8
+ import { Subject, defer, of, firstValueFrom } from 'rxjs';
9
+ import { shareReplay, retry, takeUntil, switchMap, startWith, scan, catchError } from 'rxjs/operators';
10
10
  import '@ui5/webcomponents/dist/Breadcrumbs.js';
11
11
  import '@ui5/webcomponents/dist/BreadcrumbsItem.js';
12
12
 
@@ -95,93 +95,124 @@ class NamespaceSelectionRendererService {
95
95
  return (containerElement, nodeItems, _clickHandler) => {
96
96
  containerElement.style.paddingBottom = '0.5rem';
97
97
  const lastNode = nodeItems.at(-1)?.node;
98
- if (!this.isNamespacedNode(lastNode)) {
98
+ const namespace = this.luigiCoreService
99
+ .routing()
100
+ .getSearchParams().namespace;
101
+ const kcpPath = lastNode?.context?.kcpPath;
102
+ if (lastNode?.context && !isNamespacedResource(lastNode.context)) {
99
103
  return containerElement;
100
104
  }
101
105
  const ui5combobox = this.createCombobox(containerElement);
102
- const namespaceName = this.getNamespaceNodeName(lastNode);
103
- this.addComboboxItems(portalConfig, ui5combobox, namespaceName);
106
+ this.addComboboxItems(portalConfig, ui5combobox, namespace, kcpPath);
104
107
  ui5combobox.addEventListener('change', (event) => {
105
- const value = event?.target?.value ?? '';
106
- const selected = (value || '').trim();
107
- this.replacePathSegment(namespaceName, selected);
108
+ const value = event?.target?.value.trim() ?? '';
109
+ this.changeNamespace(value);
108
110
  });
109
111
  return ui5combobox;
110
112
  };
111
113
  }
112
- isNamespacedNode(node) {
113
- return node?.context?.resourceDefinition?.scope === 'Namespaced';
114
- }
115
- getNamespaceNodeName(node) {
116
- const namespacedNodeName = node?.navigationContext || '';
117
- const segments = window.location.pathname.split('/').filter(Boolean);
118
- const index = segments.indexOf(namespacedNodeName);
119
- return index > 0 ? segments[index - 1] : null;
120
- }
121
114
  createCombobox(containerElement) {
122
115
  const ui5combobox = document.createElement('ui5-combobox');
123
116
  ui5combobox.setAttribute('placeholder', 'Namespaces');
124
117
  containerElement.appendChild(ui5combobox);
125
118
  return ui5combobox;
126
119
  }
127
- addComboboxItems(portalConfig, ui5combobox, namespaceName) {
128
- if (!this.namespaceResources$) {
129
- this.namespaceResources$ = this.getNamespaceResources(portalConfig).pipe(shareReplay(1), takeUntilDestroyed(this.destroyRef));
130
- }
131
- this.namespaceResources$.subscribe((resources) => {
132
- resources.forEach((resource) => {
133
- const name = resource.metadata?.name;
134
- if (!name) {
135
- return;
136
- }
137
- const existingItem = Array.from(ui5combobox.children).find((child) => child.getAttribute('text') === name);
138
- if (existingItem) {
139
- return;
140
- }
141
- const resourceOption = document.createElement('ui5-cb-item');
142
- resourceOption.setAttribute('text', name);
143
- if (name === namespaceName) {
144
- ui5combobox.setAttribute('value', name);
145
- }
146
- ui5combobox.appendChild(resourceOption);
147
- });
120
+ addComboboxItems(portalConfig, ui5combobox, namespace, kcpPath) {
121
+ this.getNamespaceResourcesCached(portalConfig, kcpPath).subscribe((resources) => {
122
+ this.syncComboboxItems(ui5combobox, resources);
123
+ this.setSelectedValue(ui5combobox, resources, namespace);
148
124
  });
149
125
  }
150
- getNamespaceResources(portalConfig) {
151
- const operation = 'v1_namespaces';
152
- const fields = generateGraphQLFields(defaultColumns);
153
- try {
154
- return this.resourceService.list(operation, fields, {
155
- portalContext: {
156
- crdGatewayApiUrl: portalConfig.portalContext['crdGatewayApiUrl'],
157
- },
158
- resourceDefinition: {
159
- version: 'v1',
160
- plural: 'namespaces',
161
- scope: 'Cluster',
162
- },
163
- token: this.authService.getToken(),
164
- });
126
+ getNamespaceResourcesCached(portalConfig, kcpPath) {
127
+ const cacheKey = this.getNamespaceResourcesCacheKey(kcpPath);
128
+ if (this.namespaceResourcesCache?.key === cacheKey) {
129
+ return this.namespaceResourcesCache.value$;
165
130
  }
166
- catch (e) {
167
- console.error(`Failed to read entities from ${operation}`, e);
168
- return of([]);
131
+ if (this.namespaceResourcesCache) {
132
+ this.namespaceResourcesCache.stop$.next();
133
+ this.namespaceResourcesCache.stop$.complete();
134
+ this.namespaceResourcesCache = undefined;
169
135
  }
136
+ const stop$ = new Subject();
137
+ const value$ = this.getNamespaceResources(portalConfig, kcpPath, stop$).pipe(shareReplay(1), takeUntilDestroyed(this.destroyRef));
138
+ this.namespaceResourcesCache = {
139
+ key: cacheKey,
140
+ value$,
141
+ stop$,
142
+ };
143
+ return value$;
144
+ }
145
+ getNamespaceResourcesCacheKey(kcpPath) {
146
+ return kcpPath ?? '';
170
147
  }
171
- replacePathSegment(name, newValue) {
172
- if (!name || !newValue) {
148
+ syncComboboxItems(ui5combobox, resources) {
149
+ ui5combobox.replaceChildren();
150
+ resources.forEach((resource) => {
151
+ const name = resource.metadata?.name;
152
+ if (!name) {
153
+ return;
154
+ }
155
+ const resourceOption = document.createElement('ui5-cb-item');
156
+ resourceOption.setAttribute('text', name);
157
+ ui5combobox.appendChild(resourceOption);
158
+ });
159
+ const allOption = document.createElement('ui5-cb-item');
160
+ allOption.setAttribute('text', '-all-');
161
+ ui5combobox.appendChild(allOption);
162
+ }
163
+ setSelectedValue(ui5combobox, resources, namespace) {
164
+ const currentNamespace = this.luigiCoreService
165
+ .routing()
166
+ .getSearchParams().namespace;
167
+ if (currentNamespace) {
168
+ ui5combobox.setAttribute('value', currentNamespace);
173
169
  return;
174
170
  }
175
- const segments = window.location.pathname.split('/').filter(Boolean);
176
- const index = segments.indexOf(name);
177
- if (index !== -1) {
178
- segments[index] = newValue;
179
- const newPath = `/${segments.join('/')}`;
180
- this.luigiCoreService.navigation().navigate(newPath);
171
+ if (namespace &&
172
+ resources.find((resource) => resource.metadata?.name === namespace)) {
173
+ ui5combobox.setAttribute('value', namespace);
181
174
  }
182
175
  else {
183
- console.warn(`Segment "${name}" not found in path.`);
176
+ ui5combobox.setAttribute('value', '-all-');
177
+ this.changeNamespace('-all-');
178
+ }
179
+ }
180
+ getNamespaceResources(portalConfig, kcpPath, stop$) {
181
+ const operation = 'v1_namespaces';
182
+ const fields = generateGraphQLFields(defaultColumns);
183
+ const context = {
184
+ portalContext: {
185
+ crdGatewayApiUrl: portalConfig.portalContext['crdGatewayApiUrl'],
186
+ },
187
+ resourceDefinition: {
188
+ version: 'v1',
189
+ plural: 'namespaces',
190
+ scope: 'Cluster',
191
+ },
192
+ kcpPath,
193
+ token: this.authService.getToken(),
194
+ };
195
+ return defer(() => this.resourceService.list(operation, fields, context)).pipe(retry(3), takeUntil(stop$), switchMap((result) => this.resourceService
196
+ .resourceChangeSubscription(operation, fields, context, result.resourceVersion, false)
197
+ .pipe(startWith(undefined), scan((resources, subscriptionResult) => mergeListWithSubscriptionResult(resources, subscriptionResult, {
198
+ getItemKey: (resource) => resource.metadata?.name,
199
+ mapSubscriptionObjectToItem: (object) => object,
200
+ }), result.items), takeUntil(stop$))), catchError((error) => {
201
+ console.error(`Failed to read entities from ${operation}`, error);
202
+ return of([]);
203
+ }));
204
+ }
205
+ changeNamespace(value) {
206
+ if (!value) {
207
+ return;
208
+ }
209
+ const oldValue = this.luigiCoreService
210
+ .routing()
211
+ .getSearchParams().namespace;
212
+ if (oldValue === value) {
213
+ return;
184
214
  }
215
+ this.luigiCoreService.routing().addSearchParams({ namespace: value });
185
216
  }
186
217
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: NamespaceSelectionRendererService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
187
218
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: NamespaceSelectionRendererService, providedIn: 'root' }); }
@@ -446,6 +477,7 @@ class CustomRoutingConfigServiceImpl {
446
477
  }
447
478
  getRoutingConfig() {
448
479
  return {
480
+ preserveQueryParams: true,
449
481
  pageNotFoundHandler: () => {
450
482
  if (!this.envConfig?.baseDomain) {
451
483
  return this.redirectTo('error/404');
@@ -1 +1 @@
1
- {"version":3,"file":"platform-mesh-portal-ui-lib-portal-options.mjs","sources":["../../projects/lib/portal-options/services/custom-global-nodes.service.ts","../../projects/lib/portal-options/services/header-bar-renderers/namespace-selection-renderer.service.ts","../../projects/lib/portal-options/services/header-bar-renderers/breadcrumb-renderer.ts","../../projects/lib/portal-options/services/header-bar-config.service.ts","../../projects/lib/portal-options/models/constants.ts","../../projects/lib/portal-options/services/luigi-extended-global-context-config.service.ts","../../projects/lib/portal-options/services/navigation-redirect-strategy.service.ts","../../projects/lib/portal-options/utils/account-hierarchy.util.ts","../../projects/lib/portal-options/services/crd-gateway-kcp-patch-resolver.service.ts","../../projects/lib/portal-options/services/node-change-hook-config.service.ts","../../projects/lib/portal-options/services/node-context-processing.service.ts","../../projects/lib/portal-options/services/router-config.service.ts","../../projects/lib/portal-options/services/user-profile-config.service.ts","../../projects/lib/portal-options/platform-mesh-portal-ui-lib-portal-options.ts"],"sourcesContent":["import { PortalNodeContext } from '../models/luigi-context';\nimport { PortalLuigiNode } from '../models/luigi-node';\nimport { inject } from '@angular/core';\nimport {\n CustomGlobalNodesService,\n EntityType,\n I18nService,\n NodeContext,\n} from '@openmfp/portal-ui-lib';\n\nexport class CustomGlobalNodesServiceImpl implements CustomGlobalNodesService {\n private i18nService = inject(I18nService);\n\n async getCustomGlobalNodes(): Promise<PortalLuigiNode[]> {\n return [\n {\n pathSegment: 'error',\n order: 1000,\n hideFromNav: true,\n showBreadcrumbs: false,\n context: {} as PortalNodeContext,\n children: [\n {\n pathSegment: ':id',\n entityType: EntityType.ENTITY_ERROR,\n hideFromNav: true,\n hideSideNav: true,\n viewUrl: '/assets/platform-mesh-portal-ui-wc.js#error-component',\n context: {\n id: ':id',\n translationTable: this.i18nService.translationTable,\n } as any as NodeContext,\n webcomponent: {\n selfRegistered: true,\n },\n },\n ],\n },\n {\n pathSegment: 'users',\n showBreadcrumbs: false,\n hideSideNav: true,\n hideFromNav: true,\n context: {} as PortalNodeContext,\n entityType: 'global',\n children: [\n {\n pathSegment: ':userId',\n hideSideNav: true,\n hideFromNav: true,\n defineEntity: {\n id: 'user',\n },\n context: {\n userId: ':userId',\n } as PortalNodeContext,\n children: [\n {\n pathSegment: 'overview',\n context: {} as PortalNodeContext,\n hideSideNav: true,\n hideFromNav: true,\n defineEntity: {\n id: 'overview',\n },\n compound: {\n children: [],\n },\n },\n ],\n },\n ],\n },\n ];\n }\n}\n","import { DestroyRef, Injectable, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n AuthService,\n LuigiCoreService,\n LuigiNode,\n PortalConfig,\n} from '@openmfp/portal-ui-lib';\nimport { FieldDefinition, Resource, ResourceDefinition } from '@platform-mesh/portal-ui-lib/models';\nimport { ResourceNodeContext, ResourceService } from '@platform-mesh/portal-ui-lib/services';\nimport { generateGraphQLFields } from '@platform-mesh/portal-ui-lib/utils';\nimport '@ui5/webcomponents/dist/ComboBox.js';\nimport { Observable, of } from 'rxjs';\nimport { shareReplay } from 'rxjs/operators';\n\nconst defaultColumns: FieldDefinition[] = [\n {\n label: 'Name',\n property: 'metadata.name',\n },\n];\n\n@Injectable({ providedIn: 'root' })\nexport class NamespaceSelectionRendererService {\n private namespaceResources$?: Observable<Resource[]>;\n\n private resourceService = inject(ResourceService);\n private authService = inject(AuthService);\n private luigiCoreService = inject(LuigiCoreService);\n private destroyRef = inject(DestroyRef);\n\n public create(portalConfig: PortalConfig) {\n return (containerElement: HTMLElement, nodeItems: any[], _clickHandler: any) => {\n containerElement.style.paddingBottom = '0.5rem';\n\n const lastNode = nodeItems.at(-1)?.node as LuigiNode | undefined;\n\n if (!this.isNamespacedNode(lastNode)) {\n return containerElement;\n }\n\n const ui5combobox = this.createCombobox(containerElement);\n const namespaceName = this.getNamespaceNodeName(lastNode);\n this.addComboboxItems(portalConfig, ui5combobox, namespaceName);\n\n ui5combobox.addEventListener('change', (event: any) => {\n const value = (event?.target as any)?.value ?? '';\n const selected = (value || '').trim();\n this.replacePathSegment(namespaceName, selected);\n });\n\n return ui5combobox as HTMLElement;\n };\n }\n\n private isNamespacedNode(node: LuigiNode | undefined) {\n return node?.context?.resourceDefinition?.scope === 'Namespaced';\n }\n\n private getNamespaceNodeName(node?: LuigiNode) {\n const namespacedNodeName = node?.navigationContext || '';\n const segments = window.location.pathname.split('/').filter(Boolean);\n const index = segments.indexOf(namespacedNodeName);\n\n return index > 0 ? segments[index - 1] : null;\n }\n\n private createCombobox(containerElement: HTMLElement) {\n const ui5combobox = document.createElement('ui5-combobox');\n ui5combobox.setAttribute('placeholder', 'Namespaces');\n containerElement.appendChild(ui5combobox);\n\n return ui5combobox;\n }\n\n private addComboboxItems(\n portalConfig: PortalConfig,\n ui5combobox: HTMLElement,\n namespaceName: string | null,\n ) {\n if (!this.namespaceResources$) {\n this.namespaceResources$ = this.getNamespaceResources(portalConfig).pipe(\n shareReplay(1),\n takeUntilDestroyed(this.destroyRef),\n );\n }\n\n this.namespaceResources$.subscribe((resources) => {\n resources.forEach((resource) => {\n const name = resource.metadata?.name;\n if (!name) {\n return;\n }\n const existingItem = Array.from(ui5combobox.children).find(\n (child) => (child as Element).getAttribute('text') === name,\n );\n\n if (existingItem) {\n return;\n }\n const resourceOption = document.createElement('ui5-cb-item');\n resourceOption.setAttribute('text', name);\n if (name === namespaceName) {\n ui5combobox.setAttribute('value', name);\n }\n ui5combobox.appendChild(resourceOption);\n });\n });\n }\n\n private getNamespaceResources(\n portalConfig: PortalConfig,\n ): Observable<Resource[]> {\n const operation = 'v1_namespaces';\n const fields = generateGraphQLFields(defaultColumns);\n\n try {\n return this.resourceService.list(operation, fields, {\n portalContext: {\n crdGatewayApiUrl: portalConfig.portalContext['crdGatewayApiUrl'],\n },\n resourceDefinition: {\n version: 'v1',\n plural: 'namespaces',\n scope: 'Cluster',\n } as ResourceDefinition,\n token: this.authService.getToken(),\n } as ResourceNodeContext);\n } catch (e) {\n console.error(`Failed to read entities from ${operation}`, e);\n return of([]);\n }\n }\n\n private replacePathSegment(name: string | null, newValue: string): void {\n if (!name || !newValue) {\n return;\n }\n const segments = window.location.pathname.split('/').filter(Boolean);\n const index = segments.indexOf(name);\n\n if (index !== -1) {\n segments[index] = newValue;\n const newPath = `/${segments.join('/')}`;\n\n this.luigiCoreService.navigation().navigate(newPath);\n } else {\n console.warn(`Segment \"${name}\" not found in path.`);\n }\n }\n}\n","import '@ui5/webcomponents/dist/Breadcrumbs.js';\nimport '@ui5/webcomponents/dist/BreadcrumbsItem.js';\n\nexport const breadcrumbRenderer = (\n containerElement: HTMLElement,\n nodeItems: any[],\n clickHandler: (item: any) => void,\n): HTMLElement => {\n containerElement.style.width = '100%';\n\n const ui5breadcrumbs = document.createElement('ui5-breadcrumbs');\n ui5breadcrumbs.setAttribute('separators', 'Slash');\n containerElement.appendChild(ui5breadcrumbs);\n\n nodeItems.forEach((item) => {\n if (item.node?.hideFromBreadcrumb) {\n return;\n }\n\n const itemCmp = document.createElement('ui5-breadcrumbs-item');\n itemCmp.textContent = item.label ?? '';\n (itemCmp as any)._item = item;\n ui5breadcrumbs.appendChild(itemCmp);\n });\n\n ui5breadcrumbs.addEventListener('item-click', (event: any) => {\n if (\n !(\n event.detail.ctrlKey ||\n event.detail.altKey ||\n event.detail.shiftKey ||\n event.detail.metaKey\n )\n ) {\n event.preventDefault();\n clickHandler(event.detail.item._item);\n }\n });\n\n return ui5breadcrumbs;\n};\n","import { Injectable, inject } from '@angular/core';\nimport {\n ConfigService,\n HeaderBarConfig,\n HeaderBarConfigService,\n} from '@openmfp/portal-ui-lib';\nimport { NamespaceSelectionRendererService } from './header-bar-renderers/namespace-selection-renderer.service';\nimport { breadcrumbRenderer } from './header-bar-renderers/breadcrumb-renderer';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class HeaderBarConfigServiceImpl implements HeaderBarConfigService {\n private configService = inject(ConfigService);\n private namespaceSelectionRendererService = inject(NamespaceSelectionRendererService);\n\n public async getConfig(): Promise<HeaderBarConfig> {\n const portalConfig = await this.configService.getPortalConfig();\n\n return {\n pendingItemLabel: '...',\n omitRoot: false,\n clearBeforeRender: true,\n autoHide: true,\n leftRenderers: [breadcrumbRenderer],\n rightRenderers: [this.namespaceSelectionRendererService.create(portalConfig)],\n };\n }\n}\n","export const kcpRootOrgsPath = 'root:orgs';\n","import { kcpRootOrgsPath } from '../models/constants';\nimport { Injectable, inject } from '@angular/core';\nimport {\n EnvConfigService,\n LuigiExtendedGlobalContextConfigService,\n} from '@openmfp/portal-ui-lib';\n\n@Injectable({ providedIn: 'root' })\nexport class LuigiExtendedGlobalContextConfigServiceImpl implements LuigiExtendedGlobalContextConfigService {\n private envConfigService = inject(EnvConfigService);\n\n async createLuigiExtendedGlobalContext(): Promise<Record<string, any>> {\n const idpName = (await this.envConfigService.getEnvConfig()).idpName;\n\n if (idpName === 'welcome') {\n return {};\n }\n\n return {\n organization: idpName,\n kcpPath: `${kcpRootOrgsPath}:${idpName}`,\n entityName: idpName,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { LocalStorageKeys, NavigationRedirectStrategy } from '@openmfp/portal-ui-lib';\n\n@Injectable({ providedIn: 'root' })\nexport class NavigationRedirectStrategyServiceImpl implements NavigationRedirectStrategy {\n getRedirectUrl(): string {\n return localStorage.getItem(LocalStorageKeys.LAST_NAVIGATION_URL) || '';\n }\n\n saveRedirectUrl(url: string): void {\n if (url.startsWith('/error')) {\n return;\n }\n\n localStorage.setItem(LocalStorageKeys.LAST_NAVIGATION_URL, url);\n }\n\n clearRedirectUrl(): void {\n localStorage.removeItem(LocalStorageKeys.LAST_NAVIGATION_URL);\n }\n}\n","import { PortalLuigiNode } from '../models/luigi-node';\n\nexport function collectAccountNamesFromNodeHierarchy(\n node: PortalLuigiNode | undefined,\n): string[] {\n const accountNames: string[] = [];\n let currentNode: PortalLuigiNode | undefined = node;\n\n while (currentNode) {\n const entityName = currentNode.context?.entityName;\n const entityKind = currentNode.context?.entityKind;\n if (entityName && entityKind?.toLowerCase() === 'account') {\n accountNames.unshift(entityName);\n }\n currentNode = currentNode.parent;\n }\n\n return accountNames;\n}\n\nexport function getInitialAccountId(\n entityId?: string,\n kind?: string,\n): string | undefined {\n return kind?.toLowerCase() === 'account' && entityId ? entityId : undefined;\n}\n\nexport function calculateAccountHierarchy(\n entityNode: PortalLuigiNode,\n entityId?: string,\n kind?: string,\n): string[] {\n const initialAccountId = getInitialAccountId(entityId, kind);\n // when we are on a dynamic node and the id any kind has changed we need to reset the context data\n if (entityNode.defineEntity?.contextKey && initialAccountId) {\n entityNode.context.entityName = undefined;\n entityNode.context.entityKind = undefined;\n }\n\n const accountNames = collectAccountNamesFromNodeHierarchy(entityNode);\n\n if (initialAccountId) {\n accountNames.push(initialAccountId);\n }\n return accountNames;\n}\n","import { kcpRootOrgsPath } from '../models/constants';\nimport { PortalLuigiNode } from '../models/luigi-node';\nimport {\n calculateAccountHierarchy,\n getInitialAccountId,\n} from '../utils/account-hierarchy.util';\nimport { Injectable, inject } from '@angular/core';\nimport { EnvConfigService } from '@openmfp/portal-ui-lib';\nimport { GatewayService } from '@platform-mesh/portal-ui-lib/services';\n\nexport interface KcpData {\n kcpPath: string;\n accountPath: string | undefined;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class CrdGatewayKcpPatchResolver {\n private gatewayService = inject(GatewayService);\n private envConfigService = inject(EnvConfigService);\n\n public async resolveCrdGatewayKcpPath(\n nextNode: PortalLuigiNode,\n entityId?: string,\n kind?: string,\n ): Promise<KcpData> {\n if (nextNode.context?.kcpPath && !getInitialAccountId(entityId, kind)) {\n this.gatewayService.updateCrdGatewayUrlWithEntityPath(\n nextNode.context.kcpPath,\n );\n return {\n kcpPath: nextNode.context.kcpPath,\n accountPath: nextNode.context.accountPath,\n };\n }\n\n const accountNames = calculateAccountHierarchy(nextNode, entityId, kind);\n\n const accountPath =\n accountNames.length > 0 ? `${accountNames.join(':')}` : '';\n\n const org = (await this.envConfigService.getEnvConfig()).idpName;\n const kcpPath = `${kcpRootOrgsPath}:${org}${accountPath ? ':' + accountPath : ''}`;\n this.gatewayService.updateCrdGatewayUrlWithEntityPath(kcpPath);\n\n if (nextNode.context) {\n nextNode.context.kcpPath = kcpPath;\n nextNode.context.accountPath = accountPath;\n }\n return { kcpPath, accountPath };\n }\n}\n","import { PortalLuigiNode } from '../models/luigi-node';\nimport { CrdGatewayKcpPatchResolver } from './crd-gateway-kcp-patch-resolver.service';\nimport { Injectable, inject } from '@angular/core';\nimport {\n LuigiCoreService,\n NodeChangeHookConfigService,\n NodeContext,\n} from '@openmfp/portal-ui-lib';\n\n@Injectable({ providedIn: 'root' })\nexport class NodeChangeHookConfigServiceImpl implements NodeChangeHookConfigService {\n private luigiCoreService = inject(LuigiCoreService);\n private crdGatewayKcpPatchResolver = inject(CrdGatewayKcpPatchResolver);\n\n async nodeChangeHook(\n prevNode: PortalLuigiNode,\n nextNode: PortalLuigiNode,\n currentContext: NodeContext,\n ) {\n if (\n nextNode.initialRoute &&\n nextNode.virtualTree &&\n !(nextNode as any)._virtualTree\n ) {\n this.luigiCoreService.navigation().navigate(nextNode.initialRoute);\n }\n\n await this.crdGatewayKcpPatchResolver.resolveCrdGatewayKcpPath(nextNode);\n }\n}\n","import { PortalNodeContext } from '../models/luigi-context';\nimport { PortalLuigiNode } from '../models/luigi-node';\nimport { CrdGatewayKcpPatchResolver } from './crd-gateway-kcp-patch-resolver.service';\nimport { Injectable, inject } from '@angular/core';\nimport { NodeContextProcessingService } from '@openmfp/portal-ui-lib';\nimport { AccountInfo } from '@platform-mesh/portal-ui-lib/models';\nimport {\n AccountInfoService,\n ErrorHandlerService,\n OrganizationReadyService,\n} from '@platform-mesh/portal-ui-lib/services';\nimport { firstValueFrom } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NodeContextProcessingServiceImpl implements NodeContextProcessingService {\n private crdGatewayKcpPatchResolver = inject(CrdGatewayKcpPatchResolver);\n private accountInfoService = inject(AccountInfoService);\n private organizationReadyService = inject(OrganizationReadyService);\n private errorHandlerService = inject(ErrorHandlerService);\n\n public async processNodeContext(\n dynamicEntityId: string,\n entityNode: PortalLuigiNode,\n ctx: PortalNodeContext,\n ) {\n const kind = entityNode.defineEntity?.type;\n const entityId =\n dynamicEntityId || entityNode.context.resourceDefinition?.name;\n\n if (!entityId) {\n return;\n }\n\n const { kcpPath, accountPath } =\n await this.crdGatewayKcpPatchResolver.resolveCrdGatewayKcpPath(\n entityNode,\n entityId,\n kind,\n );\n\n // update the current already calculated by Luigi context for a node\n this.addFieldsToContext(ctx, entityId, kcpPath, accountPath, kind);\n\n // update the node context of sa node to contain the entity for future context calculations\n this.addFieldsToContext(\n entityNode.context,\n entityId,\n kcpPath,\n accountPath,\n kind,\n );\n\n try {\n const accountInfo = await firstValueFrom(\n this.accountInfoService.read({\n portalContext: {\n crdGatewayApiUrl: ctx.portalContext.crdGatewayApiUrl,\n },\n token: ctx.token,\n accountId: entityId,\n }),\n );\n\n // update the current already calculated by Luigi context for a node\n this.addFieldsToContextFromAccountInfo(ctx, entityId, accountInfo);\n\n // update the node context of sa node to contain the entity for future context calculations\n this.addFieldsToContextFromAccountInfo(\n entityNode.context,\n entityId,\n accountInfo,\n );\n\n // we were able to ready the account info so on this kcpPath we can query for the organization ready state\n this.organizationReadyService.checkOrganizationReady();\n } catch (e) {\n if (!this.errorHandlerService.isUnauthorizedAccess(e)) {\n console.error('Failed to read account info', e);\n }\n }\n }\n\n private addFieldsToContext(\n ctx: PortalNodeContext,\n entityId: string | undefined,\n kcpPath: string,\n accountPath: string | undefined,\n kind: string | undefined,\n ) {\n ctx.kcpPath = kcpPath;\n ctx.entityName = entityId;\n ctx.entityKind = kind;\n ctx.accountPath = accountPath;\n }\n\n private addFieldsToContextFromAccountInfo(\n ctx: PortalNodeContext,\n entityId: string,\n accountInfo: AccountInfo,\n ) {\n const accountOriginClusterId = accountInfo.spec.account.originClusterId;\n const organizationOriginClusterId =\n accountInfo.spec.organization.originClusterId;\n const organization = accountInfo.spec.organization.name;\n\n ctx.organizationId = `${organizationOriginClusterId}/${organization}`;\n ctx.entityId = `${accountOriginClusterId}/${entityId}`;\n ctx.kcpCA = btoa(accountInfo.spec.clusterInfo.ca);\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n ClientEnvironment,\n EnvConfigService,\n RoutingConfigService,\n} from '@openmfp/portal-ui-lib';\n\n@Injectable()\nexport class CustomRoutingConfigServiceImpl implements RoutingConfigService {\n private envConfigService = inject(EnvConfigService);\n private envConfig: ClientEnvironment | null = null;\n\n constructor() {\n this.getEnvConfig();\n }\n\n async getEnvConfig(): Promise<void> {\n this.envConfig = await this.envConfigService.getEnvConfig();\n }\n\n getRoutingConfig(): any {\n return {\n pageNotFoundHandler: () => {\n if (!this.envConfig?.baseDomain) {\n return this.redirectTo('error/404');\n }\n\n if (window.location.hostname === this.envConfig.baseDomain) {\n return this.redirectTo('welcome');\n }\n\n return this.redirectTo('error/404');\n },\n };\n }\n\n public redirectTo(path: string, keepURL = true): any {\n return {\n redirectTo: path,\n keepURL,\n };\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n AuthService,\n UserProfile,\n UserProfileConfigService,\n} from '@openmfp/portal-ui-lib';\n\n@Injectable({ providedIn: 'root' })\nexport class UserProfileConfigServiceImpl implements UserProfileConfigService {\n private authService = inject(AuthService);\n async getProfile(): Promise<UserProfile> {\n const { email } = this.authService.getUserInfo();\n\n return {\n items: [\n {\n label: 'PROFILE_PROFILE',\n icon: 'customer',\n link: `/users/${email}/overview`,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAUa,4BAA4B,CAAA;AAAzC,IAAA,WAAA,GAAA;AACU,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IAgE3C;AA9DE,IAAA,MAAM,oBAAoB,GAAA;QACxB,OAAO;AACL,YAAA;AACE,gBAAA,WAAW,EAAE,OAAO;AACpB,gBAAA,KAAK,EAAE,IAAI;AACX,gBAAA,WAAW,EAAE,IAAI;AACjB,gBAAA,eAAe,EAAE,KAAK;AACtB,gBAAA,OAAO,EAAE,EAAuB;AAChC,gBAAA,QAAQ,EAAE;AACR,oBAAA;AACE,wBAAA,WAAW,EAAE,KAAK;wBAClB,UAAU,EAAE,UAAU,CAAC,YAAY;AACnC,wBAAA,WAAW,EAAE,IAAI;AACjB,wBAAA,WAAW,EAAE,IAAI;AACjB,wBAAA,OAAO,EAAE,uDAAuD;AAChE,wBAAA,OAAO,EAAE;AACP,4BAAA,EAAE,EAAE,KAAK;AACT,4BAAA,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,gBAAgB;AAC9B,yBAAA;AACvB,wBAAA,YAAY,EAAE;AACZ,4BAAA,cAAc,EAAE,IAAI;AACrB,yBAAA;AACF,qBAAA;AACF,iBAAA;AACF,aAAA;AACD,YAAA;AACE,gBAAA,WAAW,EAAE,OAAO;AACpB,gBAAA,eAAe,EAAE,KAAK;AACtB,gBAAA,WAAW,EAAE,IAAI;AACjB,gBAAA,WAAW,EAAE,IAAI;AACjB,gBAAA,OAAO,EAAE,EAAuB;AAChC,gBAAA,UAAU,EAAE,QAAQ;AACpB,gBAAA,QAAQ,EAAE;AACR,oBAAA;AACE,wBAAA,WAAW,EAAE,SAAS;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B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA5B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,cADf,MAAM,EAAA,CAAA,CAAA;;2FACnB,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACPlC;;AAEG;;;;"}
1
+ {"version":3,"file":"platform-mesh-portal-ui-lib-portal-options.mjs","sources":["../../projects/lib/portal-options/services/custom-global-nodes.service.ts","../../projects/lib/portal-options/services/header-bar-renderers/namespace-selection-renderer.service.ts","../../projects/lib/portal-options/services/header-bar-renderers/breadcrumb-renderer.ts","../../projects/lib/portal-options/services/header-bar-config.service.ts","../../projects/lib/portal-options/models/constants.ts","../../projects/lib/portal-options/services/luigi-extended-global-context-config.service.ts","../../projects/lib/portal-options/services/navigation-redirect-strategy.service.ts","../../projects/lib/portal-options/utils/account-hierarchy.util.ts","../../projects/lib/portal-options/services/crd-gateway-kcp-patch-resolver.service.ts","../../projects/lib/portal-options/services/node-change-hook-config.service.ts","../../projects/lib/portal-options/services/node-context-processing.service.ts","../../projects/lib/portal-options/services/router-config.service.ts","../../projects/lib/portal-options/services/user-profile-config.service.ts","../../projects/lib/portal-options/platform-mesh-portal-ui-lib-portal-options.ts"],"sourcesContent":["import { PortalNodeContext } from '../models/luigi-context';\nimport { PortalLuigiNode } from '../models/luigi-node';\nimport { inject } from '@angular/core';\nimport {\n CustomGlobalNodesService,\n EntityType,\n I18nService,\n NodeContext,\n} from '@openmfp/portal-ui-lib';\n\nexport class CustomGlobalNodesServiceImpl implements CustomGlobalNodesService {\n private i18nService = inject(I18nService);\n\n async getCustomGlobalNodes(): Promise<PortalLuigiNode[]> {\n return [\n {\n pathSegment: 'error',\n order: 1000,\n hideFromNav: true,\n showBreadcrumbs: false,\n context: {} as PortalNodeContext,\n children: [\n {\n pathSegment: ':id',\n entityType: EntityType.ENTITY_ERROR,\n hideFromNav: true,\n hideSideNav: true,\n viewUrl: '/assets/platform-mesh-portal-ui-wc.js#error-component',\n context: {\n id: ':id',\n translationTable: this.i18nService.translationTable,\n } as any as NodeContext,\n webcomponent: {\n selfRegistered: true,\n },\n },\n ],\n },\n {\n pathSegment: 'users',\n showBreadcrumbs: false,\n hideSideNav: true,\n hideFromNav: true,\n context: {} as PortalNodeContext,\n entityType: 'global',\n children: [\n {\n pathSegment: ':userId',\n hideSideNav: true,\n hideFromNav: true,\n defineEntity: {\n id: 'user',\n },\n context: {\n userId: ':userId',\n } as PortalNodeContext,\n children: [\n {\n pathSegment: 'overview',\n context: {} as PortalNodeContext,\n hideSideNav: true,\n hideFromNav: true,\n defineEntity: {\n id: 'overview',\n },\n compound: {\n children: [],\n },\n },\n ],\n },\n ],\n },\n ];\n }\n}\n","import { DestroyRef, Injectable, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n AuthService,\n LuigiCoreService,\n LuigiNode,\n PortalConfig,\n} from '@openmfp/portal-ui-lib';\nimport {\n FieldDefinition,\n Resource,\n ResourceDefinition,\n ResourceListResult,\n} from '@platform-mesh/portal-ui-lib/models';\nimport {\n ResourceNodeContext,\n ResourceService,\n} from '@platform-mesh/portal-ui-lib/services';\nimport {\n generateGraphQLFields,\n isNamespacedResource,\n mergeListWithSubscriptionResult,\n} from '@platform-mesh/portal-ui-lib/utils';\nimport '@ui5/webcomponents/dist/ComboBox.js';\nimport { Observable, Subject, defer, of } from 'rxjs';\nimport {\n catchError,\n retry,\n scan,\n shareReplay,\n startWith,\n switchMap,\n takeUntil,\n} from 'rxjs/operators';\n\nconst defaultColumns: FieldDefinition[] = [\n {\n label: 'Name',\n property: 'metadata.name',\n },\n];\n\n@Injectable({ providedIn: 'root' })\nexport class NamespaceSelectionRendererService {\n private namespaceResourcesCache?: {\n key: string;\n value$: Observable<Resource[]>;\n stop$: Subject<void>;\n };\n\n private resourceService = inject(ResourceService);\n private authService = inject(AuthService);\n private luigiCoreService = inject(LuigiCoreService);\n private destroyRef = inject(DestroyRef);\n\n public create(portalConfig: PortalConfig) {\n return (\n containerElement: HTMLElement,\n nodeItems: any[],\n _clickHandler: any,\n ) => {\n containerElement.style.paddingBottom = '0.5rem';\n\n const lastNode = nodeItems.at(-1)?.node as LuigiNode | undefined;\n const namespace = this.luigiCoreService\n .routing()\n .getSearchParams().namespace;\n const kcpPath = lastNode?.context?.kcpPath;\n\n if (lastNode?.context && !isNamespacedResource(lastNode.context)) {\n return containerElement;\n }\n\n const ui5combobox = this.createCombobox(containerElement);\n\n this.addComboboxItems(portalConfig, ui5combobox, namespace, kcpPath);\n\n ui5combobox.addEventListener('change', (event: any) => {\n const value = (event?.target as any)?.value.trim() ?? '';\n this.changeNamespace(value);\n });\n\n return ui5combobox as HTMLElement;\n };\n }\n\n private createCombobox(containerElement: HTMLElement) {\n const ui5combobox = document.createElement('ui5-combobox');\n ui5combobox.setAttribute('placeholder', 'Namespaces');\n containerElement.appendChild(ui5combobox);\n\n return ui5combobox;\n }\n\n private addComboboxItems(\n portalConfig: PortalConfig,\n ui5combobox: HTMLElement,\n namespace: string | null,\n kcpPath?: string,\n ) {\n this.getNamespaceResourcesCached(portalConfig, kcpPath).subscribe(\n (resources) => {\n this.syncComboboxItems(ui5combobox, resources);\n this.setSelectedValue(ui5combobox, resources, namespace);\n },\n );\n }\n\n private getNamespaceResourcesCached(\n portalConfig: PortalConfig,\n kcpPath?: string,\n ): Observable<Resource[]> {\n const cacheKey = this.getNamespaceResourcesCacheKey(kcpPath);\n if (this.namespaceResourcesCache?.key === cacheKey) {\n return this.namespaceResourcesCache.value$;\n }\n\n if (this.namespaceResourcesCache) {\n this.namespaceResourcesCache.stop$.next();\n this.namespaceResourcesCache.stop$.complete();\n this.namespaceResourcesCache = undefined;\n }\n\n const stop$ = new Subject<void>();\n const value$ = this.getNamespaceResources(\n portalConfig,\n kcpPath,\n stop$,\n ).pipe(shareReplay(1), takeUntilDestroyed(this.destroyRef));\n this.namespaceResourcesCache = {\n key: cacheKey,\n value$,\n stop$,\n };\n\n return value$;\n }\n\n private getNamespaceResourcesCacheKey(kcpPath?: string): string {\n return kcpPath ?? '';\n }\n\n private syncComboboxItems(ui5combobox: HTMLElement, resources: Resource[]) {\n ui5combobox.replaceChildren();\n\n resources.forEach((resource) => {\n const name = resource.metadata?.name;\n if (!name) {\n return;\n }\n const resourceOption = document.createElement('ui5-cb-item');\n resourceOption.setAttribute('text', name);\n ui5combobox.appendChild(resourceOption);\n });\n\n const allOption = document.createElement('ui5-cb-item');\n allOption.setAttribute('text', '-all-');\n ui5combobox.appendChild(allOption);\n }\n\n private setSelectedValue(\n ui5combobox: HTMLElement,\n resources: Resource[],\n namespace: string | null,\n ) {\n const currentNamespace = this.luigiCoreService\n .routing()\n .getSearchParams().namespace;\n\n if (currentNamespace) {\n ui5combobox.setAttribute('value', currentNamespace);\n return;\n }\n\n if (\n namespace &&\n resources.find((resource) => resource.metadata?.name === namespace)\n ) {\n ui5combobox.setAttribute('value', namespace);\n } else {\n ui5combobox.setAttribute('value', '-all-');\n this.changeNamespace('-all-');\n }\n }\n\n private getNamespaceResources(\n portalConfig: PortalConfig,\n kcpPath: string | undefined,\n stop$: Subject<void>,\n ): Observable<Resource[]> {\n const operation = 'v1_namespaces';\n const fields = generateGraphQLFields(defaultColumns);\n const context = {\n portalContext: {\n crdGatewayApiUrl: portalConfig.portalContext['crdGatewayApiUrl'],\n },\n resourceDefinition: {\n version: 'v1',\n plural: 'namespaces',\n scope: 'Cluster',\n } as ResourceDefinition,\n kcpPath,\n token: this.authService.getToken(),\n } as ResourceNodeContext;\n\n return defer(() => this.resourceService.list(operation, fields, context)).pipe(\n retry(3),\n takeUntil(stop$),\n switchMap((result: ResourceListResult) =>\n this.resourceService\n .resourceChangeSubscription(\n operation,\n fields,\n context,\n result.resourceVersion,\n false,\n )\n .pipe(\n startWith(undefined),\n scan(\n (resources, subscriptionResult) =>\n mergeListWithSubscriptionResult(resources, subscriptionResult, {\n getItemKey: (resource) => resource.metadata?.name,\n mapSubscriptionObjectToItem: (object) => object,\n }),\n result.items,\n ),\n takeUntil(stop$),\n ),\n ),\n catchError((error) => {\n console.error(`Failed to read entities from ${operation}`, error);\n return of([]);\n }),\n );\n }\n\n private changeNamespace(value: string): void {\n if (!value) {\n return;\n }\n\n const oldValue = this.luigiCoreService\n .routing()\n .getSearchParams().namespace;\n\n if (oldValue === value) {\n return;\n }\n\n this.luigiCoreService.routing().addSearchParams({ namespace: value });\n }\n}\n","import '@ui5/webcomponents/dist/Breadcrumbs.js';\nimport '@ui5/webcomponents/dist/BreadcrumbsItem.js';\n\nexport const breadcrumbRenderer = (\n containerElement: HTMLElement,\n nodeItems: any[],\n clickHandler: (item: any) => void,\n): HTMLElement => {\n containerElement.style.width = '100%';\n\n const ui5breadcrumbs = document.createElement('ui5-breadcrumbs');\n ui5breadcrumbs.setAttribute('separators', 'Slash');\n containerElement.appendChild(ui5breadcrumbs);\n\n nodeItems.forEach((item) => {\n if (item.node?.hideFromBreadcrumb) {\n return;\n }\n\n const itemCmp = document.createElement('ui5-breadcrumbs-item');\n itemCmp.textContent = item.label ?? '';\n (itemCmp as any)._item = item;\n ui5breadcrumbs.appendChild(itemCmp);\n });\n\n ui5breadcrumbs.addEventListener('item-click', (event: any) => {\n if (\n !(\n event.detail.ctrlKey ||\n event.detail.altKey ||\n event.detail.shiftKey ||\n event.detail.metaKey\n )\n ) {\n event.preventDefault();\n clickHandler(event.detail.item._item);\n }\n });\n\n return ui5breadcrumbs;\n};\n","import { Injectable, inject } from '@angular/core';\nimport {\n ConfigService,\n HeaderBarConfig,\n HeaderBarConfigService,\n} from '@openmfp/portal-ui-lib';\nimport { NamespaceSelectionRendererService } from './header-bar-renderers/namespace-selection-renderer.service';\nimport { breadcrumbRenderer } from './header-bar-renderers/breadcrumb-renderer';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class HeaderBarConfigServiceImpl implements HeaderBarConfigService {\n private configService = inject(ConfigService);\n private namespaceSelectionRendererService = inject(NamespaceSelectionRendererService);\n\n public async getConfig(): Promise<HeaderBarConfig> {\n const portalConfig = await this.configService.getPortalConfig();\n\n return {\n pendingItemLabel: '...',\n omitRoot: false,\n clearBeforeRender: true,\n autoHide: true,\n leftRenderers: [breadcrumbRenderer],\n rightRenderers: [this.namespaceSelectionRendererService.create(portalConfig)],\n };\n }\n}\n","export const kcpRootOrgsPath = 'root:orgs';\n","import { kcpRootOrgsPath } from '../models/constants';\nimport { Injectable, inject } from '@angular/core';\nimport {\n EnvConfigService,\n LuigiExtendedGlobalContextConfigService,\n} from '@openmfp/portal-ui-lib';\n\n@Injectable({ providedIn: 'root' })\nexport class LuigiExtendedGlobalContextConfigServiceImpl implements LuigiExtendedGlobalContextConfigService {\n private envConfigService = inject(EnvConfigService);\n\n async createLuigiExtendedGlobalContext(): Promise<Record<string, any>> {\n const idpName = (await this.envConfigService.getEnvConfig()).idpName;\n\n if (idpName === 'welcome') {\n return {};\n }\n\n return {\n organization: idpName,\n kcpPath: `${kcpRootOrgsPath}:${idpName}`,\n entityName: idpName,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { LocalStorageKeys, NavigationRedirectStrategy } from '@openmfp/portal-ui-lib';\n\n@Injectable({ providedIn: 'root' })\nexport class NavigationRedirectStrategyServiceImpl implements NavigationRedirectStrategy {\n getRedirectUrl(): string {\n return localStorage.getItem(LocalStorageKeys.LAST_NAVIGATION_URL) || '';\n }\n\n saveRedirectUrl(url: string): void {\n if (url.startsWith('/error')) {\n return;\n }\n\n localStorage.setItem(LocalStorageKeys.LAST_NAVIGATION_URL, url);\n }\n\n clearRedirectUrl(): void {\n localStorage.removeItem(LocalStorageKeys.LAST_NAVIGATION_URL);\n }\n}\n","import { PortalLuigiNode } from '../models/luigi-node';\n\nexport function collectAccountNamesFromNodeHierarchy(\n node: PortalLuigiNode | undefined,\n): string[] {\n const accountNames: string[] = [];\n let currentNode: PortalLuigiNode | undefined = node;\n\n while (currentNode) {\n const entityName = currentNode.context?.entityName;\n const entityKind = currentNode.context?.entityKind;\n if (entityName && entityKind?.toLowerCase() === 'account') {\n accountNames.unshift(entityName);\n }\n currentNode = currentNode.parent;\n }\n\n return accountNames;\n}\n\nexport function getInitialAccountId(\n entityId?: string,\n kind?: string,\n): string | undefined {\n return kind?.toLowerCase() === 'account' && entityId ? entityId : undefined;\n}\n\nexport function calculateAccountHierarchy(\n entityNode: PortalLuigiNode,\n entityId?: string,\n kind?: string,\n): string[] {\n const initialAccountId = getInitialAccountId(entityId, kind);\n // when we are on a dynamic node and the id any kind has changed we need to reset the context data\n if (entityNode.defineEntity?.contextKey && initialAccountId) {\n entityNode.context.entityName = undefined;\n entityNode.context.entityKind = undefined;\n }\n\n const accountNames = collectAccountNamesFromNodeHierarchy(entityNode);\n\n if (initialAccountId) {\n accountNames.push(initialAccountId);\n }\n return accountNames;\n}\n","import { kcpRootOrgsPath } from '../models/constants';\nimport { PortalLuigiNode } from '../models/luigi-node';\nimport {\n calculateAccountHierarchy,\n getInitialAccountId,\n} from '../utils/account-hierarchy.util';\nimport { Injectable, inject } from '@angular/core';\nimport { EnvConfigService } from '@openmfp/portal-ui-lib';\nimport { GatewayService } from '@platform-mesh/portal-ui-lib/services';\n\nexport interface KcpData {\n kcpPath: string;\n accountPath: string | undefined;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class CrdGatewayKcpPatchResolver {\n private gatewayService = inject(GatewayService);\n private envConfigService = inject(EnvConfigService);\n\n public async resolveCrdGatewayKcpPath(\n nextNode: PortalLuigiNode,\n entityId?: string,\n kind?: string,\n ): Promise<KcpData> {\n if (nextNode.context?.kcpPath && !getInitialAccountId(entityId, kind)) {\n this.gatewayService.updateCrdGatewayUrlWithEntityPath(\n nextNode.context.kcpPath,\n );\n return {\n kcpPath: nextNode.context.kcpPath,\n accountPath: nextNode.context.accountPath,\n };\n }\n\n const accountNames = calculateAccountHierarchy(nextNode, entityId, kind);\n\n const accountPath =\n accountNames.length > 0 ? `${accountNames.join(':')}` : '';\n\n const org = (await this.envConfigService.getEnvConfig()).idpName;\n const kcpPath = `${kcpRootOrgsPath}:${org}${accountPath ? ':' + accountPath : ''}`;\n this.gatewayService.updateCrdGatewayUrlWithEntityPath(kcpPath);\n\n if (nextNode.context) {\n nextNode.context.kcpPath = kcpPath;\n nextNode.context.accountPath = accountPath;\n }\n return { kcpPath, accountPath };\n }\n}\n","import { PortalLuigiNode } from '../models/luigi-node';\nimport { CrdGatewayKcpPatchResolver } from './crd-gateway-kcp-patch-resolver.service';\nimport { Injectable, inject } from '@angular/core';\nimport {\n LuigiCoreService,\n NodeChangeHookConfigService,\n NodeContext,\n} from '@openmfp/portal-ui-lib';\n\n@Injectable({ providedIn: 'root' })\nexport class NodeChangeHookConfigServiceImpl implements NodeChangeHookConfigService {\n private luigiCoreService = inject(LuigiCoreService);\n private crdGatewayKcpPatchResolver = inject(CrdGatewayKcpPatchResolver);\n\n async nodeChangeHook(\n prevNode: PortalLuigiNode,\n nextNode: PortalLuigiNode,\n currentContext: NodeContext,\n ) {\n if (\n nextNode.initialRoute &&\n nextNode.virtualTree &&\n !(nextNode as any)._virtualTree\n ) {\n this.luigiCoreService.navigation().navigate(nextNode.initialRoute);\n }\n\n await this.crdGatewayKcpPatchResolver.resolveCrdGatewayKcpPath(nextNode);\n }\n}\n","import { PortalNodeContext } from '../models/luigi-context';\nimport { PortalLuigiNode } from '../models/luigi-node';\nimport { CrdGatewayKcpPatchResolver } from './crd-gateway-kcp-patch-resolver.service';\nimport { Injectable, inject } from '@angular/core';\nimport { NodeContextProcessingService } from '@openmfp/portal-ui-lib';\nimport { AccountInfo } from '@platform-mesh/portal-ui-lib/models';\nimport {\n AccountInfoService,\n ErrorHandlerService,\n OrganizationReadyService,\n} from '@platform-mesh/portal-ui-lib/services';\nimport { firstValueFrom } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NodeContextProcessingServiceImpl implements NodeContextProcessingService {\n private crdGatewayKcpPatchResolver = inject(CrdGatewayKcpPatchResolver);\n private accountInfoService = inject(AccountInfoService);\n private organizationReadyService = inject(OrganizationReadyService);\n private errorHandlerService = inject(ErrorHandlerService);\n\n public async processNodeContext(\n dynamicEntityId: string,\n entityNode: PortalLuigiNode,\n ctx: PortalNodeContext,\n ) {\n const kind = entityNode.defineEntity?.type;\n const entityId =\n dynamicEntityId || entityNode.context.resourceDefinition?.name;\n\n if (!entityId) {\n return;\n }\n\n const { kcpPath, accountPath } =\n await this.crdGatewayKcpPatchResolver.resolveCrdGatewayKcpPath(\n entityNode,\n entityId,\n kind,\n );\n\n // update the current already calculated by Luigi context for a node\n this.addFieldsToContext(ctx, entityId, kcpPath, accountPath, kind);\n\n // update the node context of sa node to contain the entity for future context calculations\n this.addFieldsToContext(\n entityNode.context,\n entityId,\n kcpPath,\n accountPath,\n kind,\n );\n\n try {\n const accountInfo = await firstValueFrom(\n this.accountInfoService.read({\n portalContext: {\n crdGatewayApiUrl: ctx.portalContext.crdGatewayApiUrl,\n },\n token: ctx.token,\n accountId: entityId,\n }),\n );\n\n // update the current already calculated by Luigi context for a node\n this.addFieldsToContextFromAccountInfo(ctx, entityId, accountInfo);\n\n // update the node context of sa node to contain the entity for future context calculations\n this.addFieldsToContextFromAccountInfo(\n entityNode.context,\n entityId,\n accountInfo,\n );\n\n // we were able to ready the account info so on this kcpPath we can query for the organization ready state\n this.organizationReadyService.checkOrganizationReady();\n } catch (e) {\n if (!this.errorHandlerService.isUnauthorizedAccess(e)) {\n console.error('Failed to read account info', e);\n }\n }\n }\n\n private addFieldsToContext(\n ctx: PortalNodeContext,\n entityId: string | undefined,\n kcpPath: string,\n accountPath: string | undefined,\n kind: string | undefined,\n ) {\n ctx.kcpPath = kcpPath;\n ctx.entityName = entityId;\n ctx.entityKind = kind;\n ctx.accountPath = accountPath;\n }\n\n private addFieldsToContextFromAccountInfo(\n ctx: PortalNodeContext,\n entityId: string,\n accountInfo: AccountInfo,\n ) {\n const accountOriginClusterId = accountInfo.spec.account.originClusterId;\n const organizationOriginClusterId =\n accountInfo.spec.organization.originClusterId;\n const organization = accountInfo.spec.organization.name;\n\n ctx.organizationId = `${organizationOriginClusterId}/${organization}`;\n ctx.entityId = `${accountOriginClusterId}/${entityId}`;\n ctx.kcpCA = btoa(accountInfo.spec.clusterInfo.ca);\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n ClientEnvironment,\n EnvConfigService,\n RoutingConfigService,\n} from '@openmfp/portal-ui-lib';\n\n@Injectable()\nexport class CustomRoutingConfigServiceImpl implements RoutingConfigService {\n private envConfigService = inject(EnvConfigService);\n private envConfig: ClientEnvironment | null = null;\n\n constructor() {\n this.getEnvConfig();\n }\n\n async getEnvConfig(): Promise<void> {\n this.envConfig = await this.envConfigService.getEnvConfig();\n }\n\n getRoutingConfig(): any {\n return {\n preserveQueryParams: true,\n pageNotFoundHandler: () => {\n if (!this.envConfig?.baseDomain) {\n return this.redirectTo('error/404');\n }\n\n if (window.location.hostname === this.envConfig.baseDomain) {\n return this.redirectTo('welcome');\n }\n\n return this.redirectTo('error/404');\n },\n };\n }\n\n public redirectTo(path: string, keepURL = true): any {\n return {\n redirectTo: path,\n keepURL,\n };\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n AuthService,\n UserProfile,\n UserProfileConfigService,\n} from '@openmfp/portal-ui-lib';\n\n@Injectable({ providedIn: 'root' })\nexport class UserProfileConfigServiceImpl implements UserProfileConfigService {\n private authService = inject(AuthService);\n async getProfile(): Promise<UserProfile> {\n const { email } = this.authService.getUserInfo();\n\n return {\n items: [\n {\n label: 'PROFILE_PROFILE',\n icon: 'customer',\n link: `/users/${email}/overview`,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"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AAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,cADf,MAAM,EAAA,CAAA,CAAA;;2FACnB,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACPlC;;AAEG;;;;"}
@@ -9,10 +9,10 @@ import { Apollo, gql } from 'apollo-angular';
9
9
  import { HttpLink } from 'apollo-angular/http';
10
10
  import { print } from 'graphql';
11
11
  import { createClient } from 'graphql-sse';
12
- import { getValueByPath, buildResourcePath, getResourceValueByJsonPath, replaceDotsAndHyphensWithUnderscores, capitalize, stripTypename } from '@platform-mesh/portal-ui-lib/utils';
12
+ import { isNamespacedResource, getValueByPath, buildResourcePath, getResourceValueByJsonPath, replaceDotsAndHyphensWithUnderscores, capitalize, stripTypename } from '@platform-mesh/portal-ui-lib/utils';
13
13
  import * as gqlBuilder from 'gql-query-builder';
14
14
  import { throwError, Subject, filter, exhaustMap, EMPTY } from 'rxjs';
15
- import { map, catchError } from 'rxjs/operators';
15
+ import { map, catchError, shareReplay } from 'rxjs/operators';
16
16
 
17
17
  class GatewayService {
18
18
  constructor() {
@@ -122,8 +122,9 @@ class ResourceService {
122
122
  this.luigiCoreService = inject(LuigiCoreService);
123
123
  }
124
124
  read(resourceId, params, fieldsOrRawQuery, nodeContext, readFromParentKcpPath = true) {
125
- const isNamespacedResource = this.isNamespacedResource(nodeContext);
126
- let query = this.resolveReadQuery(params, fieldsOrRawQuery, resourceId, isNamespacedResource ? nodeContext.namespaceId : undefined);
125
+ const isNamespaced = isNamespacedResource(nodeContext);
126
+ const namespace = this.getNamespace(nodeContext);
127
+ let query = this.resolveReadQuery(params, fieldsOrRawQuery, resourceId, isNamespaced ? namespace : undefined);
127
128
  query = this.parseGQLQuery(query);
128
129
  return this.apolloFactory
129
130
  .apollo(nodeContext, readFromParentKcpPath)
@@ -131,8 +132,8 @@ class ResourceService {
131
132
  query,
132
133
  variables: {
133
134
  name: resourceId,
134
- ...(isNamespacedResource && {
135
- namespace: nodeContext.namespaceId,
135
+ ...(isNamespaced && {
136
+ namespace: namespace,
136
137
  }),
137
138
  },
138
139
  })
@@ -164,10 +165,10 @@ class ResourceService {
164
165
  }
165
166
  }
166
167
  list(operation, fieldsOrRawQuery, nodeContext, readFromParentKcpPath = false, pagination) {
167
- const isNamespacedResource = this.isNamespacedResource(nodeContext);
168
+ const isNamespaced = isNamespacedResource(nodeContext);
168
169
  const variables = {
169
- ...(isNamespacedResource && {
170
- namespace: { type: 'String', value: nodeContext.namespaceId },
170
+ ...(isNamespaced && {
171
+ namespace: { type: 'String', value: this.getNamespace(nodeContext) },
171
172
  }),
172
173
  ...(pagination?.limit && {
173
174
  limit: { type: 'Int', value: pagination?.limit },
@@ -248,10 +249,10 @@ class ResourceService {
248
249
  }));
249
250
  }
250
251
  resourceChangeSubscription(operation, fields, nodeContext, resourceVersion, readFromParentKcpPath) {
251
- const isNamespacedResource = this.isNamespacedResource(nodeContext);
252
+ const isNamespaced = isNamespacedResource(nodeContext);
252
253
  const variables = {
253
- ...(isNamespacedResource && {
254
- namespace: { type: 'String', value: nodeContext.namespaceId },
254
+ ...(isNamespaced && {
255
+ namespace: { type: 'String', value: this.getNamespace(nodeContext) },
255
256
  }),
256
257
  };
257
258
  const lowerCaseOperation = operation.toLowerCase();
@@ -292,7 +293,7 @@ class ResourceService {
292
293
  }
293
294
  delete(resource, resourceDefinition, nodeContext, readFromParentKcpPath = false) {
294
295
  const group = replaceDotsAndHyphensWithUnderscores(resourceDefinition.group);
295
- const isNamespacedResource = this.isNamespacedResource(nodeContext);
296
+ const isNamespaced = isNamespacedResource(nodeContext);
296
297
  const kind = resourceDefinition.kind;
297
298
  const version = resourceDefinition.version;
298
299
  const fields = [
@@ -300,8 +301,11 @@ class ResourceService {
300
301
  operation: `delete${kind}`,
301
302
  variables: {
302
303
  name: { type: 'String!', value: resource.metadata.name },
303
- ...(isNamespacedResource && {
304
- namespace: { type: 'String', value: nodeContext.namespaceId },
304
+ ...(isNamespaced && {
305
+ namespace: {
306
+ type: 'String',
307
+ value: this.getNamespace(nodeContext),
308
+ },
305
309
  }),
306
310
  },
307
311
  fields: [],
@@ -326,16 +330,16 @@ class ResourceService {
326
330
  }));
327
331
  }
328
332
  create(resource, resourceDefinition, nodeContext) {
329
- const isNamespacedResource = this.isNamespacedResource(nodeContext);
333
+ const isNamespaced = isNamespacedResource(nodeContext);
330
334
  const group = replaceDotsAndHyphensWithUnderscores(resourceDefinition.group);
331
335
  const version = resourceDefinition.version;
332
336
  const kind = resourceDefinition.kind;
333
- const namespace = nodeContext.namespaceId;
337
+ const namespace = this.getNamespace(nodeContext);
334
338
  const mutationFields = [
335
339
  {
336
340
  operation: `create${kind}`,
337
341
  variables: {
338
- ...(isNamespacedResource && {
342
+ ...(isNamespaced && {
339
343
  namespace: { type: 'String', value: namespace },
340
344
  }),
341
345
  object: { type: `${kind}Input!`, value: resource },
@@ -363,17 +367,17 @@ class ResourceService {
363
367
  }));
364
368
  }
365
369
  update(resource, resourceDefinition, nodeContext, readFromParentKcpPath = false, fields = ['__typename']) {
366
- const isNamespacedResource = this.isNamespacedResource(nodeContext);
370
+ const isNamespaced = isNamespacedResource(nodeContext);
367
371
  const group = replaceDotsAndHyphensWithUnderscores(resourceDefinition.group);
368
372
  const kind = resourceDefinition.kind;
369
373
  const version = resourceDefinition.version;
370
- const namespace = nodeContext.namespaceId;
374
+ const namespace = this.getNamespace(nodeContext);
371
375
  const cleanResource = stripTypename(resource);
372
376
  const mutationFields = [
373
377
  {
374
378
  operation: `update${kind}`,
375
379
  variables: {
376
- ...(isNamespacedResource && {
380
+ ...(isNamespaced && {
377
381
  namespace: { type: 'String', value: namespace },
378
382
  }),
379
383
  name: { type: 'String!', value: resource.metadata.name },
@@ -404,8 +408,15 @@ class ResourceService {
404
408
  return throwError(() => error);
405
409
  }));
406
410
  }
407
- isNamespacedResource(nodeContext) {
408
- return nodeContext?.resourceDefinition?.scope === 'Namespaced';
411
+ getNamespace(nodeContext) {
412
+ if (nodeContext.namespaceId) {
413
+ return nodeContext.namespaceId;
414
+ }
415
+ const namespace = this.luigiCoreService.routing().getSearchParams().namespace;
416
+ if (namespace) {
417
+ return namespace === '-all-' ? undefined : namespace;
418
+ }
419
+ return undefined;
409
420
  }
410
421
  normalizeGqlBuilderVariables(variables) {
411
422
  return Object.fromEntries(Object.entries(variables).map(([key, value]) => [key, value.value]));
@@ -495,9 +506,15 @@ const accountInfoRead = gql `
495
506
  class AccountInfoService {
496
507
  constructor() {
497
508
  this.apolloFactory = inject(ApolloFactory);
509
+ this.readCache = new Map();
498
510
  }
499
511
  read(nodeContext) {
500
- return this.apolloFactory
512
+ const cacheKey = nodeContext.kcpPath ?? '';
513
+ const cachedRead = this.readCache.get(cacheKey);
514
+ if (cachedRead) {
515
+ return cachedRead;
516
+ }
517
+ const request$ = this.apolloFactory
501
518
  .apollo(nodeContext)
502
519
  .query({
503
520
  query: accountInfoRead,
@@ -514,7 +531,12 @@ class AccountInfoService {
514
531
  },
515
532
  },
516
533
  };
534
+ }), shareReplay(1), catchError((error) => {
535
+ this.readCache.delete(cacheKey);
536
+ return throwError(() => error);
517
537
  }));
538
+ this.readCache.set(cacheKey, request$);
539
+ return request$;
518
540
  }
519
541
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: AccountInfoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
520
542
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: AccountInfoService, providedIn: 'root' }); }