@centreon/ui 23.10.117 → 23.10.119
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/package.json +12 -14
- package/src/Button/Save/StartIcon.tsx +3 -3
- package/src/Dashboard/Item.tsx +1 -1
- package/src/FileDropZone/index.tsx +1 -3
- package/src/Form/Inputs/CheckboxGroup.tsx +4 -1
- package/src/Form/Inputs/index.tsx +1 -1
- package/src/Graph/LineChart/BasicComponents/Lines/Threshold/index.tsx +4 -5
- package/src/Graph/LineChart/BasicComponents/useFilterLines.ts +1 -1
- package/src/Graph/LineChart/InteractiveComponents/Annotations/Annotation/index.tsx +3 -2
- package/src/Graph/LineChart/InteractiveComponents/Annotations/EventAnnotations.tsx +1 -1
- package/src/Graph/LineChart/Legend/useLegend.ts +5 -5
- package/src/Graph/LineChart/helpers/doc.ts +13 -16
- package/src/Graph/LineChart/helpers/index.ts +1 -1
- package/src/Graph/LineChart/index.stories.tsx +2 -1
- package/src/Graph/Text/Text.stories.tsx +4 -60
- package/src/Graph/common/timeSeries/index.ts +3 -3
- package/src/InputField/Select/Autocomplete/Connected/index.tsx +7 -10
- package/src/InputField/Select/Autocomplete/Draggable/SortableList.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Draggable/SortableListContent.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Draggable/index.tsx +1 -1
- package/src/InputField/Select/IconPopover/index.tsx +2 -2
- package/src/InputField/Select/index.tsx +1 -1
- package/src/Listing/Header/ListingHeader.tsx +1 -1
- package/src/Listing/index.stories.tsx +1 -12
- package/src/Listing/index.tsx +1 -1
- package/src/RichTextEditor/RichTextEditor.cypress.spec.tsx +52 -100
- package/src/RichTextEditor/RichTextEditor.tsx +4 -20
- package/src/RichTextEditor/plugins/ToolbarPlugin/AlignPicker.tsx +20 -21
- package/src/RichTextEditor/plugins/ToolbarPlugin/BlockButtons.tsx +77 -35
- package/src/RichTextEditor/plugins/ToolbarPlugin/FormatButtons.tsx +83 -29
- package/src/RichTextEditor/plugins/ToolbarPlugin/MacrosButton.tsx +39 -23
- package/src/RichTextEditor/plugins/ToolbarPlugin/ToolbarPlugin.styles.ts +14 -24
- package/src/RichTextEditor/plugins/ToolbarPlugin/UndoRedoButtons.tsx +0 -6
- package/src/RichTextEditor/plugins/ToolbarPlugin/index.tsx +10 -5
- package/src/RichTextEditor/translatedLabels.ts +0 -3
- package/src/SortableItems/index.tsx +7 -2
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +3 -8
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/models.ts +2 -0
- package/src/TimePeriods/DateTimePickerInput.tsx +17 -45
- package/src/TimePeriods/TimePeriods.cypress.spec.tsx +33 -9
- package/src/TimePeriods/helpers/index.ts +1 -1
- package/src/api/QueryProvider.tsx +1 -1
- package/src/api/TestQueryProvider.tsx +1 -1
- package/src/api/useFetchQuery/index.ts +24 -28
- package/src/api/useMutationQuery/index.ts +17 -39
- package/src/components/DataTable/Item/DataTableItem.tsx +2 -2
- package/src/components/Form/AccessRights/__fixtures__/contactAccessRight.mock.ts +0 -2
- package/src/components/Form/AccessRights/useAccessRightsForm.utils.ts +1 -1
- package/src/components/Form/Dashboard/DashboardForm.tsx +12 -15
- package/src/components/ItemComposition/ItemComposition.tsx +2 -4
- package/src/components/Menu/Button/MenuButton.tsx +2 -4
- package/src/components/Menu/MenuItem.tsx +3 -5
- package/src/components/Menu/MenuItems.tsx +3 -4
- package/src/index.ts +0 -1
- package/src/queryParameters/url/index.ts +1 -5
- package/src/screens/dashboard/DashboardsDetail.stories.tsx +108 -0
- package/src/screens/dashboard/DashboardsOverview.stories.tsx +281 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/useDateTimePickerAdapter.ts +309 -0
- package/src/utils/{useLicenseExpirationWarning.test.tsx → useLicenseExpirationWarning.cypress.spec.tsx} +37 -48
- package/src/utils/useLicenseExpirationWarning.ts +18 -18
- package/src/RichTextEditor/plugins/ToolbarPlugin/LinkButton.tsx +0 -106
- package/src/RichTextEditor/plugins/ToolbarPlugin/ListButton.tsx +0 -155
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@centreon/ui",
|
|
3
|
-
"version": "23.10.
|
|
3
|
+
"version": "23.10.119",
|
|
4
4
|
"description": "Centreon UI Components",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
"@testing-library/react-hooks": "^8.0.1",
|
|
74
74
|
"@types/cypress": "^1.1.3",
|
|
75
75
|
"@types/jest": "^27.5.0",
|
|
76
|
-
"@types/ramda": "^0.
|
|
76
|
+
"@types/ramda": "^0.28.12",
|
|
77
77
|
"@types/react": "^18.0.26",
|
|
78
78
|
"@types/testing-library__jest-dom": "^5.14.6",
|
|
79
79
|
"@vitejs/plugin-react": "^4.0.0",
|
|
80
80
|
"@vitejs/plugin-react-swc": "^3.3.0",
|
|
81
81
|
"axios-mock-adapter": "^1.21.4",
|
|
82
|
-
"cypress": "^
|
|
82
|
+
"cypress": "^12.8.0",
|
|
83
83
|
"identity-obj-proxy": "^3.0.0",
|
|
84
84
|
"jest-transform-stub": "^2.0.0",
|
|
85
85
|
"mochawesome": "^7.1.3",
|
|
@@ -101,13 +101,12 @@
|
|
|
101
101
|
"vite-plugin-turbosnap": "^1.0.2"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@lexical/
|
|
105
|
-
"@lexical/
|
|
106
|
-
"@lexical/
|
|
107
|
-
"@lexical/
|
|
108
|
-
"@lexical/
|
|
109
|
-
"@lexical/
|
|
110
|
-
"@lexical/utils": "^0.12.2",
|
|
104
|
+
"@lexical/link": "0.11.3",
|
|
105
|
+
"@lexical/list": "^0.11.3",
|
|
106
|
+
"@lexical/react": "0.11.3",
|
|
107
|
+
"@lexical/rich-text": "^0.11.3",
|
|
108
|
+
"@lexical/selection": "0.11.3",
|
|
109
|
+
"@lexical/utils": "0.11.3",
|
|
111
110
|
"@react-spring/web": "^9.7.3",
|
|
112
111
|
"@visx/curve": "^2.1.0",
|
|
113
112
|
"@visx/group": "^3.3.0",
|
|
@@ -119,9 +118,8 @@
|
|
|
119
118
|
"anylogger": "^1.0.11",
|
|
120
119
|
"d3-array": "3.2.0",
|
|
121
120
|
"humanize-duration": "^3.27.3",
|
|
122
|
-
"lexical": "
|
|
123
|
-
"notistack": "^
|
|
124
|
-
"ramda": "0.29.1",
|
|
121
|
+
"lexical": "0.11.3",
|
|
122
|
+
"notistack": "^2.0.8",
|
|
125
123
|
"react-grid-layout": "^1.3.4",
|
|
126
124
|
"react-html-parser": "^2.0.2",
|
|
127
125
|
"react-resizable": "^3.0.5",
|
|
@@ -137,7 +135,7 @@
|
|
|
137
135
|
"@mui/icons-material": "5.x",
|
|
138
136
|
"@mui/material": "5.x",
|
|
139
137
|
"@mui/styles": "5.x",
|
|
140
|
-
"@tanstack/react-query": "
|
|
138
|
+
"@tanstack/react-query": "4.x",
|
|
141
139
|
"axios": "0.x",
|
|
142
140
|
"dayjs": "1.x",
|
|
143
141
|
"formik": "2.x",
|
|
@@ -15,9 +15,9 @@ interface Props {
|
|
|
15
15
|
|
|
16
16
|
const StartIcon = ({ startIconConfig }: Props): JSX.Element | null =>
|
|
17
17
|
cond<Array<StartIconConfigProps>, JSX.Element | null>([
|
|
18
|
-
[pipe(propEq(
|
|
19
|
-
[propEq(
|
|
20
|
-
[propEq(
|
|
18
|
+
[pipe(propEq('hasLabel', true), not), always(null)],
|
|
19
|
+
[propEq('succeeded', true), always(<CheckIcon />)],
|
|
20
|
+
[propEq('loading', true), always(<SaveIcon />)],
|
|
21
21
|
[T, always(<SaveIcon />)]
|
|
22
22
|
])(startIconConfig);
|
|
23
23
|
|
package/src/Dashboard/Item.tsx
CHANGED
|
@@ -98,9 +98,7 @@ const getExtensions = cond([
|
|
|
98
98
|
[T, identity]
|
|
99
99
|
]) as (accept: string) => Array<string>;
|
|
100
100
|
|
|
101
|
-
export const transformFileListToArray = (
|
|
102
|
-
files: FileList | null
|
|
103
|
-
): Array<File> =>
|
|
101
|
+
export const transformFileListToArray = (files: FileList | null): Array<File> =>
|
|
104
102
|
isNil(files)
|
|
105
103
|
? []
|
|
106
104
|
: (Array(files.length)
|
|
@@ -185,7 +185,7 @@ const Inputs = ({
|
|
|
185
185
|
const hasGroupTitle = R.not(R.isNil(groupName));
|
|
186
186
|
|
|
187
187
|
const groupProps = hasGroupTitle
|
|
188
|
-
? R.find(R.propEq(
|
|
188
|
+
? R.find(R.propEq('name', groupName), groups)
|
|
189
189
|
: ({} as Group);
|
|
190
190
|
|
|
191
191
|
const isFirstElement = areGroupsOpen || R.equals(index, 0);
|
|
@@ -130,11 +130,10 @@ const WrapperThresholdLines = ({
|
|
|
130
130
|
|
|
131
131
|
return (
|
|
132
132
|
<g>
|
|
133
|
-
{filteredThresholdLines.map(
|
|
134
|
-
(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
))
|
|
133
|
+
{filteredThresholdLines.map((element) =>
|
|
134
|
+
element?.map(({ Component, props, key }) => (
|
|
135
|
+
<Component {...props} id={key} key={key} />
|
|
136
|
+
))
|
|
138
137
|
)}
|
|
139
138
|
</g>
|
|
140
139
|
);
|
|
@@ -28,7 +28,7 @@ const useFilterLines = ({
|
|
|
28
28
|
linesGraph,
|
|
29
29
|
setLinesGraph
|
|
30
30
|
}: UseFilterLines): Result => {
|
|
31
|
-
const displayedLines = reject(propEq(
|
|
31
|
+
const displayedLines = reject(propEq('display', false), linesGraph ?? lines);
|
|
32
32
|
const filterLines = (): Array<Line> => {
|
|
33
33
|
const lineOriginMetric = findLineOfOriginMetricThreshold(lines);
|
|
34
34
|
|
|
@@ -43,8 +43,9 @@ const Annotation = ({
|
|
|
43
43
|
|
|
44
44
|
const setAnnotationHovered = useSetAtom(annotationHoveredAtom);
|
|
45
45
|
|
|
46
|
-
const content = `${truncate(event.content)} (${t(labelBy)} ${
|
|
47
|
-
?.name
|
|
46
|
+
const content = `${truncate(event.content)} (${t(labelBy)} ${
|
|
47
|
+
event.contact?.name
|
|
48
|
+
})`;
|
|
48
49
|
|
|
49
50
|
return (
|
|
50
51
|
<g>
|
|
@@ -27,15 +27,15 @@ interface Props {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const useLegend = ({ lines, setLinesGraph }: Props): LegendActions => {
|
|
30
|
-
const displayedLines = reject(propEq(
|
|
30
|
+
const displayedLines = reject(propEq('display', false), lines);
|
|
31
31
|
const getLineByMetric = (metric_id: number): Line =>
|
|
32
|
-
find(propEq(metric_id,
|
|
32
|
+
find(propEq('metric_id', metric_id), lines) as Line;
|
|
33
33
|
|
|
34
34
|
const toggleMetricLine = (metric_id): void => {
|
|
35
35
|
const line = getLineByMetric(metric_id);
|
|
36
36
|
|
|
37
37
|
setLinesGraph([
|
|
38
|
-
...reject(propEq(metric_id,
|
|
38
|
+
...reject(propEq('metric_id', metric_id), lines),
|
|
39
39
|
{ ...line, display: !line.display }
|
|
40
40
|
]);
|
|
41
41
|
};
|
|
@@ -43,7 +43,7 @@ const useLegend = ({ lines, setLinesGraph }: Props): LegendActions => {
|
|
|
43
43
|
const highlightLine = (metric_id): void => {
|
|
44
44
|
const fadedLines = map((line) => ({ ...line, highlight: false }), lines);
|
|
45
45
|
const data = [
|
|
46
|
-
...reject(propEq(metric_id,
|
|
46
|
+
...reject(propEq('metric_id', metric_id), fadedLines),
|
|
47
47
|
{ ...getLineByMetric(metric_id), highlight: true }
|
|
48
48
|
];
|
|
49
49
|
|
|
@@ -93,7 +93,7 @@ const useLegend = ({ lines, setLinesGraph }: Props): LegendActions => {
|
|
|
93
93
|
|
|
94
94
|
const newLines = lines.map((line) => ({
|
|
95
95
|
...line,
|
|
96
|
-
display: find(propEq(
|
|
96
|
+
display: find(propEq('metric_id', line.metric_id), lines)?.display ?? true
|
|
97
97
|
}));
|
|
98
98
|
|
|
99
99
|
setLinesGraph(newLines);
|
|
@@ -69,24 +69,21 @@ export const getDescription = ({ sections }: Description): string => {
|
|
|
69
69
|
})}<br></details>`;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
const formattedProps = props.reduce(
|
|
73
|
-
(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
})}`;
|
|
72
|
+
const formattedProps = props.reduce((accumulator, currentValue, index) => {
|
|
73
|
+
const key = Object.keys(currentValue)[0];
|
|
74
|
+
const { description, type } = currentValue[key];
|
|
75
|
+
const body = `${accumulator} ${getBodyDescription({
|
|
76
|
+
description,
|
|
77
|
+
key,
|
|
78
|
+
type
|
|
79
|
+
})}`;
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
if (!equals(index, props.length - 1)) {
|
|
82
|
+
return body;
|
|
83
|
+
}
|
|
85
84
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
getInitialValue({ section: name, type: item?.type })
|
|
89
|
-
);
|
|
85
|
+
return `${body}</details>`;
|
|
86
|
+
}, getInitialValue({ section: name, type: item?.type }));
|
|
90
87
|
|
|
91
88
|
return formattedProps as string;
|
|
92
89
|
});
|
|
@@ -14,7 +14,7 @@ import { LineChartData } from '../../common/models';
|
|
|
14
14
|
export const adjustGraphData = (graphData: LineChartData): LinesData => {
|
|
15
15
|
const lines = getLineData(graphData);
|
|
16
16
|
const sortedLines = sortBy(prop('name'), lines);
|
|
17
|
-
const displayedLines = reject(propEq(
|
|
17
|
+
const displayedLines = reject(propEq('display', false), sortedLines);
|
|
18
18
|
|
|
19
19
|
const timeSeries = getTimeSeries(graphData);
|
|
20
20
|
|
|
@@ -39,7 +39,8 @@ import { Interval, ThresholdType, TooltipData } from './models';
|
|
|
39
39
|
import WrapperLineChart from './index';
|
|
40
40
|
|
|
41
41
|
const meta: Meta<typeof WrapperLineChart> = {
|
|
42
|
-
component: WrapperLineChart
|
|
42
|
+
component: WrapperLineChart,
|
|
43
|
+
tags: ['autodocs']
|
|
43
44
|
};
|
|
44
45
|
export default meta;
|
|
45
46
|
|
|
@@ -24,21 +24,7 @@ export const success: Story = {
|
|
|
24
24
|
critical: 'Critical',
|
|
25
25
|
warning: 'Warning'
|
|
26
26
|
},
|
|
27
|
-
thresholds:
|
|
28
|
-
critical: [
|
|
29
|
-
{
|
|
30
|
-
label: 'Critical',
|
|
31
|
-
value: 1.5
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
enabled: true,
|
|
35
|
-
warning: [
|
|
36
|
-
{
|
|
37
|
-
label: 'Warning',
|
|
38
|
-
value: 0.5
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
27
|
+
thresholds: [0.5, 1.5]
|
|
42
28
|
},
|
|
43
29
|
render: Template
|
|
44
30
|
};
|
|
@@ -50,21 +36,7 @@ export const warning: Story = {
|
|
|
50
36
|
critical: 'Critical',
|
|
51
37
|
warning: 'Warning'
|
|
52
38
|
},
|
|
53
|
-
thresholds:
|
|
54
|
-
critical: [
|
|
55
|
-
{
|
|
56
|
-
label: 'Critical',
|
|
57
|
-
value: 1.5
|
|
58
|
-
}
|
|
59
|
-
],
|
|
60
|
-
enabled: true,
|
|
61
|
-
warning: [
|
|
62
|
-
{
|
|
63
|
-
label: 'Warning',
|
|
64
|
-
value: 0.4
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
}
|
|
39
|
+
thresholds: [0.2, 0.5]
|
|
68
40
|
},
|
|
69
41
|
render: Template
|
|
70
42
|
};
|
|
@@ -76,21 +48,7 @@ export const critical: Story = {
|
|
|
76
48
|
critical: 'Critical',
|
|
77
49
|
warning: 'Warning'
|
|
78
50
|
},
|
|
79
|
-
thresholds:
|
|
80
|
-
critical: [
|
|
81
|
-
{
|
|
82
|
-
label: 'Critical',
|
|
83
|
-
value: 0.3
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
enabled: true,
|
|
87
|
-
warning: [
|
|
88
|
-
{
|
|
89
|
-
label: 'Warning',
|
|
90
|
-
value: 0.2
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
}
|
|
51
|
+
thresholds: [0.13, 0.35]
|
|
94
52
|
},
|
|
95
53
|
render: Template
|
|
96
54
|
};
|
|
@@ -103,21 +61,7 @@ export const rawValue: Story = {
|
|
|
103
61
|
critical: 'Critical',
|
|
104
62
|
warning: 'Warning'
|
|
105
63
|
},
|
|
106
|
-
thresholds:
|
|
107
|
-
critical: [
|
|
108
|
-
{
|
|
109
|
-
label: 'Critical',
|
|
110
|
-
value: 1.5
|
|
111
|
-
}
|
|
112
|
-
],
|
|
113
|
-
enabled: true,
|
|
114
|
-
warning: [
|
|
115
|
-
{
|
|
116
|
-
label: 'Warning',
|
|
117
|
-
value: 0.5
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
}
|
|
64
|
+
thresholds: [0.5, 1.5]
|
|
121
65
|
},
|
|
122
66
|
render: Template
|
|
123
67
|
};
|
|
@@ -179,7 +179,7 @@ const getMetricValuesForUnit = ({
|
|
|
179
179
|
) as Array<number>;
|
|
180
180
|
|
|
181
181
|
return pipe(
|
|
182
|
-
filter(propEq(unit,
|
|
182
|
+
filter(propEq('unit', unit)) as (line) => Array<Line>,
|
|
183
183
|
map(prop('metric_id')),
|
|
184
184
|
map(getTimeSeriesValuesForMetric),
|
|
185
185
|
flatten,
|
|
@@ -203,7 +203,7 @@ const getLineForMetric = ({
|
|
|
203
203
|
lines,
|
|
204
204
|
metric_id
|
|
205
205
|
}: LineForMetricProps): Line | undefined =>
|
|
206
|
-
find(propEq(metric_id,
|
|
206
|
+
find(propEq('metric_id', metric_id), lines);
|
|
207
207
|
|
|
208
208
|
interface LinesTimeSeries {
|
|
209
209
|
lines: Array<Line>;
|
|
@@ -275,7 +275,7 @@ interface HasStackedLines {
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
const hasUnitStackedLines = ({ lines, unit }: HasStackedLines): boolean =>
|
|
278
|
-
pipe(getSortedStackedLines, any(propEq(unit,
|
|
278
|
+
pipe(getSortedStackedLines, any(propEq('unit', unit)))(lines);
|
|
279
279
|
|
|
280
280
|
const getTimeSeriesForLines = ({
|
|
281
281
|
lines,
|
|
@@ -280,16 +280,13 @@ const ConnectedAutocompleteField = (
|
|
|
280
280
|
}
|
|
281
281
|
}, [optionsOpen]);
|
|
282
282
|
|
|
283
|
-
useEffect(
|
|
284
|
-
(
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
},
|
|
291
|
-
useDeepCompare([searchConditions])
|
|
292
|
-
);
|
|
283
|
+
useEffect(() => {
|
|
284
|
+
setSearchParameter(
|
|
285
|
+
!isEmpty(searchConditions)
|
|
286
|
+
? { conditions: searchConditions }
|
|
287
|
+
: undefined
|
|
288
|
+
);
|
|
289
|
+
}, useDeepCompare([searchConditions]));
|
|
293
290
|
|
|
294
291
|
useEffect(() => {
|
|
295
292
|
if (!autocompleteChangedValue && !props?.value) {
|
|
@@ -49,7 +49,7 @@ const SortableListContent = ({
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const itemIndex = findIndex(propEq(id,
|
|
52
|
+
const itemIndex = findIndex(propEq('id', id), items);
|
|
53
53
|
|
|
54
54
|
itemHover?.(null);
|
|
55
55
|
itemClick?.({ index: itemIndex, item: { createOption, id, name } });
|
|
@@ -77,7 +77,7 @@ const DraggableAutocomplete = (
|
|
|
77
77
|
const deleteValue = (id): void => {
|
|
78
78
|
itemHover?.(null);
|
|
79
79
|
setSelectedValues((values: Array<DraggableSelectEntry>) => {
|
|
80
|
-
const index = findIndex(propEq(id,
|
|
80
|
+
const index = findIndex(propEq('id', id), values);
|
|
81
81
|
|
|
82
82
|
const newSelectedValues = remove(index, 1, values);
|
|
83
83
|
|
|
@@ -73,14 +73,14 @@ const IconPopoverMultiAutocomplete = ({
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const isSelected = (id: number | string): boolean => {
|
|
76
|
-
return pipe(find(propEq(id,
|
|
76
|
+
return pipe(find(propEq('id', id)), Boolean)(value);
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
const unSelect = (option: SelectEntry): void => {
|
|
80
80
|
const { id } = option;
|
|
81
81
|
|
|
82
82
|
const updatedValue = isSelected(id)
|
|
83
|
-
? reject(propEq(id,
|
|
83
|
+
? reject(propEq('id', id), value)
|
|
84
84
|
: [...value, option];
|
|
85
85
|
|
|
86
86
|
onChange(updatedValue);
|
|
@@ -69,7 +69,7 @@ const SelectField = ({
|
|
|
69
69
|
const { classes, cx } = useStyles();
|
|
70
70
|
|
|
71
71
|
const getOption = (id): SelectEntry => {
|
|
72
|
-
return options.find(propEq(id,
|
|
72
|
+
return options.find(propEq('id', id)) as SelectEntry;
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const changeOption = (event): void => {
|
|
@@ -366,16 +366,6 @@ const columnsWithSubItems = [
|
|
|
366
366
|
}
|
|
367
367
|
];
|
|
368
368
|
|
|
369
|
-
const TemplateSubItems = (args): JSX.Element => {
|
|
370
|
-
const { classes } = useStyles();
|
|
371
|
-
|
|
372
|
-
return (
|
|
373
|
-
<div className={classes.listing}>
|
|
374
|
-
<Listing {...args} />
|
|
375
|
-
</div>
|
|
376
|
-
);
|
|
377
|
-
};
|
|
378
|
-
|
|
379
369
|
export const ListingWithSubItems = {
|
|
380
370
|
args: {
|
|
381
371
|
checkable: true,
|
|
@@ -392,6 +382,5 @@ export const ListingWithSubItems = {
|
|
|
392
382
|
rowProperty: 'subItems'
|
|
393
383
|
},
|
|
394
384
|
totalRows: 10
|
|
395
|
-
}
|
|
396
|
-
render: TemplateSubItems
|
|
385
|
+
}
|
|
397
386
|
};
|