@gingkoo/pandora-metabase 1.0.158-alpha.2 → 1.0.158-alpha.21
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/common/SplitView/index.js +2 -2
- package/lib/cjs/components/dialog/column-type-label/index.d.ts +8 -0
- package/lib/cjs/components/dialog/column-type-label/index.js +22 -0
- package/lib/cjs/components/dialog/column-type-label/index.less +17 -0
- package/lib/cjs/components/dialog/custom-column/config.js +2 -2
- package/lib/cjs/components/dialog/custom-column/expression-editor.js +1 -1
- package/lib/cjs/components/dialog/custom-column/expressions/suggest.js +2 -2
- package/lib/cjs/components/dialog/custom-column/expressions/tokenizer.js +2 -2
- package/lib/cjs/components/dialog/custom-column/index.js +2 -2
- package/lib/cjs/components/dialog/custom-column/tokenized-expression.js +6 -6
- package/lib/cjs/components/dialog/custom-column/tokenizedI-input.js +8 -8
- package/lib/cjs/components/dialog/custom-editor/index.js +4 -4
- package/lib/cjs/components/dialog/expression/date-format-picker.js +1 -1
- package/lib/cjs/components/dialog/expression/index.js +4 -4
- package/lib/cjs/components/dialog/formula/index.js +55 -14
- package/lib/cjs/components/dialog/formula/index.less +7 -0
- package/lib/cjs/components/dialog/formula/utils.js +5 -1
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.d.ts +3 -4
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.js +138 -214
- package/lib/cjs/components/dialog/formula-list/LogicGroup.js +55 -39
- package/lib/cjs/components/dialog/formula-list/index.d.ts +3 -0
- package/lib/cjs/components/dialog/formula-list/index.js +414 -321
- package/lib/cjs/components/dialog/formula-list/index.less +1012 -1105
- package/lib/cjs/components/dialog/formula-list/utils.d.ts +16 -2
- package/lib/cjs/components/dialog/formula-list/utils.js +650 -131
- package/lib/cjs/components/dialog/select-column/index.js +10 -4
- package/lib/cjs/components/dialog/select-column/index.less +6 -1
- package/lib/cjs/components/dialog/select-column-multiple/index.js +12 -9
- package/lib/cjs/components/dialog/select-column-multiple/index.less +10 -0
- package/lib/cjs/components/dialog/select-join-column/index.js +9 -5
- package/lib/cjs/components/dialog/select-join-column/index.less +10 -0
- package/lib/cjs/components/dialog/select-join-column-multiple/index.js +10 -6
- package/lib/cjs/components/dialog/select-join-column-multiple/index.less +10 -0
- package/lib/cjs/components/dialog/select-permission-table/index.js +1 -1
- package/lib/cjs/components/dialog/select-summarize/index.js +2 -2
- package/lib/cjs/components/dialog/select-table/index.js +5 -5
- package/lib/cjs/components/icons.js +1 -1
- package/lib/cjs/components/metabase/index.js +129 -60
- package/lib/cjs/components/metabase/index.less +28 -29
- package/lib/cjs/components/modules/components/Wrapper.js +2 -2
- package/lib/cjs/components/modules/components/header.d.ts +2 -1
- package/lib/cjs/components/modules/components/header.js +7 -3
- package/lib/cjs/components/modules/components/item-wrapper.js +1 -1
- package/lib/cjs/components/modules/components/meta-icon.js +3 -5
- package/lib/cjs/components/modules/custom-column.js +7 -4
- package/lib/cjs/components/modules/filter.js +2 -2
- package/lib/cjs/components/modules/join-data.js +100 -21
- package/lib/cjs/components/modules/sort.js +6 -3
- package/lib/cjs/components/modules/summarize/group-by.js +10 -6
- package/lib/cjs/components/modules/summarize/select-index.js +12 -5
- package/lib/cjs/components/modules/table-data.js +50 -16
- package/lib/cjs/components/popup.js +7 -7
- package/lib/cjs/components/right-click-menu.js +3 -3
- package/lib/cjs/components/sql-syntax-confirm.d.ts +14 -0
- package/lib/cjs/components/sql-syntax-confirm.js +149 -0
- package/lib/cjs/enum.d.ts +1 -0
- package/lib/cjs/enum.js +16 -0
- package/lib/cjs/hooks/patch.js +1 -1
- package/lib/cjs/hooks/patch2.js +1 -1
- package/lib/cjs/hooks/use-state.js +118 -111
- package/lib/cjs/hooks/winsize.js +1 -1
- package/lib/cjs/index.d.ts +4 -2
- package/lib/cjs/index.js +14 -6
- package/lib/cjs/locale/en.js +35 -0
- package/lib/cjs/locale/zh.js +35 -0
- package/lib/cjs/prompt.d.ts +3 -0
- package/lib/cjs/prompt.js +262 -0
- package/lib/cjs/store/enum.d.ts +50 -0
- package/lib/cjs/store/enum.js +56 -2
- package/lib/cjs/store/helper.js +2 -2
- package/lib/cjs/store/types.d.ts +9 -52
- package/lib/cjs/store/types.js +25 -54
- package/lib/cjs/types.d.ts +6 -0
- package/lib/cjs/utils/event.js +3 -3
- package/lib/cjs/utils/helper.js +1 -1
- package/lib/cjs/utils/keydown.js +2 -2
- package/lib/cjs/utils/selection.js +1 -1
- package/lib/cjs/utils/storage.js +2 -2
- package/lib/cjs/utils/transformSql.d.ts +44 -1
- package/lib/cjs/utils/transformSql.js +1042 -29
- package/lib/cjs/utils.d.ts +3 -1
- package/lib/cjs/utils.js +82 -43
- package/lib/cjs/validate.d.ts +2 -0
- package/lib/cjs/validate.js +42 -0
- package/lib/es/components/dialog/column-type-label/index.d.ts +8 -0
- package/lib/es/components/dialog/column-type-label/index.js +16 -0
- package/lib/es/components/dialog/column-type-label/index.less +17 -0
- package/lib/es/components/dialog/expression/index.js +1 -1
- package/lib/es/components/dialog/formula/index.js +53 -12
- package/lib/es/components/dialog/formula/index.less +7 -0
- package/lib/es/components/dialog/formula/utils.js +5 -1
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.d.ts +3 -4
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.js +141 -217
- package/lib/es/components/dialog/formula-list/LogicGroup.js +54 -38
- package/lib/es/components/dialog/formula-list/index.d.ts +3 -0
- package/lib/es/components/dialog/formula-list/index.js +409 -316
- package/lib/es/components/dialog/formula-list/index.less +1012 -1105
- package/lib/es/components/dialog/formula-list/utils.d.ts +16 -2
- package/lib/es/components/dialog/formula-list/utils.js +646 -126
- package/lib/es/components/dialog/select-column/index.js +7 -1
- package/lib/es/components/dialog/select-column/index.less +6 -1
- package/lib/es/components/dialog/select-column-multiple/index.js +9 -6
- package/lib/es/components/dialog/select-column-multiple/index.less +10 -0
- package/lib/es/components/dialog/select-join-column/index.js +7 -3
- package/lib/es/components/dialog/select-join-column/index.less +10 -0
- package/lib/es/components/dialog/select-join-column-multiple/index.js +7 -3
- package/lib/es/components/dialog/select-join-column-multiple/index.less +10 -0
- package/lib/es/components/metabase/index.js +126 -57
- package/lib/es/components/metabase/index.less +28 -29
- package/lib/es/components/modules/components/header.d.ts +2 -1
- package/lib/es/components/modules/components/header.js +6 -2
- package/lib/es/components/modules/components/meta-icon.js +2 -4
- package/lib/es/components/modules/custom-column.js +4 -1
- package/lib/es/components/modules/join-data.js +98 -19
- package/lib/es/components/modules/sort.js +4 -1
- package/lib/es/components/modules/summarize/group-by.js +5 -1
- package/lib/es/components/modules/summarize/select-index.js +8 -1
- package/lib/es/components/modules/table-data.js +47 -13
- package/lib/es/components/sql-syntax-confirm.d.ts +14 -0
- package/lib/es/components/sql-syntax-confirm.js +142 -0
- package/lib/es/enum.d.ts +1 -0
- package/lib/es/enum.js +1 -0
- package/lib/es/hooks/use-state.js +112 -105
- package/lib/es/index.d.ts +4 -2
- package/lib/es/index.js +8 -6
- package/lib/es/locale/en.js +35 -0
- package/lib/es/locale/zh.js +35 -0
- package/lib/es/prompt.d.ts +3 -0
- package/lib/es/prompt.js +3 -0
- package/lib/es/store/enum.d.ts +50 -0
- package/lib/es/store/enum.js +55 -1
- package/lib/es/store/types.d.ts +9 -52
- package/lib/es/store/types.js +2 -53
- package/lib/es/types.d.ts +6 -0
- package/lib/es/utils/transformSql.d.ts +44 -1
- package/lib/es/utils/transformSql.js +1038 -25
- package/lib/es/utils.d.ts +3 -1
- package/lib/es/utils.js +76 -37
- package/lib/es/validate.d.ts +2 -0
- package/lib/es/validate.js +1 -0
- package/package.json +31 -1
- package/lib/cjs/components/dialog/diff-viewer/index copy.d.ts +0 -10
- package/lib/cjs/components/dialog/diff-viewer/index copy.js +0 -139
- package/lib/es/components/dialog/diff-viewer/index copy.d.ts +0 -10
- package/lib/es/components/dialog/diff-viewer/index copy.js +0 -132
|
@@ -5,14 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = exports.SummarizeAlias = void 0;
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
8
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
11
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
14
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
15
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
15
|
var _react = require("react");
|
|
17
16
|
var _helper = require("../utils/helper");
|
|
18
17
|
var _enum = require("../store/enum");
|
|
@@ -106,7 +105,11 @@ var useStore = function useStore() {
|
|
|
106
105
|
metaList = _useState26[0],
|
|
107
106
|
setMetaState = _useState26[1];
|
|
108
107
|
var latestMetaListRef = (0, _react.useRef)((0, _cloneDeep["default"])(defaultMeta));
|
|
108
|
+
var metaRevisionRef = (0, _react.useRef)(0);
|
|
109
|
+
var metaRequestRef = (0, _react.useRef)(0);
|
|
110
|
+
var metaEditRequestRef = (0, _react.useRef)(0);
|
|
109
111
|
var _setMeta = (0, _react.useCallback)(function (data) {
|
|
112
|
+
metaRevisionRef.current += 1;
|
|
110
113
|
latestMetaListRef.current = (0, _cloneDeep["default"])(data);
|
|
111
114
|
setMetaState(data);
|
|
112
115
|
}, []);
|
|
@@ -204,46 +207,50 @@ var useStore = function useStore() {
|
|
|
204
207
|
setMatchBrackets = _useState68[1];
|
|
205
208
|
var _useState69 = (0, _react.useState)(false),
|
|
206
209
|
_useState70 = (0, _slicedToArray2["default"])(_useState69, 2),
|
|
207
|
-
|
|
208
|
-
|
|
210
|
+
pairBrackets = _useState70[0],
|
|
211
|
+
setPairBrackets = _useState70[1];
|
|
209
212
|
var _useState71 = (0, _react.useState)(false),
|
|
210
213
|
_useState72 = (0, _slicedToArray2["default"])(_useState71, 2),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
var _useState73 = (0, _react.useState)(
|
|
214
|
+
hasFormulaSqlCode = _useState72[0],
|
|
215
|
+
setHasFormulaSqlCode = _useState72[1];
|
|
216
|
+
var _useState73 = (0, _react.useState)(false),
|
|
214
217
|
_useState74 = (0, _slicedToArray2["default"])(_useState73, 2),
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
var _useState75 = (0, _react.useState)(
|
|
218
|
+
hasFormulaDiffCode = _useState74[0],
|
|
219
|
+
setHasFormulaDiffCode = _useState74[1];
|
|
220
|
+
var _useState75 = (0, _react.useState)([]),
|
|
218
221
|
_useState76 = (0, _slicedToArray2["default"])(_useState75, 2),
|
|
219
|
-
|
|
220
|
-
|
|
222
|
+
sourceData = _useState76[0],
|
|
223
|
+
setSourceData = _useState76[1];
|
|
221
224
|
var _useState77 = (0, _react.useState)(false),
|
|
222
225
|
_useState78 = (0, _slicedToArray2["default"])(_useState77, 2),
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
moduleCopy = _useState78[0],
|
|
227
|
+
setModuleCopy = _useState78[1];
|
|
225
228
|
var _useState79 = (0, _react.useState)(false),
|
|
226
229
|
_useState80 = (0, _slicedToArray2["default"])(_useState79, 2),
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
var _useState81 = (0, _react.useState)(
|
|
230
|
+
isMetabaseCopy = _useState80[0],
|
|
231
|
+
setIsMetabaseCopy = _useState80[1];
|
|
232
|
+
var _useState81 = (0, _react.useState)(false),
|
|
230
233
|
_useState82 = (0, _slicedToArray2["default"])(_useState81, 2),
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
var rightClickButtonValueMap = (0, _react.useRef)({});
|
|
234
|
+
joinAliasConflictCheck = _useState82[0],
|
|
235
|
+
setJoinAliasConflictCheck = _useState82[1];
|
|
234
236
|
var _useState83 = (0, _react.useState)([]),
|
|
235
237
|
_useState84 = (0, _slicedToArray2["default"])(_useState83, 2),
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
var
|
|
238
|
+
existsError = _useState84[0],
|
|
239
|
+
setExistsError = _useState84[1];
|
|
240
|
+
var rightClickButtonValueMap = (0, _react.useRef)({});
|
|
241
|
+
var _useState85 = (0, _react.useState)([]),
|
|
239
242
|
_useState86 = (0, _slicedToArray2["default"])(_useState85, 2),
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
var
|
|
243
|
-
var _useState87 = (0, _react.useState)(_storage["default"]._metabaseCopyModule || []),
|
|
243
|
+
rightClickMenu = _useState86[0],
|
|
244
|
+
setRightClickMenu = _useState86[1];
|
|
245
|
+
var _useState87 = (0, _react.useState)(null),
|
|
244
246
|
_useState88 = (0, _slicedToArray2["default"])(_useState87, 2),
|
|
245
|
-
|
|
246
|
-
|
|
247
|
+
rightClickMenuState = _useState88[0],
|
|
248
|
+
setRightClickMenuState = _useState88[1];
|
|
249
|
+
var rightClickMenuClickRef = (0, _react.useRef)();
|
|
250
|
+
var _useState89 = (0, _react.useState)(_storage["default"]._metabaseCopyModule || []),
|
|
251
|
+
_useState90 = (0, _slicedToArray2["default"])(_useState89, 2),
|
|
252
|
+
metabaseCopyModule = _useState90[0],
|
|
253
|
+
setMetabaseCopyModule = _useState90[1];
|
|
247
254
|
var setRightClickMenuClick = function setRightClickMenuClick(fn) {
|
|
248
255
|
rightClickMenuClickRef.current = fn;
|
|
249
256
|
};
|
|
@@ -499,15 +506,21 @@ var useStore = function useStore() {
|
|
|
499
506
|
}
|
|
500
507
|
return _context7.abrupt("return", tables);
|
|
501
508
|
case 1:
|
|
502
|
-
|
|
509
|
+
if (!(typeof fetchDatasetFn.current !== 'function')) {
|
|
510
|
+
_context7.next = 2;
|
|
511
|
+
break;
|
|
512
|
+
}
|
|
513
|
+
return _context7.abrupt("return", []);
|
|
514
|
+
case 2:
|
|
515
|
+
_context7.next = 3;
|
|
503
516
|
return fetchDatasetFn.current(datasourceId, {
|
|
504
517
|
isExit: isExit
|
|
505
518
|
});
|
|
506
|
-
case
|
|
519
|
+
case 3:
|
|
507
520
|
_tables = _context7.sent;
|
|
508
521
|
setDataset(datasourceId, _tables);
|
|
509
522
|
return _context7.abrupt("return", _tables);
|
|
510
|
-
case
|
|
523
|
+
case 4:
|
|
511
524
|
case "end":
|
|
512
525
|
return _context7.stop();
|
|
513
526
|
}
|
|
@@ -523,7 +536,6 @@ var useStore = function useStore() {
|
|
|
523
536
|
var oldColumns,
|
|
524
537
|
callback,
|
|
525
538
|
isSelect,
|
|
526
|
-
_isSubquery,
|
|
527
539
|
_isExit,
|
|
528
540
|
_table$alias,
|
|
529
541
|
alias,
|
|
@@ -541,26 +553,29 @@ var useStore = function useStore() {
|
|
|
541
553
|
oldColumns = _args8.length > 2 && _args8[2] !== undefined ? _args8[2] : [];
|
|
542
554
|
callback = _args8.length > 3 ? _args8[3] : undefined;
|
|
543
555
|
isSelect = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : isSelectFields;
|
|
544
|
-
|
|
545
|
-
_isExit = _args8.length > 6 && _args8[6] !== undefined ? _args8[6] : isExit;
|
|
546
|
-
if (_isSubquery && oldColumns.length < 1) {
|
|
547
|
-
isSelect = false;
|
|
548
|
-
}
|
|
556
|
+
_isExit = _args8.length > 5 && _args8[5] !== undefined ? _args8[5] : isExit;
|
|
549
557
|
_table$alias = table.alias, alias = _table$alias === void 0 ? '' : _table$alias, datasourceName = table.datasourceName, did = table.datasourceId, column = table.column, extra = (0, _objectWithoutProperties2["default"])(table, _excluded);
|
|
550
558
|
tableName = table.name;
|
|
551
|
-
columns = getColumns(tableName);
|
|
559
|
+
columns = getColumns(tableName, datasourceId, _isExit);
|
|
552
560
|
if (columns.length) {
|
|
553
|
-
_context8.next =
|
|
561
|
+
_context8.next = 3;
|
|
554
562
|
break;
|
|
555
563
|
}
|
|
556
|
-
|
|
564
|
+
if (!(typeof fetchColumnsFn.current !== 'function')) {
|
|
565
|
+
_context8.next = 1;
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
568
|
+
typeof callback === 'function' && callback(oldColumns);
|
|
569
|
+
return _context8.abrupt("return", oldColumns);
|
|
570
|
+
case 1:
|
|
571
|
+
_context8.next = 2;
|
|
557
572
|
return fetchColumnsFn.current(extra, datasourceId, {
|
|
558
573
|
isExit: _isExit
|
|
559
574
|
});
|
|
560
|
-
case 1:
|
|
561
|
-
columns = _context8.sent;
|
|
562
|
-
setColumns(tableName, columns);
|
|
563
575
|
case 2:
|
|
576
|
+
columns = _context8.sent;
|
|
577
|
+
setColumns(tableName, columns, datasourceId, _isExit);
|
|
578
|
+
case 3:
|
|
564
579
|
_columns = (_columns2 = columns) === null || _columns2 === void 0 ? void 0 : _columns2.map(function (v) {
|
|
565
580
|
var _ref9, _obj$fieldAlias;
|
|
566
581
|
var obj = oldColumns.find(function (oldColumn) {
|
|
@@ -574,7 +589,7 @@ var useStore = function useStore() {
|
|
|
574
589
|
});
|
|
575
590
|
});
|
|
576
591
|
typeof callback === 'function' && callback(_columns);
|
|
577
|
-
case
|
|
592
|
+
case 4:
|
|
578
593
|
case "end":
|
|
579
594
|
return _context8.stop();
|
|
580
595
|
}
|
|
@@ -588,12 +603,15 @@ var useStore = function useStore() {
|
|
|
588
603
|
var _ref0 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee9(curData, groupInd) {
|
|
589
604
|
var changeObj,
|
|
590
605
|
_metaList,
|
|
606
|
+
requestId,
|
|
607
|
+
prevRevision,
|
|
591
608
|
prevMeta,
|
|
592
609
|
newMeta,
|
|
593
610
|
oldData,
|
|
594
611
|
newData,
|
|
595
612
|
isChange,
|
|
596
|
-
_args9 = arguments
|
|
613
|
+
_args9 = arguments,
|
|
614
|
+
_t;
|
|
597
615
|
return _regenerator["default"].wrap(function (_context9) {
|
|
598
616
|
while (1) switch (_context9.prev = _context9.next) {
|
|
599
617
|
case 0:
|
|
@@ -605,30 +623,54 @@ var useStore = function useStore() {
|
|
|
605
623
|
}
|
|
606
624
|
return _context9.abrupt("return");
|
|
607
625
|
case 1:
|
|
626
|
+
if (changeObj !== 'init') {
|
|
627
|
+
metaEditRequestRef.current += 1;
|
|
628
|
+
}
|
|
629
|
+
requestId = ++metaRequestRef.current;
|
|
630
|
+
prevRevision = metaRevisionRef.current;
|
|
608
631
|
prevMeta = (0, _cloneDeep["default"])(_metaList || latestMetaListRef.current);
|
|
609
632
|
newMeta = (0, _cloneDeep["default"])(prevMeta);
|
|
610
633
|
if (newMeta[groupInd]) {
|
|
611
634
|
newMeta[groupInd].list = (0, _cloneDeep["default"])(curData);
|
|
612
|
-
_setMeta(newMeta);
|
|
613
635
|
}
|
|
614
636
|
if (!(changeObj === 'init')) {
|
|
615
637
|
_context9.next = 2;
|
|
616
638
|
break;
|
|
617
639
|
}
|
|
640
|
+
_setMeta(newMeta);
|
|
618
641
|
return _context9.abrupt("return");
|
|
619
642
|
case 2:
|
|
620
643
|
oldData = (0, _utils.splitByUnion)(prevMeta);
|
|
621
644
|
newData = (0, _utils.splitByUnion)(newMeta);
|
|
645
|
+
if (!(typeof fetchChangeFn.current === 'function')) {
|
|
646
|
+
_context9.next = 4;
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
622
649
|
_context9.next = 3;
|
|
623
650
|
return fetchChangeFn.current(oldData, changeObj, {
|
|
624
651
|
isExit: isExit
|
|
625
652
|
}, newData);
|
|
626
653
|
case 3:
|
|
627
|
-
|
|
628
|
-
|
|
654
|
+
_t = _context9.sent;
|
|
655
|
+
_context9.next = 5;
|
|
656
|
+
break;
|
|
657
|
+
case 4:
|
|
658
|
+
_t = true;
|
|
659
|
+
case 5:
|
|
660
|
+
isChange = _t;
|
|
661
|
+
if (!(isChange === false)) {
|
|
662
|
+
_context9.next = 6;
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
if (requestId === metaRequestRef.current && metaRevisionRef.current === prevRevision) {
|
|
629
666
|
_setMeta(prevMeta);
|
|
630
667
|
}
|
|
631
|
-
|
|
668
|
+
return _context9.abrupt("return");
|
|
669
|
+
case 6:
|
|
670
|
+
if (requestId === metaRequestRef.current && metaRevisionRef.current === prevRevision) {
|
|
671
|
+
_setMeta(newMeta);
|
|
672
|
+
}
|
|
673
|
+
case 7:
|
|
632
674
|
case "end":
|
|
633
675
|
return _context9.stop();
|
|
634
676
|
}
|
|
@@ -639,8 +681,7 @@ var useStore = function useStore() {
|
|
|
639
681
|
};
|
|
640
682
|
}();
|
|
641
683
|
var setPreData = function setPreData(data) {
|
|
642
|
-
var
|
|
643
|
-
var _isExit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isExit;
|
|
684
|
+
var _isExit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isExit;
|
|
644
685
|
if (data.length) {
|
|
645
686
|
var _metaList = data === null || data === void 0 ? void 0 : data.map(function (item, groupIndex) {
|
|
646
687
|
var _item$list;
|
|
@@ -657,7 +698,7 @@ var useStore = function useStore() {
|
|
|
657
698
|
newMeta[i].columns = columns || [];
|
|
658
699
|
}
|
|
659
700
|
setMeta(newMeta, groupIndex, 'init', data);
|
|
660
|
-
}, false,
|
|
701
|
+
}, false, _isExit);
|
|
661
702
|
return (0, _objectSpread2["default"])({}, v);
|
|
662
703
|
}
|
|
663
704
|
if ((_v$table2 = v.table) !== null && _v$table2 !== void 0 && _v$table2.datasourceId) {
|
|
@@ -667,7 +708,7 @@ var useStore = function useStore() {
|
|
|
667
708
|
newMeta[i].columns = columns || [];
|
|
668
709
|
}
|
|
669
710
|
setMeta(newMeta, groupIndex, 'init', data);
|
|
670
|
-
}, false,
|
|
711
|
+
}, false, _isExit);
|
|
671
712
|
return (0, _objectSpread2["default"])({}, v);
|
|
672
713
|
}
|
|
673
714
|
return (0, _objectSpread2["default"])({}, v);
|
|
@@ -890,57 +931,8 @@ var useStore = function useStore() {
|
|
|
890
931
|
}
|
|
891
932
|
return item;
|
|
892
933
|
};
|
|
893
|
-
var
|
|
894
|
-
var _metaList$groupIndex;
|
|
895
|
-
if (!objList || objList.length === 0) return {
|
|
896
|
-
hasConflict: false
|
|
897
|
-
};
|
|
898
|
-
var groupList = ((_metaList$groupIndex = metaList[groupIndex]) === null || _metaList$groupIndex === void 0 ? void 0 : _metaList$groupIndex.list) || [];
|
|
899
|
-
var getJoinKey = function getJoinKey(table1, table2) {
|
|
900
|
-
return "".concat((table1 === null || table1 === void 0 ? void 0 : table1.id) || '', "_").concat((table2 === null || table2 === void 0 ? void 0 : table2.id) || '', "_").concat((table2 === null || table2 === void 0 ? void 0 : table2.name) || '');
|
|
901
|
-
};
|
|
902
|
-
var existingJoinKeys = new Set();
|
|
903
|
-
groupList.forEach(function (item) {
|
|
904
|
-
if (item.type === _enum.TypeEnum.joinData && item.table1 && item.table2) {
|
|
905
|
-
existingJoinKeys.add(getJoinKey(item.table1, item.table2));
|
|
906
|
-
}
|
|
907
|
-
});
|
|
908
|
-
var _iterator = (0, _createForOfIteratorHelper2["default"])(objList),
|
|
909
|
-
_step;
|
|
910
|
-
try {
|
|
911
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
912
|
-
var pastedItem = _step.value;
|
|
913
|
-
if (pastedItem.type !== _enum.TypeEnum.joinData || !pastedItem.table1 || !pastedItem.table2) {
|
|
914
|
-
continue;
|
|
915
|
-
}
|
|
916
|
-
var pastedKey = getJoinKey(pastedItem.table1, pastedItem.table2);
|
|
917
|
-
if (existingJoinKeys.has(pastedKey)) {
|
|
918
|
-
var _pastedItem$table, _pastedItem$table2;
|
|
919
|
-
return {
|
|
920
|
-
hasConflict: true,
|
|
921
|
-
conflictingAlias: (_pastedItem$table = pastedItem.table2) === null || _pastedItem$table === void 0 ? void 0 : _pastedItem$table.alias,
|
|
922
|
-
conflictingId: (_pastedItem$table2 = pastedItem.table2) === null || _pastedItem$table2 === void 0 ? void 0 : _pastedItem$table2.id
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
} catch (err) {
|
|
927
|
-
_iterator.e(err);
|
|
928
|
-
} finally {
|
|
929
|
-
_iterator.f();
|
|
930
|
-
}
|
|
931
|
-
return {
|
|
932
|
-
hasConflict: false
|
|
933
|
-
};
|
|
934
|
-
};
|
|
935
|
-
var addMeta = function addMeta(type, index, groupIndex, obj, onConflict) {
|
|
934
|
+
var addMeta = function addMeta(type, index, groupIndex, obj) {
|
|
936
935
|
if (snapshotMode) return false;
|
|
937
|
-
if (joinAliasConflictCheck && obj && obj.length > 0) {
|
|
938
|
-
var conflict = checkTable1Conflict(obj, index, groupIndex);
|
|
939
|
-
if (conflict.hasConflict && conflict.conflictingAlias && onConflict) {
|
|
940
|
-
onConflict(conflict.conflictingAlias);
|
|
941
|
-
return false;
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
936
|
var newMeta = metaList[groupIndex].list.slice();
|
|
945
937
|
var items = [];
|
|
946
938
|
var sharedUuidMap = {};
|
|
@@ -1010,18 +1002,27 @@ var useStore = function useStore() {
|
|
|
1010
1002
|
});
|
|
1011
1003
|
setMeta(_metaList, groupIndex);
|
|
1012
1004
|
};
|
|
1005
|
+
var getColumnsCacheKey = function getColumnsCacheKey(tableId) {
|
|
1006
|
+
var datasourceId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1007
|
+
var exitMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1008
|
+
return "".concat(datasourceId || '', "::").concat(tableId || '', "::").concat(exitMode ? 'exit' : 'main');
|
|
1009
|
+
};
|
|
1013
1010
|
var setColumns = function setColumns(tableId, columns) {
|
|
1011
|
+
var datasourceId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
1012
|
+
var exitMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
1014
1013
|
var _columns = columns === null || columns === void 0 ? void 0 : columns.map(function (v) {
|
|
1015
1014
|
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, v), {}, {
|
|
1016
1015
|
fieldUuid: v.fieldUuid || (0, _helper.uuidv4)('field')
|
|
1017
1016
|
});
|
|
1018
1017
|
});
|
|
1019
1018
|
var map = (0, _objectSpread2["default"])({}, _cacheColumnsMap);
|
|
1020
|
-
map[tableId] = _columns;
|
|
1019
|
+
map[getColumnsCacheKey(tableId, datasourceId, exitMode)] = _columns;
|
|
1021
1020
|
set_cacheColumnsMap(map);
|
|
1022
1021
|
};
|
|
1023
1022
|
var getColumns = function getColumns(tableId) {
|
|
1024
|
-
|
|
1023
|
+
var datasourceId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1024
|
+
var exitMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1025
|
+
return _cacheColumnsMap[getColumnsCacheKey(tableId, datasourceId, exitMode)] || [];
|
|
1025
1026
|
};
|
|
1026
1027
|
var setDataset = function setDataset(datasourceId, tables) {
|
|
1027
1028
|
var map = (0, _objectSpread2["default"])({}, _cacheSource2TableMap);
|
|
@@ -1039,6 +1040,9 @@ var useStore = function useStore() {
|
|
|
1039
1040
|
var getCurrentMetaList = function getCurrentMetaList() {
|
|
1040
1041
|
return (0, _cloneDeep["default"])(latestMetaListRef.current);
|
|
1041
1042
|
};
|
|
1043
|
+
var getMetaEditRequestId = function getMetaEditRequestId() {
|
|
1044
|
+
return metaEditRequestRef.current;
|
|
1045
|
+
};
|
|
1042
1046
|
return {
|
|
1043
1047
|
showFields: showFields,
|
|
1044
1048
|
setShowFields: setShowFields,
|
|
@@ -1084,6 +1088,7 @@ var useStore = function useStore() {
|
|
|
1084
1088
|
getDataset: getDataset,
|
|
1085
1089
|
reset: reset,
|
|
1086
1090
|
getCurrentMetaList: getCurrentMetaList,
|
|
1091
|
+
getMetaEditRequestId: getMetaEditRequestId,
|
|
1087
1092
|
setProps: setProps,
|
|
1088
1093
|
preProps: preProps.current,
|
|
1089
1094
|
showSubquery: showSubquery,
|
|
@@ -1127,6 +1132,8 @@ var useStore = function useStore() {
|
|
|
1127
1132
|
setShowFormulaDiff: setShowFormulaDiff,
|
|
1128
1133
|
matchBrackets: matchBrackets,
|
|
1129
1134
|
setMatchBrackets: setMatchBrackets,
|
|
1135
|
+
pairBrackets: pairBrackets,
|
|
1136
|
+
setPairBrackets: setPairBrackets,
|
|
1130
1137
|
hasFormulaSqlCode: hasFormulaSqlCode,
|
|
1131
1138
|
hasFormulaDiffCode: hasFormulaDiffCode,
|
|
1132
1139
|
sourceData: sourceData,
|
package/lib/cjs/hooks/winsize.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.useWinSize = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _helperDom = require("../utils/helper-dom");
|
|
11
11
|
var _event = require("../utils/event");
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './locale/en';
|
|
3
3
|
import './locale/zh';
|
|
4
|
-
import type { MetabaseProps, SqlVisionBuilderRef, DatasourceType, MetabaseRightClickMenuItem, MetabaseRightClickMenuClickParams, FormulaSqlParseParams, FormulaSqlParseResult, FormulaSqlChatMessage, FormulaSqlTableScopeItem, FormulaSqlStreamHandlers, FormulaSqlStreamParseParams } from './types';
|
|
4
|
+
import type { MetabaseProps, SqlVisionBuilderRef, DatasourceType, MetabaseRightClickMenuItem, MetabaseRightClickMenuClickParams, FormulaSqlParseParams, FormulaSqlParseResult, FormulaSqlChatMessage, FormulaSqlTableScopeItem, FormulaSqlStreamHandlers, FormulaSqlStreamParseParams, SqlDialect, SqlValidationQueryKind } from './types';
|
|
5
5
|
import type { MetaListType, ToolbarType } from './store/types';
|
|
6
6
|
import { AtomsTypeEnum } from './store/types';
|
|
7
|
+
import { validateMetabaseConfig } from './utils/transformSql';
|
|
8
|
+
import type { SqlValidationIssue, SqlValidationIssueCode, SqlValidationPathItem, SqlValidationPathType, SqlValidationResult } from './utils/transformSql';
|
|
7
9
|
declare const SqlVisionBuilder: React.ForwardRefExoticComponent<MetabaseProps & React.RefAttributes<SqlVisionBuilderRef>>;
|
|
8
10
|
export default SqlVisionBuilder;
|
|
9
|
-
export { MetabaseProps, DatasourceType, MetaListType, ToolbarType, SqlVisionBuilderRef, MetabaseRightClickMenuItem, MetabaseRightClickMenuClickParams, FormulaSqlParseParams, FormulaSqlParseResult, FormulaSqlChatMessage, FormulaSqlTableScopeItem, FormulaSqlStreamHandlers, FormulaSqlStreamParseParams, AtomsTypeEnum, };
|
|
11
|
+
export { MetabaseProps, DatasourceType, MetaListType, ToolbarType, SqlVisionBuilderRef, MetabaseRightClickMenuItem, MetabaseRightClickMenuClickParams, FormulaSqlParseParams, FormulaSqlParseResult, FormulaSqlChatMessage, FormulaSqlTableScopeItem, FormulaSqlStreamHandlers, FormulaSqlStreamParseParams, SqlDialect, SqlValidationQueryKind, SqlValidationIssue, SqlValidationIssueCode, SqlValidationPathItem, SqlValidationPathType, SqlValidationResult, AtomsTypeEnum, validateMetabaseConfig, };
|
package/lib/cjs/index.js
CHANGED
|
@@ -12,7 +12,13 @@ Object.defineProperty(exports, "AtomsTypeEnum", {
|
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
exports["default"] = void 0;
|
|
15
|
-
|
|
15
|
+
Object.defineProperty(exports, "validateMetabaseConfig", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function get() {
|
|
18
|
+
return _transformSql.validateMetabaseConfig;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
16
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
23
|
var _react = _interopRequireWildcard(require("react"));
|
|
18
24
|
var _useProvider = require("./hooks/use-provider");
|
|
@@ -24,6 +30,7 @@ var _Loading = _interopRequireDefault(require("./common/Loading"));
|
|
|
24
30
|
var _metabase = _interopRequireDefault(require("./components/metabase"));
|
|
25
31
|
var _types = require("./store/types");
|
|
26
32
|
var _utils = require("./utils");
|
|
33
|
+
var _transformSql = require("./utils/transformSql");
|
|
27
34
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
28
35
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
29
36
|
var EMPTY_ARRAY = [];
|
|
@@ -93,6 +100,8 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
|
|
|
93
100
|
showFormulaDiff = _props$showFormulaDif === void 0 ? true : _props$showFormulaDif,
|
|
94
101
|
_props$matchBrackets = props.matchBrackets,
|
|
95
102
|
matchBrackets = _props$matchBrackets === void 0 ? true : _props$matchBrackets,
|
|
103
|
+
_props$pairBrackets = props.pairBrackets,
|
|
104
|
+
pairBrackets = _props$pairBrackets === void 0 ? false : _props$pairBrackets,
|
|
96
105
|
_props$joinAliasConfl = props.joinAliasConflictCheck,
|
|
97
106
|
joinAliasConflictCheck = _props$joinAliasConfl === void 0 ? false : _props$joinAliasConfl,
|
|
98
107
|
_props$operatorList = props.operatorList,
|
|
@@ -103,9 +112,7 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
|
|
|
103
112
|
getColumns && store.setFetchColumnsFn(getColumns);
|
|
104
113
|
onChange && store.setFetchChangeFn(onChange);
|
|
105
114
|
getModuleDiffCode && store.setFetchDiffFn(getModuleDiffCode);
|
|
106
|
-
|
|
107
|
-
store.setFetchFormulaDiffFn(getFormulaDiffCode);
|
|
108
|
-
}, []);
|
|
115
|
+
}, [getTables, getColumns, onChange, getModuleDiffCode]);
|
|
109
116
|
(0, _react.useEffect)(function () {
|
|
110
117
|
store.setFetchFormulaSqlFn(getFormulaSqlCode);
|
|
111
118
|
store.setFetchFormulaDiffFn(getFormulaDiffCode);
|
|
@@ -116,7 +123,7 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
|
|
|
116
123
|
(0, _react.useEffect)(function () {
|
|
117
124
|
var source_value = (0, _utils.normalizeAndOrStructure)((0, _utils.patchData)(value, constantList, formulaTemplates));
|
|
118
125
|
var _value = (0, _utils.reassembleByUnion)(source_value);
|
|
119
|
-
store.setPreData((0, _cloneDeep["default"])(_value),
|
|
126
|
+
store.setPreData((0, _cloneDeep["default"])(_value), isExit);
|
|
120
127
|
store.setSourceData(source_value);
|
|
121
128
|
getExistsError && store.setExistsErrorFn(getExistsError, value);
|
|
122
129
|
}, [value, constantList, formulaTemplates]);
|
|
@@ -147,11 +154,12 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
|
|
|
147
154
|
store.setShowFormulaSql(showFormulaSql);
|
|
148
155
|
store.setShowFormulaDiff(showFormulaDiff);
|
|
149
156
|
store.setMatchBrackets(matchBrackets);
|
|
157
|
+
store.setPairBrackets(pairBrackets);
|
|
150
158
|
store.setIsSubquery(isSubquery);
|
|
151
159
|
store.setModuleCopy(moduleCopy);
|
|
152
160
|
store.setJoinAliasConflictCheck(joinAliasConflictCheck);
|
|
153
161
|
store.setOperatorList(operatorList || EMPTY_ARRAY);
|
|
154
|
-
}, [showFields, fieldNameTpl, tableNameTpl, toolbar, showSubquery, subShowSubquery, constantList, formulaTemplates, ignoreGroupByType, filterCustomType, isExit, tableEnableAlias, fieldEnableAlias, groupByEnableAlias, isSelectFields, tableFlat, snapshotMode, copyType, metabaseCopy, moduleDiff, showFormulaSql, showFormulaDiff, matchBrackets, getFormulaSqlCode, getFormulaDiffCode, isSubquery, moduleCopy, joinAliasConflictCheck, operatorList]);
|
|
162
|
+
}, [showFields, fieldNameTpl, tableNameTpl, toolbar, showSubquery, subShowSubquery, constantList, formulaTemplates, ignoreGroupByType, filterCustomType, isExit, tableEnableAlias, fieldEnableAlias, groupByEnableAlias, isSelectFields, tableFlat, snapshotMode, copyType, metabaseCopy, moduleDiff, showFormulaSql, showFormulaDiff, matchBrackets, pairBrackets, getFormulaSqlCode, getFormulaDiffCode, isSubquery, moduleCopy, joinAliasConflictCheck, operatorList]);
|
|
155
163
|
_react["default"].useImperativeHandle(ref, function () {
|
|
156
164
|
return {
|
|
157
165
|
reset: function reset() {
|
package/lib/cjs/locale/en.js
CHANGED
|
@@ -40,6 +40,8 @@ var _default = exports["default"] = (0, _index.register)('en', {
|
|
|
40
40
|
'SqlQueryBuilder.pickTable': 'Select data table...',
|
|
41
41
|
'SqlQueryBuilder.pickConstant': 'Select constant...',
|
|
42
42
|
'customColumn.input': 'Input',
|
|
43
|
+
'customColumn.inputList': 'Value list',
|
|
44
|
+
'customColumn.inputListPlaceholder': 'Type and press Enter to add',
|
|
43
45
|
'customColumn.numberInput': 'Number input',
|
|
44
46
|
'customColumn.addSql': 'Add SQL',
|
|
45
47
|
'customColumn.parseSql': 'Parse with AI',
|
|
@@ -206,11 +208,44 @@ var _default = exports["default"] = (0, _index.register)('en', {
|
|
|
206
208
|
'metabase.nextBtn': 'next step',
|
|
207
209
|
'metabase.nextOk': 'ok',
|
|
208
210
|
'metabase.verify': 'The table has been modified. Please select again',
|
|
211
|
+
'metabase.tableNotExists': 'The table no longer exists. Please select again',
|
|
212
|
+
'metabase.fieldNotExists': 'The field no longer exists. Please select again',
|
|
209
213
|
'metabase.verifyAliasAction': 'The table has been modified. Please select it again; click As to modify the alias',
|
|
210
214
|
'metabase.validationFailed': 'Validation failed. Do you still want to save?',
|
|
211
215
|
'metabase.validationFilter': 'The filter configuration is incorrect. Saving is prohibited!',
|
|
212
216
|
'metabase.validationFormula': 'The formula configuration is incorrect. Saving is prohibited!',
|
|
213
217
|
'metabase.validationFormulaSave': 'The formula configuration is incorrect. Do you still want to save?',
|
|
218
|
+
'metabase.validationSqlSave': 'The SQL generated from the complete configuration may not execute. Do you still want to save?',
|
|
219
|
+
'metabase.validationConfigSave': 'The configuration is incomplete. Do you still want to save?',
|
|
220
|
+
'metabase.sqlErrorEmptyQuery': 'Please finish configuring this query',
|
|
221
|
+
'metabase.sqlErrorMissingSelection': 'Something is still incomplete. Check the highlighted items',
|
|
222
|
+
'metabase.sqlErrorMissingCustomInput': 'Please choose a custom input',
|
|
223
|
+
'metabase.sqlErrorMissingField': 'Please select a field',
|
|
224
|
+
'metabase.sqlErrorEmptyOutputFields': 'Please select output fields',
|
|
225
|
+
'metabase.sqlErrorOpenNested': 'Something inside is incomplete. Open it to review',
|
|
226
|
+
'metabase.sqlErrorSelectList': 'The SELECT output list is empty or incomplete',
|
|
227
|
+
'metabase.sqlErrorScalarSelectList': 'A scalar subquery must output exactly one field',
|
|
228
|
+
'metabase.sqlErrorFrom': 'FROM is missing a valid table or subquery',
|
|
229
|
+
'metabase.sqlErrorJoin': 'JOIN is missing a table or complete ON condition',
|
|
230
|
+
'metabase.sqlErrorClause': 'A WHERE, GROUP BY, ORDER BY, or LIMIT clause is incomplete',
|
|
231
|
+
'metabase.sqlErrorDanglingOperator': 'An expression starts or ends with a dangling operator',
|
|
232
|
+
'metabase.sqlErrorUnion': 'A UNION branch is missing or its output column count does not match',
|
|
233
|
+
'metabase.sqlErrorInvalidIdentifier': 'The SQL contains a table, column, or alias that was not generated correctly',
|
|
234
|
+
'metabase.sqlErrorGeneration': 'SQL generation failed for the complete configuration',
|
|
235
|
+
'metabase.sqlErrorParentheses': 'Parentheses are not balanced',
|
|
236
|
+
'metabase.sqlErrorCase': 'The CASE expression is structurally invalid',
|
|
237
|
+
'metabase.sqlErrorCaseMissingWhen': 'CASE is missing WHEN',
|
|
238
|
+
'metabase.sqlErrorCaseMissingThen': 'CASE is missing THEN',
|
|
239
|
+
'metabase.sqlErrorCaseMissingEnd': 'CASE is missing END',
|
|
240
|
+
'metabase.sqlErrorCaseMissingValue': 'A CASE WHEN / THEN / ELSE expression is empty',
|
|
241
|
+
'metabase.sqlErrorCaseKeywordScope': 'WHEN, THEN, ELSE, and END can only appear inside CASE',
|
|
242
|
+
'metabase.sqlErrorWindow': 'Incomplete window function (missing OVER or parentheses)',
|
|
243
|
+
'metabase.sqlErrorDuplicateLogicalOperator': 'Duplicate logical operator (for example AND AND or OR OR)',
|
|
244
|
+
'metabase.sqlErrorAndOr': 'Incomplete AND / OR group (missing operator or condition)',
|
|
245
|
+
'metabase.sqlErrorUnterminatedQuote': 'Unterminated string or identifier quote',
|
|
246
|
+
'metabase.sqlErrorFormula': 'The formula configuration is incorrect',
|
|
247
|
+
'metabase.sqlErrorSubstrNegativeLength': 'The third SUBSTR argument (length) cannot be negative',
|
|
248
|
+
'metabase.sqlErrorUi': 'A field or module failed validation',
|
|
214
249
|
'metabase.prompt': 'Prompt',
|
|
215
250
|
'metabase.copy': 'Copy',
|
|
216
251
|
'metabase.copySuccess': 'Copy success',
|
package/lib/cjs/locale/zh.js
CHANGED
|
@@ -85,6 +85,8 @@ var _default = exports["default"] = (0, _index.register)('zh', {
|
|
|
85
85
|
'customColumn.formula': '公式',
|
|
86
86
|
'customColumn.selectFormula': '选择公式...',
|
|
87
87
|
'customColumn.input': '输入框',
|
|
88
|
+
'customColumn.inputList': '值列表',
|
|
89
|
+
'customColumn.inputListPlaceholder': '可输入回车新增下拉选项',
|
|
88
90
|
'customColumn.numberInput': '数字输入框',
|
|
89
91
|
'customColumn.addSql': '添加 SQL',
|
|
90
92
|
'customColumn.parseSql': 'AI 解析',
|
|
@@ -206,11 +208,44 @@ var _default = exports["default"] = (0, _index.register)('zh', {
|
|
|
206
208
|
'metabase.nextBtn': '下一步',
|
|
207
209
|
'metabase.nextOk': '确定',
|
|
208
210
|
'metabase.verify': '表已修改,请重新选择',
|
|
211
|
+
'metabase.tableNotExists': '表不存在,请重新选择',
|
|
212
|
+
'metabase.fieldNotExists': '字段不存在,请重新选择',
|
|
209
213
|
'metabase.verifyAliasAction': '表已修改,请重新选择;点击 As 可修改别名',
|
|
210
214
|
'metabase.validationFailed': '校验未通过,是否依然保存?',
|
|
211
215
|
'metabase.validationFilter': '过滤器配置有误,禁止保存!',
|
|
212
216
|
'metabase.validationFormula': '公式配置有误,禁止保存!',
|
|
213
217
|
'metabase.validationFormulaSave': '公式配置有误,是否依然保存?',
|
|
218
|
+
'metabase.validationSqlSave': '完整配置生成的 SQL 可能无法正常执行,是否依然保存?',
|
|
219
|
+
'metabase.validationConfigSave': '配置不完整,是否依然保存?',
|
|
220
|
+
'metabase.sqlErrorEmptyQuery': '请先配置查询',
|
|
221
|
+
'metabase.sqlErrorMissingSelection': '还有未完成的内容,请查看标红位置',
|
|
222
|
+
'metabase.sqlErrorMissingCustomInput': '请选择自定义输入',
|
|
223
|
+
'metabase.sqlErrorMissingField': '请选择字段',
|
|
224
|
+
'metabase.sqlErrorEmptyOutputFields': '请选择输出字段',
|
|
225
|
+
'metabase.sqlErrorOpenNested': '内部有未完成配置,请打开查看',
|
|
226
|
+
'metabase.sqlErrorSelectList': 'SELECT 输出字段为空或不完整',
|
|
227
|
+
'metabase.sqlErrorScalarSelectList': '标量子查询必须且只能输出一个字段',
|
|
228
|
+
'metabase.sqlErrorFrom': 'FROM 缺少有效的数据表或子查询',
|
|
229
|
+
'metabase.sqlErrorJoin': 'JOIN 缺少关联表或完整的 ON 条件',
|
|
230
|
+
'metabase.sqlErrorClause': 'WHERE、GROUP BY、ORDER BY 或 LIMIT 子句不完整',
|
|
231
|
+
'metabase.sqlErrorDanglingOperator': '表达式开头或结尾存在悬空操作符',
|
|
232
|
+
'metabase.sqlErrorUnion': 'UNION 分支缺失,或各分支输出字段数量不一致',
|
|
233
|
+
'metabase.sqlErrorInvalidIdentifier': 'SQL 中存在未正确生成的表名、字段名或别名',
|
|
234
|
+
'metabase.sqlErrorGeneration': '根据当前完整配置生成 SQL 时发生错误',
|
|
235
|
+
'metabase.sqlErrorParentheses': '括号不匹配',
|
|
236
|
+
'metabase.sqlErrorCase': 'CASE 语句结构不正确',
|
|
237
|
+
'metabase.sqlErrorCaseMissingWhen': 'CASE 语句缺少 WHEN',
|
|
238
|
+
'metabase.sqlErrorCaseMissingThen': 'CASE 语句缺少 THEN',
|
|
239
|
+
'metabase.sqlErrorCaseMissingEnd': 'CASE 语句缺少 END',
|
|
240
|
+
'metabase.sqlErrorCaseMissingValue': 'CASE 的 WHEN / THEN / ELSE 表达式未填写完整',
|
|
241
|
+
'metabase.sqlErrorCaseKeywordScope': 'WHEN、THEN、ELSE、END 只能出现在 CASE 结构中',
|
|
242
|
+
'metabase.sqlErrorWindow': '窗口函数结构不完整(缺少 OVER 或括号)',
|
|
243
|
+
'metabase.sqlErrorDuplicateLogicalOperator': '逻辑操作符重复(例如 AND AND 或 OR OR)',
|
|
244
|
+
'metabase.sqlErrorAndOr': 'AND / OR 结构不完整(缺少连接符或条件)',
|
|
245
|
+
'metabase.sqlErrorUnterminatedQuote': '字符串或标识符引号未闭合',
|
|
246
|
+
'metabase.sqlErrorFormula': '公式配置有误',
|
|
247
|
+
'metabase.sqlErrorSubstrNegativeLength': 'SUBSTR 的第三个参数(截取长度)不能为负数',
|
|
248
|
+
'metabase.sqlErrorUi': '字段或模块配置校验未通过',
|
|
214
249
|
'metabase.prompt': '提示',
|
|
215
250
|
'metabase.copy': '复制',
|
|
216
251
|
'metabase.copySuccess': '复制成功',
|