Skip to content

Commit 310d15e

Browse files
authored
About box and version file (#180)
1 parent 5d6b80a commit 310d15e

File tree

5 files changed

+81
-11
lines changed

5 files changed

+81
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Collections of known configurations are gathered in subdirectories of main/configs (#175).
1414
- Templated queries: variables shown in title of result table (#163).
1515
- Templated queries: changing variables dialogue is preloaded with previous values (#167).
16+
- About dialog, reachable from the application bar (#171).
1617

1718
## [1.5.0] - 2025-01-02
1819

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Table of contents:
2828
* [Additional prerequisites](#additional-prerequisites)
2929
* [Testing the production version](#testing-the-production-version)
3030
* [Testing the development version](#testing-the-development-version)
31+
* [Setting the version string](#setting-the-version-string)
3132

3233
## Preface
3334

@@ -442,3 +443,8 @@ The procedure is the same as for testing the production version, except for step
442443
```bash
443444
npm run dev-with-path
444445
```
446+
447+
### Setting the version string
448+
449+
Before every merge to the main branch and before every release, set the version string [here](./main/src/version.js)
450+
according to the rules in that file.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { Component } from "react";
2+
import CloseIcon from "@mui/icons-material/Close";
3+
import { IconButton, Dialog, DialogTitle, DialogContent, DialogContentText } from "@mui/material";
4+
5+
import version from "../../../version";
6+
7+
/**
8+
*
9+
* @param {boolean} props.open - forwarded to Dialog open
10+
* @param {function} props.close - forwarded to Dialog onClose and the close button
11+
* @returns {Component}
12+
*/
13+
function AboutDialog(props) {
14+
return (
15+
<Dialog open={props.open} onClose={props.close} fullWidth maxWidth="sm">
16+
<DialogTitle sx={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
17+
<div>Generic Data Viewer</div>
18+
<IconButton onClick={props.close} size="small">
19+
<CloseIcon />
20+
</IconButton>
21+
</DialogTitle>
22+
<DialogContent>
23+
<DialogContentText>
24+
<p>Version: {version}</p>
25+
<p>Questions? Remarks?
26+
Please create an issue at our <a href="https://github.com/SolidLabResearch/generic-data-viewer-react-admin" target="_blank">Repository</a><br />
27+
or mail to <a href="mailto:ben.demeester@ugent.be" target="_blank">ben.demeester@ugent.be</a>.</p>
28+
<p>Powered by <a href="https://comunica.dev/" target="_blank">Comunica</a> and <a href="https://marmelab.com/react-admin/" target="_blank">React-Admin</a>.</p>
29+
<p>Initial development funded by <a href="https://ontodeside.eu/" target="_blank">Onto-DESIDE</a> and <a href="https://solidlab.be/" target="_blank">SolidLab</a>.</p>
30+
<p>&copy; <a href="https://idlab.ugent.be/">IDLab</a> 2025</p>
31+
</DialogContentText>
32+
</DialogContent>
33+
</Dialog>
34+
);
35+
}
36+
37+
export default AboutDialog;

main/src/components/InteractionLayout/NavigationBar/NavigationBar.jsx

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
import { AppBar, TitlePortal, useRefresh } from "react-admin";
22
import "./NavigationBar.css";
33
import AuthenticationMenu from "../AuthenticationMenu/AuthenticationMenu";
4-
import { Component } from "react";
5-
import SparqlDataProvider from "./../../../dataProvider/SparqlDataProvider";
4+
import { Component, useState } from "react";
65
import CleaningServicesIcon from '@mui/icons-material/CleaningServices';
76
import { IconButton } from '@mui/material';
87
import { Tooltip } from '@mui/material';
8+
import HelpIcon from '@mui/icons-material/Help';
9+
import AboutDialog from "./AboutDialog";
910

1011
import configManager from "../../../configManager/configManager";
1112
import comunicaEngineWrapper from "../../../comunicaEngineWrapper/comunicaEngineWrapper";
1213

14+
function AboutButton(props) {
15+
return (
16+
<Tooltip title="About">
17+
<IconButton color="inherit" onClick={props.click}>
18+
<HelpIcon />
19+
</IconButton>
20+
</Tooltip>
21+
)
22+
}
23+
1324
function InvalidateButton() {
1425
const refresh = useRefresh();
1526
const handleClick = () => {
@@ -32,16 +43,26 @@ function InvalidateButton() {
3243
*/
3344
function NavigationBar(props) {
3445
const config = configManager.getConfig();
46+
47+
const [aboutOpen, setAboutOpen] = useState(false);
48+
49+
const handleAboutOpen = () => setAboutOpen(true);
50+
const handleAboutClose = () => setAboutOpen(false);
51+
3552
return (
36-
<AppBar {...props} userMenu={<AuthenticationMenu />}>
37-
<img
38-
id="app-logo"
39-
src={config.logoLocation}
40-
alt="Web application logo"
41-
></img>
42-
<TitlePortal/>
43-
<InvalidateButton/>
44-
</AppBar>
53+
<>
54+
<AppBar {...props} userMenu={<AuthenticationMenu />}>
55+
<img
56+
id="app-logo"
57+
src={config.logoLocation}
58+
alt="Web application logo"
59+
></img>
60+
<TitlePortal/>
61+
<AboutButton click={handleAboutOpen} />
62+
<InvalidateButton/>
63+
</AppBar>
64+
<AboutDialog open={aboutOpen} close={handleAboutClose} />
65+
</>
4566
);
4667
}
4768

main/src/version.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Set to a next intermediate version string vX.Y.Z-tttt when merging an unreleased version to the main branch.
2+
// Set to the new release version string vX.Y.Z right before make a new release tag vX.Y.Z (see https://github.com/SolidLabResearch/generic-data-viewer-react-admin/tags).
3+
// ... All in accordance with https://semver.org/spec/v2.0.0.html.
4+
const version = "v1.6.0.0003";
5+
export default version;

0 commit comments

Comments
 (0)