@gingkoo/pandora-metabase 1.0.127 → 1.0.128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1034,10 +1034,13 @@ var JoinData = function JoinData(props) {
1034
1034
  });
1035
1035
  });
1036
1036
  newMeta[index].columns = newColumns.map(function (newCol) {
1037
+ var _existingCol$select;
1037
1038
  var existingCol = newMeta[index].columns.find(function (oldCol) {
1038
- return oldCol.name === newCol.name;
1039
+ return newCol.fieldUuid && oldCol.fieldUuid === newCol.fieldUuid || newCol.fieldAlias && oldCol.fieldAlias === newCol.fieldAlias || oldCol.name === newCol.name;
1040
+ });
1041
+ var _column = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, newCol), {}, {
1042
+ select: (_existingCol$select = existingCol === null || existingCol === void 0 ? void 0 : existingCol.select) !== null && _existingCol$select !== void 0 ? _existingCol$select : newCol.select
1039
1043
  });
1040
- var _column = existingCol ? existingCol : newCol;
1041
1044
  _column.select = store.isSelectFields || _column.select;
1042
1045
  return _column;
1043
1046
  });
@@ -246,10 +246,13 @@ var TableData = function TableData(props) {
246
246
  });
247
247
  });
248
248
  newMetaList.columns = newColumns.map(function (newCol) {
249
+ var _existingCol$select;
249
250
  var existingCol = newMetaList.columns.find(function (oldCol) {
250
- return oldCol.name === newCol.name;
251
+ return newCol.fieldUuid && oldCol.fieldUuid === newCol.fieldUuid || newCol.fieldAlias && oldCol.fieldAlias === newCol.fieldAlias || oldCol.name === newCol.name;
252
+ });
253
+ var _column = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, newCol), {}, {
254
+ select: (_existingCol$select = existingCol === null || existingCol === void 0 ? void 0 : existingCol.select) !== null && _existingCol$select !== void 0 ? _existingCol$select : newCol.select
251
255
  });
252
- var _column = existingCol ? existingCol : newCol;
253
256
  _column.select = store.isSelectFields || _column.select;
254
257
  return _column;
255
258
  });
