@gridsuite/commons-ui 0.140.0 → 0.141.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/dist/components/customAGGrid/cell-renderers.d.ts +26 -0
- package/dist/components/customAGGrid/cell-renderers.js +199 -0
- package/dist/components/customAGGrid/index.d.ts +1 -0
- package/dist/components/customAGGrid/index.js +9 -0
- package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +2 -2
- package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.d.ts +1 -1
- package/dist/components/dialogs/modifyElementSelection/ModifyElementSelection.js +3 -0
- package/dist/components/directoryItemSelector/DirectoryItemSelector.js +5 -2
- package/dist/components/directoryItemSelector/utils.js +2 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +15 -0
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +2 -1
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +44 -55
- package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +1 -0
- package/dist/components/inputs/reactQueryBuilder/ElementValueEditor.js +1 -1
- package/dist/components/muiTable/OverflowableTableCell.d.ts +3 -0
- package/dist/components/muiTable/OverflowableTableCell.js +10 -0
- package/dist/components/muiTable/OverflowableTableCellWithCheckbox.d.ts +6 -0
- package/dist/components/muiTable/OverflowableTableCellWithCheckbox.js +16 -0
- package/dist/components/muiTable/index.d.ts +8 -0
- package/dist/components/muiTable/index.js +6 -0
- package/dist/components/parameters/common/parameters-creation-dialog.js +1 -1
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +1 -1
- package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +1 -1
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -1
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -1
- package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
- package/dist/components/resizablePanels/ResizeHandle.d.ts +8 -0
- package/dist/components/resizablePanels/ResizeHandle.js +32 -0
- package/dist/components/resizablePanels/index.d.ts +7 -0
- package/dist/components/resizablePanels/index.js +4 -0
- package/dist/components/topBar/GridLogo.d.ts +4 -2
- package/dist/components/topBar/GridLogo.js +39 -21
- package/dist/components/topBar/TopBar.d.ts +2 -1
- package/dist/components/topBar/TopBar.js +81 -65
- package/dist/index.js +23 -5
- package/dist/services/config.d.ts +10 -0
- package/dist/services/config.js +34 -0
- package/dist/services/directory.d.ts +6 -4
- package/dist/services/directory.js +17 -32
- package/dist/services/index.d.ts +5 -4
- package/dist/services/index.js +8 -5
- package/package.json +2 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { backendFetch, backendFetchJson } from "./utils.js";
|
|
2
|
+
import { COMMON_APP_NAME, COMMON_CONFIG_PARAMS_NAMES } from "../utils/constants/configConstants.js";
|
|
3
|
+
import "../utils/conversionUtils.js";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "@mui/icons-material";
|
|
6
|
+
import "../utils/types/equipmentType.js";
|
|
7
|
+
import "../utils/yupConfig.js";
|
|
8
|
+
const PREFIX_CONFIG_QUERIES = `${"api/gateway"}/config`;
|
|
9
|
+
function getAppName(appName, name) {
|
|
10
|
+
return COMMON_CONFIG_PARAMS_NAMES.has(name) ? COMMON_APP_NAME : appName;
|
|
11
|
+
}
|
|
12
|
+
function updateConfigParameter(appName, name, value) {
|
|
13
|
+
const targetAppName = getAppName(appName, name);
|
|
14
|
+
console.info(`Updating config parameter '${name}=${value}' for app '${targetAppName}'`);
|
|
15
|
+
const updateParams = `${PREFIX_CONFIG_QUERIES}/v1/applications/${targetAppName}/parameters/${name}?value=${encodeURIComponent(value)}`;
|
|
16
|
+
return backendFetch(updateParams, { method: "put" });
|
|
17
|
+
}
|
|
18
|
+
function fetchConfigParameters(appName) {
|
|
19
|
+
console.info(`Fetching UI configuration params for app : ${appName}`);
|
|
20
|
+
const fetchParams = `${PREFIX_CONFIG_QUERIES}/v1/applications/${appName}/parameters`;
|
|
21
|
+
return backendFetchJson(fetchParams);
|
|
22
|
+
}
|
|
23
|
+
function fetchConfigParameter(appName, name) {
|
|
24
|
+
const targetAppName = getAppName(appName, name);
|
|
25
|
+
console.info(`Fetching UI config parameter '${name}' for app '${targetAppName}'`);
|
|
26
|
+
const fetchParams = `${PREFIX_CONFIG_QUERIES}/v1/applications/${targetAppName}/parameters/${name}`;
|
|
27
|
+
return backendFetchJson(fetchParams);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
fetchConfigParameter,
|
|
31
|
+
fetchConfigParameters,
|
|
32
|
+
getAppName,
|
|
33
|
+
updateConfigParameter
|
|
34
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
2
|
import { ElementAttributes } from '../utils';
|
|
3
|
-
export declare function getAppName(appName: string, name: string): string;
|
|
4
|
-
export declare function updateConfigParameter(appName: string, name: string, value: string): Promise<Response>;
|
|
5
|
-
export declare function fetchConfigParameters(appName: string): Promise<any>;
|
|
6
|
-
export declare function fetchConfigParameter(appName: string, name: string): Promise<any>;
|
|
7
3
|
export declare function fetchRootFolders(types: string[]): Promise<ElementAttributes[]>;
|
|
8
4
|
export declare function fetchDirectoryContent(directoryUuid: UUID, types?: string[]): Promise<ElementAttributes[]>;
|
|
9
5
|
export declare function fetchDirectoryElementPath(elementUuid: UUID): Promise<ElementAttributes[]>;
|
|
10
6
|
export declare function elementAlreadyExists(directoryUuid: UUID, elementName: string, type: string): Promise<boolean>;
|
|
7
|
+
export declare enum PermissionType {
|
|
8
|
+
READ = "READ",
|
|
9
|
+
WRITE = "WRITE",
|
|
10
|
+
MANAGE = "MANAGE"
|
|
11
|
+
}
|
|
12
|
+
export declare function hasElementPermission(elementUuid: UUID, permission: PermissionType): Promise<boolean>;
|
|
@@ -1,32 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { COMMON_APP_NAME, COMMON_CONFIG_PARAMS_NAMES } from "../utils/constants/configConstants.js";
|
|
3
|
-
import "../utils/conversionUtils.js";
|
|
4
|
-
import "react/jsx-runtime";
|
|
5
|
-
import "@mui/icons-material";
|
|
6
|
-
import "../utils/types/equipmentType.js";
|
|
7
|
-
import "../utils/yupConfig.js";
|
|
1
|
+
import { getRequestParamFromList, backendFetchJson, backendFetch } from "./utils.js";
|
|
8
2
|
const PREFIX_EXPLORE_SERVER_QUERIES = `${"api/gateway"}/explore`;
|
|
9
|
-
const PREFIX_CONFIG_QUERIES = `${"api/gateway"}/config`;
|
|
10
|
-
function getAppName(appName, name) {
|
|
11
|
-
return COMMON_CONFIG_PARAMS_NAMES.has(name) ? COMMON_APP_NAME : appName;
|
|
12
|
-
}
|
|
13
|
-
function updateConfigParameter(appName, name, value) {
|
|
14
|
-
const targetAppName = getAppName(appName, name);
|
|
15
|
-
console.info(`Updating config parameter '${name}=${value}' for app '${targetAppName}'`);
|
|
16
|
-
const updateParams = `${PREFIX_CONFIG_QUERIES}/v1/applications/${targetAppName}/parameters/${name}?value=${encodeURIComponent(value)}`;
|
|
17
|
-
return backendFetch(updateParams, { method: "put" });
|
|
18
|
-
}
|
|
19
|
-
function fetchConfigParameters(appName) {
|
|
20
|
-
console.info(`Fetching UI configuration params for app : ${appName}`);
|
|
21
|
-
const fetchParams = `${PREFIX_CONFIG_QUERIES}/v1/applications/${appName}/parameters`;
|
|
22
|
-
return backendFetchJson(fetchParams);
|
|
23
|
-
}
|
|
24
|
-
function fetchConfigParameter(appName, name) {
|
|
25
|
-
const targetAppName = getAppName(appName, name);
|
|
26
|
-
console.info(`Fetching UI config parameter '${name}' for app '${targetAppName}'`);
|
|
27
|
-
const fetchParams = `${PREFIX_CONFIG_QUERIES}/v1/applications/${targetAppName}/parameters/${name}`;
|
|
28
|
-
return backendFetchJson(fetchParams);
|
|
29
|
-
}
|
|
30
3
|
function fetchRootFolders(types) {
|
|
31
4
|
console.info("Fetching Root Directories");
|
|
32
5
|
const urlSearchParams = getRequestParamFromList("elementTypes", types).toString();
|
|
@@ -65,13 +38,25 @@ function elementAlreadyExists(directoryUuid, elementName, type) {
|
|
|
65
38
|
// HTTP 204 : No-content
|
|
66
39
|
);
|
|
67
40
|
}
|
|
41
|
+
var PermissionType = /* @__PURE__ */ ((PermissionType2) => {
|
|
42
|
+
PermissionType2["READ"] = "READ";
|
|
43
|
+
PermissionType2["WRITE"] = "WRITE";
|
|
44
|
+
PermissionType2["MANAGE"] = "MANAGE";
|
|
45
|
+
return PermissionType2;
|
|
46
|
+
})(PermissionType || {});
|
|
47
|
+
function hasElementPermission(elementUuid, permission) {
|
|
48
|
+
const url = `${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/elements/${elementUuid}?permission=${permission}`;
|
|
49
|
+
console.debug(url);
|
|
50
|
+
return backendFetch(url, { method: "head" }).then((response) => response.status === 200).catch(() => {
|
|
51
|
+
console.info(`${permission} permission denied for element or directory ${elementUuid}`);
|
|
52
|
+
return false;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
68
55
|
export {
|
|
56
|
+
PermissionType,
|
|
69
57
|
elementAlreadyExists,
|
|
70
|
-
fetchConfigParameter,
|
|
71
|
-
fetchConfigParameters,
|
|
72
58
|
fetchDirectoryContent,
|
|
73
59
|
fetchDirectoryElementPath,
|
|
74
60
|
fetchRootFolders,
|
|
75
|
-
|
|
76
|
-
updateConfigParameter
|
|
61
|
+
hasElementPermission
|
|
77
62
|
};
|
package/dist/services/index.d.ts
CHANGED
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
|
-
export * from './utils';
|
|
8
|
-
export * from './explore';
|
|
9
7
|
export * from './appsMetadata';
|
|
8
|
+
export * from './config';
|
|
10
9
|
export * from './directory';
|
|
10
|
+
export * from './explore';
|
|
11
11
|
export * from './loadflow';
|
|
12
|
+
export * from './pcc-min';
|
|
13
|
+
export * from './security-analysis';
|
|
12
14
|
export * from './study';
|
|
13
15
|
export * from './study-config';
|
|
14
16
|
export * from './userAdmin';
|
|
17
|
+
export * from './utils';
|
|
15
18
|
export * from './voltage-init';
|
|
16
|
-
export * from './pcc-min';
|
|
17
|
-
export * from './security-analysis';
|
package/dist/services/index.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { NetworkTimeoutError, backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList } from "./utils.js";
|
|
2
|
-
import { createFilter, createParameter, fetchElementsInfos, saveFilter, updateParameter } from "./explore.js";
|
|
3
1
|
import { fetchAppsMetadata, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefaultCountries, fetchStudyMetadata, isStudyMetadata } from "./appsMetadata.js";
|
|
4
|
-
import {
|
|
2
|
+
import { fetchConfigParameter, fetchConfigParameters, getAppName, updateConfigParameter } from "./config.js";
|
|
3
|
+
import { PermissionType, elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders, hasElementPermission } from "./directory.js";
|
|
4
|
+
import { createFilter, createParameter, fetchElementsInfos, saveFilter, updateParameter } from "./explore.js";
|
|
5
5
|
import { PREFIX_STUDY_QUERIES, fetchLoadFlowParameters, getDefaultLoadFlowProvider, getLoadFlowDefaultLimitReductions, getLoadFlowProviders, getLoadFlowSpecificParametersDescription, getLoadFlowUrl, setLoadFlowParameters } from "./loadflow.js";
|
|
6
|
+
import { getPccMinStudyParameters, updatePccMinParameters } from "./pcc-min.js";
|
|
7
|
+
import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters, fetchSecurityAnalysisProviders, getSecurityAnalysisDefaultLimitReductions, getSecurityAnalysisParameters, getStudyUrl, safeEncodeURIComponent, setSecurityAnalysisParameters, updateSecurityAnalysisParameters, updateSecurityAnalysisProvider } from "./security-analysis.js";
|
|
6
8
|
import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, invalidateStudyShortCircuitStatus, setStudyNetworkVisualizationParameters, setStudyShortCircuitParameters, updateVoltageInitParameters } from "./study.js";
|
|
7
9
|
import { getNetworkVisualizationsParameters } from "./study-config.js";
|
|
8
10
|
import { fetchCurrentAnnouncement, fetchUserDetails } from "./userAdmin.js";
|
|
11
|
+
import { NetworkTimeoutError, backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList } from "./utils.js";
|
|
9
12
|
import { getVoltageInitParameters, getVoltageInitUrl } from "./voltage-init.js";
|
|
10
|
-
import { getPccMinStudyParameters, updatePccMinParameters } from "./pcc-min.js";
|
|
11
|
-
import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters, fetchSecurityAnalysisProviders, getSecurityAnalysisDefaultLimitReductions, getSecurityAnalysisParameters, getStudyUrl, safeEncodeURIComponent, setSecurityAnalysisParameters, updateSecurityAnalysisParameters, updateSecurityAnalysisProvider } from "./security-analysis.js";
|
|
12
13
|
export {
|
|
13
14
|
NetworkTimeoutError,
|
|
14
15
|
PREFIX_STUDY_QUERIES,
|
|
16
|
+
PermissionType,
|
|
15
17
|
backendFetch,
|
|
16
18
|
backendFetchFile,
|
|
17
19
|
backendFetchJson,
|
|
@@ -54,6 +56,7 @@ export {
|
|
|
54
56
|
getStudyUrl,
|
|
55
57
|
getVoltageInitParameters,
|
|
56
58
|
getVoltageInitUrl,
|
|
59
|
+
hasElementPermission,
|
|
57
60
|
invalidateStudyShortCircuitStatus,
|
|
58
61
|
isStudyMetadata,
|
|
59
62
|
safeEncodeURIComponent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsuite/commons-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.141.0",
|
|
4
4
|
"description": "common react components for gridsuite applications",
|
|
5
5
|
"author": "gridsuite team",
|
|
6
6
|
"homepage": "https://github.com/gridsuite",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"react-dnd": "^16.0.1",
|
|
54
54
|
"react-dnd-html5-backend": "^16.0.1",
|
|
55
55
|
"react-querybuilder": "^8.11.0",
|
|
56
|
+
"react-resizable-panels": "^3.0.6",
|
|
56
57
|
"reconnecting-websocket": "^4.4.0",
|
|
57
58
|
"type-fest": "^4.41.0",
|
|
58
59
|
"uuid": "^13.0.0"
|