From 58e536ce444bb53c356326cefede569e731011cf Mon Sep 17 00:00:00 2001 From: Pieter Heyvaert Date: Mon, 21 Aug 2023 16:05:53 +0200 Subject: [PATCH 1/3] Fix #30 --- .gitignore | 2 +- src/App.jsx | 4 ++++ src/components/Dashboard/Dashboard.css | 3 +++ src/components/Dashboard/Dashboard.jsx | 29 ++++++++++++++++++++++++++ src/config.json | 7 ++++--- 5 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 src/components/Dashboard/Dashboard.css create mode 100644 src/components/Dashboard/Dashboard.jsx diff --git a/.gitignore b/.gitignore index 36f3a0cf..91cbbeff 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,4 @@ dist-ssr pods* -lintPush.sh \ No newline at end of file +lintPush.sh diff --git a/src/App.jsx b/src/App.jsx index 9ae99c3c..318c0467 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -12,6 +12,7 @@ import GDVLayout from "./components/GDVLayout/GDVLayout"; import authenticationProvider from "./authenticationProvider/authenticationProvider"; import SolidLoginForm from "./components/LoginPage/LoginPage"; import {QueryClient} from "react-query"; +import Dashboard from "./components/Dashboard/Dashboard"; const queryClient = new QueryClient({ defaultOptions: { @@ -57,6 +58,9 @@ function App() { authProvider={authenticationProvider} loginPage={SolidLoginForm} requireAuth={false} + dashboard={() => { + return Dashboard({text: config.introductionText}) + }} > {config.queries.map((query) => { return ( diff --git a/src/components/Dashboard/Dashboard.css b/src/components/Dashboard/Dashboard.css new file mode 100644 index 00000000..d3efe624 --- /dev/null +++ b/src/components/Dashboard/Dashboard.css @@ -0,0 +1,3 @@ +#main-content { + margin-top: 30px; +} diff --git a/src/components/Dashboard/Dashboard.jsx b/src/components/Dashboard/Dashboard.jsx new file mode 100644 index 00000000..9cb702e6 --- /dev/null +++ b/src/components/Dashboard/Dashboard.jsx @@ -0,0 +1,29 @@ +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import {Title} from 'react-admin'; +import PropTypes from 'prop-types'; +import './Dashboard.css'; + +/** + * This function returns a function that creates a dashboard with an introduction for . + * @param {object} props - This has one property `text` with the introduction text. + * @returns {function(): *} - A function that creates a dashboard with an introduction for . + */ +function Dashboard(props) { + let {text} = props; + + text = text || 'You change this text via the config file.'; + + return ( + + + <CardContent>{text}</CardContent> + </Card> + ); +} + +Dashboard.propTypes = { + text: PropTypes.string +}; + +export default Dashboard; diff --git a/src/config.json b/src/config.json index 966865d6..3884114a 100644 --- a/src/config.json +++ b/src/config.json @@ -2,15 +2,16 @@ "title": "Generic Data Viewer", "logoLocation": "images/IDLab-logo.png", "logoRedirectURL": "https://idlab.technology/", - "mainAppColor": "lightgray", + "mainAppColor": "lightgray", "backgroundColor": "#fff", "titleColor": "black", "textColor": "#1976D2", "queryFolder": "queries", "httpProxy": "http://localhost:8000/", - "showMilliseconds": false, + "showMilliseconds": false, "defaultIDP": "https://pod.playground.solidlab.be/", "footer": "<p><a href='https://idlab.technology/'>IDLab</a> - <a href='https://www.imec.be/nl'>imec</a> - <a href='https://www.ugent.be/'>UGent</a></p>", + "introductionText": "Please select a query from the menu on the left.", "queries": [ { "queryLocation": "test.rq", @@ -69,4 +70,4 @@ "sources": ["http://localhost:8080/example/wish-list"] } ] -} \ No newline at end of file +} From 398d127e54a8bfc7ac7e0947a8a040ac3284dbca Mon Sep 17 00:00:00 2001 From: Pieter Heyvaert <pheyvaer.heyvaert@ugent.be> Date: Mon, 21 Aug 2023 16:08:29 +0200 Subject: [PATCH 2/3] Update README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 28eaac2a..6cb5ff8a 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ The configuration file follows a simple structure. "defaultIDP": "The default value used for IDP when logging in, this IDP can be manually changed in the Web app as well. ", "queryFolder": "The base location of the queries, all query locations will start from this folder (relative to public folder.)", "httpProxy": "The http proxy through which the requests will be rerouted. When left empty, the Comunica query engine will handle it. This is useful when CORS headers are not set (correctly) on the queried source.", + "introductionText": "The text that the app shows when you first open it.", "queries": [ { "queryLocation": "path to the query location, relative to "queryFolder"", From d899ca5d0a0177c12d76b0cc9e0c9bc5b7c98397 Mon Sep 17 00:00:00 2001 From: Pieter Heyvaert <pheyvaer.heyvaert@ugent.be> Date: Tue, 29 Aug 2023 11:46:46 +0200 Subject: [PATCH 3/3] Update description of introductionText --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6cb5ff8a..836496a3 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ The configuration file follows a simple structure. "defaultIDP": "The default value used for IDP when logging in, this IDP can be manually changed in the Web app as well. ", "queryFolder": "The base location of the queries, all query locations will start from this folder (relative to public folder.)", "httpProxy": "The http proxy through which the requests will be rerouted. When left empty, the Comunica query engine will handle it. This is useful when CORS headers are not set (correctly) on the queried source.", - "introductionText": "The text that the app shows when you first open it.", + "introductionText": "The text that the app shows on the dashboard, which the app also shows when you first open it.", "queries": [ { "queryLocation": "path to the query location, relative to "queryFolder"",