-
Notifications
You must be signed in to change notification settings - Fork 0
Add kcpPath to Luigi context configuration and processing
#98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
0ebae56
0ea15dd
64fbc29
3c1e7f3
23e43d4
685bce8
8eae74f
2fef084
80101e8
1e02be7
c6faa87
61e8866
7c0081d
779353a
de5f47e
f91c9fe
c099caf
8f137b8
f274288
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,6 @@ import { PortalNodeContext } from './luigi-context'; | |
| import { LuigiNode } from '@openmfp/portal-ui-lib'; | ||
|
|
||
| export interface PortalLuigiNode extends LuigiNode { | ||
| context?: PortalNodeContext; | ||
| context: PortalNodeContext; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify that making context required doesn't break existing code. Changing Run the following script to verify all usages of PortalLuigiNode provide a context: 🏁 Script executed: #!/bin/bash
# Description: Find all PortalLuigiNode instantiations and verify they include context property
# Search for object literals typed as PortalLuigiNode or assignments/returns
rg -n -A 10 -B 2 --type=ts 'as PortalLuigiNode|: PortalLuigiNode\[?\]|Promise<PortalLuigiNode'Length of output: 1339 I need to examine the complete file content and search for all usages of Now let me examine the complete file to verify if Length of output: 1827 I found a critical issue! The nested Length of output: 4488 Let me examine the service implementations and test files to see if they instantiate Length of output: 4707 Length of output: 6025 Add context property to nested overview node in custom-global-nodes.service.ts. Making 🤖 Prompt for AI Agents |
||
| parent?: PortalLuigiNode; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,19 +30,17 @@ export class CustomGlobalNodesServiceImpl implements CustomGlobalNodesService { | |
| showBreadcrumbs: false, | ||
| hideSideNav: true, | ||
| hideFromNav: true, | ||
| context: {} as PortalNodeContext, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify that an empty context is appropriate for the users node. The Please verify:
Run this script to check how context is accessed for these nodes: 🏁 Script executed: #!/bin/bash
# Description: Find usages of users node context to verify if portalContext is accessed
# Search for context access patterns in node processing
rg -n -A 5 --type=ts 'users.*context|pathSegment.*users' | head -50
# Check PortalNodeContext interface definition for required fields
ast-grep --pattern 'interface PortalNodeContext {
$$$
}'Length of output: 613 I need to search more thoroughly for the interface definition and context usage patterns.The web search returned generic TypeScript interface information. I need to search for the specific PortalNodeContext definition in the codebase instead. 🏁 Script executed: #!/bin/bash
# Find PortalNodeContext interface definition
rg -n 'interface PortalNodeContext|type PortalNodeContext' --type=ts | head -20
# Also search for NodeContext interface to understand the hierarchy
rg -n 'interface NodeContext|type NodeContext' --type=ts | head -20
# Search for imports of these types
rg -n 'import.*PortalNodeContext' --type=ts | head -20Length of output: 621 🏁 Script executed: #!/bin/bash
# Look for how context is accessed on nodes
rg -n 'context\.portalContext|context\[' --type=ts | head -30
# Search for where these nodes are processed/consumed
rg -n 'getCustomGlobalNodes|\.context' projects/lib/portal-options/services/custom-global-nodes.service.ts -A 5 -B 5Length of output: 441 🏁 Script executed: #!/bin/bash
# Check if there's any runtime context initialization
rg -n 'portalContext|PortalContext' --type=ts | grep -i 'init\|assign\|set\|populate' | head -20Length of output: 0 🏁 Script executed: #!/bin/bash
# View the PortalNodeContext and NodeContext interface definitions
cat projects/lib/portal-options/models/luigi-context.ts
# Also check what NodeContext is (might be from Luigi library)
rg -n 'interface NodeContext|type NodeContext|from.*NodeContext' --type=ts -B 2 -A 10 | head -40Length of output: 490 🏁 Script executed: #!/bin/bash
# Check node-context-processing.service.ts to see how contexts are actually used
cat projects/lib/portal-options/services/node-context-processing.service.ts | head -100Length of output: 2832 🏁 Script executed: #!/bin/bash
# Search for actual consumption of getCustomGlobalNodes and how contexts are accessed
rg -n 'getCustomGlobalNodes' --type=ts -A 10 -B 2 | head -50Length of output: 1339 🏁 Script executed: #!/bin/bash
# View full custom-global-nodes.service.ts to see all node definitions
cat projects/lib/portal-options/services/custom-global-nodes.service.tsLength of output: 1827 🏁 Script executed: #!/bin/bash
# Search for where processNodeContext is called to understand which nodes it applies to
rg -n 'processNodeContext' --type=ts -B 5 -A 5 | head -60Length of output: 6062 Provide valid portalContext for nodes that will be processed by Luigi. The Populate these contexts with at least 🤖 Prompt for AI Agents |
||
| entityType: 'global', | ||
| children: [ | ||
| { | ||
| context: { | ||
| profileUserId: ':profileUserId', | ||
| } as unknown as PortalNodeContext, | ||
| pathSegment: ':userId', | ||
| hideSideNav: true, | ||
| hideFromNav: true, | ||
| defineEntity: { | ||
| id: 'user', | ||
| contextKey: 'profileUserId', | ||
| }, | ||
| pathSegment: ':profileUserId', | ||
| hideSideNav: true, | ||
| hideFromNav: true, | ||
| context: {} as PortalNodeContext, | ||
| children: [ | ||
| { | ||
| pathSegment: 'overview', | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,7 +7,6 @@ import { ResourceService } from '@platform-mesh/portal-ui-lib/services'; | |||||||||||||||||||||||
| import { replaceDotsAndHyphensWithUnderscores } from '@platform-mesh/portal-ui-lib/utils'; | ||||||||||||||||||||||||
| import { firstValueFrom } from 'rxjs'; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| @Injectable({ | ||||||||||||||||||||||||
| providedIn: 'root', | ||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||
|
|
@@ -30,10 +29,10 @@ export class NodeContextProcessingServiceImpl | |||||||||||||||||||||||
| return; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| await this.crdGatewayKcpPatchResolver.resolveCrdGatewayKcpPathForNextAccountEntity( | ||||||||||||||||||||||||
| await this.crdGatewayKcpPatchResolver.resolveCrdGatewayKcpPath( | ||||||||||||||||||||||||
| entityNode.parent || ({} as PortalLuigiNode), | ||||||||||||||||||||||||
| entityId, | ||||||||||||||||||||||||
| kind, | ||||||||||||||||||||||||
| entityNode, | ||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| await this.crdGatewayKcpPatchResolver.resolveCrdGatewayKcpPath( | |
| entityNode.parent || ({} as PortalLuigiNode), | |
| entityId, | |
| kind, | |
| entityNode, | |
| ); | |
| await this.crdGatewayKcpPatchResolver.resolveCrdGatewayKcpPath( | |
| entityNode.parent || ({ context: {} } as PortalLuigiNode), | |
| entityId, | |
| kind, | |
| ); |
🤖 Prompt for AI Agents
In projects/lib/portal-options/services/node-context-processing.service.ts
around lines 32 to 36, the code currently casts an empty object when
entityNode.parent is undefined, which lacks the required context and causes
resolveCrdGatewayKcpPath to throw; change the fallback to pass a valid
PortalLuigiNode instance whose context property is initialized (for example,
context should be an object with kcpPath initialized to an empty array) so that
nextNode.context.kcpPath can be safely read/assigned.
Uh oh!
There was an error while loading. Please reload this page.