@gridsuite/commons-ui 0.63.4 → 0.63.5
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/dist/_mocks_/svg.js +1 -3
- package/dist/assets/expert-filter-form.css +18 -8
- package/dist/components/AuthenticationRouter/AuthenticationRouter.js +88 -97
- package/dist/components/CardErrorBoundary/card-error-boundary.js +6 -20
- package/dist/components/CustomAGGrid/custom-aggrid.js +47 -49
- package/dist/components/DirectoryItemSelector/directory-item-selector.js +10 -40
- package/dist/components/ElementSearchDialog/element-search-dialog.js +1 -17
- package/dist/components/ElementSearchDialog/equipment-item.js +29 -47
- package/dist/components/ElementSearchDialog/tag-renderer.js +2 -8
- package/dist/components/ElementSearchDialog/use-element-search.js +1 -4
- package/dist/components/FlatParameters/FlatParameters.js +13 -77
- package/dist/components/Login/Login.js +9 -34
- package/dist/components/Login/Logout.js +3 -26
- package/dist/components/MuiVirtualizedTable/ColumnHeader.js +35 -64
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +4 -17
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +1 -1
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +19 -95
- package/dist/components/MuiVirtualizedTable/index.d.ts +1 -1
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +2 -6
- package/dist/components/OverflowableText/overflowable-text.js +3 -10
- package/dist/components/ReportViewer/filter-button.d.ts +1 -1
- package/dist/components/ReportViewer/filter-button.js +2 -7
- package/dist/components/ReportViewer/log-report-item.js +7 -17
- package/dist/components/ReportViewer/log-report.js +4 -13
- package/dist/components/ReportViewer/log-table.d.ts +1 -1
- package/dist/components/ReportViewer/log-table.js +3 -16
- package/dist/components/ReportViewer/multi-select-list.d.ts +1 -1
- package/dist/components/ReportViewer/multi-select-list.js +2 -14
- package/dist/components/ReportViewer/report-item.js +4 -10
- package/dist/components/ReportViewer/report-viewer.d.ts +1 -1
- package/dist/components/ReportViewer/report-viewer.js +2 -7
- package/dist/components/ReportViewerDialog/report-viewer-dialog.js +1 -13
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +1 -1
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +1 -4
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +1 -1
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +1 -4
- package/dist/components/SnackbarProvider/SnackbarProvider.js +4 -11
- package/dist/components/TopBar/AboutDialog.js +51 -152
- package/dist/components/TopBar/GridLogo.d.ts +2 -2
- package/dist/components/TopBar/GridLogo.js +8 -41
- package/dist/components/TopBar/TopBar.js +197 -328
- package/dist/components/TreeViewFinder/TreeViewFinder.js +23 -66
- package/dist/components/TreeViewFinder/index.d.ts +2 -2
- package/dist/components/dialogs/custom-mui-dialog.d.ts +2 -1
- package/dist/components/dialogs/custom-mui-dialog.js +64 -39
- package/dist/components/dialogs/modify-element-selection.js +1 -3
- package/dist/components/dialogs/popup-confirmation-dialog.d.ts +1 -1
- package/dist/components/dialogs/popup-confirmation-dialog.js +8 -15
- package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +3 -18
- package/dist/components/filter/criteria-based/criteria-based-filter-utils.js +3 -9
- package/dist/components/filter/criteria-based/criteria-based-form.d.ts +1 -1
- package/dist/components/filter/criteria-based/criteria-based-form.js +7 -15
- package/dist/components/filter/criteria-based/filter-free-properties.d.ts +1 -1
- package/dist/components/filter/criteria-based/filter-free-properties.js +1 -4
- package/dist/components/filter/criteria-based/filter-properties.js +16 -24
- package/dist/components/filter/criteria-based/filter-property.js +1 -4
- package/dist/components/filter/expert/expert-filter-constants.d.ts +10 -3
- package/dist/components/filter/expert/expert-filter-constants.js +16 -12
- package/dist/components/filter/expert/expert-filter-edition-dialog.js +3 -18
- package/dist/components/filter/expert/expert-filter-form.js +1 -7
- package/dist/components/filter/expert/expert-filter-utils.js +10 -30
- package/dist/components/filter/expert/expert-filter.type.d.ts +3 -1
- package/dist/components/filter/expert/expert-filter.type.js +2 -0
- package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +2 -15
- package/dist/components/filter/explicit-naming/explicit-naming-filter-form.d.ts +1 -1
- package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +10 -35
- package/dist/components/filter/filter-creation-dialog.js +5 -10
- package/dist/components/filter/filter-form.js +1 -6
- package/dist/components/filter/utils/filter-api.js +1 -7
- package/dist/components/inputs/react-hook-form/ExpandingTextField.js +1 -9
- package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.js +14 -52
- package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js +14 -62
- package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js +29 -40
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.js +2 -8
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js +1 -3
- package/dist/components/inputs/react-hook-form/booleans/boolean-input.js +1 -7
- package/dist/components/inputs/react-hook-form/booleans/checkbox-input.js +1 -9
- package/dist/components/inputs/react-hook-form/booleans/switch-input.js +1 -9
- package/dist/components/inputs/react-hook-form/directory-items-input.js +5 -29
- package/dist/components/inputs/react-hook-form/error-management/error-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/provider/custom-form-provider.js +1 -7
- package/dist/components/inputs/react-hook-form/radio-input.js +8 -18
- package/dist/components/inputs/react-hook-form/range-input.js +1 -4
- package/dist/components/inputs/react-hook-form/select-inputs/countries-input.js +1 -9
- package/dist/components/inputs/react-hook-form/select-inputs/mui-select-input.js +2 -13
- package/dist/components/inputs/react-hook-form/select-inputs/select-input.js +2 -6
- package/dist/components/inputs/react-hook-form/slider-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/slider-input.js +2 -19
- package/dist/components/inputs/react-hook-form/unique-name-input.js +1 -9
- package/dist/components/inputs/react-hook-form/utils/field-label.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/utils/field-label.js +1 -5
- package/dist/components/inputs/react-hook-form/utils/submit-button.js +1 -8
- package/dist/components/inputs/react-hook-form/utils/text-field-with-adornment.js +18 -47
- package/dist/components/inputs/react-query-builder/add-button.js +1 -10
- package/dist/components/inputs/react-query-builder/autocomplete-with-favorites.d.ts +12 -0
- package/dist/components/inputs/react-query-builder/autocomplete-with-favorites.js +43 -0
- package/dist/components/inputs/react-query-builder/composite-rule-editor/group-value-editor.js +14 -27
- package/dist/components/inputs/react-query-builder/composite-rule-editor/rule-value-editor.js +1 -3
- package/dist/components/inputs/react-query-builder/country-value-editor.js +27 -28
- package/dist/components/inputs/react-query-builder/custom-react-query-builder.js +25 -31
- package/dist/components/inputs/react-query-builder/element-value-editor.js +1 -10
- package/dist/components/inputs/react-query-builder/property-value-editor.js +6 -11
- package/dist/components/inputs/react-query-builder/remove-button.js +1 -9
- package/dist/components/inputs/react-query-builder/text-value-editor.js +2 -1
- package/dist/components/inputs/react-query-builder/translated-value-editor.js +3 -4
- package/dist/components/inputs/react-query-builder/use-convert-value.d.ts +1 -1
- package/dist/components/inputs/react-query-builder/use-convert-value.js +1 -6
- package/dist/components/inputs/react-query-builder/value-editor.js +4 -20
- package/dist/components/translations/filter-expert-en.d.ts +2 -0
- package/dist/components/translations/filter-expert-en.js +3 -1
- package/dist/components/translations/filter-expert-fr.d.ts +2 -0
- package/dist/components/translations/filter-expert-fr.js +3 -1
- package/dist/hooks/localized-countries-hook.js +1 -3
- package/dist/hooks/useConfidentialityWarning.d.ts +8 -0
- package/dist/hooks/useConfidentialityWarning.js +14 -0
- package/dist/hooks/useDebounce.js +1 -4
- package/dist/hooks/useSnackMessage.js +3 -12
- package/dist/index.d.ts +10 -9
- package/dist/index.js +77 -73
- package/dist/services/apps-metadata.d.ts +7 -0
- package/dist/services/apps-metadata.js +13 -0
- package/dist/services/directory.js +3 -11
- package/dist/services/explore.js +2 -8
- package/dist/services/index.js +3 -1
- package/dist/services/utils.js +4 -12
- package/dist/utils/AuthService.js +8 -29
- package/dist/utils/UserManagerMock.js +6 -23
- package/dist/utils/styles.js +1 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -74,74 +74,75 @@ import { default as default53 } from "./hooks/useIntlRef.js";
|
|
|
74
74
|
import { useSnackMessage } from "./hooks/useSnackMessage.js";
|
|
75
75
|
import { default as default54 } from "./hooks/useDebounce.js";
|
|
76
76
|
import { usePrevious } from "./hooks/usePrevious.js";
|
|
77
|
-
import { default as default55 } from "./
|
|
78
|
-
import { default as default56 } from "./components/inputs/
|
|
79
|
-
import { default as default57 } from "./components/inputs/react-hook-form/provider/custom-form-
|
|
80
|
-
import { default as default58 } from "./components/inputs/react-hook-form/
|
|
81
|
-
import { default as default59 } from "./components/inputs/react-hook-form/
|
|
82
|
-
import { default as default60 } from "./components/inputs/react-hook-form/
|
|
83
|
-
import { default as default61 } from "./components/inputs/react-hook-form/
|
|
84
|
-
import { default as default62 } from "./components/inputs/react-hook-form/
|
|
85
|
-
import { default as default63 } from "./components/inputs/react-hook-form/
|
|
86
|
-
import { default as default64 } from "./components/inputs/react-hook-form/numbers/
|
|
87
|
-
import { default as default65 } from "./components/inputs/react-hook-form/
|
|
88
|
-
import { default as default66 } from "./components/inputs/react-hook-form/
|
|
89
|
-
import { default as default67 } from "./components/inputs/react-hook-form/booleans/
|
|
90
|
-
import { default as default68 } from "./components/inputs/react-hook-form/
|
|
91
|
-
import { default as default69 } from "./components/inputs/react-hook-form/error-management/
|
|
92
|
-
import { default as default70 } from "./components/inputs/react-hook-form/error-management/
|
|
93
|
-
import { default as default71 } from "./components/inputs/react-hook-form/
|
|
94
|
-
import { default as default72 } from "./components/inputs/react-hook-form/utils/field-
|
|
95
|
-
import { default as default73 } from "./components/inputs/react-hook-form/utils/
|
|
96
|
-
import { default as default74 } from "./components/inputs/react-hook-form/utils/
|
|
77
|
+
import { default as default55 } from "./hooks/useConfidentialityWarning.js";
|
|
78
|
+
import { default as default56 } from "./components/inputs/select-clearable.js";
|
|
79
|
+
import { default as default57 } from "./components/inputs/react-hook-form/provider/use-custom-form-context.js";
|
|
80
|
+
import { default as default58 } from "./components/inputs/react-hook-form/provider/custom-form-provider.js";
|
|
81
|
+
import { default as default59 } from "./components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.js";
|
|
82
|
+
import { default as default60 } from "./components/inputs/react-hook-form/text-input.js";
|
|
83
|
+
import { default as default61 } from "./components/inputs/react-hook-form/ExpandingTextField.js";
|
|
84
|
+
import { default as default62 } from "./components/inputs/react-hook-form/radio-input.js";
|
|
85
|
+
import { default as default63 } from "./components/inputs/react-hook-form/slider-input.js";
|
|
86
|
+
import { default as default64 } from "./components/inputs/react-hook-form/numbers/float-input.js";
|
|
87
|
+
import { default as default65 } from "./components/inputs/react-hook-form/numbers/integer-input.js";
|
|
88
|
+
import { default as default66 } from "./components/inputs/react-hook-form/select-inputs/select-input.js";
|
|
89
|
+
import { default as default67 } from "./components/inputs/react-hook-form/booleans/checkbox-input.js";
|
|
90
|
+
import { default as default68 } from "./components/inputs/react-hook-form/booleans/switch-input.js";
|
|
91
|
+
import { default as default69 } from "./components/inputs/react-hook-form/error-management/error-input.js";
|
|
92
|
+
import { default as default70 } from "./components/inputs/react-hook-form/error-management/field-error-alert.js";
|
|
93
|
+
import { default as default71 } from "./components/inputs/react-hook-form/error-management/mid-form-error.js";
|
|
94
|
+
import { default as default72 } from "./components/inputs/react-hook-form/utils/text-field-with-adornment.js";
|
|
95
|
+
import { default as default73 } from "./components/inputs/react-hook-form/utils/field-label.js";
|
|
96
|
+
import { default as default74 } from "./components/inputs/react-hook-form/utils/submit-button.js";
|
|
97
|
+
import { default as default75 } from "./components/inputs/react-hook-form/utils/cancel-button.js";
|
|
97
98
|
import { genHelperError, genHelperPreviousValue, gridItem, identity, isFieldRequired, isFloatNumber, toFloatOrNullValue } from "./components/inputs/react-hook-form/utils/functions.js";
|
|
98
99
|
import { areArrayElementsUnique, isObjectEmpty, keyGenerator } from "./utils/functions.js";
|
|
99
|
-
import { default as
|
|
100
|
-
import { default as
|
|
101
|
-
import { default as
|
|
102
|
-
import { default as
|
|
103
|
-
import { default as
|
|
104
|
-
import { default as
|
|
105
|
-
import { default as
|
|
106
|
-
import { default as
|
|
100
|
+
import { default as default76 } from "./components/inputs/react-hook-form/directory-items-input.js";
|
|
101
|
+
import { default as default77 } from "./components/DirectoryItemSelector/directory-item-selector.js";
|
|
102
|
+
import { default as default78 } from "./components/CustomAGGrid/custom-aggrid.js";
|
|
103
|
+
import { default as default79 } from "./components/inputs/react-hook-form/raw-read-only-input.js";
|
|
104
|
+
import { default as default80 } from "./components/filter/filter-creation-dialog.js";
|
|
105
|
+
import { default as default81 } from "./components/filter/expert/expert-filter-edition-dialog.js";
|
|
106
|
+
import { default as default82 } from "./components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js";
|
|
107
|
+
import { default as default83 } from "./components/filter/criteria-based/criteria-based-filter-edition-dialog.js";
|
|
107
108
|
import { saveCriteriaBasedFilter, saveExpertFilter, saveExplicitNamingFilter } from "./components/filter/utils/filter-api.js";
|
|
108
|
-
import { DEFAULT_RANGE_VALUE, default as
|
|
109
|
-
import { default as
|
|
110
|
-
import { default as
|
|
111
|
-
import { default as
|
|
109
|
+
import { DEFAULT_RANGE_VALUE, default as default84, getRangeInputDataForm, getRangeInputSchema } from "./components/inputs/react-hook-form/range-input.js";
|
|
110
|
+
import { default as default85 } from "./components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js";
|
|
111
|
+
import { default as default86 } from "./components/inputs/react-hook-form/select-inputs/mui-select-input.js";
|
|
112
|
+
import { default as default87 } from "./components/inputs/react-hook-form/select-inputs/countries-input.js";
|
|
112
113
|
import { getComputedLanguage, getSystemLanguage, useLocalizedCountries } from "./hooks/localized-countries-hook.js";
|
|
113
|
-
import { default as
|
|
114
|
-
import { default as
|
|
115
|
-
import { default as
|
|
116
|
-
import { default as
|
|
114
|
+
import { default as default88 } from "./components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js";
|
|
115
|
+
import { default as default89 } from "./components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js";
|
|
116
|
+
import { default as default90 } from "./components/inputs/react-hook-form/unique-name-input.js";
|
|
117
|
+
import { default as default91 } from "./utils/UserManagerMock.js";
|
|
117
118
|
import { CONTINGENCY_LIST_EQUIPMENTS, FILTER_EQUIPMENTS } from "./components/filter/utils/filter-form-utils.js";
|
|
118
119
|
import { getCriteriaBasedFormData, getCriteriaBasedSchema } from "./components/filter/criteria-based/criteria-based-filter-utils.js";
|
|
119
120
|
import { setCommonStore } from "./redux/commonStore.js";
|
|
120
121
|
import { backendFetch, backendFetchJson, getRequestParamFromList } from "./services/utils.js";
|
|
121
122
|
import { createFilter, fetchElementsInfos, saveFilter } from "./services/explore.js";
|
|
122
|
-
import { fetchAppsMetadata, fetchEnv, fetchStudyMetadata } from "./services/apps-metadata.js";
|
|
123
|
+
import { fetchAppsMetadata, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefaultCountries, fetchStudyMetadata } from "./services/apps-metadata.js";
|
|
123
124
|
import { fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders } from "./services/directory.js";
|
|
124
125
|
import { exportFilter } from "./services/study.js";
|
|
125
126
|
import * as yup from "yup";
|
|
126
127
|
export {
|
|
127
128
|
default4 as AboutDialog,
|
|
128
129
|
default6 as AuthenticationRouter,
|
|
129
|
-
|
|
130
|
+
default59 as AutocompleteInput,
|
|
130
131
|
Battery,
|
|
131
132
|
default19 as BottomRightButtons,
|
|
132
133
|
BusBar,
|
|
133
134
|
CONTINGENCY_LIST_EQUIPMENTS,
|
|
134
|
-
|
|
135
|
+
default75 as CancelButton,
|
|
135
136
|
default52 as CardErrorBoundary,
|
|
136
137
|
ChangeWays,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
default67 as CheckboxInput,
|
|
139
|
+
default87 as CountriesInput,
|
|
140
|
+
default83 as CriteriaBasedFilterEditionDialog,
|
|
140
141
|
default17 as CriteriaBasedForm,
|
|
141
|
-
|
|
142
|
-
|
|
142
|
+
default89 as CsvUploader,
|
|
143
|
+
default78 as CustomAGGrid,
|
|
143
144
|
default20 as CustomAgGridTable,
|
|
144
|
-
|
|
145
|
+
default58 as CustomFormProvider,
|
|
145
146
|
default14 as CustomMuiDialog,
|
|
146
147
|
default22 as CustomReactQueryBuilder,
|
|
147
148
|
DARK_THEME,
|
|
@@ -151,8 +152,8 @@ export {
|
|
|
151
152
|
DEFAULT_ROW_HEIGHT,
|
|
152
153
|
DanglingLine,
|
|
153
154
|
default15 as DescriptionModificationDialog,
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
default77 as DirectoryItemSelector,
|
|
156
|
+
default76 as DirectoryItemsInput,
|
|
156
157
|
EQUIPMENT_TYPE,
|
|
157
158
|
fields as EXPERT_FILTER_FIELDS,
|
|
158
159
|
EXPERT_FILTER_QUERY,
|
|
@@ -161,23 +162,23 @@ export {
|
|
|
161
162
|
ElementType,
|
|
162
163
|
EquipmentItem,
|
|
163
164
|
EquipmentType,
|
|
164
|
-
|
|
165
|
+
default69 as ErrorInput,
|
|
165
166
|
default12 as ExpandableGroup,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
default61 as ExpandingTextField,
|
|
168
|
+
default81 as ExpertFilterEditionDialog,
|
|
169
|
+
default82 as ExplicitNamingFilterEditionDialog,
|
|
169
170
|
FILTER_EQUIPMENTS,
|
|
170
171
|
default21 as FieldConstants,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
default70 as FieldErrorAlert,
|
|
173
|
+
default73 as FieldLabel,
|
|
174
|
+
default80 as FilterCreationDialog,
|
|
174
175
|
FlatParameters,
|
|
175
|
-
|
|
176
|
+
default64 as FloatInput,
|
|
176
177
|
GRIDSUITE_DEFAULT_PRECISION,
|
|
177
178
|
Generator,
|
|
178
179
|
Hvdc,
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
default85 as InputWithPopupConfirmation,
|
|
181
|
+
default65 as IntegerInput,
|
|
181
182
|
KeyedColumnsRowIndexer,
|
|
182
183
|
LANG_ENGLISH,
|
|
183
184
|
LANG_FRENCH,
|
|
@@ -187,35 +188,35 @@ export {
|
|
|
187
188
|
LOGOUT_ERROR,
|
|
188
189
|
Line,
|
|
189
190
|
Load,
|
|
190
|
-
|
|
191
|
+
default71 as MidFormError,
|
|
191
192
|
default16 as ModifyElementSelection,
|
|
192
|
-
|
|
193
|
+
default86 as MuiSelectInput,
|
|
193
194
|
default7 as MuiVirtualizedTable,
|
|
194
|
-
|
|
195
|
+
default88 as MultipleAutocompleteInput,
|
|
195
196
|
default13 as MultipleSelectionDialog,
|
|
196
197
|
OverflowableText,
|
|
197
198
|
default18 as PopupConfirmationDialog,
|
|
198
199
|
RESET_AUTHENTICATION_ROUTER_ERROR,
|
|
199
200
|
ROW_DRAGGING_SELECTION_COLUMN_DEF,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
default62 as RadioInput,
|
|
202
|
+
default84 as RangeInput,
|
|
203
|
+
default79 as RawReadOnlyInput,
|
|
203
204
|
default8 as ReportViewer,
|
|
204
205
|
default9 as ReportViewerDialog,
|
|
205
206
|
SHOW_AUTH_INFO_LOGIN,
|
|
206
207
|
SIGNIN_CALLBACK_ERROR,
|
|
207
208
|
SVC,
|
|
208
|
-
|
|
209
|
-
|
|
209
|
+
default56 as SelectClearable,
|
|
210
|
+
default66 as SelectInput,
|
|
210
211
|
ShuntCompensator,
|
|
211
|
-
|
|
212
|
+
default63 as SliderInput,
|
|
212
213
|
default5 as SnackbarProvider,
|
|
213
|
-
|
|
214
|
+
default74 as SubmitButton,
|
|
214
215
|
Substation,
|
|
215
|
-
|
|
216
|
+
default68 as SwitchInput,
|
|
216
217
|
default10 as TagRenderer,
|
|
217
|
-
|
|
218
|
-
|
|
218
|
+
default72 as TextFieldWithAdornment,
|
|
219
|
+
default60 as TextInput,
|
|
219
220
|
ThreeWindingTransfo,
|
|
220
221
|
default3 as TopBar,
|
|
221
222
|
default2 as TreeViewFinder,
|
|
@@ -223,8 +224,8 @@ export {
|
|
|
223
224
|
UNAUTHORIZED_USER_INFO,
|
|
224
225
|
USER,
|
|
225
226
|
USER_VALIDATION_ERROR,
|
|
226
|
-
|
|
227
|
-
|
|
227
|
+
default90 as UniqueNameInput,
|
|
228
|
+
default91 as UserManagerMock,
|
|
228
229
|
VSC,
|
|
229
230
|
VoltageLevel,
|
|
230
231
|
areArrayElementsUnique,
|
|
@@ -246,10 +247,12 @@ export {
|
|
|
246
247
|
exportExpertRules,
|
|
247
248
|
exportFilter,
|
|
248
249
|
fetchAppsMetadata,
|
|
250
|
+
fetchDefaultCountry,
|
|
249
251
|
fetchDirectoryContent,
|
|
250
252
|
fetchDirectoryElementPath,
|
|
251
253
|
fetchElementsInfos,
|
|
252
254
|
fetchEnv,
|
|
255
|
+
fetchFavoriteAndDefaultCountries,
|
|
253
256
|
fetchRootFolders,
|
|
254
257
|
fetchStudyMetadata,
|
|
255
258
|
default38 as filter_en,
|
|
@@ -310,7 +313,8 @@ export {
|
|
|
310
313
|
default32 as treeview_finder_en,
|
|
311
314
|
default33 as treeview_finder_fr,
|
|
312
315
|
unitToMicroUnit,
|
|
313
|
-
|
|
316
|
+
default55 as useConfidentialityWarning,
|
|
317
|
+
default57 as useCustomFormContext,
|
|
314
318
|
default54 as useDebounce,
|
|
315
319
|
default11 as useElementSearch,
|
|
316
320
|
default53 as useIntlRef,
|
|
@@ -4,6 +4,7 @@ export type Url = string | URL;
|
|
|
4
4
|
export type Env = {
|
|
5
5
|
appsMetadataServerUrl?: Url;
|
|
6
6
|
mapBoxToken?: string;
|
|
7
|
+
confidentialityMessageKey?: string;
|
|
7
8
|
};
|
|
8
9
|
export declare function fetchEnv(): Promise<Env>;
|
|
9
10
|
export type CommonMetadata = {
|
|
@@ -27,6 +28,12 @@ export type StudyMetadata = CommonMetadata & {
|
|
|
27
28
|
mapManualRefresh?: string;
|
|
28
29
|
};
|
|
29
30
|
defaultCountry?: string;
|
|
31
|
+
favoriteCountries?: string[];
|
|
30
32
|
};
|
|
31
33
|
export declare function fetchAppsMetadata(): Promise<CommonMetadata[]>;
|
|
32
34
|
export declare function fetchStudyMetadata(): Promise<StudyMetadata>;
|
|
35
|
+
export declare function fetchFavoriteAndDefaultCountries(): Promise<{
|
|
36
|
+
favoriteCountries: string[];
|
|
37
|
+
defaultCountry?: string;
|
|
38
|
+
}>;
|
|
39
|
+
export declare const fetchDefaultCountry: () => Promise<string | undefined>;
|
|
@@ -19,8 +19,21 @@ async function fetchStudyMetadata() {
|
|
|
19
19
|
return studyMetadata[0];
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
async function fetchFavoriteAndDefaultCountries() {
|
|
23
|
+
const { favoriteCountries = [], defaultCountry } = await fetchStudyMetadata();
|
|
24
|
+
return {
|
|
25
|
+
favoriteCountries,
|
|
26
|
+
defaultCountry
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const fetchDefaultCountry = async () => {
|
|
30
|
+
const studyMetadata = await fetchStudyMetadata();
|
|
31
|
+
return studyMetadata.defaultCountry;
|
|
32
|
+
};
|
|
22
33
|
export {
|
|
23
34
|
fetchAppsMetadata,
|
|
35
|
+
fetchDefaultCountry,
|
|
24
36
|
fetchEnv,
|
|
37
|
+
fetchFavoriteAndDefaultCountries,
|
|
25
38
|
fetchStudyMetadata
|
|
26
39
|
};
|
|
@@ -2,10 +2,7 @@ import { getRequestParamFromList, backendFetchJson } from "./utils.js";
|
|
|
2
2
|
const PREFIX_DIRECTORY_SERVER_QUERIES = `${"api/gateway"}/directory`;
|
|
3
3
|
function fetchRootFolders(types) {
|
|
4
4
|
console.info("Fetching Root Directories");
|
|
5
|
-
const urlSearchParams = getRequestParamFromList(
|
|
6
|
-
"elementTypes",
|
|
7
|
-
types
|
|
8
|
-
).toString();
|
|
5
|
+
const urlSearchParams = getRequestParamFromList("elementTypes", types).toString();
|
|
9
6
|
const fetchRootFoldersUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/root-directories?${urlSearchParams}`;
|
|
10
7
|
return backendFetchJson(fetchRootFoldersUrl, {
|
|
11
8
|
method: "get",
|
|
@@ -14,10 +11,7 @@ function fetchRootFolders(types) {
|
|
|
14
11
|
}
|
|
15
12
|
function fetchDirectoryContent(directoryUuid, types) {
|
|
16
13
|
console.info("Fetching Folder content '%s'", directoryUuid);
|
|
17
|
-
const urlSearchParams = getRequestParamFromList(
|
|
18
|
-
"elementTypes",
|
|
19
|
-
types
|
|
20
|
-
).toString();
|
|
14
|
+
const urlSearchParams = getRequestParamFromList("elementTypes", types).toString();
|
|
21
15
|
const fetchDirectoryContentUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/directories/${directoryUuid}/elements${urlSearchParams ? `?${urlSearchParams}` : ""}`;
|
|
22
16
|
return backendFetchJson(fetchDirectoryContentUrl, {
|
|
23
17
|
method: "get",
|
|
@@ -26,9 +20,7 @@ function fetchDirectoryContent(directoryUuid, types) {
|
|
|
26
20
|
}
|
|
27
21
|
function fetchDirectoryElementPath(elementUuid) {
|
|
28
22
|
console.info(`Fetching element '${elementUuid}' and its parents info ...`);
|
|
29
|
-
const fetchPathUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/elements/${encodeURIComponent(
|
|
30
|
-
elementUuid
|
|
31
|
-
)}/path`;
|
|
23
|
+
const fetchPathUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/elements/${encodeURIComponent(elementUuid)}/path`;
|
|
32
24
|
console.debug(fetchPathUrl);
|
|
33
25
|
return backendFetchJson(fetchPathUrl, {
|
|
34
26
|
method: "get",
|
package/dist/services/explore.js
CHANGED
|
@@ -37,14 +37,8 @@ function fetchElementsInfos(ids, elementTypes, equipmentTypes) {
|
|
|
37
37
|
ids.filter((id) => id)
|
|
38
38
|
// filter falsy elements
|
|
39
39
|
);
|
|
40
|
-
const equipmentTypesParams = getRequestParamFromList(
|
|
41
|
-
|
|
42
|
-
equipmentTypes
|
|
43
|
-
);
|
|
44
|
-
const elementTypesParams = getRequestParamFromList(
|
|
45
|
-
"elementTypes",
|
|
46
|
-
elementTypes
|
|
47
|
-
);
|
|
40
|
+
const equipmentTypesParams = getRequestParamFromList("equipmentTypes", equipmentTypes);
|
|
41
|
+
const elementTypesParams = getRequestParamFromList("elementTypes", elementTypes);
|
|
48
42
|
const urlSearchParams = new URLSearchParams([
|
|
49
43
|
...idsParams,
|
|
50
44
|
...equipmentTypesParams,
|
package/dist/services/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { backendFetch, backendFetchJson, getRequestParamFromList } from "./utils.js";
|
|
2
2
|
import { createFilter, fetchElementsInfos, saveFilter } from "./explore.js";
|
|
3
|
-
import { fetchAppsMetadata, fetchEnv, fetchStudyMetadata } from "./apps-metadata.js";
|
|
3
|
+
import { fetchAppsMetadata, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefaultCountries, fetchStudyMetadata } from "./apps-metadata.js";
|
|
4
4
|
import { fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders } from "./directory.js";
|
|
5
5
|
import { exportFilter } from "./study.js";
|
|
6
6
|
export {
|
|
@@ -9,10 +9,12 @@ export {
|
|
|
9
9
|
createFilter,
|
|
10
10
|
exportFilter,
|
|
11
11
|
fetchAppsMetadata,
|
|
12
|
+
fetchDefaultCountry,
|
|
12
13
|
fetchDirectoryContent,
|
|
13
14
|
fetchDirectoryElementPath,
|
|
14
15
|
fetchElementsInfos,
|
|
15
16
|
fetchEnv,
|
|
17
|
+
fetchFavoriteAndDefaultCountries,
|
|
16
18
|
fetchRootFolders,
|
|
17
19
|
fetchStudyMetadata,
|
|
18
20
|
getRequestParamFromList,
|
package/dist/services/utils.js
CHANGED
|
@@ -8,9 +8,7 @@ const parseError = (text) => {
|
|
|
8
8
|
};
|
|
9
9
|
const prepareRequest = (init, token) => {
|
|
10
10
|
if (!(typeof init === "undefined" || typeof init === "object")) {
|
|
11
|
-
throw new TypeError(
|
|
12
|
-
`First argument of prepareRequest is not an object : ${typeof init}`
|
|
13
|
-
);
|
|
11
|
+
throw new TypeError(`First argument of prepareRequest is not an object : ${typeof init}`);
|
|
14
12
|
}
|
|
15
13
|
const initCopy = { ...init };
|
|
16
14
|
initCopy.headers = new Headers(initCopy.headers || {});
|
|
@@ -29,18 +27,14 @@ const handleError = (response) => {
|
|
|
29
27
|
);
|
|
30
28
|
customError.status = errorJson.status;
|
|
31
29
|
} else {
|
|
32
|
-
customError = new Error(
|
|
33
|
-
`${errorName + response.status} ${response.statusText}, message : ${text}`
|
|
34
|
-
);
|
|
30
|
+
customError = new Error(`${errorName + response.status} ${response.statusText}, message : ${text}`);
|
|
35
31
|
customError.status = response.status;
|
|
36
32
|
}
|
|
37
33
|
throw customError;
|
|
38
34
|
});
|
|
39
35
|
};
|
|
40
36
|
const safeFetch = (url, initCopy) => {
|
|
41
|
-
return fetch(url, initCopy).then(
|
|
42
|
-
(response) => response.ok ? response : handleError(response)
|
|
43
|
-
);
|
|
37
|
+
return fetch(url, initCopy).then((response) => response.ok ? response : handleError(response));
|
|
44
38
|
};
|
|
45
39
|
const backendFetch = (url, init, token) => {
|
|
46
40
|
const initCopy = prepareRequest(init, token);
|
|
@@ -48,9 +42,7 @@ const backendFetch = (url, init, token) => {
|
|
|
48
42
|
};
|
|
49
43
|
const backendFetchJson = (url, init, token) => {
|
|
50
44
|
const initCopy = prepareRequest(init, token);
|
|
51
|
-
return safeFetch(url, initCopy).then(
|
|
52
|
-
(safeResponse) => safeResponse.status === 204 ? null : safeResponse.json()
|
|
53
|
-
);
|
|
45
|
+
return safeFetch(url, initCopy).then((safeResponse) => safeResponse.status === 204 ? null : safeResponse.json());
|
|
54
46
|
};
|
|
55
47
|
const getRequestParamFromList = (paramName, params = []) => {
|
|
56
48
|
return new URLSearchParams(params.map((param) => [paramName, param]));
|
|
@@ -108,25 +108,17 @@ function dispatchUser(dispatch, userManagerInstance, validateUser) {
|
|
|
108
108
|
return userManagerInstance.getUser().then((user) => {
|
|
109
109
|
if (user) {
|
|
110
110
|
if (getIdTokenExpiresIn(user) < 0) {
|
|
111
|
-
console.debug(
|
|
112
|
-
"User token is expired and will not be dispatched"
|
|
113
|
-
);
|
|
111
|
+
console.debug("User token is expired and will not be dispatched");
|
|
114
112
|
return Promise.resolve();
|
|
115
113
|
}
|
|
116
114
|
const validateUserPromise = (validateUser == null ? void 0 : validateUser(user)) || Promise.resolve(true);
|
|
117
115
|
return validateUserPromise.then((valid) => {
|
|
118
116
|
var _a, _b;
|
|
119
117
|
if (!valid) {
|
|
120
|
-
console.debug(
|
|
121
|
-
|
|
122
|
-
);
|
|
123
|
-
return dispatch(
|
|
124
|
-
setUnauthorizedUserInfo((_a = user == null ? void 0 : user.profile) == null ? void 0 : _a.name, "")
|
|
125
|
-
);
|
|
118
|
+
console.debug("User isn't authorized to log in and will not be dispatched");
|
|
119
|
+
return dispatch(setUnauthorizedUserInfo((_a = user == null ? void 0 : user.profile) == null ? void 0 : _a.name, ""));
|
|
126
120
|
}
|
|
127
|
-
console.debug(
|
|
128
|
-
"User has been successfully loaded from store."
|
|
129
|
-
);
|
|
121
|
+
console.debug("User has been successfully loaded from store.");
|
|
130
122
|
reloadTimerOnExpiresIn(
|
|
131
123
|
user,
|
|
132
124
|
userManagerInstance,
|
|
@@ -194,17 +186,12 @@ function handleUser(dispatch, userManager, validateUser) {
|
|
|
194
186
|
userManager.getUser().then((user) => {
|
|
195
187
|
var _a, _b;
|
|
196
188
|
if (!user) {
|
|
197
|
-
console.error(
|
|
198
|
-
"user is null at silent renew error, it shouldn't happen."
|
|
199
|
-
);
|
|
189
|
+
console.error("user is null at silent renew error, it shouldn't happen.");
|
|
200
190
|
return;
|
|
201
191
|
}
|
|
202
192
|
const idTokenExpiresIn = getIdTokenExpiresIn(user);
|
|
203
193
|
if (idTokenExpiresIn < 0) {
|
|
204
|
-
console.log(
|
|
205
|
-
`Error in silent renew, idtoken expired: ${idTokenExpiresIn} => Logging out.`,
|
|
206
|
-
error
|
|
207
|
-
);
|
|
194
|
+
console.log(`Error in silent renew, idtoken expired: ${idTokenExpiresIn} => Logging out.`, error);
|
|
208
195
|
dispatch(setShowAuthenticationRouterLogin(true));
|
|
209
196
|
dispatch(resetAuthenticationRouterError());
|
|
210
197
|
dispatch(setLoggedUser(null));
|
|
@@ -218,21 +205,13 @@ function handleUser(dispatch, userManager, validateUser) {
|
|
|
218
205
|
`last renew attempt in ${idTokenExpiresIn - accessTokenExpiringNotificationTime}seconds`,
|
|
219
206
|
error
|
|
220
207
|
);
|
|
221
|
-
reloadTimerOnExpiresIn(
|
|
222
|
-
user,
|
|
223
|
-
userManager,
|
|
224
|
-
idTokenExpiresIn
|
|
225
|
-
);
|
|
208
|
+
reloadTimerOnExpiresIn(user, userManager, idTokenExpiresIn);
|
|
226
209
|
} else {
|
|
227
210
|
console.log(
|
|
228
211
|
`Error in silent renew, but idtoken NOT expiring (expiring in${idTokenExpiresIn}) => postponing expiration to${userManager.idpSettings.maxExpiresIn}`,
|
|
229
212
|
error
|
|
230
213
|
);
|
|
231
|
-
reloadTimerOnExpiresIn(
|
|
232
|
-
user,
|
|
233
|
-
userManager,
|
|
234
|
-
userManager.idpSettings.maxExpiresIn
|
|
235
|
-
);
|
|
214
|
+
reloadTimerOnExpiresIn(user, userManager, userManager.idpSettings.maxExpiresIn);
|
|
236
215
|
}
|
|
237
216
|
} else {
|
|
238
217
|
console.log(
|
|
@@ -71,39 +71,25 @@ class UserManagerMock {
|
|
|
71
71
|
}
|
|
72
72
|
// eslint-disable-next-line class-methods-use-this
|
|
73
73
|
getUser() {
|
|
74
|
-
return Promise.resolve(
|
|
75
|
-
JSON.parse(
|
|
76
|
-
sessionStorage.getItem("powsybl-gridsuite-mock-user") ?? "null"
|
|
77
|
-
)
|
|
78
|
-
);
|
|
74
|
+
return Promise.resolve(JSON.parse(sessionStorage.getItem("powsybl-gridsuite-mock-user") ?? "null"));
|
|
79
75
|
}
|
|
80
76
|
async signinSilent() {
|
|
81
77
|
console.info("signinSilent..............");
|
|
82
|
-
const localStorageUser = JSON.parse(
|
|
83
|
-
localStorage.getItem("powsybl-gridsuite-mock-user") ?? "null"
|
|
84
|
-
);
|
|
78
|
+
const localStorageUser = JSON.parse(localStorage.getItem("powsybl-gridsuite-mock-user") ?? "null");
|
|
85
79
|
if (localStorageUser === null) {
|
|
86
80
|
throw new Error("End-User authentication required");
|
|
87
81
|
}
|
|
88
|
-
sessionStorage.setItem(
|
|
89
|
-
"powsybl-gridsuite-mock-user",
|
|
90
|
-
JSON.stringify(localStorageUser)
|
|
91
|
-
);
|
|
82
|
+
sessionStorage.setItem("powsybl-gridsuite-mock-user", JSON.stringify(localStorageUser));
|
|
92
83
|
this.events.userLoadedCallbacks.forEach((c) => c(localStorageUser));
|
|
93
84
|
return localStorageUser;
|
|
94
85
|
}
|
|
95
86
|
// eslint-disable-next-line class-methods-use-this
|
|
96
87
|
signinSilentCallback() {
|
|
97
|
-
console.error(
|
|
98
|
-
"Unsupported, iframe signinSilentCallback in UserManagerMock (dev mode)"
|
|
99
|
-
);
|
|
88
|
+
console.error("Unsupported, iframe signinSilentCallback in UserManagerMock (dev mode)");
|
|
100
89
|
return Promise.reject();
|
|
101
90
|
}
|
|
102
91
|
signinRedirect() {
|
|
103
|
-
localStorage.setItem(
|
|
104
|
-
"powsybl-gridsuite-mock-user",
|
|
105
|
-
JSON.stringify(this.user)
|
|
106
|
-
);
|
|
92
|
+
localStorage.setItem("powsybl-gridsuite-mock-user", JSON.stringify(this.user));
|
|
107
93
|
window.location.href = "./sign-in-callback";
|
|
108
94
|
return Promise.resolve();
|
|
109
95
|
}
|
|
@@ -115,10 +101,7 @@ class UserManagerMock {
|
|
|
115
101
|
return Promise.resolve();
|
|
116
102
|
}
|
|
117
103
|
signinRedirectCallback() {
|
|
118
|
-
sessionStorage.setItem(
|
|
119
|
-
"powsybl-gridsuite-mock-user",
|
|
120
|
-
JSON.stringify(this.user)
|
|
121
|
-
);
|
|
104
|
+
sessionStorage.setItem("powsybl-gridsuite-mock-user", JSON.stringify(this.user));
|
|
122
105
|
this.events.userLoadedCallbacks.forEach((c) => c(this.user));
|
|
123
106
|
return Promise.resolve(this.user);
|
|
124
107
|
}
|
package/dist/utils/styles.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
const makeComposeClasses = (generateGlobalClass) => (classes, ruleName) => [generateGlobalClass(ruleName), classes[ruleName]].filter((x) => x).join(" ");
|
|
2
|
-
const toNestedGlobalSelectors = (styles, generateGlobalClass) => Object.fromEntries(
|
|
3
|
-
Object.entries(styles).map(([k, v]) => [
|
|
4
|
-
`& .${generateGlobalClass(k)}`,
|
|
5
|
-
v
|
|
6
|
-
])
|
|
7
|
-
);
|
|
2
|
+
const toNestedGlobalSelectors = (styles, generateGlobalClass) => Object.fromEntries(Object.entries(styles).map(([k, v]) => [`& .${generateGlobalClass(k)}`, v]));
|
|
8
3
|
const isSxProps = (sx) => {
|
|
9
4
|
return sx !== void 0;
|
|
10
5
|
};
|