Skip to content

Commit

Permalink
Update "about" dialog (#317)
Browse files Browse the repository at this point in the history
update dialog and use new url
  • Loading branch information
Tristan-WorkGH authored Dec 27, 2023
1 parent ffbd8ba commit 4f94af5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 43 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",
"@gridsuite/commons-ui": "^0.42.0",
"@gridsuite/commons-ui": "^0.43.0",
"@hookform/resolvers": "^3.0.0",
"@mui/icons-material": "^5.5.0",
"@mui/lab": "^5.0.0-alpha.72",
Expand Down
39 changes: 3 additions & 36 deletions src/components/app-top-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,43 +69,10 @@ const AppTopBar = ({ user, userManager }) => {
theme={themeLocal}
onLanguageClick={handleChangeLanguage}
language={languageLocal}
getGlobalVersion={(setGlobalVersion) =>
fetchVersion()
.then((res) => setGlobalVersion(res.deployVersion))
.catch((reason) => {
console.error(
'Error while fetching the version : ' + reason
);
setGlobalVersion(null);
})
}
getAdditionalModules={(setServers) =>
getServersInfos()
.then((res) =>
setServers(
Object.entries(res).map(([name, infos]) => ({
name:
infos?.build?.name ||
infos?.build?.artifact ||
name,
type: 'server',
version: infos?.build?.version,
gitTag:
infos?.git?.tags ||
infos?.git?.commit?.id[
'describe-short'
],
}))
)
)
.catch((reason) => {
console.error(
'Error while fetching the servers infos : ' +
reason
);
setServers(null);
})
globalVersionPromise={() =>
fetchVersion().then((res) => res?.deployVersion)
}
additionalModulesPromise={getServersInfos}
/>
<ParametersDialog
showParameters={showParameters}
Expand Down
13 changes: 11 additions & 2 deletions src/utils/rest-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ export function fetchVersion() {
console.info(`Fetching global metadata...`);
return fetchEnv()
.then((env) => fetch(env.appsMetadataServerUrl + '/version.json'))
.then((response) => response.json());
.then((response) => response.json())
.catch((reason) => {
console.error('Error while fetching the version : ' + reason);
return reason;
});
}

export function fetchConfigParameters(appName) {
Expand Down Expand Up @@ -989,5 +993,10 @@ export function downloadCase(caseUuid) {

export function getServersInfos() {
console.info('get backend servers informations');
return backendFetchJson(PREFIX_STUDY_QUERIES + '/v1/servers/infos');
return backendFetchJson(
PREFIX_STUDY_QUERIES + '/v1/servers/about?view=explore'
).catch((reason) => {
console.error('Error while fetching the servers infos : ' + reason);
return reason;
});
}

0 comments on commit 4f94af5

Please sign in to comment.