@dexteel/mesf-core 7.22.1 → 7.22.3
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [7.22.3](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v7.22.2...@dexteel/mesf-core-v7.22.3) (2026-05-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **Header:** Add functionality to hide the area selector based on permissions. ([b15c823](https://github.com/dexteel/mesf-core-frontend/commit/b15c82331c2063f0e5d524ae95dfcd90e1978641))
|
|
9
|
+
|
|
10
|
+
## [7.22.2](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v7.22.1...@dexteel/mesf-core-v7.22.2) (2026-05-13)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **realtime:** share SignalR connection across subscribers ([023f7cf](https://github.com/dexteel/mesf-core-frontend/commit/023f7cf2805d1d9d1419c000a13480fd14d607f0))
|
|
16
|
+
|
|
3
17
|
## [7.22.1](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v7.22.0...@dexteel/mesf-core-v7.22.1) (2026-05-11)
|
|
4
18
|
|
|
5
19
|
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HubConnectionBuilder, LogLevel } from '@microsoft/signalr';
|
|
1
|
+
import { HubConnectionState, HubConnectionBuilder, LogLevel } from '@microsoft/signalr';
|
|
2
2
|
export * from '@microsoft/signalr';
|
|
3
3
|
export { LicenseManager } from 'ag-grid-enterprise';
|
|
4
4
|
import { styled, DialogTitle as DialogTitle$1, DialogContent as DialogContent$1, DialogActions as DialogActions$1, Grid2, Button, Box, MenuItem, ListItemIcon, createTheme, TextField, Alert as Alert$2, useTheme, InputAdornment, Popover, MenuList, ListItemText, alpha, Dialog as Dialog$1, Paper, List, ListItem, Chip, SvgIcon, Typography as Typography$1, Checkbox, IconButton as IconButton$1, CircularProgress, FormControl, FormHelperText, FormControlLabel, Snackbar, DialogContentText, Badge, InputLabel, Select, Input, Divider, Card, CardContent, CardActions, Collapse, Tooltip, CssBaseline, AppBar, Toolbar, Container, Menu, Switch, Autocomplete as Autocomplete$1, useMediaQuery, Drawer, Grid, Accordion, AccordionSummary, AccordionDetails, Tabs, Tab, ListSubheader, ListItemButton, StyledEngineProvider, ThemeProvider, ListItemSecondaryAction } from '@mui/material';
|
|
@@ -4341,34 +4341,63 @@ const DeleteUser = ({ userId, show, onHide, suffixTitle }) => {
|
|
|
4341
4341
|
React__default.createElement(ErrorModal, { error: profileError, onHide: () => setprofileError(""), title: "Error Choosing Profile" })));
|
|
4342
4342
|
};
|
|
4343
4343
|
|
|
4344
|
+
const receiveMessageHandlers = new Set();
|
|
4345
|
+
let connection = null;
|
|
4346
|
+
let startPromise = null;
|
|
4347
|
+
const getConnection = () => {
|
|
4348
|
+
if (connection)
|
|
4349
|
+
return connection;
|
|
4350
|
+
connection = new HubConnectionBuilder()
|
|
4351
|
+
.withUrl("/ws")
|
|
4352
|
+
.withAutomaticReconnect()
|
|
4353
|
+
.configureLogging(LogLevel.Information)
|
|
4354
|
+
.build();
|
|
4355
|
+
connection.on("ReceiveMessage", (author, message) => {
|
|
4356
|
+
receiveMessageHandlers.forEach((handler) => {
|
|
4357
|
+
handler(author, message);
|
|
4358
|
+
});
|
|
4359
|
+
});
|
|
4360
|
+
connection.onclose((error) => {
|
|
4361
|
+
if (error)
|
|
4362
|
+
console.log("SignalR connection closed", error);
|
|
4363
|
+
});
|
|
4364
|
+
return connection;
|
|
4365
|
+
};
|
|
4366
|
+
const startConnection = () => {
|
|
4367
|
+
const currentConnection = getConnection();
|
|
4368
|
+
if (currentConnection.state !== HubConnectionState.Disconnected) {
|
|
4369
|
+
return Promise.resolve();
|
|
4370
|
+
}
|
|
4371
|
+
if (startPromise)
|
|
4372
|
+
return startPromise;
|
|
4373
|
+
startPromise = currentConnection
|
|
4374
|
+
.start()
|
|
4375
|
+
.then(() => {
|
|
4376
|
+
console.log("SignalR connection started");
|
|
4377
|
+
})
|
|
4378
|
+
.catch((err) => {
|
|
4379
|
+
console.log("Error while starting SignalR connection: " + err);
|
|
4380
|
+
})
|
|
4381
|
+
.finally(() => {
|
|
4382
|
+
startPromise = null;
|
|
4383
|
+
});
|
|
4384
|
+
return startPromise;
|
|
4385
|
+
};
|
|
4386
|
+
const subscribeMesfRealtime = (handler) => {
|
|
4387
|
+
receiveMessageHandlers.add(handler);
|
|
4388
|
+
void startConnection();
|
|
4389
|
+
return () => {
|
|
4390
|
+
receiveMessageHandlers.delete(handler);
|
|
4391
|
+
};
|
|
4392
|
+
};
|
|
4393
|
+
|
|
4344
4394
|
const useMesfRealtime = ({ onReceiveMessage }) => {
|
|
4395
|
+
const onReceiveMessageRef = useRef(onReceiveMessage);
|
|
4396
|
+
onReceiveMessageRef.current = onReceiveMessage;
|
|
4345
4397
|
useEffect(() => {
|
|
4346
|
-
|
|
4347
|
-
.
|
|
4348
|
-
.withAutomaticReconnect()
|
|
4349
|
-
.configureLogging(LogLevel.Information)
|
|
4350
|
-
.build();
|
|
4351
|
-
connection
|
|
4352
|
-
.start()
|
|
4353
|
-
.then(() => {
|
|
4354
|
-
console.log("Connection started");
|
|
4355
|
-
})
|
|
4356
|
-
.catch((err) => {
|
|
4357
|
-
console.log("Error while starting connection: " + err);
|
|
4358
|
-
});
|
|
4359
|
-
connection.on("ReceiveMessage", (author, message) => {
|
|
4360
|
-
onReceiveMessage(author, message);
|
|
4398
|
+
return subscribeMesfRealtime((author, message) => {
|
|
4399
|
+
onReceiveMessageRef.current(author, message);
|
|
4361
4400
|
});
|
|
4362
|
-
return () => {
|
|
4363
|
-
connection
|
|
4364
|
-
.stop()
|
|
4365
|
-
.then(() => {
|
|
4366
|
-
console.log("Connection stopped");
|
|
4367
|
-
})
|
|
4368
|
-
.catch((err) => {
|
|
4369
|
-
console.log("Error while stopping connection: " + err);
|
|
4370
|
-
});
|
|
4371
|
-
};
|
|
4372
4401
|
}, []);
|
|
4373
4402
|
};
|
|
4374
4403
|
|
|
@@ -10156,6 +10185,7 @@ function Header({ showAreaSelector = false, showTrendingsV2Icon = true, navbarTi
|
|
|
10156
10185
|
};
|
|
10157
10186
|
}, []);
|
|
10158
10187
|
const canShowSettings = hasPermissionTo("ui.navbar.settings");
|
|
10188
|
+
const canShowAreaSelector = hasPermissionTo("SEC.UpsertDefaultAssetId");
|
|
10159
10189
|
const isCompactNavigation = isMobileBreakpoint || isOverflowing;
|
|
10160
10190
|
return (React__default.createElement(React__default.Fragment, null,
|
|
10161
10191
|
React__default.createElement(AppBar, { position: "static", sx: {
|
|
@@ -10209,7 +10239,7 @@ function Header({ showAreaSelector = false, showTrendingsV2Icon = true, navbarTi
|
|
|
10209
10239
|
canShowSettings && (React__default.createElement(Tooltip, { title: "Settings", placement: "bottom" },
|
|
10210
10240
|
React__default.createElement(IconButton$1, { color: "inherit", component: Link, to: "/configuration" },
|
|
10211
10241
|
React__default.createElement(Settings$1, null)))),
|
|
10212
|
-
showAreaSelector && (React__default.createElement(Suspense, { fallback: React__default.createElement("div", null, "...") },
|
|
10242
|
+
showAreaSelector && canShowAreaSelector && (React__default.createElement(Suspense, { fallback: React__default.createElement("div", null, "...") },
|
|
10213
10243
|
React__default.createElement(AreaSelector$1, null))),
|
|
10214
10244
|
React__default.createElement(TimeAndUserMenu, null)))),
|
|
10215
10245
|
React__default.createElement(Drawer, { variant: "temporary", anchor: "left", open: drawerOpen, onClose: handleDrawerToggle, sx: {
|
|
@@ -10265,6 +10295,7 @@ const ChatComponent = () => {
|
|
|
10265
10295
|
const [user, setUser] = useState("");
|
|
10266
10296
|
const [message, setMessage] = useState("");
|
|
10267
10297
|
const messageEndRef = useRef(null);
|
|
10298
|
+
const connectionRef = useRef(null);
|
|
10268
10299
|
const latestMessages = useRef([]);
|
|
10269
10300
|
latestMessages.current = messages;
|
|
10270
10301
|
const scrollToBottom = () => {
|
|
@@ -10281,6 +10312,7 @@ const ChatComponent = () => {
|
|
|
10281
10312
|
.withAutomaticReconnect()
|
|
10282
10313
|
.configureLogging(LogLevel.Information)
|
|
10283
10314
|
.build();
|
|
10315
|
+
connectionRef.current = newConnection;
|
|
10284
10316
|
newConnection.on("ReceiveMessage", (user, message) => {
|
|
10285
10317
|
const newMessage = {
|
|
10286
10318
|
user,
|
|
@@ -10311,7 +10343,9 @@ const ChatComponent = () => {
|
|
|
10311
10343
|
useEffect(() => {
|
|
10312
10344
|
startConnection();
|
|
10313
10345
|
return () => {
|
|
10314
|
-
|
|
10346
|
+
var _a;
|
|
10347
|
+
void ((_a = connectionRef.current) === null || _a === void 0 ? void 0 : _a.stop());
|
|
10348
|
+
connectionRef.current = null;
|
|
10315
10349
|
};
|
|
10316
10350
|
}, [startConnection]);
|
|
10317
10351
|
const sendMessage = (e) => __awaiter(void 0, void 0, void 0, function* () {
|