@centreon/ui 23.10.58 → 23.10.60
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 +1 -1
- package/src/InputField/Select/Autocomplete/Connected/Multi/MultiConnectedAutocompleteField.cypress.spec.tsx +4 -6
- package/src/Listing/Listing.cypress.spec.tsx +2 -2
- package/src/RichTextEditor/ContentEditable.tsx +7 -1
- package/src/RichTextEditor/RichTextEditor.tsx +6 -3
- package/src/TimePeriods/ResolutionTimePeriod.cypress.spec.tsx +1 -1
- package/src/TimePeriods/TimePeriods.cypress.spec.tsx +1 -1
- package/src/utils/useLicenseExpirationWarning.cypress.spec.tsx +1 -1
package/package.json
CHANGED
|
@@ -73,15 +73,13 @@ describe('Multi connected autocomplete', () => {
|
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
cy.
|
|
77
|
-
'displays the list when the user clicks on the input'
|
|
78
|
-
);
|
|
76
|
+
cy.makeSnapshot('displays the list when the user clicks on the input');
|
|
79
77
|
|
|
80
78
|
cy.get('@input').click();
|
|
81
79
|
|
|
82
80
|
cy.get('@listOptions').should('not.exist');
|
|
83
81
|
|
|
84
|
-
cy.
|
|
82
|
+
cy.makeSnapshot('hides the list when the user clicks on the input');
|
|
85
83
|
});
|
|
86
84
|
|
|
87
85
|
it('displays exactly one option on the list when the user types that option', () => {
|
|
@@ -109,7 +107,7 @@ describe('Multi connected autocomplete', () => {
|
|
|
109
107
|
cy.contains(optionOne).should('be.visible');
|
|
110
108
|
});
|
|
111
109
|
|
|
112
|
-
cy.
|
|
110
|
+
cy.makeSnapshot();
|
|
113
111
|
});
|
|
114
112
|
|
|
115
113
|
it('displays all options on the list when the user searches for and selects an option', () => {
|
|
@@ -156,6 +154,6 @@ describe('Multi connected autocomplete', () => {
|
|
|
156
154
|
});
|
|
157
155
|
});
|
|
158
156
|
|
|
159
|
-
cy.
|
|
157
|
+
cy.makeSnapshot();
|
|
160
158
|
});
|
|
161
159
|
});
|
|
@@ -105,7 +105,7 @@ describe('Listing', () => {
|
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
cy.
|
|
108
|
+
cy.makeSnapshot();
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
it('collapses the row when the corresponding icon si clicked', () => {
|
|
@@ -115,6 +115,6 @@ describe('Listing', () => {
|
|
|
115
115
|
|
|
116
116
|
cy.contains('Sub item 100').should('not.exist');
|
|
117
117
|
|
|
118
|
-
cy.
|
|
118
|
+
cy.makeSnapshot();
|
|
119
119
|
});
|
|
120
120
|
});
|
|
@@ -53,6 +53,7 @@ interface Props {
|
|
|
53
53
|
error?: string;
|
|
54
54
|
hasInitialTextContent?: boolean;
|
|
55
55
|
initialEditorState?: string;
|
|
56
|
+
initialize?: (editor) => void;
|
|
56
57
|
inputClassname?: string;
|
|
57
58
|
minInputHeight: number;
|
|
58
59
|
namespace: string;
|
|
@@ -77,7 +78,8 @@ const ContentEditable = ({
|
|
|
77
78
|
error,
|
|
78
79
|
onBlur,
|
|
79
80
|
className,
|
|
80
|
-
disabled
|
|
81
|
+
disabled,
|
|
82
|
+
initialize
|
|
81
83
|
}: Props): JSX.Element => {
|
|
82
84
|
const { classes, cx } = useStyles({ editable, error, minInputHeight });
|
|
83
85
|
const { t } = useTranslation();
|
|
@@ -147,6 +149,10 @@ const ContentEditable = ({
|
|
|
147
149
|
editor.setEditable(!disabled);
|
|
148
150
|
}, [disabled]);
|
|
149
151
|
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
initialize?.(editor);
|
|
154
|
+
}, []);
|
|
155
|
+
|
|
150
156
|
return (
|
|
151
157
|
<div
|
|
152
158
|
className={cx(
|
|
@@ -7,7 +7,7 @@ import { HeadingNode } from '@lexical/rich-text';
|
|
|
7
7
|
import { ListItemNode, ListNode } from '@lexical/list';
|
|
8
8
|
import anylogger from 'anylogger';
|
|
9
9
|
import { makeStyles } from 'tss-react/mui';
|
|
10
|
-
import { EditorState } from 'lexical';
|
|
10
|
+
import { EditorState, LexicalEditor } from 'lexical';
|
|
11
11
|
import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';
|
|
12
12
|
import { equals } from 'ramda';
|
|
13
13
|
import { ListPlugin } from '@lexical/react/LexicalListPlugin';
|
|
@@ -27,8 +27,9 @@ export interface RichTextEditorProps {
|
|
|
27
27
|
editable: boolean;
|
|
28
28
|
editorState?: string;
|
|
29
29
|
error?: string;
|
|
30
|
-
getEditorState?: (editorState: EditorState) => void;
|
|
30
|
+
getEditorState?: (editorState: EditorState, editor: LexicalEditor) => void;
|
|
31
31
|
initialEditorState?: string;
|
|
32
|
+
initialize?: (editor) => void;
|
|
32
33
|
inputClassname?: string;
|
|
33
34
|
minInputHeight?: number;
|
|
34
35
|
namespace?: string;
|
|
@@ -132,7 +133,8 @@ const RichTextEditor = ({
|
|
|
132
133
|
contentClassName,
|
|
133
134
|
displayMacrosButton = false,
|
|
134
135
|
disabled,
|
|
135
|
-
openLinkInNewTab = true
|
|
136
|
+
openLinkInNewTab = true,
|
|
137
|
+
initialize
|
|
136
138
|
}: RichTextEditorProps): JSX.Element => {
|
|
137
139
|
const { classes } = useStyles({ toolbarPositions });
|
|
138
140
|
|
|
@@ -188,6 +190,7 @@ const RichTextEditor = ({
|
|
|
188
190
|
error={error}
|
|
189
191
|
hasInitialTextContent={hasInitialTextContent}
|
|
190
192
|
initialEditorState={initialEditorState}
|
|
193
|
+
initialize={initialize}
|
|
191
194
|
inputClassname={inputClassname}
|
|
192
195
|
minInputHeight={minInputHeight}
|
|
193
196
|
namespace={namespace}
|