(blockType: string, subBlockId: string)
| 133 | * Falls back to the raw ID if the block or subBlock is not found. |
| 134 | */ |
| 135 | export function resolveFieldLabel(blockType: string, subBlockId: string): string { |
| 136 | if (subBlockId.startsWith('data.')) { |
| 137 | return formatParameterLabel(subBlockId.slice(5)) |
| 138 | } |
| 139 | const blockConfig = getBlock(blockType) |
| 140 | if (!blockConfig) return subBlockId |
| 141 | const subBlockConfig = blockConfig.subBlocks.find((sb) => sb.id === subBlockId) |
| 142 | return subBlockConfig?.title ?? subBlockId |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Resolves a dropdown option ID to its human-readable label. |
no test coverage detected