@gingkoo/pandora-metabase 1.0.96 → 1.0.97
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.
- package/lib/cjs/hooks/patch.js +10 -6
- package/lib/es/hooks/patch.js +10 -6
- package/package.json +1 -1
package/lib/cjs/hooks/patch.js
CHANGED
|
@@ -26,13 +26,14 @@ var setFormulaId = function setFormulaId(item, formulaTemplates) {
|
|
|
26
26
|
var joinDataPatch = exports.joinDataPatch = function joinDataPatch(newMeta, constantList, formulaTemplates) {
|
|
27
27
|
var _newMeta$expressions;
|
|
28
28
|
newMeta.expressions = (_newMeta$expressions = newMeta.expressions) === null || _newMeta$expressions === void 0 ? void 0 : _newMeta$expressions.map(function (v, i) {
|
|
29
|
-
|
|
29
|
+
var _v$lhs, _v$rhs;
|
|
30
|
+
v.lhs = (_v$lhs = v.lhs) === null || _v$lhs === void 0 ? void 0 : _v$lhs.map(function (vv) {
|
|
30
31
|
if (vv.type === 'constant' && !vv.id) {
|
|
31
32
|
return setConstantId(vv, constantList);
|
|
32
33
|
}
|
|
33
34
|
return vv;
|
|
34
35
|
});
|
|
35
|
-
v.rhs = v.rhs.map(function (vv) {
|
|
36
|
+
v.rhs = (_v$rhs = v.rhs) === null || _v$rhs === void 0 ? void 0 : _v$rhs.map(function (vv) {
|
|
36
37
|
if (vv.type === 'constant' && !vv.id) {
|
|
37
38
|
return setConstantId(vv, constantList);
|
|
38
39
|
}
|
|
@@ -50,7 +51,8 @@ var filterPatch = exports.filterPatch = function filterPatch(newMeta, constantLi
|
|
|
50
51
|
return setConstantId(v, constantList);
|
|
51
52
|
}
|
|
52
53
|
if (v.type === 'expression') {
|
|
53
|
-
|
|
54
|
+
var _v$rhs2;
|
|
55
|
+
v.rhs = (_v$rhs2 = v.rhs) === null || _v$rhs2 === void 0 ? void 0 : _v$rhs2.map(function (item) {
|
|
54
56
|
if (item.type === 'constant' && !item.id) {
|
|
55
57
|
return setConstantId(item, constantList);
|
|
56
58
|
}
|
|
@@ -72,15 +74,17 @@ var filterPatch = exports.filterPatch = function filterPatch(newMeta, constantLi
|
|
|
72
74
|
var customColumnPatch = exports.customColumnPatch = function customColumnPatch(newMeta, constantList, formulaTemplates) {
|
|
73
75
|
var _newMeta$customColumn;
|
|
74
76
|
newMeta.customColumn = (newMeta === null || newMeta === void 0 || (_newMeta$customColumn = newMeta.customColumn) === null || _newMeta$customColumn === void 0 ? void 0 : _newMeta$customColumn.map(function (v) {
|
|
75
|
-
var
|
|
77
|
+
var _v$formulaList;
|
|
78
|
+
var _formulaList = (_v$formulaList = v.formulaList) === null || _v$formulaList === void 0 ? void 0 : _v$formulaList.map(function (formula) {
|
|
76
79
|
if (formula.type === 'expression') {
|
|
77
|
-
|
|
80
|
+
var _formula$lhs, _formula$rhs;
|
|
81
|
+
formula.lhs = (_formula$lhs = formula.lhs) === null || _formula$lhs === void 0 ? void 0 : _formula$lhs.map(function (vv) {
|
|
78
82
|
if (vv.type === 'constant' && !vv.id) {
|
|
79
83
|
return setConstantId(vv, constantList);
|
|
80
84
|
}
|
|
81
85
|
return vv;
|
|
82
86
|
});
|
|
83
|
-
formula.rhs = formula.rhs.map(function (vv) {
|
|
87
|
+
formula.rhs = (_formula$rhs = formula.rhs) === null || _formula$rhs === void 0 ? void 0 : _formula$rhs.map(function (vv) {
|
|
84
88
|
if (vv.type === 'constant' && !vv.id) {
|
|
85
89
|
return setConstantId(vv, constantList);
|
|
86
90
|
}
|
package/lib/es/hooks/patch.js
CHANGED
|
@@ -19,13 +19,14 @@ var setFormulaId = function setFormulaId(item, formulaTemplates) {
|
|
|
19
19
|
export var joinDataPatch = function joinDataPatch(newMeta, constantList, formulaTemplates) {
|
|
20
20
|
var _newMeta$expressions;
|
|
21
21
|
newMeta.expressions = (_newMeta$expressions = newMeta.expressions) === null || _newMeta$expressions === void 0 ? void 0 : _newMeta$expressions.map(function (v, i) {
|
|
22
|
-
|
|
22
|
+
var _v$lhs, _v$rhs;
|
|
23
|
+
v.lhs = (_v$lhs = v.lhs) === null || _v$lhs === void 0 ? void 0 : _v$lhs.map(function (vv) {
|
|
23
24
|
if (vv.type === 'constant' && !vv.id) {
|
|
24
25
|
return setConstantId(vv, constantList);
|
|
25
26
|
}
|
|
26
27
|
return vv;
|
|
27
28
|
});
|
|
28
|
-
v.rhs = v.rhs.map(function (vv) {
|
|
29
|
+
v.rhs = (_v$rhs = v.rhs) === null || _v$rhs === void 0 ? void 0 : _v$rhs.map(function (vv) {
|
|
29
30
|
if (vv.type === 'constant' && !vv.id) {
|
|
30
31
|
return setConstantId(vv, constantList);
|
|
31
32
|
}
|
|
@@ -43,7 +44,8 @@ export var filterPatch = function filterPatch(newMeta, constantList, formulaTemp
|
|
|
43
44
|
return setConstantId(v, constantList);
|
|
44
45
|
}
|
|
45
46
|
if (v.type === 'expression') {
|
|
46
|
-
|
|
47
|
+
var _v$rhs2;
|
|
48
|
+
v.rhs = (_v$rhs2 = v.rhs) === null || _v$rhs2 === void 0 ? void 0 : _v$rhs2.map(function (item) {
|
|
47
49
|
if (item.type === 'constant' && !item.id) {
|
|
48
50
|
return setConstantId(item, constantList);
|
|
49
51
|
}
|
|
@@ -65,15 +67,17 @@ export var filterPatch = function filterPatch(newMeta, constantList, formulaTemp
|
|
|
65
67
|
export var customColumnPatch = function customColumnPatch(newMeta, constantList, formulaTemplates) {
|
|
66
68
|
var _newMeta$customColumn;
|
|
67
69
|
newMeta.customColumn = (newMeta === null || newMeta === void 0 || (_newMeta$customColumn = newMeta.customColumn) === null || _newMeta$customColumn === void 0 ? void 0 : _newMeta$customColumn.map(function (v) {
|
|
68
|
-
var
|
|
70
|
+
var _v$formulaList;
|
|
71
|
+
var _formulaList = (_v$formulaList = v.formulaList) === null || _v$formulaList === void 0 ? void 0 : _v$formulaList.map(function (formula) {
|
|
69
72
|
if (formula.type === 'expression') {
|
|
70
|
-
|
|
73
|
+
var _formula$lhs, _formula$rhs;
|
|
74
|
+
formula.lhs = (_formula$lhs = formula.lhs) === null || _formula$lhs === void 0 ? void 0 : _formula$lhs.map(function (vv) {
|
|
71
75
|
if (vv.type === 'constant' && !vv.id) {
|
|
72
76
|
return setConstantId(vv, constantList);
|
|
73
77
|
}
|
|
74
78
|
return vv;
|
|
75
79
|
});
|
|
76
|
-
formula.rhs = formula.rhs.map(function (vv) {
|
|
80
|
+
formula.rhs = (_formula$rhs = formula.rhs) === null || _formula$rhs === void 0 ? void 0 : _formula$rhs.map(function (vv) {
|
|
77
81
|
if (vv.type === 'constant' && !vv.id) {
|
|
78
82
|
return setConstantId(vv, constantList);
|
|
79
83
|
}
|