@@ -40,56 +40,8 @@ interface ResolutionContext {
4040 blockId ?: string
4141}
4242
43- function getSemanticFallback ( subBlockId : string , subBlockConfig ?: SubBlockConfig ) : string {
44- if ( subBlockConfig ?. title ) {
45- return subBlockConfig . title . toLowerCase ( )
46- }
47-
48- const patterns : Record < string , string > = {
49- credential : 'credential' ,
50- channel : 'channel' ,
51- channelId : 'channel' ,
52- user : 'user' ,
53- userId : 'user' ,
54- workflow : 'workflow' ,
55- workflowId : 'workflow' ,
56- file : 'file' ,
57- fileId : 'file' ,
58- folder : 'folder' ,
59- folderId : 'folder' ,
60- project : 'project' ,
61- projectId : 'project' ,
62- team : 'team' ,
63- teamId : 'team' ,
64- sheet : 'sheet' ,
65- sheetId : 'sheet' ,
66- document : 'document' ,
67- documentId : 'document' ,
68- knowledgeBase : 'knowledge base' ,
69- knowledgeBaseId : 'knowledge base' ,
70- server : 'server' ,
71- serverId : 'server' ,
72- tool : 'tool' ,
73- toolId : 'tool' ,
74- calendar : 'calendar' ,
75- calendarId : 'calendar' ,
76- label : 'label' ,
77- labelId : 'label' ,
78- site : 'site' ,
79- siteId : 'site' ,
80- collection : 'collection' ,
81- collectionId : 'collection' ,
82- item : 'item' ,
83- itemId : 'item' ,
84- contact : 'contact' ,
85- contactId : 'contact' ,
86- task : 'task' ,
87- taskId : 'task' ,
88- chat : 'chat' ,
89- chatId : 'chat' ,
90- }
91-
92- return patterns [ subBlockId ] || 'value'
43+ function getSemanticFallback ( subBlockConfig : SubBlockConfig ) : string {
44+ return ( subBlockConfig . title ?? subBlockConfig . id ) . toLowerCase ( )
9345}
9446
9547async function resolveCredential ( credentialId : string , workflowId : string ) : Promise < string | null > {
@@ -219,7 +171,10 @@ export async function resolveValueForDisplay(
219171
220172 const blockConfig = getBlock ( context . blockType )
221173 const subBlockConfig = blockConfig ?. subBlocks . find ( ( sb ) => sb . id === context . subBlockId )
222- const semanticFallback = getSemanticFallback ( context . subBlockId , subBlockConfig )
174+ if ( ! subBlockConfig ) {
175+ return { original : value , displayLabel : formatValueForDisplay ( value ) , resolved : false }
176+ }
177+ const semanticFallback = getSemanticFallback ( subBlockConfig )
223178
224179 const selectorCtx = context . blockId
225180 ? extractSelectorContext ( context . blockId , context . currentState , context . workflowId )
0 commit comments