@cubejs-client/core
Advanced tools
Comparing version 0.28.25 to 0.28.35
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.28.35](https://github.com/cube-js/cube.js/compare/v0.28.34...v0.28.35) (2021-09-13) | ||
### Bug Fixes | ||
* **cubejs-client-core:** keep order of elements within tableColumns ([#3368](https://github.com/cube-js/cube.js/issues/3368)) ([b9a0f47](https://github.com/cube-js/cube.js/commit/b9a0f4744543d2d5facdbb191638f05790d21070)) | ||
## [0.28.25](https://github.com/cube-js/cube.js/compare/v0.28.24...v0.28.25) (2021-08-20) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@cubejs-client/core", | ||
"version": "0.28.25", | ||
"version": "0.28.35", | ||
"engines": {}, | ||
@@ -48,3 +48,3 @@ "repository": { | ||
}, | ||
"gitHead": "e5adcccf057a58636689037f6f56a0159edf36a8" | ||
"gitHead": "34bfc75296e9b265c55233e432a41c3017496e45" | ||
} |
@@ -540,3 +540,3 @@ import dayjs from 'dayjs'; | ||
yValues.forEach((value, index) => { | ||
currentItem[value] = { | ||
currentItem[`_${value}`] = { | ||
key: value, | ||
@@ -546,6 +546,6 @@ memberId: normalizedPivotConfig.y[index] === 'measures' | ||
: normalizedPivotConfig.y[index], | ||
children: (currentItem[value] && currentItem[value].children) || {} | ||
children: (currentItem[`_${value}`] && currentItem[`_${value}`].children) || {} | ||
}; | ||
currentItem = currentItem[value].children; | ||
currentItem = currentItem[`_${value}`].children; | ||
}); | ||
@@ -552,0 +552,0 @@ } |
@@ -696,2 +696,97 @@ import 'jest'; | ||
}); | ||
test('order of values is preserved', () => { | ||
const resultSet = new ResultSet({ | ||
query: { | ||
measures: [ | ||
'Branch.count' | ||
], | ||
dimensions: [ | ||
'Tenant.number' | ||
], | ||
'order': [ | ||
{ | ||
'id': 'Tenant.number', | ||
'desc': true | ||
} | ||
], | ||
filters: [], | ||
timezone: 'UTC' | ||
}, | ||
data: [ | ||
{ | ||
'Tenant.number': '6', | ||
'Branch.count': '2' | ||
}, | ||
{ | ||
'Tenant.number': '1', | ||
'Branch.count': '2' | ||
}, | ||
], | ||
annotation: { | ||
measures: { | ||
'Branch.count': { | ||
type: 'number' | ||
} | ||
}, | ||
dimensions: { | ||
'Tenant.number': { | ||
title: 'Tenant Number', | ||
shortTitle: 'Number', | ||
type: 'string' | ||
} | ||
}, | ||
segments: {}, | ||
timeDimensions: {} | ||
} | ||
}); | ||
expect(resultSet.tableColumns({ | ||
'x': [], | ||
'y': [ | ||
'Tenant.number' | ||
] | ||
})).toEqual( | ||
[ | ||
{ | ||
'key': '6', | ||
'type': 'string', | ||
'title': 'Tenant Number 6', | ||
'shortTitle': '6', | ||
'format': undefined, | ||
'meta': undefined, | ||
'children': [ | ||
{ | ||
'key': 'Branch.count', | ||
'type': 'number', | ||
'dataIndex': '6,Branch.count', | ||
'title': 'Branch.count', | ||
'shortTitle': 'Branch.count', | ||
'format': undefined, | ||
'meta': undefined, | ||
} | ||
] | ||
}, | ||
{ | ||
'key': '1', | ||
'type': 'string', | ||
'title': 'Tenant Number 1', | ||
'shortTitle': '1', | ||
'format': undefined, | ||
'meta': undefined, | ||
'children': [ | ||
{ | ||
'key': 'Branch.count', | ||
'type': 'number', | ||
'dataIndex': '1,Branch.count', | ||
'title': 'Branch.count', | ||
'shortTitle': 'Branch.count', | ||
'format': undefined, | ||
"meta": undefined, | ||
} | ||
] | ||
} | ||
] | ||
); | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1859387
21216