Skip to content

Commit 0233c16

Browse files
committed
feat(api-gateway): Meta - expose aliasMember for members in view
1 parent 7723838 commit 0233c16

File tree

5 files changed

+424
-11
lines changed

5 files changed

+424
-11
lines changed

packages/cubejs-schema-compiler/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
"coveragePathIgnorePatterns": [
100100
".*\\.d\\.ts"
101101
],
102-
"globalSetup": "<rootDir>/dist/test/global-setup.js"
102+
"globalSetup": "<rootDir>/dist/test/global-setup.js",
103+
"snapshotResolver": "<rootDir>/test/snapshotResolver.js"
103104
}
104105
}

packages/cubejs-schema-compiler/src/compiler/CubeToMetaTransformer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export class CubeToMetaTransformer {
8080
? this.isVisible(nameToDimension[1], !nameToDimension[1].primaryKey)
8181
: false,
8282
primaryKey: !!nameToDimension[1].primaryKey,
83+
aliasMember: nameToDimension[1].aliasMember,
8384
granularities:
8485
nameToDimension[1].granularities
8586
? R.compose(R.map((g) => ({
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const path = require('path');
2+
3+
function resolveSnapshotPath(testPath, snapshotExtension) {
4+
const testSourcePath = testPath.replace('dist/', '');
5+
const testDirectory = path.dirname(testSourcePath);
6+
const testFilename = path.basename(testSourcePath).replace('.js', '.ts');
7+
8+
return `${testDirectory}/__snapshots__/${testFilename}${snapshotExtension}`;
9+
}
10+
11+
function resolveTestPath(snapshotFilePath, snapshotExtension) {
12+
const testSourceFile = snapshotFilePath
13+
.replace('test/__snapshots__', 'dist/test')
14+
.replace('.ts', '.js')
15+
.replace(snapshotExtension, '');
16+
17+
return testSourceFile;
18+
}
19+
20+
module.exports = {
21+
resolveSnapshotPath,
22+
resolveTestPath,
23+
24+
testPathForConsistencyCheck: 'dist/test/Test.spec.js'
25+
};

0 commit comments

Comments
 (0)