@dexteel/mesf-core 7.6.0 → 7.8.0
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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +25 -0
- package/GEMINI.md +92 -0
- package/dist/index.esm.js +263 -94
- package/dist/index.esm.js.map +1 -1
- package/dist/pages/trendings/components/chart/repository/TrendingRepository.d.ts +6 -1
- package/dist/pages/trendings-v2/components/chart/utils/LocalStorageUtils.d.ts +4 -0
- package/package.json +6 -5
package/dist/index.esm.js
CHANGED
|
@@ -59,6 +59,7 @@ import { DateTimePicker as DateTimePicker$1 } from '@mui/x-date-pickers/DateTime
|
|
|
59
59
|
import ClearAllIcon from '@mui/icons-material/ClearAll';
|
|
60
60
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
61
61
|
import axios from 'axios';
|
|
62
|
+
import { Group as Group$1, Panel, Separator } from 'react-resizable-panels';
|
|
62
63
|
import { LocalizationProvider as LocalizationProvider$1 } from '@mui/x-date-pickers/LocalizationProvider';
|
|
63
64
|
import InsertChartIcon from '@mui/icons-material/InsertChart';
|
|
64
65
|
import ReactECharts from 'echarts-for-react';
|
|
@@ -3859,13 +3860,13 @@ var INITIAL_VALUES$2 = {
|
|
|
3859
3860
|
};
|
|
3860
3861
|
|
|
3861
3862
|
var CreateProfile = function (_a) {
|
|
3862
|
-
var _b;
|
|
3863
|
+
var _b, _c;
|
|
3863
3864
|
var show = _a.show, onHide = _a.onHide, suffixTitle = _a.suffixTitle;
|
|
3864
|
-
var
|
|
3865
|
-
var
|
|
3866
|
-
var
|
|
3867
|
-
var
|
|
3868
|
-
var
|
|
3865
|
+
var _d = useState(false), openSnackbar = _d[0], setOpenSnackbar = _d[1];
|
|
3866
|
+
var _e = useState(""), message = _e[0], setMessage = _e[1];
|
|
3867
|
+
var _f = useState(false), isSubmitLoading = _f[0], setIsSubmitLoading = _f[1];
|
|
3868
|
+
var _g = useState(""), error = _g[0], setError = _g[1];
|
|
3869
|
+
var _h = useForm({ defaultValues: INITIAL_VALUES$2 }), register = _h.register, handleSubmit = _h.handleSubmit, reset = _h.reset, errors = _h.formState.errors;
|
|
3869
3870
|
var createProfile = useMutation({
|
|
3870
3871
|
mutationFn: upsertProfile,
|
|
3871
3872
|
onSuccess: function () {
|
|
@@ -3915,9 +3916,18 @@ var CreateProfile = function (_a) {
|
|
|
3915
3916
|
React.createElement(MesfModal.Content, { style: { padding: "15px 30px" } },
|
|
3916
3917
|
React.createElement(Grid2, { container: true, spacing: 1 },
|
|
3917
3918
|
React.createElement(Grid2, { size: { md: 12, xs: 12 } },
|
|
3918
|
-
React.createElement(TextField, __assign({}, register("ProfileName", {
|
|
3919
|
+
React.createElement(TextField, __assign({}, register("ProfileName", {
|
|
3920
|
+
required: true,
|
|
3921
|
+
validate: {
|
|
3922
|
+
notWhitespace: function (value) {
|
|
3923
|
+
return value.trim() !== "" ||
|
|
3924
|
+
"Profile name cannot be only whitespace";
|
|
3925
|
+
},
|
|
3926
|
+
},
|
|
3927
|
+
}), { label: "Profile name", variant: "outlined", error: !!errors.ProfileName, fullWidth: true, margin: "dense", autoComplete: "off" })),
|
|
3919
3928
|
" ",
|
|
3920
|
-
((_b = errors.ProfileName) === null || _b === void 0 ? void 0 : _b.type) === "required" && (React.createElement("span", { style: { fontSize: 12, color: "#F44336" } }, "Profile name is required"))
|
|
3929
|
+
((_b = errors.ProfileName) === null || _b === void 0 ? void 0 : _b.type) === "required" && (React.createElement("span", { style: { fontSize: 12, color: "#F44336" } }, "Profile name is required")),
|
|
3930
|
+
((_c = errors.ProfileName) === null || _c === void 0 ? void 0 : _c.type) === "notWhitespace" && (React.createElement("span", { style: { fontSize: 12, color: "#F44336" } }, errors.ProfileName.message))))),
|
|
3921
3931
|
React.createElement(MesfModal.Actions, { style: { padding: "20px 30px 30px" } },
|
|
3922
3932
|
React.createElement(Grid2, { container: true, spacing: 2, justifyContent: "flex-end" },
|
|
3923
3933
|
React.createElement(Grid2, { size: { md: 3, xs: 12 }, style: { margin: 0 } },
|
|
@@ -12052,7 +12062,7 @@ var getViewTags = function (ViewId) { return __awaiter(void 0, void 0, void 0, f
|
|
|
12052
12062
|
}); };
|
|
12053
12063
|
var upsertViewTag = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
12054
12064
|
var apiService, parameters, resp;
|
|
12055
|
-
var viewId = _b.viewId, tagId = _b.tagId, color = _b.color, minScale = _b.minScale, maxScale = _b.maxScale, isVisible = _b.isVisible, isAutoScale = _b.isAutoScale, unit = _b.unit;
|
|
12065
|
+
var viewId = _b.viewId, tagId = _b.tagId, color = _b.color, minScale = _b.minScale, maxScale = _b.maxScale, isVisible = _b.isVisible, isAutoScale = _b.isAutoScale, unit = _b.unit; _b.order; _b.alias; _b.tagType; _b.sourceTagId; _b.bitIndex;
|
|
12056
12066
|
return __generator(this, function (_c) {
|
|
12057
12067
|
switch (_c.label) {
|
|
12058
12068
|
case 0:
|
|
@@ -12148,6 +12158,37 @@ var ConfirmationDialogRaw = function (_a) {
|
|
|
12148
12158
|
React__default.createElement(Button, { variant: "contained", size: "small", color: "primary", onClick: handleOk }, "Ok")))));
|
|
12149
12159
|
};
|
|
12150
12160
|
|
|
12161
|
+
var STORAGE_PREFIX = "mesf_trending_view_v2_";
|
|
12162
|
+
var saveViewToLocal = function (viewId, viewTags) {
|
|
12163
|
+
try {
|
|
12164
|
+
var key = "".concat(STORAGE_PREFIX).concat(viewId);
|
|
12165
|
+
localStorage.setItem(key, JSON.stringify(viewTags));
|
|
12166
|
+
}
|
|
12167
|
+
catch (e) {
|
|
12168
|
+
console.error("Failed to save view to local storage", e);
|
|
12169
|
+
}
|
|
12170
|
+
};
|
|
12171
|
+
var getViewFromLocal = function (viewId) {
|
|
12172
|
+
try {
|
|
12173
|
+
var key = "".concat(STORAGE_PREFIX).concat(viewId);
|
|
12174
|
+
var data = localStorage.getItem(key);
|
|
12175
|
+
return data ? JSON.parse(data) : null;
|
|
12176
|
+
}
|
|
12177
|
+
catch (e) {
|
|
12178
|
+
console.error("Failed to load view from local storage", e);
|
|
12179
|
+
return null;
|
|
12180
|
+
}
|
|
12181
|
+
};
|
|
12182
|
+
var removeViewFromLocal = function (viewId) {
|
|
12183
|
+
try {
|
|
12184
|
+
var key = "".concat(STORAGE_PREFIX).concat(viewId);
|
|
12185
|
+
localStorage.removeItem(key);
|
|
12186
|
+
}
|
|
12187
|
+
catch (e) {
|
|
12188
|
+
console.error("Failed to remove view from local storage", e);
|
|
12189
|
+
}
|
|
12190
|
+
};
|
|
12191
|
+
|
|
12151
12192
|
var SaveUpdateDeleteViewModalV2 = function (_a) {
|
|
12152
12193
|
var _b, _c, _d;
|
|
12153
12194
|
var open = _a.open, mode = _a.mode, handleClose = _a.handleClose, view = _a.view;
|
|
@@ -12185,7 +12226,7 @@ var SaveUpdateDeleteViewModalV2 = function (_a) {
|
|
|
12185
12226
|
};
|
|
12186
12227
|
var updateViewTag = useMutation({
|
|
12187
12228
|
mutationFn: function (_a) {
|
|
12188
|
-
var viewId = _a.viewId, tagId = _a.tagId, color = _a.color, minScale = _a.minScale, maxScale = _a.maxScale, isVisible = _a.isVisible, isAutoScale = _a.isAutoScale, unit = _a.unit;
|
|
12229
|
+
var viewId = _a.viewId, tagId = _a.tagId, color = _a.color, minScale = _a.minScale, maxScale = _a.maxScale, isVisible = _a.isVisible, isAutoScale = _a.isAutoScale, unit = _a.unit, order = _a.order, alias = _a.alias, tagType = _a.tagType, sourceTagId = _a.sourceTagId, bitIndex = _a.bitIndex;
|
|
12189
12230
|
return upsertViewTag({
|
|
12190
12231
|
viewId: viewId,
|
|
12191
12232
|
tagId: tagId,
|
|
@@ -12195,6 +12236,11 @@ var SaveUpdateDeleteViewModalV2 = function (_a) {
|
|
|
12195
12236
|
isVisible: isVisible,
|
|
12196
12237
|
isAutoScale: isAutoScale,
|
|
12197
12238
|
unit: unit,
|
|
12239
|
+
order: order,
|
|
12240
|
+
alias: alias,
|
|
12241
|
+
tagType: tagType,
|
|
12242
|
+
sourceTagId: sourceTagId,
|
|
12243
|
+
bitIndex: bitIndex,
|
|
12198
12244
|
});
|
|
12199
12245
|
},
|
|
12200
12246
|
onError: function (error) {
|
|
@@ -12207,6 +12253,12 @@ var SaveUpdateDeleteViewModalV2 = function (_a) {
|
|
|
12207
12253
|
return __generator(this, function (_a) {
|
|
12208
12254
|
switch (_a.label) {
|
|
12209
12255
|
case 0:
|
|
12256
|
+
if (view === null || view === void 0 ? void 0 : view.ViewId) {
|
|
12257
|
+
removeViewFromLocal(view.ViewId);
|
|
12258
|
+
}
|
|
12259
|
+
else if (viewSelected === null || viewSelected === void 0 ? void 0 : viewSelected.ViewId) {
|
|
12260
|
+
removeViewFromLocal(viewSelected.ViewId);
|
|
12261
|
+
}
|
|
12210
12262
|
setSnackbarMessage("The view was deleted successfully");
|
|
12211
12263
|
setSnackbarOpen(true);
|
|
12212
12264
|
return [4 /*yield*/, queryClient.invalidateQueries({ queryKey: ["views-v2"] })];
|
|
@@ -12229,31 +12281,43 @@ var SaveUpdateDeleteViewModalV2 = function (_a) {
|
|
|
12229
12281
|
});
|
|
12230
12282
|
}); },
|
|
12231
12283
|
onSuccess: function (viewId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12232
|
-
var results, failed;
|
|
12284
|
+
var backendTags, results, failed;
|
|
12233
12285
|
return __generator(this, function (_a) {
|
|
12234
12286
|
switch (_a.label) {
|
|
12235
|
-
case 0:
|
|
12236
|
-
|
|
12237
|
-
|
|
12238
|
-
|
|
12239
|
-
|
|
12240
|
-
|
|
12241
|
-
|
|
12242
|
-
|
|
12243
|
-
|
|
12244
|
-
|
|
12245
|
-
|
|
12246
|
-
|
|
12247
|
-
|
|
12248
|
-
|
|
12249
|
-
|
|
12250
|
-
|
|
12251
|
-
|
|
12252
|
-
|
|
12253
|
-
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12287
|
+
case 0:
|
|
12288
|
+
// Save complete state to local storage (metadata + virtual tags)
|
|
12289
|
+
saveViewToLocal(viewId, viewTags);
|
|
12290
|
+
backendTags = Object.values(viewTags).filter(function (_a) {
|
|
12291
|
+
var viewTag = _a.viewTag;
|
|
12292
|
+
return !viewTag.IsBitExtracted;
|
|
12293
|
+
});
|
|
12294
|
+
return [4 /*yield*/, Promise.allSettled(backendTags
|
|
12295
|
+
.sort(function (a, b) { return a.order - b.order; })
|
|
12296
|
+
.map(function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
12297
|
+
var viewTag = _b.viewTag, order = _b.order;
|
|
12298
|
+
return __generator(this, function (_c) {
|
|
12299
|
+
switch (_c.label) {
|
|
12300
|
+
case 0: return [4 /*yield*/, updateViewTag.mutateAsync({
|
|
12301
|
+
viewId: viewId,
|
|
12302
|
+
tagId: viewTag.TagId,
|
|
12303
|
+
color: viewTag.Color,
|
|
12304
|
+
minScale: viewTag.MinScale,
|
|
12305
|
+
maxScale: viewTag.MaxScale,
|
|
12306
|
+
isVisible: viewTag.IsVisible,
|
|
12307
|
+
isAutoScale: viewTag.IsAutoScale,
|
|
12308
|
+
unit: viewTag.Unit,
|
|
12309
|
+
order: order,
|
|
12310
|
+
alias: viewTag.Alias,
|
|
12311
|
+
tagType: viewTag.TagType,
|
|
12312
|
+
sourceTagId: viewTag.SourceTagId,
|
|
12313
|
+
bitIndex: viewTag.BitIndex,
|
|
12314
|
+
})];
|
|
12315
|
+
case 1:
|
|
12316
|
+
_c.sent();
|
|
12317
|
+
return [2 /*return*/];
|
|
12318
|
+
}
|
|
12319
|
+
});
|
|
12320
|
+
}); }))];
|
|
12257
12321
|
case 1:
|
|
12258
12322
|
results = _a.sent();
|
|
12259
12323
|
failed = results.filter(function (r) { return r.status === "rejected"; });
|
|
@@ -12291,7 +12355,7 @@ var SaveUpdateDeleteViewModalV2 = function (_a) {
|
|
|
12291
12355
|
setIsSubmitLoading(true);
|
|
12292
12356
|
viewToDelete = view || viewSelected;
|
|
12293
12357
|
if (!!isNil(viewToDelete)) return [3 /*break*/, 2];
|
|
12294
|
-
return [4 /*yield*/, removeView.
|
|
12358
|
+
return [4 /*yield*/, removeView.mutateAsync(viewToDelete.ViewId)];
|
|
12295
12359
|
case 1:
|
|
12296
12360
|
_a.sent();
|
|
12297
12361
|
_a.label = 2;
|
|
@@ -12882,6 +12946,22 @@ var ColorPickerV2 = function (_a) {
|
|
|
12882
12946
|
} }, tagColors.map(function (tagColor) { return (React__default.createElement(ColorSwatch, { key: tagColor, color: tagColor, onSelect: handleColorSelect })); })))));
|
|
12883
12947
|
};
|
|
12884
12948
|
|
|
12949
|
+
var NotificationSnackBar = function (_a) {
|
|
12950
|
+
var message = _a.message, _b = _a.onHide, onHide = _b === void 0 ? function () { } : _b, _c = _a.severity, severity = _c === void 0 ? "success" : _c;
|
|
12951
|
+
var handleClose = function (event, reason) {
|
|
12952
|
+
if (reason === "clickaway") {
|
|
12953
|
+
return;
|
|
12954
|
+
}
|
|
12955
|
+
onHide();
|
|
12956
|
+
};
|
|
12957
|
+
var _d = useState(true), open = _d[0], setOpen = _d[1];
|
|
12958
|
+
useEffect(function () {
|
|
12959
|
+
setOpen(!!message);
|
|
12960
|
+
}, [message]);
|
|
12961
|
+
return (React__default.createElement(Snackbar, { open: open, autoHideDuration: 2500, onClose: handleClose, anchorOrigin: { vertical: "bottom", horizontal: "center" } },
|
|
12962
|
+
React__default.createElement(Alert$3, { elevation: 6, variant: "filled", severity: severity, onClose: handleClose }, message)));
|
|
12963
|
+
};
|
|
12964
|
+
|
|
12885
12965
|
var NewFolderModal = function (_a) {
|
|
12886
12966
|
var open = _a.open, handleClose = _a.handleClose, tagNodeSelectedInTree = _a.tagNodeSelectedInTree;
|
|
12887
12967
|
var _b = useState(), name = _b[0], setName = _b[1];
|
|
@@ -13119,7 +13199,7 @@ var TagFolderCustomNodeV2 = function (_a) {
|
|
|
13119
13199
|
(_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener("contextmenu", handleContextMenu);
|
|
13120
13200
|
};
|
|
13121
13201
|
}, []);
|
|
13122
|
-
return (React__default.createElement(Box, { onClick: onClickHandler, sx: {
|
|
13202
|
+
return (React__default.createElement(Box, { "data-node-id": node.id, onClick: onClickHandler, sx: {
|
|
13123
13203
|
paddingInlineStart: depth * 2,
|
|
13124
13204
|
cursor: "pointer",
|
|
13125
13205
|
alignItems: "center",
|
|
@@ -13400,13 +13480,14 @@ var TagsTreeModalV2 = function (_a) {
|
|
|
13400
13480
|
var open = _a.open, handleClose = _a.handleClose, onTagSelect = _a.onTagSelect;
|
|
13401
13481
|
var _b = useState(false), isLoading = _b[0], setIsLoading = _b[1];
|
|
13402
13482
|
var _c = useState(""), error = _c[0], setError = _c[1];
|
|
13403
|
-
var _d = useState(
|
|
13404
|
-
var _e = useState(
|
|
13405
|
-
var _f = useState(null),
|
|
13406
|
-
var _g = useState(
|
|
13483
|
+
var _d = useState(null), snackbarMessage = _d[0], setSnackbarMessage = _d[1];
|
|
13484
|
+
var _e = useState([]), tagsTreeData = _e[0], setTagsTreeData = _e[1];
|
|
13485
|
+
var _f = useState(null), tagNodeSelectedInTree = _f[0], setTagNodeSelectedInTree = _f[1];
|
|
13486
|
+
var _g = useState(null), anchorPoint = _g[0], setAnchorPoint = _g[1];
|
|
13487
|
+
var _h = useState(false), showContextMenu = _h[0], setShowContextMenu = _h[1];
|
|
13407
13488
|
var backendOffset = 1000000;
|
|
13408
|
-
var
|
|
13409
|
-
var
|
|
13489
|
+
var _j = useState({}), openTagFolders = _j[0], setOpenTagFolders = _j[1];
|
|
13490
|
+
var _k = useState([]), selectedNodes = _k[0], setSelectedNodes = _k[1];
|
|
13410
13491
|
var handleContextMenu = function (data, e) {
|
|
13411
13492
|
e.preventDefault();
|
|
13412
13493
|
var top = e.clientY;
|
|
@@ -13419,7 +13500,7 @@ var TagsTreeModalV2 = function (_a) {
|
|
|
13419
13500
|
setTagNodeSelectedInTree(selectedNode);
|
|
13420
13501
|
}
|
|
13421
13502
|
};
|
|
13422
|
-
var
|
|
13503
|
+
var _l = useSearchTagsTree$1(), tagsTree = _l.data, tagsTreeLoading = _l.isLoading, tagsTreeIsError = _l.isError, tagsTreeError = _l.error, tagsTreeIsSuccess = _l.isSuccess, tagsTreeIsFetched = _l.isFetched, refetch = _l.refetch;
|
|
13423
13504
|
var updateTagFolder = useMutation({
|
|
13424
13505
|
mutationFn: function (_a) {
|
|
13425
13506
|
var tagFolderId = _a.tagFolderId, parentTagFolderId = _a.parentTagFolderId, tagFolderName = _a.tagFolderName, isActive = _a.isActive;
|
|
@@ -13518,6 +13599,10 @@ var TagsTreeModalV2 = function (_a) {
|
|
|
13518
13599
|
});
|
|
13519
13600
|
setOpenTagFolders(newOpenTagFolders);
|
|
13520
13601
|
setSelectedNodes([result.node]);
|
|
13602
|
+
if (result.node.data && result.node.data.TagTypeCode !== "F") {
|
|
13603
|
+
onTagSelect(result.node.data);
|
|
13604
|
+
setSnackbarMessage("Tag \"".concat(result.node.data.TagName, "\" added"));
|
|
13605
|
+
}
|
|
13521
13606
|
// Scroll to the node after expansion
|
|
13522
13607
|
setTimeout(function () {
|
|
13523
13608
|
var nodeElement = document.querySelector("[data-node-id=\"".concat(result.id, "\"]"));
|
|
@@ -13605,7 +13690,8 @@ var TagsTreeModalV2 = function (_a) {
|
|
|
13605
13690
|
return (React__default.createElement(TagFolderCustomNodeV2, { setContextMenuOver: handleContextMenu, node: node, options: options, isSelected: selected, openTagFolders: openTagFolders, setOpenTagFolders: setOpenTagFolders, handleSelect: handleClick }));
|
|
13606
13691
|
}, dragPreviewRender: function (monitorProps) { return React__default.createElement(CustomDragPreview, { monitorProps: monitorProps }); } })))))),
|
|
13607
13692
|
React__default.createElement(ContextMenu, { anchorPoint: anchorPoint, isOpen: showContextMenu, setShowContextMenu: setShowContextMenu, tagNodeSelectedInTree: tagNodeSelectedInTree, getTagsTreeData: function () { return refetch(); } }),
|
|
13608
|
-
React__default.createElement(ErrorModal, { error: error, onHide: function () { return setError(""); } })
|
|
13693
|
+
React__default.createElement(ErrorModal, { error: error, onHide: function () { return setError(""); } }),
|
|
13694
|
+
React__default.createElement(NotificationSnackBar, { message: snackbarMessage, onHide: function () { return setSnackbarMessage(null); } })))));
|
|
13609
13695
|
};
|
|
13610
13696
|
|
|
13611
13697
|
var BitSelectorModal = function (_a) {
|
|
@@ -13952,20 +14038,31 @@ var TagsTableV2 = function () {
|
|
|
13952
14038
|
var viewId = _a.viewId, viewName = _a.viewName, isPublic = _a.isPublic;
|
|
13953
14039
|
return upsertView({ viewId: viewId, viewName: viewName, isPublic: isPublic });
|
|
13954
14040
|
},
|
|
13955
|
-
onSuccess: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
13956
|
-
var results, failed;
|
|
14041
|
+
onSuccess: function (viewId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
14042
|
+
var backendTags, results, failed;
|
|
13957
14043
|
var _a;
|
|
13958
14044
|
return __generator(this, function (_b) {
|
|
13959
14045
|
switch (_b.label) {
|
|
13960
|
-
case 0:
|
|
14046
|
+
case 0:
|
|
14047
|
+
// Save complete state to local storage (metadata + virtual tags)
|
|
14048
|
+
if (viewSelected === null || viewSelected === void 0 ? void 0 : viewSelected.ViewId) {
|
|
14049
|
+
saveViewToLocal(viewSelected.ViewId, viewTags);
|
|
14050
|
+
}
|
|
14051
|
+
// Wait for delete to finish before inserting new tags
|
|
14052
|
+
return [4 /*yield*/, deleteAllViewTags.mutateAsync((_a = viewSelected === null || viewSelected === void 0 ? void 0 : viewSelected.ViewId) !== null && _a !== void 0 ? _a : 0)];
|
|
13961
14053
|
case 1:
|
|
14054
|
+
// Wait for delete to finish before inserting new tags
|
|
13962
14055
|
_b.sent();
|
|
13963
|
-
|
|
14056
|
+
backendTags = Object.values(viewTags).filter(function (_a) {
|
|
14057
|
+
var viewTag = _a.viewTag;
|
|
14058
|
+
return !viewTag.IsBitExtracted;
|
|
14059
|
+
});
|
|
14060
|
+
return [4 /*yield*/, Promise.allSettled(backendTags
|
|
13964
14061
|
.sort(function (a, b) { return b.order - a.order; })
|
|
13965
14062
|
.map(function (_a) {
|
|
13966
14063
|
var _b;
|
|
13967
|
-
var viewTag = _a.viewTag;
|
|
13968
|
-
return
|
|
14064
|
+
var viewTag = _a.viewTag, order = _a.order;
|
|
14065
|
+
return updateViewTag.mutateAsync({
|
|
13969
14066
|
viewId: (_b = viewSelected === null || viewSelected === void 0 ? void 0 : viewSelected.ViewId) !== null && _b !== void 0 ? _b : 0,
|
|
13970
14067
|
tagId: viewTag.TagId,
|
|
13971
14068
|
color: viewTag.Color,
|
|
@@ -13974,6 +14071,11 @@ var TagsTableV2 = function () {
|
|
|
13974
14071
|
isVisible: viewTag.IsVisible,
|
|
13975
14072
|
isAutoScale: viewTag.IsAutoScale,
|
|
13976
14073
|
unit: viewTag.Unit,
|
|
14074
|
+
order: order,
|
|
14075
|
+
alias: viewTag.Alias,
|
|
14076
|
+
tagType: viewTag.TagType,
|
|
14077
|
+
sourceTagId: viewTag.SourceTagId,
|
|
14078
|
+
bitIndex: viewTag.BitIndex,
|
|
13977
14079
|
});
|
|
13978
14080
|
}))];
|
|
13979
14081
|
case 2:
|
|
@@ -13995,7 +14097,7 @@ var TagsTableV2 = function () {
|
|
|
13995
14097
|
});
|
|
13996
14098
|
var updateViewTag = useMutation({
|
|
13997
14099
|
mutationFn: function (_a) {
|
|
13998
|
-
var viewId = _a.viewId, tagId = _a.tagId, color = _a.color, minScale = _a.minScale, maxScale = _a.maxScale, isVisible = _a.isVisible, isAutoScale = _a.isAutoScale, unit = _a.unit;
|
|
14100
|
+
var viewId = _a.viewId, tagId = _a.tagId, color = _a.color, minScale = _a.minScale, maxScale = _a.maxScale, isVisible = _a.isVisible, isAutoScale = _a.isAutoScale, unit = _a.unit, order = _a.order, alias = _a.alias, tagType = _a.tagType, sourceTagId = _a.sourceTagId, bitIndex = _a.bitIndex;
|
|
13999
14101
|
return upsertViewTag({
|
|
14000
14102
|
viewId: viewId,
|
|
14001
14103
|
tagId: tagId,
|
|
@@ -14005,6 +14107,11 @@ var TagsTableV2 = function () {
|
|
|
14005
14107
|
isVisible: isVisible,
|
|
14006
14108
|
isAutoScale: isAutoScale,
|
|
14007
14109
|
unit: unit,
|
|
14110
|
+
order: order,
|
|
14111
|
+
alias: alias,
|
|
14112
|
+
tagType: tagType,
|
|
14113
|
+
sourceTagId: sourceTagId,
|
|
14114
|
+
bitIndex: bitIndex,
|
|
14008
14115
|
});
|
|
14009
14116
|
},
|
|
14010
14117
|
onError: function (error) {
|
|
@@ -15270,6 +15377,9 @@ var TrendingChartV2 = function (_a) {
|
|
|
15270
15377
|
if (tag.IsAutoScale) {
|
|
15271
15378
|
// Use automatic scaling based on data
|
|
15272
15379
|
baseConfig.scale = true;
|
|
15380
|
+
// Explicitly clear min/max to ensure auto-scaling works when switching from fixed scale
|
|
15381
|
+
baseConfig.min = null;
|
|
15382
|
+
baseConfig.max = null;
|
|
15273
15383
|
}
|
|
15274
15384
|
else {
|
|
15275
15385
|
// Use explicit min/max values
|
|
@@ -15971,10 +16081,11 @@ var TrendingChartV2 = function (_a) {
|
|
|
15971
16081
|
}
|
|
15972
16082
|
}, [onChartReady, dataLoadedTrigger, chartOptions]);
|
|
15973
16083
|
// Track chart area coordinates for cursor positioning
|
|
16084
|
+
var containerRef = useRef(null);
|
|
15974
16085
|
useEffect(function () {
|
|
15975
16086
|
var _a;
|
|
15976
16087
|
var instance = (_a = chartRef.current) === null || _a === void 0 ? void 0 : _a.getEchartsInstance();
|
|
15977
|
-
if (!instance)
|
|
16088
|
+
if (!instance || !containerRef.current)
|
|
15978
16089
|
return;
|
|
15979
16090
|
var updateChartArea = function () {
|
|
15980
16091
|
try {
|
|
@@ -16017,14 +16128,18 @@ var TrendingChartV2 = function (_a) {
|
|
|
16017
16128
|
// Silently handle chart area update failure
|
|
16018
16129
|
}
|
|
16019
16130
|
};
|
|
16131
|
+
// Create ResizeObserver to handle container resizing (panel resize)
|
|
16132
|
+
var resizeObserver = new ResizeObserver(function () {
|
|
16133
|
+
instance.resize();
|
|
16134
|
+
// Small delay to ensure ECharts has updated its internal state
|
|
16135
|
+
requestAnimationFrame(updateChartArea);
|
|
16136
|
+
});
|
|
16137
|
+
resizeObserver.observe(containerRef.current);
|
|
16020
16138
|
// Update immediately
|
|
16021
16139
|
updateChartArea();
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
setTimeout(updateChartArea, 100);
|
|
16140
|
+
return function () {
|
|
16141
|
+
resizeObserver.disconnect();
|
|
16025
16142
|
};
|
|
16026
|
-
window.addEventListener("resize", handleResize);
|
|
16027
|
-
return function () { return window.removeEventListener("resize", handleResize); };
|
|
16028
16143
|
}, [chartInstance, useSeparateGrids]);
|
|
16029
16144
|
// Keyboard control for cursor navigation
|
|
16030
16145
|
useEffect(function () {
|
|
@@ -16086,7 +16201,7 @@ var TrendingChartV2 = function (_a) {
|
|
|
16086
16201
|
zIndex: 10,
|
|
16087
16202
|
} },
|
|
16088
16203
|
React__default.createElement(CircularProgress, { size: "2rem" }))),
|
|
16089
|
-
React__default.createElement("div", { style: { height: "100%", width: "100%", position: "relative" } },
|
|
16204
|
+
React__default.createElement("div", { ref: containerRef, style: { height: "100%", width: "100%", position: "relative" } },
|
|
16090
16205
|
React__default.createElement(ReactECharts, { key: chartKey, ref: chartRef, option: chartOptions, style: {
|
|
16091
16206
|
height: "100%",
|
|
16092
16207
|
width: "100%",
|
|
@@ -16295,26 +16410,70 @@ var TrendingsPageV2 = function () {
|
|
|
16295
16410
|
// This preserves local order changes (from drag-and-drop) until a new view is loaded
|
|
16296
16411
|
var loadedViewIdRef = useRef(null);
|
|
16297
16412
|
useEffect(function () {
|
|
16298
|
-
if (!viewTagsSuccess ||
|
|
16413
|
+
if (!viewTagsSuccess ||
|
|
16414
|
+
!viewTagsData ||
|
|
16415
|
+
!Array.isArray(viewTagsData) ||
|
|
16416
|
+
viewId === null)
|
|
16299
16417
|
return;
|
|
16300
16418
|
// Only reset viewTags when viewId actually changes (loading a different view)
|
|
16301
16419
|
// Do NOT reset if viewId is the same (data is just refetching)
|
|
16302
16420
|
if (viewId === loadedViewIdRef.current)
|
|
16303
16421
|
return;
|
|
16304
16422
|
loadedViewIdRef.current = viewId;
|
|
16305
|
-
var
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
|
|
16309
|
-
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16423
|
+
var backendTags = viewTagsData;
|
|
16424
|
+
var localViewTags = getViewFromLocal(viewId);
|
|
16425
|
+
var mergedTags = {};
|
|
16426
|
+
if (localViewTags) {
|
|
16427
|
+
// If local storage exists, use it as the source of truth for metadata (Order, Alias)
|
|
16428
|
+
// and for virtual tags (Bit Extracted)
|
|
16429
|
+
var backendTagIds_1 = new Set(backendTags.map(function (t) { return t.TagId; }));
|
|
16430
|
+
// 1. Process local tags
|
|
16431
|
+
Object.values(localViewTags).forEach(function (entry) {
|
|
16432
|
+
var viewTag = entry.viewTag;
|
|
16433
|
+
// If it's a backend tag, check if it still exists in the backend response
|
|
16434
|
+
// (Permission check or tag deletion check)
|
|
16435
|
+
if (!viewTag.IsBitExtracted) {
|
|
16436
|
+
if (backendTagIds_1.has(viewTag.TagId)) {
|
|
16437
|
+
mergedTags[viewTag.TagId] = entry;
|
|
16438
|
+
}
|
|
16439
|
+
}
|
|
16440
|
+
else {
|
|
16441
|
+
// Virtual tags are always added from local storage
|
|
16442
|
+
mergedTags[viewTag.TagId] = entry;
|
|
16443
|
+
}
|
|
16444
|
+
});
|
|
16445
|
+
// 2. Add any new backend tags that might be missing from local storage
|
|
16446
|
+
// (Rare case, but possible if added by another user/session)
|
|
16447
|
+
backendTags.forEach(function (backendTag) {
|
|
16448
|
+
if (!mergedTags[backendTag.TagId]) {
|
|
16449
|
+
// Add with default order at the end
|
|
16450
|
+
var maxOrder = Math.max.apply(Math, __spreadArray(__spreadArray([], Object.values(mergedTags).map(function (t) { return t.order; }), false), [0], false));
|
|
16451
|
+
if (isNil(backendTag.Color)) {
|
|
16452
|
+
backendTag.Color = getRandomColor();
|
|
16453
|
+
}
|
|
16454
|
+
mergedTags[backendTag.TagId] = {
|
|
16455
|
+
viewTag: backendTag,
|
|
16456
|
+
order: maxOrder + 1,
|
|
16457
|
+
};
|
|
16458
|
+
}
|
|
16459
|
+
});
|
|
16460
|
+
}
|
|
16461
|
+
else {
|
|
16462
|
+
// No local storage -> Use backend tags with default ordering
|
|
16463
|
+
mergedTags = backendTags.reduce(function (carr, curr, idx) {
|
|
16464
|
+
if (isNil(curr.Color)) {
|
|
16465
|
+
curr.Color = getRandomColor();
|
|
16466
|
+
}
|
|
16467
|
+
carr[curr.TagId] = {
|
|
16468
|
+
viewTag: curr,
|
|
16469
|
+
order: idx,
|
|
16470
|
+
};
|
|
16471
|
+
return carr;
|
|
16472
|
+
}, {});
|
|
16473
|
+
}
|
|
16315
16474
|
// Reset stable ref when loading new view
|
|
16316
16475
|
stableTagIdsRef.current = [];
|
|
16317
|
-
setViewTagsAndRefetch(
|
|
16476
|
+
setViewTagsAndRefetch(mergedTags);
|
|
16318
16477
|
}, [viewTagsSuccess, viewTagsData, setViewTagsAndRefetch, viewId]);
|
|
16319
16478
|
// Update context with calculated min/max values
|
|
16320
16479
|
// Use ref to prevent infinite loop from object reference changes
|
|
@@ -16375,12 +16534,14 @@ var TrendingsPageV2 = function () {
|
|
|
16375
16534
|
var isLoading = viewsLoading || viewTagsLoading;
|
|
16376
16535
|
return (React__default.createElement(React__default.Fragment, null,
|
|
16377
16536
|
React__default.createElement(HelmetDexteel, { title: "Trendings" }),
|
|
16378
|
-
React__default.createElement(
|
|
16379
|
-
|
|
16537
|
+
React__default.createElement("div", { style: {
|
|
16538
|
+
padding: "16px",
|
|
16380
16539
|
width: "100%",
|
|
16381
16540
|
height: "92vh",
|
|
16382
16541
|
position: "relative",
|
|
16383
16542
|
backgroundColor: "#FAFAFA",
|
|
16543
|
+
display: "flex",
|
|
16544
|
+
flexDirection: "column",
|
|
16384
16545
|
} },
|
|
16385
16546
|
isLoading && (React__default.createElement("div", { style: {
|
|
16386
16547
|
position: "absolute",
|
|
@@ -16395,14 +16556,38 @@ var TrendingsPageV2 = function () {
|
|
|
16395
16556
|
zIndex: 1000,
|
|
16396
16557
|
} },
|
|
16397
16558
|
React__default.createElement(CircularProgress, { size: "3rem" }))),
|
|
16398
|
-
React__default.createElement(
|
|
16559
|
+
React__default.createElement("div", { style: { flexShrink: 0 } },
|
|
16399
16560
|
React__default.createElement(HeaderSectionV2, { autoRefresh: autoRefresh, setAutoRefresh: setAutoRefresh, setChartOptions: setChartOptions, chartInstance: chartInstance })),
|
|
16400
|
-
React__default.createElement(
|
|
16401
|
-
|
|
16402
|
-
|
|
16403
|
-
|
|
16404
|
-
|
|
16405
|
-
|
|
16561
|
+
React__default.createElement(Divider, { sx: { my: 2 } }),
|
|
16562
|
+
React__default.createElement("div", { style: {
|
|
16563
|
+
flexGrow: 1,
|
|
16564
|
+
minHeight: 0,
|
|
16565
|
+
display: "flex",
|
|
16566
|
+
width: "100%",
|
|
16567
|
+
} },
|
|
16568
|
+
React__default.createElement(Group$1, { orientation: "vertical", style: { width: "100%", height: "100%" } },
|
|
16569
|
+
React__default.createElement(Panel, { defaultSize: 80, minSize: 20 },
|
|
16570
|
+
React__default.createElement("div", { style: { height: "100%", width: "100%" } },
|
|
16571
|
+
React__default.createElement(TrendingChartV2, { customOptions: chartOptions, series: filteredSeries, isLoading: seriesLoading, onChartReady: setChartInstance, dataLoadedTrigger: dataLoadedTrigger }))),
|
|
16572
|
+
React__default.createElement(Separator, { style: {
|
|
16573
|
+
height: "10px",
|
|
16574
|
+
background: "#f0f0f0",
|
|
16575
|
+
cursor: "row-resize",
|
|
16576
|
+
display: "flex",
|
|
16577
|
+
alignItems: "center",
|
|
16578
|
+
justifyContent: "center",
|
|
16579
|
+
borderTop: "1px solid #e0e0e0",
|
|
16580
|
+
borderBottom: "1px solid #e0e0e0",
|
|
16581
|
+
} },
|
|
16582
|
+
React__default.createElement("div", { style: {
|
|
16583
|
+
width: "40px",
|
|
16584
|
+
height: "4px",
|
|
16585
|
+
backgroundColor: "#ccc",
|
|
16586
|
+
borderRadius: "2px",
|
|
16587
|
+
} })),
|
|
16588
|
+
React__default.createElement(Panel, { defaultSize: 20, minSize: 10 },
|
|
16589
|
+
React__default.createElement("div", { style: { height: "100%", width: "100%", overflow: "auto" } },
|
|
16590
|
+
React__default.createElement(TagsTableV2, null)))))),
|
|
16406
16591
|
React__default.createElement(ErrorModal, { error: error, onHide: function () { return setError(""); }, size: "xl", title: "ERROR" })));
|
|
16407
16592
|
};
|
|
16408
16593
|
|
|
@@ -19940,22 +20125,6 @@ var ShiftSelector = function (_a) {
|
|
|
19940
20125
|
React__default.createElement(ErrorModal, { error: error, onHide: function () { return setError(""); }, title: "Error loading shifts" })));
|
|
19941
20126
|
};
|
|
19942
20127
|
|
|
19943
|
-
var NotificationSnackBar = function (_a) {
|
|
19944
|
-
var message = _a.message, _b = _a.onHide, onHide = _b === void 0 ? function () { } : _b, _c = _a.severity, severity = _c === void 0 ? "success" : _c;
|
|
19945
|
-
var handleClose = function (event, reason) {
|
|
19946
|
-
if (reason === "clickaway") {
|
|
19947
|
-
return;
|
|
19948
|
-
}
|
|
19949
|
-
onHide();
|
|
19950
|
-
};
|
|
19951
|
-
var _d = useState(true), open = _d[0], setOpen = _d[1];
|
|
19952
|
-
useEffect(function () {
|
|
19953
|
-
setOpen(!!message);
|
|
19954
|
-
}, [message]);
|
|
19955
|
-
return (React__default.createElement(Snackbar, { open: open, autoHideDuration: 2500, onClose: handleClose, anchorOrigin: { vertical: "bottom", horizontal: "center" } },
|
|
19956
|
-
React__default.createElement(Alert$3, { elevation: 6, variant: "filled", severity: severity, onClose: handleClose }, message)));
|
|
19957
|
-
};
|
|
19958
|
-
|
|
19959
20128
|
var useEntrySubmission = function (_a) {
|
|
19960
20129
|
var _b = _a === void 0 ? {} : _a, onSuccess = _b.onSuccess, onError = _b.onError, _c = _b.isNewEntry, isNewEntry = _c === void 0 ? false : _c, _d = _b.onHide, onHide = _d === void 0 ? function () { } : _d;
|
|
19961
20130
|
var _e = useState(false), isSubmitLoading = _e[0], setIsSubmitLoading = _e[1];
|