@gravity-ui/dashkit 6.5.1-beta.1 → 6.6.0-beta.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/README.md +15 -0
- package/build/cjs/components/GridLayout/GridLayout.d.ts +4 -0
- package/build/cjs/components/GridLayout/GridLayout.js +37 -13
- package/build/cjs/components/OverlayControls/OverlayControls.d.ts +0 -1
- package/build/cjs/components/OverlayControls/OverlayControls.js +2 -6
- package/build/cjs/constants/common.d.ts +1 -0
- package/build/cjs/constants/common.js +2 -1
- package/build/cjs/hocs/withContext.js +2 -1
- package/build/cjs/typings/common.d.ts +3 -1
- package/build/esm/components/GridLayout/GridLayout.d.ts +4 -0
- package/build/esm/components/GridLayout/GridLayout.js +37 -13
- package/build/esm/components/OverlayControls/OverlayControls.d.ts +0 -1
- package/build/esm/components/OverlayControls/OverlayControls.js +3 -7
- package/build/esm/constants/common.d.ts +1 -0
- package/build/esm/constants/common.js +1 -0
- package/build/esm/hocs/withContext.js +2 -1
- package/build/esm/typings/common.d.ts +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -120,6 +120,21 @@ Before using `DashKit` as a react component, it must be configured.
|
|
|
120
120
|
});
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
+
## Settings
|
|
124
|
+
|
|
125
|
+
### Autoupdate
|
|
126
|
+
|
|
127
|
+
This functionality allows you to automatically update the items of the Dash. All items that should participate in the auto-update cycle must have the `reload` method.
|
|
128
|
+
There are two auto-update scenarios available, the first - the classic interval to enable which is enough to pass the `autoupdateInterval` parameter and the second - the so-called `realtimeMode`.
|
|
129
|
+
`realtimeMode` is useful in cases where dash items are updated at different rates and you cannot guarantee data consistency at a given time. `realtimeMode` is based on `Promise.allSettled`.
|
|
130
|
+
|
|
131
|
+
| Name | Description | Type | Default |
|
|
132
|
+
|:--------------------|:---------------------------------------------------------------------------------------|:---------:|:-------:|
|
|
133
|
+
| autoupdateInterval | The time, in **seconds**, the dash should delay in between executions auto-update | `number` | |
|
|
134
|
+
| realtimeMode | Enable realtime mode | `boolean` | |
|
|
135
|
+
| realtimeModeDelayMs | The time, in **milliseconds**, the dash should delay after all items have been updated | `number` | 5000 |
|
|
136
|
+
| silentLoading | Items update status indicator. It will be passed into the Item `reload` method | `boolean` | false |
|
|
137
|
+
|
|
123
138
|
### Config
|
|
124
139
|
|
|
125
140
|
```ts
|
|
@@ -18,6 +18,10 @@ export default class GridLayout extends React.PureComponent<any, any, any> {
|
|
|
18
18
|
adjustedWidgetLayout: any;
|
|
19
19
|
}) => void;
|
|
20
20
|
getItemsMeta: () => any;
|
|
21
|
+
getAutoupdateIntervalMs(): number;
|
|
22
|
+
startReloadItems(): any;
|
|
23
|
+
startReloadItemsTimeout(timeoutMs: any): void;
|
|
24
|
+
forceReloadItems(): void;
|
|
21
25
|
reloadItems(): void;
|
|
22
26
|
_onStart: () => void;
|
|
23
27
|
_onStop: (newLayout: any) => void;
|
|
@@ -5,6 +5,7 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
5
5
|
const react_grid_layout_1 = tslib_1.__importStar(require("react-grid-layout"));
|
|
6
6
|
const GridItem_1 = tslib_1.__importDefault(require("../GridItem/GridItem"));
|
|
7
7
|
const DashKitContext_1 = require("../../context/DashKitContext");
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
8
9
|
const Layout = (0, react_grid_layout_1.WidthProvider)(react_grid_layout_1.default); // eslint-disable-line new-cap
|
|
9
10
|
class GridLayout extends react_1.default.PureComponent {
|
|
10
11
|
constructor(props, context) {
|
|
@@ -49,25 +50,48 @@ class GridLayout extends react_1.default.PureComponent {
|
|
|
49
50
|
document.addEventListener('visibilitychange', this.onVisibilityChange);
|
|
50
51
|
}
|
|
51
52
|
componentDidUpdate() {
|
|
52
|
-
|
|
53
|
-
this.reloadItems();
|
|
53
|
+
this.forceReloadItems();
|
|
54
54
|
}
|
|
55
55
|
componentWillUnmount() {
|
|
56
56
|
clearTimeout(this._timeout);
|
|
57
57
|
document.removeEventListener('visibilitychange', this.onVisibilityChange);
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
const {
|
|
61
|
-
const { isPageHidden } = this.state;
|
|
59
|
+
getAutoupdateIntervalMs() {
|
|
60
|
+
const { settings: { autoupdateInterval } = {} } = this.context;
|
|
62
61
|
const autoupdateIntervalMs = Number(autoupdateInterval) * 1000;
|
|
62
|
+
return autoupdateIntervalMs;
|
|
63
|
+
}
|
|
64
|
+
startReloadItems() {
|
|
65
|
+
const { editMode, settings: { silentLoading } = {}, reloadItems } = this.context;
|
|
66
|
+
const { isPageHidden } = this.state;
|
|
67
|
+
if (!isPageHidden && !editMode) {
|
|
68
|
+
this._lastReloadAt = new Date().getTime();
|
|
69
|
+
return reloadItems(this.pluginsRefs, { silentLoading, noVeil: true });
|
|
70
|
+
}
|
|
71
|
+
return Promise.resolve();
|
|
72
|
+
}
|
|
73
|
+
startReloadItemsTimeout(timeoutMs) {
|
|
74
|
+
this._timeout = setTimeout(() => this.forceReloadItems(), timeoutMs);
|
|
75
|
+
}
|
|
76
|
+
forceReloadItems() {
|
|
77
|
+
clearTimeout(this._timeout);
|
|
78
|
+
this._timeout = undefined;
|
|
79
|
+
this.reloadItems();
|
|
80
|
+
}
|
|
81
|
+
reloadItems() {
|
|
82
|
+
if (this._timeout)
|
|
83
|
+
return;
|
|
84
|
+
const { settings: { realtimeMode, realtimeModeDelayMs = 5000 } = {} } = this.context;
|
|
85
|
+
if (realtimeMode) {
|
|
86
|
+
this.startReloadItems().then(() => {
|
|
87
|
+
this.startReloadItemsTimeout(realtimeModeDelayMs);
|
|
88
|
+
});
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const autoupdateIntervalMs = this.getAutoupdateIntervalMs();
|
|
63
92
|
if (autoupdateIntervalMs) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (!isPageHidden && !editMode && reloadIntervalRemains <= 0) {
|
|
67
|
-
this._lastReloadAt = new Date().getTime();
|
|
68
|
-
reloadItems(this.pluginsRefs, { silentLoading, noVeil: true });
|
|
69
|
-
}
|
|
70
|
-
this._timeout = setTimeout(() => this.reloadItems(), reloadIntervalRemains <= 0 ? autoupdateIntervalMs : reloadIntervalRemains);
|
|
93
|
+
this.startReloadItems();
|
|
94
|
+
this.startReloadItemsTimeout(autoupdateIntervalMs);
|
|
71
95
|
}
|
|
72
96
|
}
|
|
73
97
|
render() {
|
|
@@ -75,7 +99,7 @@ class GridLayout extends react_1.default.PureComponent {
|
|
|
75
99
|
this.pluginsRefs.length = config.items.length;
|
|
76
100
|
return (react_1.default.createElement(Layout, Object.assign({}, registerManager.gridLayout, { layout: layout, isDraggable: editMode, isResizable: editMode, onDragStart: this._onStart, onDragStop: this._onStop, onResizeStart: this._onStart, onResizeStop: this._onStop }, (draggableHandleClassName
|
|
77
101
|
? { draggableHandle: `.${draggableHandleClassName}` }
|
|
78
|
-
: null)), config.items.map((item, i) => {
|
|
102
|
+
: null), { draggableCancel: `.${constants_1.OVERLAY_CONTROLS_CLASS_NAME}` }), config.items.map((item, i) => {
|
|
79
103
|
return (react_1.default.createElement(GridItem_1.default, { forwardedPluginRef: (pluginRef) => {
|
|
80
104
|
this.pluginsRefs[i] = pluginRef;
|
|
81
105
|
}, key: item.id, id: item.id, item: item, layout: layout, adjustWidgetLayout: this.adjustWidgetLayout, isDragging: this.state.isDragging, noOverlay: noOverlay, withCustomHandle: Boolean(draggableHandleClassName), overlayControls: this.props.overlayControls }));
|
|
@@ -39,7 +39,6 @@ interface OverlayControlsProps extends OverlayControlsDefaultProps {
|
|
|
39
39
|
overlayControls?: Record<string, OverlayControlItem[]>;
|
|
40
40
|
}
|
|
41
41
|
type DashKitCtx = React.Context<{
|
|
42
|
-
context: Record<string, any>;
|
|
43
42
|
registerManager: RegisterManager;
|
|
44
43
|
itemsParams: Record<string, StringParams>;
|
|
45
44
|
itemsState: Record<string, ItemState>;
|
|
@@ -12,7 +12,7 @@ const DotsIcon_1 = require("../../icons/DotsIcon");
|
|
|
12
12
|
const CogIcon_1 = require("../../icons/CogIcon");
|
|
13
13
|
const CloseIcon_1 = require("../../icons/CloseIcon");
|
|
14
14
|
const cn_1 = require("../../utils/cn");
|
|
15
|
-
const b = (0, cn_1.cn)(
|
|
15
|
+
const b = (0, cn_1.cn)(constants_1.OVERLAY_CONTROLS_CLASS_NAME);
|
|
16
16
|
var OverlayControlsPosition;
|
|
17
17
|
(function (OverlayControlsPosition) {
|
|
18
18
|
OverlayControlsPosition["TopRight"] = "top_right";
|
|
@@ -56,11 +56,10 @@ class OverlayControls extends react_1.default.Component {
|
|
|
56
56
|
return controls;
|
|
57
57
|
};
|
|
58
58
|
this.onCopyItem = () => {
|
|
59
|
-
var _a;
|
|
60
59
|
const correspondedItemLayout = this.context.config.layout.find((item) => {
|
|
61
60
|
return item.i === this.props.configItem.id;
|
|
62
61
|
});
|
|
63
|
-
|
|
62
|
+
const options = {
|
|
64
63
|
timestamp: Date.now(),
|
|
65
64
|
data: this.props.configItem.data,
|
|
66
65
|
type: this.props.configItem.type,
|
|
@@ -71,9 +70,6 @@ class OverlayControls extends react_1.default.Component {
|
|
|
71
70
|
h: correspondedItemLayout.h,
|
|
72
71
|
},
|
|
73
72
|
};
|
|
74
|
-
if (typeof ((_a = this.context.context) === null || _a === void 0 ? void 0 : _a.getPreparedCopyItemOptions) === 'function') {
|
|
75
|
-
options = this.context.context.getPreparedCopyItemOptions(options);
|
|
76
|
-
}
|
|
77
73
|
localStorage.setItem(constants_1.COPIED_WIDGET_STORE_KEY, JSON.stringify(options));
|
|
78
74
|
// https://stackoverflow.com/questions/35865481/storage-event-not-firing
|
|
79
75
|
window.dispatchEvent(new Event('storage'));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const COPIED_WIDGET_STORE_KEY = "dashCopiedItem";
|
|
2
2
|
export declare const DEFAULT_NAMESPACE = "default";
|
|
3
|
+
export declare const OVERLAY_CONTROLS_CLASS_NAME = "dashkit-overlay-controls";
|
|
3
4
|
export declare const MenuItems: {
|
|
4
5
|
readonly Copy: "copy";
|
|
5
6
|
readonly Delete: "delete";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MenuItems = exports.DEFAULT_NAMESPACE = exports.COPIED_WIDGET_STORE_KEY = void 0;
|
|
3
|
+
exports.MenuItems = exports.OVERLAY_CONTROLS_CLASS_NAME = exports.DEFAULT_NAMESPACE = exports.COPIED_WIDGET_STORE_KEY = void 0;
|
|
4
4
|
exports.COPIED_WIDGET_STORE_KEY = 'dashCopiedItem';
|
|
5
5
|
exports.DEFAULT_NAMESPACE = 'default';
|
|
6
|
+
exports.OVERLAY_CONTROLS_CLASS_NAME = 'dashkit-overlay-controls';
|
|
6
7
|
exports.MenuItems = {
|
|
7
8
|
Copy: 'copy',
|
|
8
9
|
Delete: 'delete',
|
|
@@ -121,7 +121,8 @@ function useMemoStateContext(props) {
|
|
|
121
121
|
});
|
|
122
122
|
}, [props.layout, layoutUpdateCounter]);
|
|
123
123
|
const reloadItems = react_1.default.useCallback((pluginsRefs, data) => {
|
|
124
|
-
pluginsRefs.
|
|
124
|
+
const promises = pluginsRefs.map((ref) => ref && ref.reload && ref.reload(data));
|
|
125
|
+
return Promise.allSettled(promises);
|
|
125
126
|
}, []);
|
|
126
127
|
return react_1.default.useMemo(() => ({
|
|
127
128
|
layout: resultLayout,
|
|
@@ -9,8 +9,10 @@ export interface Settings {
|
|
|
9
9
|
}
|
|
10
10
|
export type MenuItem = (typeof MenuItems)[keyof typeof MenuItems] | OverlayCustomControlItem;
|
|
11
11
|
export interface SettingsProps {
|
|
12
|
-
autoupdateInterval
|
|
12
|
+
autoupdateInterval?: number;
|
|
13
13
|
silentLoading: boolean;
|
|
14
|
+
realtimeMode?: boolean;
|
|
15
|
+
realtimeModeDelayMs?: number;
|
|
14
16
|
}
|
|
15
17
|
export interface ContextProps {
|
|
16
18
|
[key: string]: any;
|
|
@@ -18,6 +18,10 @@ export default class GridLayout extends React.PureComponent<any, any, any> {
|
|
|
18
18
|
adjustedWidgetLayout: any;
|
|
19
19
|
}) => void;
|
|
20
20
|
getItemsMeta: () => any;
|
|
21
|
+
getAutoupdateIntervalMs(): number;
|
|
22
|
+
startReloadItems(): any;
|
|
23
|
+
startReloadItemsTimeout(timeoutMs: any): void;
|
|
24
|
+
forceReloadItems(): void;
|
|
21
25
|
reloadItems(): void;
|
|
22
26
|
_onStart: () => void;
|
|
23
27
|
_onStop: (newLayout: any) => void;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import ReactGridLayout, { WidthProvider } from 'react-grid-layout';
|
|
3
3
|
import GridItem from '../GridItem/GridItem';
|
|
4
4
|
import { DashKitContext } from '../../context/DashKitContext';
|
|
5
|
+
import { OVERLAY_CONTROLS_CLASS_NAME } from '../../constants';
|
|
5
6
|
const Layout = WidthProvider(ReactGridLayout); // eslint-disable-line new-cap
|
|
6
7
|
export default class GridLayout extends React.PureComponent {
|
|
7
8
|
constructor(props, context) {
|
|
@@ -46,25 +47,48 @@ export default class GridLayout extends React.PureComponent {
|
|
|
46
47
|
document.addEventListener('visibilitychange', this.onVisibilityChange);
|
|
47
48
|
}
|
|
48
49
|
componentDidUpdate() {
|
|
49
|
-
|
|
50
|
-
this.reloadItems();
|
|
50
|
+
this.forceReloadItems();
|
|
51
51
|
}
|
|
52
52
|
componentWillUnmount() {
|
|
53
53
|
clearTimeout(this._timeout);
|
|
54
54
|
document.removeEventListener('visibilitychange', this.onVisibilityChange);
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
const {
|
|
58
|
-
const { isPageHidden } = this.state;
|
|
56
|
+
getAutoupdateIntervalMs() {
|
|
57
|
+
const { settings: { autoupdateInterval } = {} } = this.context;
|
|
59
58
|
const autoupdateIntervalMs = Number(autoupdateInterval) * 1000;
|
|
59
|
+
return autoupdateIntervalMs;
|
|
60
|
+
}
|
|
61
|
+
startReloadItems() {
|
|
62
|
+
const { editMode, settings: { silentLoading } = {}, reloadItems } = this.context;
|
|
63
|
+
const { isPageHidden } = this.state;
|
|
64
|
+
if (!isPageHidden && !editMode) {
|
|
65
|
+
this._lastReloadAt = new Date().getTime();
|
|
66
|
+
return reloadItems(this.pluginsRefs, { silentLoading, noVeil: true });
|
|
67
|
+
}
|
|
68
|
+
return Promise.resolve();
|
|
69
|
+
}
|
|
70
|
+
startReloadItemsTimeout(timeoutMs) {
|
|
71
|
+
this._timeout = setTimeout(() => this.forceReloadItems(), timeoutMs);
|
|
72
|
+
}
|
|
73
|
+
forceReloadItems() {
|
|
74
|
+
clearTimeout(this._timeout);
|
|
75
|
+
this._timeout = undefined;
|
|
76
|
+
this.reloadItems();
|
|
77
|
+
}
|
|
78
|
+
reloadItems() {
|
|
79
|
+
if (this._timeout)
|
|
80
|
+
return;
|
|
81
|
+
const { settings: { realtimeMode, realtimeModeDelayMs = 5000 } = {} } = this.context;
|
|
82
|
+
if (realtimeMode) {
|
|
83
|
+
this.startReloadItems().then(() => {
|
|
84
|
+
this.startReloadItemsTimeout(realtimeModeDelayMs);
|
|
85
|
+
});
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const autoupdateIntervalMs = this.getAutoupdateIntervalMs();
|
|
60
89
|
if (autoupdateIntervalMs) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (!isPageHidden && !editMode && reloadIntervalRemains <= 0) {
|
|
64
|
-
this._lastReloadAt = new Date().getTime();
|
|
65
|
-
reloadItems(this.pluginsRefs, { silentLoading, noVeil: true });
|
|
66
|
-
}
|
|
67
|
-
this._timeout = setTimeout(() => this.reloadItems(), reloadIntervalRemains <= 0 ? autoupdateIntervalMs : reloadIntervalRemains);
|
|
90
|
+
this.startReloadItems();
|
|
91
|
+
this.startReloadItemsTimeout(autoupdateIntervalMs);
|
|
68
92
|
}
|
|
69
93
|
}
|
|
70
94
|
render() {
|
|
@@ -72,7 +96,7 @@ export default class GridLayout extends React.PureComponent {
|
|
|
72
96
|
this.pluginsRefs.length = config.items.length;
|
|
73
97
|
return (React.createElement(Layout, Object.assign({}, registerManager.gridLayout, { layout: layout, isDraggable: editMode, isResizable: editMode, onDragStart: this._onStart, onDragStop: this._onStop, onResizeStart: this._onStart, onResizeStop: this._onStop }, (draggableHandleClassName
|
|
74
98
|
? { draggableHandle: `.${draggableHandleClassName}` }
|
|
75
|
-
: null)), config.items.map((item, i) => {
|
|
99
|
+
: null), { draggableCancel: `.${OVERLAY_CONTROLS_CLASS_NAME}` }), config.items.map((item, i) => {
|
|
76
100
|
return (React.createElement(GridItem, { forwardedPluginRef: (pluginRef) => {
|
|
77
101
|
this.pluginsRefs[i] = pluginRef;
|
|
78
102
|
}, key: item.id, id: item.id, item: item, layout: layout, adjustWidgetLayout: this.adjustWidgetLayout, isDragging: this.state.isDragging, noOverlay: noOverlay, withCustomHandle: Boolean(draggableHandleClassName), overlayControls: this.props.overlayControls }));
|
|
@@ -40,7 +40,6 @@ interface OverlayControlsProps extends OverlayControlsDefaultProps {
|
|
|
40
40
|
overlayControls?: Record<string, OverlayControlItem[]>;
|
|
41
41
|
}
|
|
42
42
|
type DashKitCtx = React.Context<{
|
|
43
|
-
context: Record<string, any>;
|
|
44
43
|
registerManager: RegisterManager;
|
|
45
44
|
itemsParams: Record<string, StringParams>;
|
|
46
45
|
itemsState: Record<string, ItemState>;
|
|
@@ -3,13 +3,13 @@ import i18n from '../../i18n';
|
|
|
3
3
|
import noop from 'lodash/noop';
|
|
4
4
|
import { DashKitContext } from '../../context/DashKitContext';
|
|
5
5
|
import { Icon, DropdownMenu, Button, } from '@gravity-ui/uikit';
|
|
6
|
-
import { COPIED_WIDGET_STORE_KEY, MenuItems } from '../../constants';
|
|
6
|
+
import { COPIED_WIDGET_STORE_KEY, OVERLAY_CONTROLS_CLASS_NAME, MenuItems } from '../../constants';
|
|
7
7
|
import { DotsIcon } from '../../icons/DotsIcon';
|
|
8
8
|
import { CogIcon } from '../../icons/CogIcon';
|
|
9
9
|
import { CloseIcon } from '../../icons/CloseIcon';
|
|
10
10
|
import { cn } from '../../utils/cn';
|
|
11
11
|
import './OverlayControls.css';
|
|
12
|
-
const b = cn(
|
|
12
|
+
const b = cn(OVERLAY_CONTROLS_CLASS_NAME);
|
|
13
13
|
export var OverlayControlsPosition;
|
|
14
14
|
(function (OverlayControlsPosition) {
|
|
15
15
|
OverlayControlsPosition["TopRight"] = "top_right";
|
|
@@ -53,11 +53,10 @@ class OverlayControls extends React.Component {
|
|
|
53
53
|
return controls;
|
|
54
54
|
};
|
|
55
55
|
this.onCopyItem = () => {
|
|
56
|
-
var _a;
|
|
57
56
|
const correspondedItemLayout = this.context.config.layout.find((item) => {
|
|
58
57
|
return item.i === this.props.configItem.id;
|
|
59
58
|
});
|
|
60
|
-
|
|
59
|
+
const options = {
|
|
61
60
|
timestamp: Date.now(),
|
|
62
61
|
data: this.props.configItem.data,
|
|
63
62
|
type: this.props.configItem.type,
|
|
@@ -68,9 +67,6 @@ class OverlayControls extends React.Component {
|
|
|
68
67
|
h: correspondedItemLayout.h,
|
|
69
68
|
},
|
|
70
69
|
};
|
|
71
|
-
if (typeof ((_a = this.context.context) === null || _a === void 0 ? void 0 : _a.getPreparedCopyItemOptions) === 'function') {
|
|
72
|
-
options = this.context.context.getPreparedCopyItemOptions(options);
|
|
73
|
-
}
|
|
74
70
|
localStorage.setItem(COPIED_WIDGET_STORE_KEY, JSON.stringify(options));
|
|
75
71
|
// https://stackoverflow.com/questions/35865481/storage-event-not-firing
|
|
76
72
|
window.dispatchEvent(new Event('storage'));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const COPIED_WIDGET_STORE_KEY = "dashCopiedItem";
|
|
2
2
|
export declare const DEFAULT_NAMESPACE = "default";
|
|
3
|
+
export declare const OVERLAY_CONTROLS_CLASS_NAME = "dashkit-overlay-controls";
|
|
3
4
|
export declare const MenuItems: {
|
|
4
5
|
readonly Copy: "copy";
|
|
5
6
|
readonly Delete: "delete";
|
|
@@ -117,7 +117,8 @@ function useMemoStateContext(props) {
|
|
|
117
117
|
});
|
|
118
118
|
}, [props.layout, layoutUpdateCounter]);
|
|
119
119
|
const reloadItems = React.useCallback((pluginsRefs, data) => {
|
|
120
|
-
pluginsRefs.
|
|
120
|
+
const promises = pluginsRefs.map((ref) => ref && ref.reload && ref.reload(data));
|
|
121
|
+
return Promise.allSettled(promises);
|
|
121
122
|
}, []);
|
|
122
123
|
return React.useMemo(() => ({
|
|
123
124
|
layout: resultLayout,
|
|
@@ -9,8 +9,10 @@ export interface Settings {
|
|
|
9
9
|
}
|
|
10
10
|
export type MenuItem = (typeof MenuItems)[keyof typeof MenuItems] | OverlayCustomControlItem;
|
|
11
11
|
export interface SettingsProps {
|
|
12
|
-
autoupdateInterval
|
|
12
|
+
autoupdateInterval?: number;
|
|
13
13
|
silentLoading: boolean;
|
|
14
|
+
realtimeMode?: boolean;
|
|
15
|
+
realtimeModeDelayMs?: number;
|
|
14
16
|
}
|
|
15
17
|
export interface ContextProps {
|
|
16
18
|
[key: string]: any;
|