Skip to content

Commit 4c7a5bb

Browse files
fix: add link url to transpiled fields patterns for proper symbol resolution
The url field inside links needs to go through the same transpilation as dimension sql and mask.sql, so that {dimension_name} references are properly resolved through the symbol resolver at evaluation time. Added pattern: /^dimensions\.[_a-zA-Z][_a-zA-Z0-9]*\.links\.[0-9]+\.url$/ Co-authored-by: Pavel Tiunov <pavel.tiunov@gmail.com>
1 parent 9cbbd7e commit 4c7a5bb

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

packages/cubejs-schema-compiler/src/compiler/transpilers/CubePropContextTranspiler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export const transpiledFieldsPatterns: Array<RegExp> = [
3838
/^(accessPolicy|access_policy)\.[0-9]+\.(rowLevel|row_level)\.filters\.[0-9]+.*\.values$/,
3939
/^(accessPolicy|access_policy)\.[0-9]+\.conditions.[0-9]+\.if$/,
4040
/^(measures|dimensions)\.[_a-zA-Z][_a-zA-Z0-9]*\.mask\.sql$/,
41+
/^dimensions\.[_a-zA-Z][_a-zA-Z0-9]*\.links\.[0-9]+\.url$/,
4142
];
4243

4344
export const transpiledFields: Set<String> = new Set<String>();

packages/cubejs-schema-compiler/test/unit/links.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cubes:
2222
url: "CONCAT('https://www.google.com/search?q=', {full_name})"
2323
icon: brand-google
2424
target: blank
25-
- name: email
25+
- name: send_email
2626
label: Write an email
2727
url: "CONCAT('mailto:', {email})"
2828
icon: send

0 commit comments

Comments
 (0)