@gridsuite/commons-ui 0.45.0 → 0.47.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 +0 -17
- package/dist/components/AuthenticationRouter/AuthenticationRouter.js +147 -0
- package/dist/components/CardErrorBoundary/card-error-boundary.js +110 -0
- package/dist/components/ElementSearchDialog/element-search-dialog.js +139 -0
- package/dist/components/ElementSearchDialog/equipment-item.js +77 -0
- package/dist/components/ElementSearchDialog/tag-renderer.js +34 -0
- package/dist/components/FlatParameters/FlatParameters.js +411 -0
- package/dist/components/Login/Login.js +78 -0
- package/dist/components/Login/Logout.js +69 -0
- package/dist/components/MuiVirtualizedTable/ColumnHeader.js +127 -0
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +548 -0
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +790 -0
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +87 -0
- package/dist/components/OverflowableText/overflowable-text.js +87 -0
- package/dist/components/ReportViewer/filter-button.js +64 -0
- package/dist/components/ReportViewer/log-report-item.js +95 -0
- package/dist/components/ReportViewer/log-report.js +49 -0
- package/dist/components/ReportViewer/log-table.js +131 -0
- package/dist/components/ReportViewer/multi-select-list.js +40 -0
- package/dist/components/ReportViewer/report-item.js +112 -0
- package/dist/components/ReportViewer/report-tree-view-context.js +8 -0
- package/dist/components/ReportViewer/report-viewer.js +158 -0
- package/dist/components/ReportViewerDialog/report-viewer-dialog.js +61 -0
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +13 -0
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +16 -0
- package/dist/components/SnackbarProvider/SnackbarProvider.js +28 -0
- package/dist/components/TopBar/AboutDialog.js +467 -0
- package/dist/components/TopBar/GridLogo.js +71 -0
- package/dist/components/TopBar/TopBar.js +679 -0
- package/dist/components/TreeViewFinder/TreeViewFinder.js +288 -0
- package/dist/components/react-hook-form/autocomplete-input.js +96 -0
- package/dist/components/react-hook-form/booleans/boolean-input.js +49 -0
- package/dist/components/react-hook-form/booleans/checkbox-input.js +24 -0
- package/dist/components/react-hook-form/booleans/switch-input.js +24 -0
- package/dist/components/react-hook-form/error-management/error-input.js +42 -0
- package/dist/components/react-hook-form/error-management/field-error-alert.js +9 -0
- package/dist/components/react-hook-form/error-management/mid-form-error.js +20 -0
- package/dist/components/react-hook-form/numbers/float-input.js +51 -0
- package/dist/components/react-hook-form/numbers/integer-input.js +36 -0
- package/dist/components/react-hook-form/numbers/utils.js +10 -0
- package/dist/components/react-hook-form/radio-input.js +44 -0
- package/dist/components/react-hook-form/select-input.js +31 -0
- package/dist/components/react-hook-form/slider-input.js +43 -0
- package/dist/components/react-hook-form/text-input.js +94 -0
- package/dist/components/react-hook-form/utils/cancel-button.js +16 -0
- package/dist/components/react-hook-form/utils/field-label.js +12 -0
- package/dist/components/react-hook-form/utils/functions.js +36 -0
- package/dist/components/react-hook-form/utils/submit-button.js +23 -0
- package/dist/components/react-hook-form/utils/text-field-with-adornment.js +96 -0
- package/dist/components/translations/card-error-boundary-en.js +8 -0
- package/dist/components/translations/card-error-boundary-fr.js +8 -0
- package/dist/components/translations/common-button-en.js +7 -0
- package/dist/components/translations/common-button-fr.js +7 -0
- package/dist/components/translations/element-search-en.js +7 -0
- package/dist/components/translations/element-search-fr.js +7 -0
- package/dist/components/translations/equipment-search-en.js +21 -0
- package/dist/components/translations/equipment-search-fr.js +21 -0
- package/dist/components/translations/flat-parameters-en.js +8 -0
- package/dist/components/translations/flat-parameters-fr.js +8 -0
- package/dist/components/translations/login-en.js +14 -0
- package/dist/components/translations/login-fr.js +14 -0
- package/dist/components/translations/multiple-selection-dialog-en.js +8 -0
- package/dist/components/translations/multiple-selection-dialog-fr.js +8 -0
- package/dist/components/translations/report-viewer-en.js +8 -0
- package/dist/components/translations/report-viewer-fr.js +8 -0
- package/dist/components/translations/table-en.js +6 -0
- package/dist/components/translations/table-fr.js +6 -0
- package/dist/components/translations/top-bar-en.js +27 -0
- package/dist/components/translations/top-bar-fr.js +27 -0
- package/dist/components/translations/treeview-finder-en.js +12 -0
- package/dist/components/translations/treeview-finder-fr.js +12 -0
- package/dist/hooks/useDebounce.js +17 -0
- package/{es/components/ElementSearchDialog/index.js → dist/hooks/useIntlRef.d.ts} +2 -2
- package/dist/hooks/useIntlRef.js +13 -0
- package/dist/hooks/useSnackMessage.js +81 -0
- package/dist/index.d.ts +225 -0
- package/dist/index.js +154 -0
- package/dist/utils/AuthService.js +336 -0
- package/dist/utils/ElementType.js +38 -0
- package/dist/utils/EquipmentType.js +132 -0
- package/dist/utils/UserManagerMock.js +85 -0
- package/dist/utils/actions.js +71 -0
- package/dist/utils/algos.js +24 -0
- package/dist/utils/styles.js +13 -0
- package/package.json +36 -21
- package/es/components/AuthenticationRouter/AuthenticationRouter.js +0 -102
- package/es/components/AuthenticationRouter/index.js +0 -7
- package/es/components/CardErrorBoundary/card-error-boundary.js +0 -138
- package/es/components/CardErrorBoundary/index.js +0 -7
- package/es/components/ElementSearchDialog/element-search-dialog.js +0 -153
- package/es/components/ElementSearchDialog/equipment-item.js +0 -63
- package/es/components/ElementSearchDialog/tag-renderer.js +0 -29
- package/es/components/FlatParameters/FlatParameters.js +0 -448
- package/es/components/FlatParameters/index.js +0 -8
- package/es/components/Login/Login.js +0 -79
- package/es/components/Login/Logout.js +0 -78
- package/es/components/Login/index.js +0 -7
- package/es/components/MuiVirtualizedTable/ColumnHeader.js +0 -125
- package/es/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +0 -619
- package/es/components/MuiVirtualizedTable/MuiVirtualizedTable.js +0 -780
- package/es/components/MuiVirtualizedTable/index.js +0 -9
- package/es/components/MultipleSelectionDialog/MultipleSelectionDialog.js +0 -95
- package/es/components/MultipleSelectionDialog/index.js +0 -8
- package/es/components/OverflowableText/index.js +0 -7
- package/es/components/OverflowableText/overflowable-text.js +0 -81
- package/es/components/ReportViewer/filter-button.js +0 -77
- package/es/components/ReportViewer/index.js +0 -7
- package/es/components/ReportViewer/log-report-item.js +0 -97
- package/es/components/ReportViewer/log-report.js +0 -63
- package/es/components/ReportViewer/log-table.js +0 -130
- package/es/components/ReportViewer/multi-select-list.js +0 -56
- package/es/components/ReportViewer/report-item.js +0 -131
- package/es/components/ReportViewer/report-tree-view-context.js +0 -13
- package/es/components/ReportViewer/report-viewer.js +0 -167
- package/es/components/ReportViewerDialog/index.js +0 -7
- package/es/components/ReportViewerDialog/report-viewer-dialog.js +0 -67
- package/es/components/SignInCallbackHandler/SignInCallbackHandler.js +0 -19
- package/es/components/SignInCallbackHandler/index.js +0 -7
- package/es/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +0 -19
- package/es/components/SilentRenewCallbackHandler/index.js +0 -7
- package/es/components/SnackbarProvider/SnackbarProvider.js +0 -39
- package/es/components/SnackbarProvider/index.js +0 -7
- package/es/components/TopBar/AboutDialog.js +0 -456
- package/es/components/TopBar/GridLogo.js +0 -73
- package/es/components/TopBar/TopBar.js +0 -487
- package/es/components/TopBar/index.js +0 -9
- package/es/components/TreeViewFinder/TreeViewFinder.js +0 -341
- package/es/components/TreeViewFinder/index.js +0 -7
- package/es/components/images/powsybl_logo.svg +0 -35
- package/es/components/react-hook-form/autocomplete-input.js +0 -110
- package/es/components/react-hook-form/booleans/boolean-input.js +0 -56
- package/es/components/react-hook-form/booleans/checkbox-input.js +0 -28
- package/es/components/react-hook-form/booleans/switch-input.js +0 -28
- package/es/components/react-hook-form/error-management/error-input.js +0 -50
- package/es/components/react-hook-form/error-management/field-error-alert.js +0 -22
- package/es/components/react-hook-form/error-management/mid-form-error.js +0 -25
- package/es/components/react-hook-form/numbers/float-input.js +0 -105
- package/es/components/react-hook-form/numbers/integer-input.js +0 -35
- package/es/components/react-hook-form/numbers/utils.js +0 -6
- package/es/components/react-hook-form/radio-input.js +0 -55
- package/es/components/react-hook-form/select-input.js +0 -40
- package/es/components/react-hook-form/slider-input.js +0 -48
- package/es/components/react-hook-form/text-input.js +0 -100
- package/es/components/react-hook-form/utils/cancel-button.js +0 -28
- package/es/components/react-hook-form/utils/field-label.js +0 -15
- package/es/components/react-hook-form/utils/functions.js +0 -42
- package/es/components/react-hook-form/utils/submit-button.js +0 -29
- package/es/components/react-hook-form/utils/text-field-with-adornment.js +0 -92
- package/es/components/translations/card-error-boundary-en.js +0 -13
- package/es/components/translations/card-error-boundary-fr.js +0 -13
- package/es/components/translations/common-button-en.js +0 -12
- package/es/components/translations/common-button-fr.js +0 -12
- package/es/components/translations/element-search-en.js +0 -12
- package/es/components/translations/element-search-fr.js +0 -12
- package/es/components/translations/equipment-search-en.js +0 -26
- package/es/components/translations/equipment-search-fr.js +0 -26
- package/es/components/translations/flat-parameters-en.js +0 -13
- package/es/components/translations/flat-parameters-fr.js +0 -13
- package/es/components/translations/inputs-en.js +0 -25
- package/es/components/translations/inputs-fr.js +0 -25
- package/es/components/translations/login-en.js +0 -19
- package/es/components/translations/login-fr.js +0 -19
- package/es/components/translations/multiple-selection-dialog-en.js +0 -13
- package/es/components/translations/multiple-selection-dialog-fr.js +0 -13
- package/es/components/translations/report-viewer-en.js +0 -13
- package/es/components/translations/report-viewer-fr.js +0 -13
- package/es/components/translations/table-en.js +0 -11
- package/es/components/translations/table-fr.js +0 -11
- package/es/components/translations/top-bar-en.js +0 -32
- package/es/components/translations/top-bar-fr.js +0 -32
- package/es/components/translations/treeview-finder-en.js +0 -17
- package/es/components/translations/treeview-finder-fr.js +0 -17
- package/es/hooks/useDebounce.js +0 -26
- package/es/hooks/useIntlRef.js +0 -22
- package/es/hooks/useSnackMessage.js +0 -81
- package/es/index.js +0 -71
- package/es/utils/AuthService.js +0 -312
- package/es/utils/ElementType.js +0 -49
- package/es/utils/EquipmentType.js +0 -133
- package/es/utils/UserManagerMock.js +0 -81
- package/es/utils/actions.js +0 -65
- package/es/utils/algos.js +0 -29
- package/es/utils/styles.js +0 -35
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
var _excluded = ["labelText", "labelIconColor", "className"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (c) 2021, RTE (http://www.rte-france.com)
|
|
6
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import React, { useContext } from 'react';
|
|
12
|
-
import Box from '@mui/material/Box';
|
|
13
|
-
import { styled } from '@mui/system';
|
|
14
|
-
import PropTypes from 'prop-types';
|
|
15
|
-
import TreeItem from '@mui/lab/TreeItem';
|
|
16
|
-
import Typography from '@mui/material/Typography';
|
|
17
|
-
import Label from '@mui/icons-material/Label';
|
|
18
|
-
import ReportTreeViewContext from './report-tree-view-context';
|
|
19
|
-
import { alpha } from '@mui/system';
|
|
20
|
-
var styles = {
|
|
21
|
-
root: function root(theme) {
|
|
22
|
-
return {
|
|
23
|
-
color: theme.palette.text.secondary,
|
|
24
|
-
'&:hover > .MuiTreeItem-content': {
|
|
25
|
-
backgroundColor: theme.palette.action.hover
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
content: function content(theme) {
|
|
30
|
-
return {
|
|
31
|
-
color: theme.palette.text.secondary,
|
|
32
|
-
borderRadius: theme.spacing(2),
|
|
33
|
-
width: 'fit-content',
|
|
34
|
-
paddingRight: theme.spacing(1),
|
|
35
|
-
fontWeight: theme.typography.fontWeightMedium,
|
|
36
|
-
'&.Mui-expanded': {
|
|
37
|
-
fontWeight: theme.typography.fontWeightRegular
|
|
38
|
-
},
|
|
39
|
-
/* &.MuiTreeItem-content.Mui-focused to increase specifity because mui5 has a rule for &.Mui-selected.Mui-focused */
|
|
40
|
-
'&.MuiTreeItem-content.Mui-focused, &.Mui-selected': {
|
|
41
|
-
backgroundColor: "var(--tree-view-bg-color, " + theme.palette.action.selected + ")",
|
|
42
|
-
color: 'var(--tree-view-color)'
|
|
43
|
-
},
|
|
44
|
-
// same as mui v4 behavior on label text only right after clicking in contrast to after moving away with arrow keys.
|
|
45
|
-
'&.Mui-selected .MuiTreeItem-label:hover, &.Mui-selected.Mui-focused .MuiTreeItem-label': {
|
|
46
|
-
borderRadius: theme.spacing(2),
|
|
47
|
-
backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity)
|
|
48
|
-
},
|
|
49
|
-
'&.Mui-focused .MuiTreeItem-label, &:hover .MuiTreeItem-label, &Mui-selected .MuiTreeItem-label': {
|
|
50
|
-
backgroundColor: 'transparent'
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
group: function group(theme) {
|
|
55
|
-
return {
|
|
56
|
-
marginLeft: '10px',
|
|
57
|
-
'& .MuiTreeItem-content': {
|
|
58
|
-
paddingLeft: theme.spacing(2)
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
expanded: {},
|
|
63
|
-
selected: {},
|
|
64
|
-
label: {
|
|
65
|
-
fontWeight: 'inherit',
|
|
66
|
-
color: 'inherit'
|
|
67
|
-
},
|
|
68
|
-
labelRoot: function labelRoot(theme) {
|
|
69
|
-
return {
|
|
70
|
-
display: 'flex',
|
|
71
|
-
alignItems: 'center',
|
|
72
|
-
padding: theme.spacing(0.5, 0)
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
labelRootHighlighted: function labelRootHighlighted(theme) {
|
|
76
|
-
return {
|
|
77
|
-
display: 'flex',
|
|
78
|
-
alignItems: 'center',
|
|
79
|
-
padding: theme.spacing(0.5, 0),
|
|
80
|
-
backgroundColor: theme.palette.action.selected
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
labelIcon: function labelIcon(theme) {
|
|
84
|
-
return {
|
|
85
|
-
marginRight: theme.spacing(1)
|
|
86
|
-
};
|
|
87
|
-
},
|
|
88
|
-
labelText: function labelText(theme) {
|
|
89
|
-
return {
|
|
90
|
-
fontWeight: 'inherit',
|
|
91
|
-
marginRight: theme.spacing(2)
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
var ReportItem = function ReportItem(props) {
|
|
96
|
-
// using a context because TreeItem uses useMemo on this. See report-viewer.js for the provider
|
|
97
|
-
var _useContext = useContext(ReportTreeViewContext),
|
|
98
|
-
isHighlighted = _useContext.isHighlighted;
|
|
99
|
-
var highlighted = isHighlighted ? isHighlighted(props.nodeId) : false;
|
|
100
|
-
var labelText = props.labelText,
|
|
101
|
-
labelIconColor = props.labelIconColor,
|
|
102
|
-
className = props.className,
|
|
103
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
104
|
-
return /*#__PURE__*/React.createElement(TreeItem, _extends({
|
|
105
|
-
className: className,
|
|
106
|
-
sx: {
|
|
107
|
-
'&': styles.root,
|
|
108
|
-
'& .MuiTreeItem-content': styles.content,
|
|
109
|
-
'& .Mui-expanded': styles.expanded,
|
|
110
|
-
'& .Mui-selected': styles.selected,
|
|
111
|
-
'& .MuiTreeItem-group': styles.group,
|
|
112
|
-
'& .MuiTreeItem-label': styles.label
|
|
113
|
-
},
|
|
114
|
-
label: /*#__PURE__*/React.createElement(Box, {
|
|
115
|
-
sx: highlighted ? styles.labelRootHighlighted : styles.labelRoot
|
|
116
|
-
}, /*#__PURE__*/React.createElement(Label, {
|
|
117
|
-
htmlColor: labelIconColor,
|
|
118
|
-
sx: styles.labelIcon
|
|
119
|
-
}), /*#__PURE__*/React.createElement(Typography, {
|
|
120
|
-
variant: "body2",
|
|
121
|
-
sx: styles.labelText
|
|
122
|
-
}, labelText))
|
|
123
|
-
}, other));
|
|
124
|
-
};
|
|
125
|
-
ReportItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
126
|
-
bgColor: PropTypes.string,
|
|
127
|
-
color: PropTypes.string,
|
|
128
|
-
labelInfo: PropTypes.string,
|
|
129
|
-
labelText: PropTypes.string.isRequired
|
|
130
|
-
} : {};
|
|
131
|
-
export default styled(ReportItem)({});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2022, RTE (http://www.rte-france.com)
|
|
3
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { createContext } from 'react';
|
|
9
|
-
var ReportTreeViewContext = createContext({});
|
|
10
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
11
|
-
ReportTreeViewContext.displayName = 'ReportTreeViewContext';
|
|
12
|
-
}
|
|
13
|
-
export default ReportTreeViewContext;
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021, RTE (http://www.rte-france.com)
|
|
3
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
-
import TreeView from '@mui/lab/TreeView';
|
|
10
|
-
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
11
|
-
import ArrowRightIcon from '@mui/icons-material/ArrowRight';
|
|
12
|
-
import ReportItem from './report-item';
|
|
13
|
-
import LogReport from './log-report';
|
|
14
|
-
import Grid from '@mui/material/Grid';
|
|
15
|
-
import LogTable from './log-table';
|
|
16
|
-
import ReportTreeViewContext from './report-tree-view-context';
|
|
17
|
-
import LogReportItem from './log-report-item';
|
|
18
|
-
var MAX_SUB_REPORTS = 500;
|
|
19
|
-
var styles = {
|
|
20
|
-
treeView: {
|
|
21
|
-
height: '100%',
|
|
22
|
-
overflow: 'scroll'
|
|
23
|
-
},
|
|
24
|
-
treeItem: {
|
|
25
|
-
whiteSpace: 'nowrap'
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
export default function ReportViewer(_ref) {
|
|
29
|
-
var jsonReport = _ref.jsonReport,
|
|
30
|
-
_ref$maxSubReports = _ref.maxSubReports,
|
|
31
|
-
maxSubReports = _ref$maxSubReports === void 0 ? MAX_SUB_REPORTS : _ref$maxSubReports;
|
|
32
|
-
var _useState = useState(null),
|
|
33
|
-
selectedNode = _useState[0],
|
|
34
|
-
setSelectedNode = _useState[1];
|
|
35
|
-
var _useState2 = useState([]),
|
|
36
|
-
expandedNodes = _useState2[0],
|
|
37
|
-
setExpandedNodes = _useState2[1];
|
|
38
|
-
var _useState3 = useState(null),
|
|
39
|
-
logs = _useState3[0],
|
|
40
|
-
setLogs = _useState3[1];
|
|
41
|
-
var _useState4 = useState(),
|
|
42
|
-
highlightedReportId = _useState4[0],
|
|
43
|
-
setHighlightedReportId = _useState4[1];
|
|
44
|
-
var rootReport = useRef(null);
|
|
45
|
-
var allReports = useRef({});
|
|
46
|
-
var treeView = useRef(null);
|
|
47
|
-
var defaultSeverityFilter = useMemo(function () {
|
|
48
|
-
var filterConfig = {};
|
|
49
|
-
Object.values(LogReportItem.SEVERITY).forEach(function (severity) {
|
|
50
|
-
filterConfig[severity.name] = true;
|
|
51
|
-
});
|
|
52
|
-
return filterConfig;
|
|
53
|
-
}, []);
|
|
54
|
-
var _useState5 = useState(defaultSeverityFilter),
|
|
55
|
-
selectedSeverity = _useState5[0],
|
|
56
|
-
setSelectedSeverity = _useState5[1];
|
|
57
|
-
var createReporterItem = useCallback(function (logReport) {
|
|
58
|
-
allReports.current[logReport.getId()] = logReport;
|
|
59
|
-
if (logReport.getSubReports().length > maxSubReports) {
|
|
60
|
-
console.warn('The number (%s) being greater than %s only the first %s subreports will be displayed', logReport.getSubReports().length, maxSubReports, maxSubReports);
|
|
61
|
-
}
|
|
62
|
-
return /*#__PURE__*/React.createElement(ReportItem, {
|
|
63
|
-
labelText: logReport.getTitle(),
|
|
64
|
-
labelIconColor: logReport.getHighestSeverity().colorName,
|
|
65
|
-
key: logReport.getId().toString(),
|
|
66
|
-
sx: styles.treeItem,
|
|
67
|
-
nodeId: logReport.getId().toString()
|
|
68
|
-
}, logReport.getSubReports().slice(0, maxSubReports).map(function (value) {
|
|
69
|
-
return createReporterItem(value);
|
|
70
|
-
}));
|
|
71
|
-
}, [maxSubReports]);
|
|
72
|
-
useEffect(function () {
|
|
73
|
-
rootReport.current = new LogReport(jsonReport);
|
|
74
|
-
var rootId = rootReport.current.getId().toString();
|
|
75
|
-
treeView.current = createReporterItem(rootReport.current);
|
|
76
|
-
setSelectedNode(rootId);
|
|
77
|
-
setExpandedNodes([rootId]);
|
|
78
|
-
setLogs(rootReport.current.getAllLogs());
|
|
79
|
-
}, [jsonReport, createReporterItem]);
|
|
80
|
-
var handleToggleNode = function handleToggleNode(event, nodeIds) {
|
|
81
|
-
event.persist();
|
|
82
|
-
var iconClicked = event.target.closest('.MuiTreeItem-iconContainer');
|
|
83
|
-
if (iconClicked) {
|
|
84
|
-
setExpandedNodes(nodeIds);
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
var handleSelectNode = function handleSelectNode(event, nodeId) {
|
|
88
|
-
selectNode(nodeId);
|
|
89
|
-
};
|
|
90
|
-
var selectNode = function selectNode(nodeId) {
|
|
91
|
-
if (selectedNode !== nodeId) {
|
|
92
|
-
setSelectedNode(nodeId);
|
|
93
|
-
setLogs(allReports.current[nodeId].getAllLogs());
|
|
94
|
-
setHighlightedReportId(null);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// The MUI TreeView/TreeItems use useMemo on our items, so it's important to avoid changing the context
|
|
99
|
-
var isHighlighted = useMemo(function () {
|
|
100
|
-
return {
|
|
101
|
-
isHighlighted: function isHighlighted(reportId) {
|
|
102
|
-
return highlightedReportId === reportId;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
}, [highlightedReportId]);
|
|
106
|
-
var onRowClick = function onRowClick(data) {
|
|
107
|
-
setExpandedNodes(function (previouslyExpandedNodes) {
|
|
108
|
-
var nodesToExpand = [];
|
|
109
|
-
var reportId = data.reportId;
|
|
110
|
-
while ((_allReports$current$r = allReports.current[reportId]) === null || _allReports$current$r === void 0 ? void 0 : _allReports$current$r.parentReportId) {
|
|
111
|
-
var _allReports$current$r;
|
|
112
|
-
var parentReportId = allReports.current[reportId].parentReportId;
|
|
113
|
-
if (!previouslyExpandedNodes.includes(parentReportId)) {
|
|
114
|
-
nodesToExpand.push(parentReportId);
|
|
115
|
-
}
|
|
116
|
-
reportId = parentReportId;
|
|
117
|
-
}
|
|
118
|
-
if (nodesToExpand.length > 0) {
|
|
119
|
-
return nodesToExpand.concat(previouslyExpandedNodes);
|
|
120
|
-
} else {
|
|
121
|
-
return previouslyExpandedNodes;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
setHighlightedReportId(data.reportId);
|
|
125
|
-
};
|
|
126
|
-
return rootReport.current && /*#__PURE__*/React.createElement(Grid, {
|
|
127
|
-
container: true,
|
|
128
|
-
style: {
|
|
129
|
-
height: '100%'
|
|
130
|
-
}
|
|
131
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
132
|
-
item: true,
|
|
133
|
-
xs: 12,
|
|
134
|
-
sm: 3,
|
|
135
|
-
style: {
|
|
136
|
-
height: '95%',
|
|
137
|
-
borderRight: '1px solid rgba(81, 81, 81, 1)'
|
|
138
|
-
}
|
|
139
|
-
}, /*#__PURE__*/React.createElement(ReportTreeViewContext.Provider, {
|
|
140
|
-
value: isHighlighted
|
|
141
|
-
}, /*#__PURE__*/React.createElement(TreeView, {
|
|
142
|
-
sx: styles.treeView,
|
|
143
|
-
defaultCollapseIcon: /*#__PURE__*/React.createElement(ArrowDropDownIcon, null),
|
|
144
|
-
defaultExpandIcon: /*#__PURE__*/React.createElement(ArrowRightIcon, null),
|
|
145
|
-
defaultEndIcon: /*#__PURE__*/React.createElement("div", {
|
|
146
|
-
style: {
|
|
147
|
-
width: 24
|
|
148
|
-
}
|
|
149
|
-
}),
|
|
150
|
-
onNodeToggle: handleToggleNode,
|
|
151
|
-
onNodeSelect: handleSelectNode,
|
|
152
|
-
selected: selectedNode,
|
|
153
|
-
expanded: expandedNodes
|
|
154
|
-
}, treeView.current))), /*#__PURE__*/React.createElement(Grid, {
|
|
155
|
-
item: true,
|
|
156
|
-
xs: 12,
|
|
157
|
-
sm: 9,
|
|
158
|
-
style: {
|
|
159
|
-
height: '95%'
|
|
160
|
-
}
|
|
161
|
-
}, /*#__PURE__*/React.createElement(LogTable, {
|
|
162
|
-
logs: logs,
|
|
163
|
-
onRowClick: onRowClick,
|
|
164
|
-
selectedSeverity: selectedSeverity,
|
|
165
|
-
setSelectedSeverity: setSelectedSeverity
|
|
166
|
-
})));
|
|
167
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021, RTE (http://www.rte-france.com)
|
|
3
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
-
*/
|
|
7
|
-
export { default } from './report-viewer-dialog';
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021, RTE (http://www.rte-france.com)
|
|
3
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React, { useState } from 'react';
|
|
9
|
-
import DialogTitle from '@mui/material/DialogTitle';
|
|
10
|
-
import DialogActions from '@mui/material/DialogActions';
|
|
11
|
-
import Button from '@mui/material/Button';
|
|
12
|
-
import FullscreenIcon from '@mui/icons-material/Fullscreen';
|
|
13
|
-
import FullscreenExitIcon from '@mui/icons-material/FullscreenExit';
|
|
14
|
-
import { FormattedMessage } from 'react-intl';
|
|
15
|
-
import { Dialog, DialogContent } from '@mui/material';
|
|
16
|
-
import ReportViewer from '../ReportViewer';
|
|
17
|
-
var styles = {
|
|
18
|
-
fullScreenIcon: {
|
|
19
|
-
cursor: 'pointer'
|
|
20
|
-
},
|
|
21
|
-
paperFullWidth: {
|
|
22
|
-
height: '100%'
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
export default function ReportViewerDialog(props) {
|
|
26
|
-
var title = props.title,
|
|
27
|
-
open = props.open,
|
|
28
|
-
onClose = props.onClose,
|
|
29
|
-
jsonReport = props.jsonReport;
|
|
30
|
-
var _useState = useState(false),
|
|
31
|
-
fullScreen = _useState[0],
|
|
32
|
-
setFullScreen = _useState[1];
|
|
33
|
-
var showFullScreen = function showFullScreen() {
|
|
34
|
-
setFullScreen(true);
|
|
35
|
-
};
|
|
36
|
-
var hideFullScreen = function hideFullScreen() {
|
|
37
|
-
setFullScreen(false);
|
|
38
|
-
};
|
|
39
|
-
return /*#__PURE__*/React.createElement(Dialog, {
|
|
40
|
-
open: open,
|
|
41
|
-
onClose: onClose,
|
|
42
|
-
fullScreen: fullScreen,
|
|
43
|
-
"aria-labelledby": "dialog-title-report",
|
|
44
|
-
fullWidth: true,
|
|
45
|
-
maxWidth: "lg",
|
|
46
|
-
sx: {
|
|
47
|
-
'& .MuiDialog-paperFullWidth': styles.paperFullWidth
|
|
48
|
-
}
|
|
49
|
-
}, /*#__PURE__*/React.createElement(DialogTitle, null, title), /*#__PURE__*/React.createElement(DialogContent, {
|
|
50
|
-
dividers: true
|
|
51
|
-
}, /*#__PURE__*/React.createElement(ReportViewer, {
|
|
52
|
-
jsonReport: jsonReport
|
|
53
|
-
})), /*#__PURE__*/React.createElement(DialogActions, null, fullScreen ? /*#__PURE__*/React.createElement(FullscreenExitIcon, {
|
|
54
|
-
onClick: hideFullScreen,
|
|
55
|
-
sx: styles.fullScreenIcon
|
|
56
|
-
}) : /*#__PURE__*/React.createElement(FullscreenIcon, {
|
|
57
|
-
onClick: showFullScreen,
|
|
58
|
-
sx: styles.fullScreenIcon
|
|
59
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
60
|
-
onClick: function onClick() {
|
|
61
|
-
return onClose();
|
|
62
|
-
},
|
|
63
|
-
variant: "text"
|
|
64
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
65
|
-
id: "report_viewer/close"
|
|
66
|
-
}))));
|
|
67
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, RTE (http://www.rte-france.com)
|
|
3
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React, { useEffect } from 'react';
|
|
9
|
-
var SignInCallbackHandler = function SignInCallbackHandler(_ref) {
|
|
10
|
-
var userManager = _ref.userManager,
|
|
11
|
-
handleSignInCallback = _ref.handleSignInCallback;
|
|
12
|
-
useEffect(function () {
|
|
13
|
-
if (userManager !== null) {
|
|
14
|
-
handleSignInCallback();
|
|
15
|
-
}
|
|
16
|
-
}, [userManager, handleSignInCallback]);
|
|
17
|
-
return /*#__PURE__*/React.createElement("h1", null, " ");
|
|
18
|
-
};
|
|
19
|
-
export default SignInCallbackHandler;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, RTE (http://www.rte-france.com)
|
|
3
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
-
*/
|
|
7
|
-
export { default } from './SignInCallbackHandler';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, RTE (http://www.rte-france.com)
|
|
3
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React, { useEffect } from 'react';
|
|
9
|
-
var SilentRenewCallbackHandler = function SilentRenewCallbackHandler(_ref) {
|
|
10
|
-
var userManager = _ref.userManager,
|
|
11
|
-
handleSilentRenewCallback = _ref.handleSilentRenewCallback;
|
|
12
|
-
useEffect(function () {
|
|
13
|
-
if (userManager !== null) {
|
|
14
|
-
handleSilentRenewCallback();
|
|
15
|
-
}
|
|
16
|
-
}, [userManager, handleSilentRenewCallback]);
|
|
17
|
-
return /*#__PURE__*/React.createElement("h1", null, "Technical token renew window, you should not see this");
|
|
18
|
-
};
|
|
19
|
-
export default SilentRenewCallbackHandler;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, RTE (http://www.rte-france.com)
|
|
3
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
-
*/
|
|
7
|
-
export { default } from './SilentRenewCallbackHandler';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2020, RTE (http://www.rte-france.com)
|
|
4
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import React, { useRef } from 'react';
|
|
10
|
-
import Button from '@mui/material/Button';
|
|
11
|
-
import { SnackbarProvider as OrigSnackbarProvider } from 'notistack';
|
|
12
|
-
|
|
13
|
-
/* A wrapper around notistack's SnackbarProvider that provides defaults props */
|
|
14
|
-
var SnackbarProvider = React.forwardRef(function (props, ref) {
|
|
15
|
-
// create our own ref and use it if the parent
|
|
16
|
-
// did not create a ref for us.
|
|
17
|
-
var innerRef = useRef();
|
|
18
|
-
var notistackRef = ref || innerRef;
|
|
19
|
-
return /*#__PURE__*/React.createElement(OrigSnackbarProvider, _extends({
|
|
20
|
-
ref: notistackRef,
|
|
21
|
-
anchorOrigin: {
|
|
22
|
-
horizontal: 'center',
|
|
23
|
-
vertical: 'bottom'
|
|
24
|
-
},
|
|
25
|
-
hideIconVariant: true,
|
|
26
|
-
action: function action(key) {
|
|
27
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
28
|
-
onClick: function onClick() {
|
|
29
|
-
return notistackRef.current.closeSnackbar(key);
|
|
30
|
-
},
|
|
31
|
-
style: {
|
|
32
|
-
color: '#fff',
|
|
33
|
-
fontSize: '20px'
|
|
34
|
-
}
|
|
35
|
-
}, "\u2716");
|
|
36
|
-
}
|
|
37
|
-
}, props));
|
|
38
|
-
});
|
|
39
|
-
export default SnackbarProvider;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, RTE (http://www.rte-france.com)
|
|
3
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
-
*/
|
|
7
|
-
export { default } from './SnackbarProvider';
|