package/lib/cjs/utils.js CHANGED
@@ -144,7 +144,7 @@ var getSubColumns = exports.getSubColumns = function getSubColumns(metaList) {
144
144
  _data.columns = _data.columns.concat(prevGroupBy.group.map(function (v) {
145
145
  var _v$sql;
146
146
  return (0, _objectSpread6["default"])((0, _objectSpread6["default"])({}, v), {}, {
147
- name: v.name || v.quotes,
147
+ name: v.fieldAlias || v.name || v.quotes,
148
148
  name_zh: v.name_zh || v.quotes,
149
149
  id: v.id || v.fieldId,
150
150
  realName: ((_v$sql = v.sql) === null || _v$sql === void 0 || (_v$sql = _v$sql.split(' AS ')) === null || _v$sql === void 0 ? void 0 : _v$sql[1]) || '',
@@ -158,7 +158,7 @@ var getSubColumns = exports.getSubColumns = function getSubColumns(metaList) {
158
158
  _data.columns = _data.columns.concat(prevGroupBy.by.map(function (v) {
159
159
  var _v$sql2;
160
160
  return (0, _objectSpread6["default"])((0, _objectSpread6["default"])({}, v), {}, {
161
- name: v.name || v.quotes,
161
+ name: v.fieldAlias || v.name || v.quotes,
162
162
  name_zh: v.name_zh || v.quotes,
163
163
  id: v.id || v.fieldId,
164
164
  realName: ((_v$sql2 = v.sql) === null || _v$sql2 === void 0 || (_v$sql2 = _v$sql2.split(' AS ')) === null || _v$sql2 === void 0 ? void 0 : _v$sql2[1]) || '',
@@ -1029,10 +1029,13 @@ var JoinData = function JoinData(props) {
1029
1029
  });
1030
1030
  });
1031
1031
  newMeta[index].columns = newColumns.map(function (newCol) {
1032
+ var _existingCol$select;
1032
1033
  var existingCol = newMeta[index].columns.find(function (oldCol) {
1033
- return oldCol.name === newCol.name;
1034
+ return newCol.fieldUuid && oldCol.fieldUuid === newCol.fieldUuid || newCol.fieldAlias && oldCol.fieldAlias === newCol.fieldAlias || oldCol.name === newCol.name;
1035
+ });
1036
+ var _column = _objectSpread(_objectSpread({}, newCol), {}, {
1037
+ select: (_existingCol$select = existingCol === null || existingCol === void 0 ? void 0 : existingCol.select) !== null && _existingCol$select !== void 0 ? _existingCol$select : newCol.select
1034
1038
  });
1035
- var _column = existingCol ? existingCol : newCol;
1036
1039
  _column.select = store.isSelectFields || _column.select;
1037
1040
  return _column;
1038
1041
  });
@@ -240,10 +240,13 @@ var TableData = function TableData(props) {
240
240
  });
241
241
  });
242
242
  newMetaList.columns = newColumns.map(function (newCol) {
243
+ var _existingCol$select;
243
244
  var existingCol = newMetaList.columns.find(function (oldCol) {
244
- return oldCol.name === newCol.name;
245
+ return newCol.fieldUuid && oldCol.fieldUuid === newCol.fieldUuid || newCol.fieldAlias && oldCol.fieldAlias === newCol.fieldAlias || oldCol.name === newCol.name;
246
+ });
247
+ var _column = _objectSpread(_objectSpread({}, newCol), {}, {
248
+ select: (_existingCol$select = existingCol === null || existingCol === void 0 ? void 0 : existingCol.select) !== null && _existingCol$select !== void 0 ? _existingCol$select : newCol.select
245
249
  });
246
- var _column = existingCol ? existingCol : newCol;
247
250
  _column.select = store.isSelectFields || _column.select;
248
251
  return _column;
249
252
  });
package/lib/es/utils.js CHANGED
@@ -131,7 +131,7 @@ export var getSubColumns = function getSubColumns(metaList) {
131
131
  _data.columns = _data.columns.concat(prevGroupBy.group.map(function (v) {
132
132
  var _v$sql;
133
133
  return _objectSpread(_objectSpread({}, v), {}, {
134
- name: v.name || v.quotes,
134
+ name: v.fieldAlias || v.name || v.quotes,
135
135
  name_zh: v.name_zh || v.quotes,
136
136
  id: v.id || v.fieldId,
137
137
  realName: ((_v$sql = v.sql) === null || _v$sql === void 0 || (_v$sql = _v$sql.split(' AS ')) === null || _v$sql === void 0 ? void 0 : _v$sql[1]) || '',
@@ -145,7 +145,7 @@ export var getSubColumns = function getSubColumns(metaList) {
145
145
  _data.columns = _data.columns.concat(prevGroupBy.by.map(function (v) {
146
146
  var _v$sql2;
147
147
  return _objectSpread(_objectSpread({}, v), {}, {
148
- name: v.name || v.quotes,
148
+ name: v.fieldAlias || v.name || v.quotes,
149
149
  name_zh: v.name_zh || v.quotes,
150
150
  id: v.id || v.fieldId,
151
151
  realName: ((_v$sql2 = v.sql) === null || _v$sql2 === void 0 || (_v$sql2 = _v$sql2.split(' AS ')) === null || _v$sql2 === void 0 ? void 0 : _v$sql2[1]) || '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gingkoo/pandora-metabase",
3
- "version": "1.0.127",
3
+ "version": "1.0.128",
4
4
  "description": "",
5
5
  "main": "lib/es/index.js",
6
6
  "module": "lib/es/index.js",