@platform-mesh/portal-server-lib 0.6.41 → 0.7.1
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/dist/portal-options/utils/account-hierarchy-resolver.js +1 -1
- package/dist/portal-options/utils/account-hierarchy-resolver.js.map +1 -1
- package/package.json +2 -2
- package/src/portal-options/service-providers/content-configuration-service-providers.service.spec.ts +1 -1
- package/src/portal-options/service-providers/kubernetes-service-providers.service.spec.ts +1 -1
- package/src/portal-options/utils/account-hierarchy-resolver.spec.ts +10 -10
- package/src/portal-options/utils/account-hierarchy-resolver.ts +1 -1
|
@@ -19,7 +19,7 @@ export const updateAccountNodeChildren = (contentConfiguration, accountPath) =>
|
|
|
19
19
|
if (accountChildrenNode) {
|
|
20
20
|
const nextHierarchyLevel = accountPath.split(':').filter(Boolean).length + 1;
|
|
21
21
|
const previousPathSegment = accountChildrenNode.pathSegment;
|
|
22
|
-
const nextPathSegment = `:${ACCOUNT_ENTITY_TYPE}Id
|
|
22
|
+
const nextPathSegment = `:${nextHierarchyLevel}_${ACCOUNT_ENTITY_TYPE}Id`;
|
|
23
23
|
replaceStringDeep(accountChildrenNode, previousPathSegment, nextPathSegment);
|
|
24
24
|
}
|
|
25
25
|
return contentConfiguration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-hierarchy-resolver.js","sourceRoot":"","sources":["../../../src/portal-options/utils/account-hierarchy-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,MAAM,mBAAmB,GAAG,+BAA+B,CAAC;AAE5D,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,oBAA0C,EAC1C,WAAmB,EACG,EAAE;IACxB,oBAAoB,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACnE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;YACnD,OAAO;QACT,CAAC;QAED,MAAM,gBAAgB,GAAG,WAAW;aACjC,KAAK,CAAC,GAAG,CAAC;aACV,MAAM,CAAC,OAAO,CAAC;aACf,GAAG,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC;aAC9B,IAAI,CAAC,GAAG,CAAC,CAAC;QAEb,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CACvC,mBAAmB,EACnB,gBAAgB,CACjB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,oBAAoB,CAAC;AAC9B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,oBAA0C,EAC1C,WAAmB,EACG,EAAE;IACxB,MAAM,mBAAmB,GACvB,oBAAoB,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IAExE,IAAI,mBAAmB,EAAE,CAAC;QACxB,MAAM,kBAAkB,GACtB,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACpD,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,WAAW,CAAC;QAC5D,MAAM,eAAe,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"account-hierarchy-resolver.js","sourceRoot":"","sources":["../../../src/portal-options/utils/account-hierarchy-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,MAAM,mBAAmB,GAAG,+BAA+B,CAAC;AAE5D,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,oBAA0C,EAC1C,WAAmB,EACG,EAAE;IACxB,oBAAoB,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAA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IACxE,IAAI,WAAW,EAAE,CAAC;QAChB,IAAI,oBAAoB,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC7C,yBAAyB,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;QAC/D,CAAC;QAED,OAAO,+BAA+B,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platform-mesh/portal-server-lib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"author": "Platform Mesh",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@types/jest": "30.0.0",
|
|
60
60
|
"@types/node": "24.12.0",
|
|
61
61
|
"@types/supertest": "7.2.0",
|
|
62
|
-
"eslint": "10.0
|
|
62
|
+
"eslint": "10.1.0",
|
|
63
63
|
"eslint-config-prettier": "10.1.8",
|
|
64
64
|
"globals": "17.4.0",
|
|
65
65
|
"jest": "30.2.0",
|
package/src/portal-options/service-providers/content-configuration-service-providers.service.spec.ts
CHANGED
|
@@ -309,7 +309,7 @@ describe('ContentConfigurationServiceProvidersService', () => {
|
|
|
309
309
|
.data.nodes[0].children[0];
|
|
310
310
|
|
|
311
311
|
expect(childNode.defineEntity.id).toBe('old-id');
|
|
312
|
-
expect(childNode.pathSegment).toBe(':
|
|
312
|
+
expect(childNode.pathSegment).toBe(':2_core_platform-mesh_io_accountId');
|
|
313
313
|
});
|
|
314
314
|
|
|
315
315
|
it('does not apply processContentConfigurationForAccountHierarchy when accountPath is not provided', async () => {
|
|
@@ -536,7 +536,7 @@ describe('KubernetesServiceProvidersService', () => {
|
|
|
536
536
|
.data.nodes[0].children[0];
|
|
537
537
|
|
|
538
538
|
expect(childNode.defineEntity.id).toBe('old-id');
|
|
539
|
-
expect(childNode.pathSegment).toBe(':
|
|
539
|
+
expect(childNode.pathSegment).toBe(':2_core_platform-mesh_io_accountId');
|
|
540
540
|
});
|
|
541
541
|
|
|
542
542
|
it('should not apply processContentConfigurationForAccountHierarchy when accountPath is not provided', async () => {
|
|
@@ -129,7 +129,7 @@ describe('updateAccountNodeChildren', () => {
|
|
|
129
129
|
.children?.[0] as any;
|
|
130
130
|
|
|
131
131
|
expect(childNode.defineEntity.id).toBe('old-id');
|
|
132
|
-
expect(childNode.pathSegment).toBe(':
|
|
132
|
+
expect(childNode.pathSegment).toBe(':2_core_platform-mesh_io_accountId');
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
it('should replace all additional fields equal to previous pathSegment', () => {
|
|
@@ -167,18 +167,18 @@ describe('updateAccountNodeChildren', () => {
|
|
|
167
167
|
const childNode = result.luigiConfigFragment.data.nodes[0]
|
|
168
168
|
.children?.[0] as any;
|
|
169
169
|
|
|
170
|
-
expect(childNode.pathSegment).toBe(':
|
|
170
|
+
expect(childNode.pathSegment).toBe(':2_core_platform-mesh_io_accountId');
|
|
171
171
|
expect(childNode.defineEntity.contextKey).toBe(
|
|
172
|
-
':
|
|
172
|
+
':2_core_platform-mesh_io_accountId',
|
|
173
173
|
);
|
|
174
174
|
expect(childNode.defineEntity.additionalContextKeys[0]).toBe(
|
|
175
|
-
':
|
|
175
|
+
':2_core_platform-mesh_io_accountId',
|
|
176
176
|
);
|
|
177
|
-
expect(childNode.context.customPath).toBe(':
|
|
177
|
+
expect(childNode.context.customPath).toBe(':2_core_platform-mesh_io_accountId');
|
|
178
178
|
expect(childNode.context.nested[0].deepPath).toBe(
|
|
179
|
-
':
|
|
179
|
+
':2_core_platform-mesh_io_accountId',
|
|
180
180
|
);
|
|
181
|
-
expect(childNode.navHeader.label).toBe(':
|
|
181
|
+
expect(childNode.navHeader.label).toBe(':2_core_platform-mesh_io_accountId');
|
|
182
182
|
});
|
|
183
183
|
|
|
184
184
|
it('should keep defineEntity.id controlled only by explicit assignment', () => {
|
|
@@ -207,7 +207,7 @@ describe('updateAccountNodeChildren', () => {
|
|
|
207
207
|
const childNode = result.luigiConfigFragment.data.nodes[0]
|
|
208
208
|
.children?.[0] as any;
|
|
209
209
|
|
|
210
|
-
expect(childNode.defineEntity.id).toBe(':
|
|
210
|
+
expect(childNode.defineEntity.id).toBe(':2_core_platform-mesh_io_accountId');
|
|
211
211
|
});
|
|
212
212
|
|
|
213
213
|
it('should not replace strings that only partially match previous pathSegment', () => {
|
|
@@ -237,7 +237,7 @@ describe('updateAccountNodeChildren', () => {
|
|
|
237
237
|
const childNode = result.luigiConfigFragment.data.nodes[0]
|
|
238
238
|
.children?.[0] as any;
|
|
239
239
|
|
|
240
|
-
expect(childNode.context.exact).toBe(':
|
|
240
|
+
expect(childNode.context.exact).toBe(':2_core_platform-mesh_io_accountId');
|
|
241
241
|
expect(childNode.context.partial).toBe(':core_platform-mesh_io_accountId:suffix');
|
|
242
242
|
});
|
|
243
243
|
|
|
@@ -291,7 +291,7 @@ describe('updateAccountNodeChildren', () => {
|
|
|
291
291
|
.children?.[0] as any;
|
|
292
292
|
|
|
293
293
|
expect(childNode.defineEntity.id).toBe('old-id');
|
|
294
|
-
expect(childNode.pathSegment).toBe(':
|
|
294
|
+
expect(childNode.pathSegment).toBe(':4_core_platform-mesh_io_accountId');
|
|
295
295
|
});
|
|
296
296
|
|
|
297
297
|
it('should not fail when there are no nodes', () => {
|
|
@@ -38,7 +38,7 @@ export const updateAccountNodeChildren = (
|
|
|
38
38
|
const nextHierarchyLevel =
|
|
39
39
|
accountPath.split(':').filter(Boolean).length + 1;
|
|
40
40
|
const previousPathSegment = accountChildrenNode.pathSegment;
|
|
41
|
-
const nextPathSegment = `:${ACCOUNT_ENTITY_TYPE}Id
|
|
41
|
+
const nextPathSegment = `:${nextHierarchyLevel}_${ACCOUNT_ENTITY_TYPE}Id`;
|
|
42
42
|
|
|
43
43
|
replaceStringDeep(
|
|
44
44
|
accountChildrenNode,
|