@gingkoo/pandora-metabase 1.0.130 → 1.0.131
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/components/dialog/expression/index.js +0 -1
- package/lib/cjs/components/dialog/formula-list/utils.js +0 -3
- package/lib/cjs/components/dialog/select-column/index.js +2 -2
- package/lib/cjs/components/dialog/select-column-multiple/index.d.ts +0 -1
- package/lib/cjs/components/dialog/select-column-multiple/index.js +44 -19
- package/lib/cjs/components/dialog/select-join-column/index.js +23 -7
- package/lib/cjs/components/dialog/select-join-column-multiple/index.js +15 -6
- package/lib/cjs/components/dialog/select-permission-table/index.js +2 -2
- package/lib/cjs/components/dialog/select-summarize/index.js +1 -3
- package/lib/cjs/components/dialog/select-table/index.d.ts +1 -2
- package/lib/cjs/components/dialog/select-table/index.js +231 -261
- package/lib/cjs/components/dialog/select-table/index.less +51 -36
- package/lib/cjs/components/metabase/index.js +34 -16
- package/lib/cjs/components/modules/components/item-name.js +0 -1
- package/lib/cjs/components/modules/custom-column.js +3 -7
- package/lib/cjs/components/modules/filter.js +3 -6
- package/lib/cjs/components/modules/join-data.js +41 -87
- package/lib/cjs/components/modules/permission-table.js +5 -9
- package/lib/cjs/components/modules/sort.js +1 -2
- package/lib/cjs/components/modules/summarize/group-by.js +1 -8
- package/lib/cjs/components/modules/summarize/select-index.js +1 -4
- package/lib/cjs/components/modules/table-data.js +28 -44
- package/lib/cjs/hooks/use-state.js +22 -147
- package/lib/cjs/index.js +1 -7
- package/lib/cjs/locale/en.js +1 -0
- package/lib/cjs/locale/zh.js +1 -0
- package/lib/cjs/store/types.d.ts +4 -5
- package/lib/cjs/types.d.ts +0 -8
- package/lib/cjs/utils/helper.d.ts +4 -0
- package/lib/cjs/utils/helper.js +102 -1
- package/lib/cjs/utils/transformSql.js +0 -2
- package/lib/cjs/utils.js +38 -18
- package/lib/es/components/dialog/expression/index.js +0 -1
- package/lib/es/components/dialog/formula-list/utils.js +0 -3
- package/lib/es/components/dialog/select-column/index.js +3 -3
- package/lib/es/components/dialog/select-column-multiple/index.d.ts +0 -1
- package/lib/es/components/dialog/select-column-multiple/index.js +45 -21
- package/lib/es/components/dialog/select-join-column/index.js +24 -8
- package/lib/es/components/dialog/select-join-column-multiple/index.js +16 -7
- package/lib/es/components/dialog/select-permission-table/index.js +3 -3
- package/lib/es/components/dialog/select-summarize/index.js +1 -3
- package/lib/es/components/dialog/select-table/index.d.ts +1 -2
- package/lib/es/components/dialog/select-table/index.js +233 -263
- package/lib/es/components/dialog/select-table/index.less +51 -36
- package/lib/es/components/metabase/index.js +34 -16
- package/lib/es/components/modules/components/item-name.js +0 -1
- package/lib/es/components/modules/custom-column.js +3 -7
- package/lib/es/components/modules/filter.js +3 -6
- package/lib/es/components/modules/join-data.js +42 -88
- package/lib/es/components/modules/permission-table.js +6 -10
- package/lib/es/components/modules/sort.js +1 -2
- package/lib/es/components/modules/summarize/group-by.js +1 -8
- package/lib/es/components/modules/summarize/select-index.js +1 -4
- package/lib/es/components/modules/table-data.js +29 -45
- package/lib/es/hooks/use-state.js +23 -148
- package/lib/es/index.js +1 -7
- package/lib/es/locale/en.js +1 -0
- package/lib/es/locale/zh.js +1 -0
- package/lib/es/store/types.d.ts +4 -5
- package/lib/es/types.d.ts +0 -8
- package/lib/es/utils/helper.d.ts +4 -0
- package/lib/es/utils/helper.js +101 -0
- package/lib/es/utils/transformSql.js +0 -2
- package/lib/es/utils.js +39 -19
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
color: #4c5773;
|
|
29
29
|
margin-top: 0;
|
|
30
30
|
margin-bottom: 0;
|
|
31
|
-
font-size:
|
|
31
|
+
font-size: 14px;
|
|
32
32
|
font-weight: 600;
|
|
33
33
|
}
|
|
34
34
|
&:not(.disabled):hover,
|
|
@@ -61,24 +61,23 @@
|
|
|
61
61
|
padding: 0.5rem;
|
|
62
62
|
display: flex;
|
|
63
63
|
align-items: center;
|
|
64
|
+
justify-content: space-between;
|
|
65
|
+
gap: 8px;
|
|
64
66
|
color: #949aab;
|
|
65
67
|
border-bottom: 1px solid #f0f0f0;
|
|
66
68
|
.left-info {
|
|
67
|
-
|
|
69
|
+
min-width: 0;
|
|
68
70
|
padding: 0.5rem 0.5rem 0.5rem 0;
|
|
69
71
|
display: flex;
|
|
70
72
|
align-items: center;
|
|
71
|
-
flex
|
|
72
|
-
|
|
73
|
-
.Sqb-DatasourceType-radio {
|
|
74
|
-
margin-left: auto;
|
|
75
|
-
}
|
|
76
|
-
> span {
|
|
73
|
+
flex: 1 1 auto;
|
|
74
|
+
span {
|
|
77
75
|
font-weight: 900;
|
|
78
76
|
font-size: 16px;
|
|
79
77
|
color: #4c5773;
|
|
80
78
|
display: flex;
|
|
81
79
|
align-items: center;
|
|
80
|
+
min-width: 0;
|
|
82
81
|
cursor: pointer;
|
|
83
82
|
font-family: 'Lato', sans-serif;
|
|
84
83
|
line-height: 1;
|
|
@@ -101,11 +100,18 @@
|
|
|
101
100
|
.Sqb-List-section {
|
|
102
101
|
}
|
|
103
102
|
|
|
104
|
-
.Sqb-List-title {
|
|
103
|
+
.Sqb-List-title-with-filter {
|
|
105
104
|
display: flex;
|
|
106
105
|
align-items: center;
|
|
107
106
|
justify-content: space-between;
|
|
108
|
-
gap:
|
|
107
|
+
gap: 10px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.Sqb-List-title-text {
|
|
111
|
+
flex: 1 1 auto;
|
|
112
|
+
min-width: 80px;
|
|
113
|
+
word-break: break-word;
|
|
114
|
+
word-wrap: anywhere;
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
.Sqb-List-item {
|
|
@@ -179,34 +185,43 @@
|
|
|
179
185
|
}
|
|
180
186
|
}
|
|
181
187
|
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.Sqb-DatasourceType-radio {
|
|
185
|
-
display: flex;
|
|
186
|
-
align-items: center;
|
|
187
|
-
flex-wrap: wrap;
|
|
188
|
-
gap: 0.375rem;
|
|
189
|
-
justify-content: flex-end;
|
|
190
|
-
}
|
|
191
188
|
|
|
192
|
-
.Sqb-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
font-weight: 600;
|
|
200
|
-
line-height: 1.2;
|
|
201
|
-
|
|
202
|
-
span {
|
|
203
|
-
font-size: 13px !important;
|
|
204
|
-
line-height: 15px;
|
|
189
|
+
.Sqb-TableType-tag-group {
|
|
190
|
+
display: inline-flex;
|
|
191
|
+
flex-wrap: wrap;
|
|
192
|
+
justify-content: flex-end;
|
|
193
|
+
gap: 4px;
|
|
194
|
+
max-width: 55%;
|
|
195
|
+
margin-left: auto;
|
|
205
196
|
}
|
|
206
197
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
198
|
+
.Sqb-TableType-filter-tag.pd-Tag {
|
|
199
|
+
max-width: 150px;
|
|
200
|
+
height: 18px;
|
|
201
|
+
margin: 0 !important;
|
|
202
|
+
padding: 0 6px;
|
|
203
|
+
border: 1px solid #dce0e8;
|
|
204
|
+
background-color: #fff;
|
|
205
|
+
color: #5f6b85;
|
|
206
|
+
font-size: 12px;
|
|
207
|
+
line-height: 16px;
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
|
|
210
|
+
.pd-Tag-content {
|
|
211
|
+
overflow: hidden;
|
|
212
|
+
text-overflow: ellipsis;
|
|
213
|
+
white-space: nowrap;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&:hover {
|
|
217
|
+
border-color: #509ee3;
|
|
218
|
+
color: #509ee3;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&.pd-Tag-checked {
|
|
222
|
+
border-color: #509ee3;
|
|
223
|
+
background-color: #e8f4ff;
|
|
224
|
+
color: #509ee3;
|
|
225
|
+
}
|
|
211
226
|
}
|
|
212
227
|
}
|
|
@@ -62,16 +62,9 @@ var Metabase = function Metabase(props) {
|
|
|
62
62
|
var doms = store.popupContainer.current.querySelectorAll('.isError');
|
|
63
63
|
var isSqlError = store.popupContainer.current.querySelectorAll('.isSqlError');
|
|
64
64
|
if (isSqlError.length) {
|
|
65
|
-
_pandora.Modal.error({
|
|
66
|
-
title: (0, _locale.__)('metabase.prompt'),
|
|
67
|
-
content: (0, _locale.__)('metabase.validationFilter')
|
|
68
|
-
});
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (doms.length) {
|
|
72
65
|
_pandora.Modal.confirm({
|
|
73
66
|
title: (0, _locale.__)('metabase.prompt'),
|
|
74
|
-
content: (0, _locale.__)('metabase.
|
|
67
|
+
content: (0, _locale.__)('metabase.validationFormulaSave'),
|
|
75
68
|
onOk: function () {
|
|
76
69
|
var _onOk = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee() {
|
|
77
70
|
return _regenerator["default"].wrap(function (_context) {
|
|
@@ -91,15 +84,40 @@ var Metabase = function Metabase(props) {
|
|
|
91
84
|
return onOk;
|
|
92
85
|
}()
|
|
93
86
|
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (doms.length) {
|
|
90
|
+
_pandora.Modal.confirm({
|
|
91
|
+
title: (0, _locale.__)('metabase.prompt'),
|
|
92
|
+
content: (0, _locale.__)('metabase.validationFailed'),
|
|
93
|
+
onOk: function () {
|
|
94
|
+
var _onOk2 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2() {
|
|
95
|
+
return _regenerator["default"].wrap(function (_context2) {
|
|
96
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
97
|
+
case 0:
|
|
98
|
+
_context2.next = 1;
|
|
99
|
+
return onSave();
|
|
100
|
+
case 1:
|
|
101
|
+
case "end":
|
|
102
|
+
return _context2.stop();
|
|
103
|
+
}
|
|
104
|
+
}, _callee2);
|
|
105
|
+
}));
|
|
106
|
+
function onOk() {
|
|
107
|
+
return _onOk2.apply(this, arguments);
|
|
108
|
+
}
|
|
109
|
+
return onOk;
|
|
110
|
+
}()
|
|
111
|
+
});
|
|
94
112
|
} else {
|
|
95
113
|
onSave();
|
|
96
114
|
}
|
|
97
115
|
};
|
|
98
116
|
var onSave = function () {
|
|
99
|
-
var _ref = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function
|
|
117
|
+
var _ref = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3() {
|
|
100
118
|
var intercept, _metaList;
|
|
101
|
-
return _regenerator["default"].wrap(function (
|
|
102
|
-
while (1) switch (
|
|
119
|
+
return _regenerator["default"].wrap(function (_context3) {
|
|
120
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
103
121
|
case 0:
|
|
104
122
|
intercept = false;
|
|
105
123
|
_metaList = (0, _utils.normalizeLegacySummarizeForSave)((0, _utils.splitByUnion)(store.metaList));
|
|
@@ -113,21 +131,21 @@ var Metabase = function Metabase(props) {
|
|
|
113
131
|
}
|
|
114
132
|
});
|
|
115
133
|
if (!(saveLoading || intercept)) {
|
|
116
|
-
|
|
134
|
+
_context3.next = 1;
|
|
117
135
|
break;
|
|
118
136
|
}
|
|
119
|
-
return
|
|
137
|
+
return _context3.abrupt("return", null);
|
|
120
138
|
case 1:
|
|
121
139
|
setSaveLoading(true);
|
|
122
|
-
|
|
140
|
+
_context3.next = 2;
|
|
123
141
|
return onOk === null || onOk === void 0 ? void 0 : onOk(_metaList);
|
|
124
142
|
case 2:
|
|
125
143
|
setSaveLoading(false);
|
|
126
144
|
case 3:
|
|
127
145
|
case "end":
|
|
128
|
-
return
|
|
146
|
+
return _context3.stop();
|
|
129
147
|
}
|
|
130
|
-
},
|
|
148
|
+
}, _callee3);
|
|
131
149
|
}));
|
|
132
150
|
return function onSave() {
|
|
133
151
|
return _ref.apply(this, arguments);
|
|
@@ -13,7 +13,6 @@ var ItemName = function ItemName(props) {
|
|
|
13
13
|
isError = props.isError,
|
|
14
14
|
message = props.message;
|
|
15
15
|
return (0, _jsxRuntime.jsx)(_pandora.Badge, {
|
|
16
|
-
offset: [-8, 0],
|
|
17
16
|
count: isError ? (0, _jsxRuntime.jsx)(_pandora.Tooltip, {
|
|
18
17
|
title: message || (0, _locale.__)('metabase.verify'),
|
|
19
18
|
children: (0, _jsxRuntime.jsx)(_pandora.Button, {
|
|
@@ -131,7 +131,6 @@ var CustomColumn = function CustomColumn(props) {
|
|
|
131
131
|
alias: prevGroupBy.alias,
|
|
132
132
|
datasourceId: '',
|
|
133
133
|
datasourceName: '',
|
|
134
|
-
datasourceType: '',
|
|
135
134
|
columns: []
|
|
136
135
|
};
|
|
137
136
|
if (prevGroupBy !== null && prevGroupBy !== void 0 && (_prevGroupBy$group = prevGroupBy.group) !== null && _prevGroupBy$group !== void 0 && _prevGroupBy$group.length) {
|
|
@@ -175,8 +174,7 @@ var CustomColumn = function CustomColumn(props) {
|
|
|
175
174
|
tableUuid: v.table2.tableUuid || (0, _helper.uuidv4)('table'),
|
|
176
175
|
columns: v.columns,
|
|
177
176
|
datasourceId: v.table2.datasourceId,
|
|
178
|
-
datasourceName: v.table2.datasourceName
|
|
179
|
-
datasourceType: v.table2.datasourceType
|
|
177
|
+
datasourceName: v.table2.datasourceName
|
|
180
178
|
});
|
|
181
179
|
}));
|
|
182
180
|
}
|
|
@@ -190,8 +188,7 @@ var CustomColumn = function CustomColumn(props) {
|
|
|
190
188
|
tableUuid: v.table.tableUuid || (0, _helper.uuidv4)('table'),
|
|
191
189
|
columns: v.columns,
|
|
192
190
|
datasourceId: mainTable.table.datasourceId,
|
|
193
|
-
datasourceName: mainTable.table.datasourceName
|
|
194
|
-
datasourceType: mainTable.table.datasourceType
|
|
191
|
+
datasourceName: mainTable.table.datasourceName
|
|
195
192
|
});
|
|
196
193
|
} else if (v.type === _enum.TypeEnum.joinData) {
|
|
197
194
|
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, v.table2), {}, {
|
|
@@ -201,8 +198,7 @@ var CustomColumn = function CustomColumn(props) {
|
|
|
201
198
|
tableUuid: v.table2.tableUuid || (0, _helper.uuidv4)('table'),
|
|
202
199
|
columns: v.columns,
|
|
203
200
|
datasourceId: v.table2.datasourceId,
|
|
204
|
-
datasourceName: v.table2.datasourceName
|
|
205
|
-
datasourceType: v.table2.datasourceType
|
|
201
|
+
datasourceName: v.table2.datasourceName
|
|
206
202
|
});
|
|
207
203
|
} else {
|
|
208
204
|
return {
|
|
@@ -89,8 +89,7 @@ var Filter = function Filter(props) {
|
|
|
89
89
|
tableUuid: v.table2.tableUuid || (0, _helper.uuidv4)('table'),
|
|
90
90
|
columns: v.columns,
|
|
91
91
|
datasourceId: v.table2.datasourceId,
|
|
92
|
-
datasourceName: v.table2.datasourceName
|
|
93
|
-
datasourceType: v.table2.datasourceType
|
|
92
|
+
datasourceName: v.table2.datasourceName
|
|
94
93
|
};
|
|
95
94
|
}));
|
|
96
95
|
}
|
|
@@ -105,8 +104,7 @@ var Filter = function Filter(props) {
|
|
|
105
104
|
tableUuid: v.table.tableUuid || (0, _helper.uuidv4)('table'),
|
|
106
105
|
columns: v.columns,
|
|
107
106
|
datasourceId: mainTable.table.datasourceId,
|
|
108
|
-
datasourceName: mainTable.table.datasourceName
|
|
109
|
-
datasourceType: mainTable.table.datasourceType
|
|
107
|
+
datasourceName: mainTable.table.datasourceName
|
|
110
108
|
};
|
|
111
109
|
} else if (v.type === _enum.TypeEnum.joinData) {
|
|
112
110
|
return {
|
|
@@ -117,8 +115,7 @@ var Filter = function Filter(props) {
|
|
|
117
115
|
tableUuid: v.table2.tableUuid || (0, _helper.uuidv4)('table'),
|
|
118
116
|
columns: v.columns,
|
|
119
117
|
datasourceId: v.table2.datasourceId,
|
|
120
|
-
datasourceName: v.table2.datasourceName
|
|
121
|
-
datasourceType: v.table2.datasourceType
|
|
118
|
+
datasourceName: v.table2.datasourceName
|
|
122
119
|
};
|
|
123
120
|
} else {
|
|
124
121
|
return {
|