From 5c344f4442312e37b6a3147217b2c91552c04864 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Wed, 3 Jul 2024 16:09:40 +0200 Subject: [PATCH 1/5] Format code --- src/Geopilot.Frontend/src/app.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Geopilot.Frontend/src/app.css b/src/Geopilot.Frontend/src/app.css index 9b2be556..43ad4395 100644 --- a/src/Geopilot.Frontend/src/app.css +++ b/src/Geopilot.Frontend/src/app.css @@ -157,19 +157,23 @@ input { .title-wrapper { margin-top: 12vh; } + .dropzone { min-height: 12vh !important; margin-top: 3vh; font-size: 1rem; } + .carousel { font-size: 20px; } + .vendor-logo { max-height: 40px; max-width: 200px; margin: 0 20px 0 0 !important; } + .app-logo { max-height: 200px; } @@ -187,23 +191,28 @@ input { justify-content: center; } } + @media screen and (max-width: 1200px) { .title-wrapper { margin-top: 12vh; } + .dropzone { min-height: 12vh !important; margin-top: 3vh; font-size: 1rem; } + .carousel { font-size: 18px; } + .vendor-logo { margin-left: 2rem; max-height: 40px; max-width: 150px; } + .app-logo { max-height: 150px; } @@ -213,14 +222,17 @@ input { .title-wrapper { margin-top: 5vh; } + .dropzone { min-height: 10vh !important; margin-top: 1vh; font-size: 0.8rem; } + .carousel { font-size: 14px; } + .app-logo { max-height: 100px; } From b7ea4ecd0c861c3a6d012737526b7db72a9b332f Mon Sep 17 00:00:00 2001 From: tschumpr Date: Wed, 3 Jul 2024 16:14:27 +0200 Subject: [PATCH 2/5] Add menu for admin area and migrate delivery overview --- src/Geopilot.Frontend/package-lock.json | 26 ++ src/Geopilot.Frontend/package.json | 1 + .../public/locale/de/common.json | 3 + .../public/locale/en/common.json | 3 + .../public/locale/fr/common.json | 3 + .../public/locale/it/common.json | 3 + src/Geopilot.Frontend/src/App.jsx | 57 ++-- src/Geopilot.Frontend/src/Header.jsx | 86 +++--- src/Geopilot.Frontend/src/app.css | 11 + .../src/pages/admin/Admin.jsx | 260 ++++++------------ .../src/pages/admin/DeliveryOverview.jsx | 190 +++++++++++++ .../src/pages/admin/Mandates.jsx | 9 + .../src/pages/admin/Organisations.jsx | 9 + .../src/pages/admin/Users.jsx | 9 + src/Geopilot.Frontend/src/pages/home/Home.jsx | 56 ++-- 15 files changed, 470 insertions(+), 256 deletions(-) create mode 100644 src/Geopilot.Frontend/src/pages/admin/DeliveryOverview.jsx create mode 100644 src/Geopilot.Frontend/src/pages/admin/Mandates.jsx create mode 100644 src/Geopilot.Frontend/src/pages/admin/Organisations.jsx create mode 100644 src/Geopilot.Frontend/src/pages/admin/Users.jsx diff --git a/src/Geopilot.Frontend/package-lock.json b/src/Geopilot.Frontend/package-lock.json index 920765d3..2b8d2345 100644 --- a/src/Geopilot.Frontend/package-lock.json +++ b/src/Geopilot.Frontend/package-lock.json @@ -12,6 +12,7 @@ "@azure/msal-react": "^2.0.7", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", + "@mui/icons-material": "^5.15.21", "@mui/material": "^5.14.18", "@mui/x-data-grid": "^6.18.1", "bootstrap": "^5.3.2", @@ -1231,6 +1232,31 @@ "url": "https://opencollective.com/mui" } }, + "node_modules/@mui/icons-material": { + "version": "5.15.21", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.15.21.tgz", + "integrity": "sha512-yqkq1MbdkmX5ZHyvZTBuAaA6RkvoqkoAgwBSx9Oh0L0jAfj9T/Ih/NhMNjkl8PWVSonjfDUkKroBnjRyo/1M9Q==", + "dependencies": { + "@babel/runtime": "^7.23.9" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@mui/material": "^5.0.0", + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/@mui/material": { "version": "5.14.18", "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.18.tgz", diff --git a/src/Geopilot.Frontend/package.json b/src/Geopilot.Frontend/package.json index 6e9fa6cc..c2b09535 100644 --- a/src/Geopilot.Frontend/package.json +++ b/src/Geopilot.Frontend/package.json @@ -18,6 +18,7 @@ "@azure/msal-react": "^2.0.7", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", + "@mui/icons-material": "^5.15.21", "@mui/material": "^5.14.18", "@mui/x-data-grid": "^6.18.1", "bootstrap": "^5.3.2", diff --git a/src/Geopilot.Frontend/public/locale/de/common.json b/src/Geopilot.Frontend/public/locale/de/common.json index ee8bc5b7..3495dac3 100644 --- a/src/Geopilot.Frontend/public/locale/de/common.json +++ b/src/Geopilot.Frontend/public/locale/de/common.json @@ -43,7 +43,9 @@ "logInForDelivery": "Anmelden um Lieferung zu erstellen", "logOut": "Abmelden", "mandate": "Mandat", + "mandates": "Mandate", "noErrors": "Keine Fehler", + "organisations": "Organisationen", "predecessor": "Vorgänger", "privacyPolicy": "Datenschutz", "stacBrowser": "STAC Browser", @@ -52,6 +54,7 @@ "type": "Typ", "uploadFile": "{{fileName}} hochladen...", "uploadNotSuccessful": "Der Upload war nicht erfolgreich. Die Validierung wurde abgebrochen.", + "users": "Benutzer:innen", "validate": "Validieren", "version": "Version", "versionInformation": "Versionsinformationen" diff --git a/src/Geopilot.Frontend/public/locale/en/common.json b/src/Geopilot.Frontend/public/locale/en/common.json index d50cab5d..e400776f 100644 --- a/src/Geopilot.Frontend/public/locale/en/common.json +++ b/src/Geopilot.Frontend/public/locale/en/common.json @@ -43,7 +43,9 @@ "logInForDelivery": "Log in to create delivery", "logOut": "Log Out", "mandate": "Mandate", + "mandates": "Mandates", "noErrors": "No Errors", + "organisations": "Organisations", "predecessor": "Predecessor", "privacyPolicy": "Privacy policy", "stacBrowser": "STAC Browser", @@ -52,6 +54,7 @@ "type": "Type", "uploadFile": "Upload {{fileName}}...", "uploadNotSuccessful": "The upload was not successful. Validation has been aborted.", + "users": "Users", "validate": "Validate", "version": "Version", "versionInformation": "Version information" diff --git a/src/Geopilot.Frontend/public/locale/fr/common.json b/src/Geopilot.Frontend/public/locale/fr/common.json index e1d0a9a6..6a49d83c 100644 --- a/src/Geopilot.Frontend/public/locale/fr/common.json +++ b/src/Geopilot.Frontend/public/locale/fr/common.json @@ -43,7 +43,9 @@ "logInForDelivery": "Connectez-vous pour créer une livraison", "logOut": "Se déconnecter", "mandate": "Mandat", + "mandates": "Mandats", "noErrors": "Pas d'erreurs", + "organisations": "Organisations", "predecessor": "Prédécesseur", "privacyPolicy": "Politique de confidentialité", "stacBrowser": "Navigateur STAC", @@ -52,6 +54,7 @@ "type": "Type", "uploadFile": "Télécharger {{fileName}}...", "uploadNotSuccessful": "Le téléchargement n'a pas réussi. La validation a été annulée.", + "users": "Utilisateurs", "validate": "Valider", "version": "Version", "versionInformation": "Informations sur la version" diff --git a/src/Geopilot.Frontend/public/locale/it/common.json b/src/Geopilot.Frontend/public/locale/it/common.json index 9114d6dc..c5c96765 100644 --- a/src/Geopilot.Frontend/public/locale/it/common.json +++ b/src/Geopilot.Frontend/public/locale/it/common.json @@ -43,7 +43,9 @@ "logInForDelivery": "Accedi per creare una consegna", "logOut": "Esci", "mandate": "Mandato", + "mandates": "Mandati", "noErrors": "Nessun errore", + "organisations": "Organizzazioni", "predecessor": "Predecessore", "privacyPolicy": "Informativa sulla privacy", "stacBrowser": "Browser STAC", @@ -52,6 +54,7 @@ "type": "Tipo", "uploadFile": "Carica {{fileName}}...", "uploadNotSuccessful": "Caricamento non riuscito. La validazione è stata interrotta.", + "users": "Utenti", "validate": "Valida", "version": "Versione", "versionInformation": "Informazioni sulla versione" diff --git a/src/Geopilot.Frontend/src/App.jsx b/src/Geopilot.Frontend/src/App.jsx index ef96a474..820056de 100644 --- a/src/Geopilot.Frontend/src/App.jsx +++ b/src/Geopilot.Frontend/src/App.jsx @@ -2,11 +2,10 @@ import { PublicClientApplication } from "@azure/msal-browser"; import { MsalProvider } from "@azure/msal-react"; import { useEffect, useMemo, useState } from "react"; import { Alert } from "react-bootstrap"; -import { BrowserRouter as Router, Routes, Route, Navigate } from "react-router-dom"; +import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom"; import { Snackbar } from "@mui/material"; import BannerContent from "./BannerContent"; import Footer from "./Footer"; -import Header from "./Header"; import Home from "./pages/home/Home"; import Admin from "./pages/admin/Admin"; import ModalContent from "./ModalContent"; @@ -18,6 +17,10 @@ import { I18nextProvider } from "react-i18next"; import i18n from "./i18n"; import { createTheme, ThemeProvider } from "@mui/material/styles"; import { deDE, enUS, frFR, itIT } from "@mui/material/locale"; +import DeliveryOverview from "./pages/admin/DeliveryOverview.jsx"; +import Users from "./pages/admin/Users.jsx"; +import Mandates from "./pages/admin/Mandates.jsx"; +import Organisations from "./pages/admin/Organisations.jsx"; export const App = () => { const [modalContent, setModalContent] = useState(false); @@ -159,20 +162,32 @@ export const App = () => {
- -
+ openModalContent(nutzungsbestimmungenContent, "markdown")} - quickStartContent={quickStartContent} - setShowBannerContent={setShowBannerContent} - /> + <> + openModalContent(nutzungsbestimmungenContent, "markdown")} + quickStartContent={quickStartContent} + setShowBannerContent={setShowBannerContent} + /> +
+ } /> @@ -183,21 +198,15 @@ export const App = () => { - } /> + }> + } /> + } /> + } /> + } /> + - -
+ { +export const Header = ({ clientSettings, hasDrawerToggle, handleDrawerToggle }) => { const { user, login, logout } = useAuth(); const { t } = useTranslation(); const navigate = useNavigate(); @@ -31,16 +34,37 @@ export const Header = ({ clientSettings }) => { }; return ( -
- - - - + <> + + + + {hasDrawerToggle ? ( + <> + + + + + {`Logo { + e.target.style.display = "none"; + }} + /> + + + ) : ( { e.target.style.display = "none"; }} /> - - {location.pathname.includes("admin") ? t("administration").toUpperCase() : t("delivery").toUpperCase()} - - - - - - - - - - - - - + )} + + {location.pathname.includes("admin") ? t("administration").toUpperCase() : t("delivery").toUpperCase()} + + + + + + + + + + + + + +
{
-
+ ); }; diff --git a/src/Geopilot.Frontend/src/app.css b/src/Geopilot.Frontend/src/app.css index 43ad4395..25dba425 100644 --- a/src/Geopilot.Frontend/src/app.css +++ b/src/Geopilot.Frontend/src/app.css @@ -9,6 +9,17 @@ body { height: 100vh; } +.admin { + display: flex; + flex-direction: column; + min-height: 100%; +} + +.admin header { + z-index: 1150; + position: relative !important; +} + main { flex: 1 1 auto; overflow: auto; diff --git a/src/Geopilot.Frontend/src/pages/admin/Admin.jsx b/src/Geopilot.Frontend/src/pages/admin/Admin.jsx index 080afde6..4f73f4dd 100644 --- a/src/Geopilot.Frontend/src/pages/admin/Admin.jsx +++ b/src/Geopilot.Frontend/src/pages/admin/Admin.jsx @@ -1,191 +1,101 @@ -import { useState, useEffect } from "react"; -import { Button, Modal, Alert } from "react-bootstrap"; -import { GoTrash } from "react-icons/go"; import { useTranslation } from "react-i18next"; -import { DataGrid } from "@mui/x-data-grid"; -import { Snackbar } from "@mui/material"; -import { useAuth } from "@/auth"; +import { Box, Divider, Drawer, List, ListItem, ListItemButton, ListItemText, Toolbar } from "@mui/material"; +import Header from "../../Header.jsx"; +import { useState } from "react"; +import { Outlet, useNavigate } from "react-router-dom"; -const useTranslatedColumns = t => { - const columns = [ - { field: "id", headerName: t("id"), width: 60 }, - { - field: "date", - headerName: t("deliveryDate"), - valueFormatter: params => { - const date = new Date(params.value); - return ( - `${date.getHours().toString().padStart(2, "0")}:` + - `${date.getMinutes().toString().padStart(2, "0")}:` + - `${date.getSeconds().toString().padStart(2, "0")} ` + - `${date.getDate().toString().padStart(2, "0")}.` + - `${(date.getMonth() + 1).toString().padStart(2, "0")}.` + - `${date.getFullYear()}` - ); - }, - width: 180, - }, - { field: "user", headerName: t("deliveredBy"), flex: 0.5, minWidth: 200 }, - { field: "mandate", headerName: t("mandate"), flex: 0.5, minWidth: 200 }, - { field: "comment", headerName: t("comment"), flex: 1, minWidth: 600 }, - ]; - return columns; -}; - -export const Admin = () => { +export const Admin = props => { const { t } = useTranslation(); - const columns = useTranslatedColumns(t); - const [deliveries, setDeliveries] = useState(undefined); - const [selectedRows, setSelectedRows] = useState([]); - const [showModal, setShowModal] = useState(false); - const [alertMessages, setAlertMessages] = useState([]); - const [currentAlert, setCurrentAlert] = useState(undefined); - const [showAlert, setShowAlert] = useState(false); - - const { user } = useAuth(); - - if (user && deliveries == undefined) { - loadDeliveries(); - } + const navigate = useNavigate(); + const [adminMenuOpen, setAdminMenuOpen] = useState(false); + const [isClosing, setIsClosing] = useState(false); + const clientSettings = props.clientSettings; - useEffect(() => { - if (alertMessages.length && (!currentAlert || !showAlert)) { - setCurrentAlert(alertMessages[0]); - setAlertMessages(prev => prev.slice(1)); - setShowAlert(true); - } - }, [alertMessages, currentAlert, showAlert]); + const handleDrawerClose = () => { + setIsClosing(true); + setAdminMenuOpen(false); + }; - const closeAlert = (event, reason) => { - if (reason === "clickaway") { - return; - } - setShowAlert(false); + const handleDrawerTransitionEnd = () => { + setIsClosing(false); }; - async function loadDeliveries() { - try { - var response = await fetch("/api/v1/delivery"); - if (response.status == 200) { - var deliveries = await response.json(); - setDeliveries( - deliveries.map(d => ({ - id: d.id, - date: d.date, - user: d.declaringUser.fullName, - mandate: d.mandate.name, - comment: d.comment, - })), - ); - } - } catch (error) { - setAlertMessages(prev => [ - ...prev, - { - message: t("deliveryOverviewLoadingError", { error: error }), - key: new Date().getTime(), - }, - ]); + const handleDrawerToggle = () => { + if (!isClosing) { + setAdminMenuOpen(!adminMenuOpen); } - } + }; - async function handleDelete() { - setShowModal(false); - for (var row of selectedRows) { - try { - var response = await fetch("api/v1/delivery/" + row, { - method: "DELETE", - }); - if (response.status == 404) { - setAlertMessages(prev => [ - ...prev, - { - message: t("deliveryOverviewDeleteIdNotExistError", { id: row }), - key: new Date().getTime(), - }, - ]); - } else if (response.status == 500) { - setAlertMessages(prev => [ - ...prev, - { - message: t("deliveryOverviewDeleteIdError", { id: row }), - key: new Date().getTime(), - }, - ]); - } - } catch (error) { - setAlertMessages(prev => [ - ...prev, - { message: t("deliveryOverviewDeleteError", { error: error }), key: new Date().getTime() }, - ]); - } + const navigateTo = path => { + navigate(path); + if (adminMenuOpen) { + handleDrawerClose(); } - await loadDeliveries(); - } + }; - return ( - <> -
- {deliveries?.length > 0 && ( - { - setSelectedRows(newSelection); - }} - hideFooterRowCount - hideFooterSelectedRowCount - /> - )} - {selectedRows.length > 0 && ( -
- -
- )} - - {t("deleteDeliveryConfirmation")} - - - - - - - -

{currentAlert ? currentAlert.message : undefined}

-
-
-
- + + + + + + + {["users", "mandates", "organisations"].map(link => ( + + { + navigateTo(link); + }}> + + + + ))} + + +
+ ); + + return ( +
+
+ + {drawerContent} + + + {drawerContent} + + + + +
); }; diff --git a/src/Geopilot.Frontend/src/pages/admin/DeliveryOverview.jsx b/src/Geopilot.Frontend/src/pages/admin/DeliveryOverview.jsx new file mode 100644 index 00000000..684667d2 --- /dev/null +++ b/src/Geopilot.Frontend/src/pages/admin/DeliveryOverview.jsx @@ -0,0 +1,190 @@ +import { useEffect, useState } from "react"; +import { Alert, Button, Modal } from "react-bootstrap"; +import { GoTrash } from "react-icons/go"; +import { useTranslation } from "react-i18next"; +import { DataGrid } from "@mui/x-data-grid"; +import { Snackbar } from "@mui/material"; +import { useAuth } from "@/auth"; + +const useTranslatedColumns = t => { + const columns = [ + { field: "id", headerName: t("id"), width: 60 }, + { + field: "date", + headerName: t("deliveryDate"), + valueFormatter: params => { + const date = new Date(params.value); + return ( + `${date.getHours().toString().padStart(2, "0")}:` + + `${date.getMinutes().toString().padStart(2, "0")}:` + + `${date.getSeconds().toString().padStart(2, "0")} ` + + `${date.getDate().toString().padStart(2, "0")}.` + + `${(date.getMonth() + 1).toString().padStart(2, "0")}.` + + `${date.getFullYear()}` + ); + }, + width: 180, + }, + { field: "user", headerName: t("deliveredBy"), flex: 0.5, minWidth: 200 }, + { field: "mandate", headerName: t("mandate"), flex: 0.5, minWidth: 200 }, + { field: "comment", headerName: t("comment"), flex: 1, minWidth: 600 }, + ]; + return columns; +}; + +export const DeliveryOverview = () => { + const { t } = useTranslation(); + const columns = useTranslatedColumns(t); + const [deliveries, setDeliveries] = useState(undefined); + const [selectedRows, setSelectedRows] = useState([]); + const [showModal, setShowModal] = useState(false); + const [alertMessages, setAlertMessages] = useState([]); + const [currentAlert, setCurrentAlert] = useState(undefined); + const [showAlert, setShowAlert] = useState(false); + + const { user } = useAuth(); + + if (user && deliveries == undefined) { + loadDeliveries(); + } + + useEffect(() => { + if (alertMessages.length && (!currentAlert || !showAlert)) { + setCurrentAlert(alertMessages[0]); + setAlertMessages(prev => prev.slice(1)); + setShowAlert(true); + } + }, [alertMessages, currentAlert, showAlert]); + + const closeAlert = (event, reason) => { + if (reason === "clickaway") { + return; + } + setShowAlert(false); + }; + + async function loadDeliveries() { + try { + var response = await fetch("/api/v1/delivery"); + if (response.status == 200) { + var deliveries = await response.json(); + setDeliveries( + deliveries.map(d => ({ + id: d.id, + date: d.date, + user: d.declaringUser.fullName, + mandate: d.mandate.name, + comment: d.comment, + })), + ); + } + } catch (error) { + setAlertMessages(prev => [ + ...prev, + { + message: t("deliveryOverviewLoadingError", { error: error }), + key: new Date().getTime(), + }, + ]); + } + } + + async function handleDelete() { + setShowModal(false); + for (var row of selectedRows) { + try { + var response = await fetch("api/v1/delivery/" + row, { + method: "DELETE", + }); + if (response.status == 404) { + setAlertMessages(prev => [ + ...prev, + { + message: t("deliveryOverviewDeleteIdNotExistError", { id: row }), + key: new Date().getTime(), + }, + ]); + } else if (response.status == 500) { + setAlertMessages(prev => [ + ...prev, + { + message: t("deliveryOverviewDeleteIdError", { id: row }), + key: new Date().getTime(), + }, + ]); + } + } catch (error) { + setAlertMessages(prev => [ + ...prev, + { message: t("deliveryOverviewDeleteError", { error: error }), key: new Date().getTime() }, + ]); + } + } + await loadDeliveries(); + } + + return ( + <> + {deliveries?.length > 0 && ( + { + setSelectedRows(newSelection); + }} + hideFooterRowCount + hideFooterSelectedRowCount + /> + )} + {selectedRows.length > 0 && ( +
+ +
+ )} + + {t("deleteDeliveryConfirmation")} + + + + + + + +

{currentAlert ? currentAlert.message : undefined}

+
+
+ + ); +}; + +export default DeliveryOverview; diff --git a/src/Geopilot.Frontend/src/pages/admin/Mandates.jsx b/src/Geopilot.Frontend/src/pages/admin/Mandates.jsx new file mode 100644 index 00000000..4de3985f --- /dev/null +++ b/src/Geopilot.Frontend/src/pages/admin/Mandates.jsx @@ -0,0 +1,9 @@ +import { useTranslation } from "react-i18next"; + +export const Mandates = () => { + const { t } = useTranslation(); + + return <>Mandates page; +}; + +export default Mandates; diff --git a/src/Geopilot.Frontend/src/pages/admin/Organisations.jsx b/src/Geopilot.Frontend/src/pages/admin/Organisations.jsx new file mode 100644 index 00000000..271667d1 --- /dev/null +++ b/src/Geopilot.Frontend/src/pages/admin/Organisations.jsx @@ -0,0 +1,9 @@ +import { useTranslation } from "react-i18next"; + +export const Organisations = () => { + const { t } = useTranslation(); + + return <>Organisations page; +}; + +export default Organisations; diff --git a/src/Geopilot.Frontend/src/pages/admin/Users.jsx b/src/Geopilot.Frontend/src/pages/admin/Users.jsx new file mode 100644 index 00000000..1c999600 --- /dev/null +++ b/src/Geopilot.Frontend/src/pages/admin/Users.jsx @@ -0,0 +1,9 @@ +import { useTranslation } from "react-i18next"; + +export const Users = () => { + const { t } = useTranslation(); + + return <>Users page; +}; + +export default Users; diff --git a/src/Geopilot.Frontend/src/pages/home/Home.jsx b/src/Geopilot.Frontend/src/pages/home/Home.jsx index 97c65903..61d4a3a8 100644 --- a/src/Geopilot.Frontend/src/pages/home/Home.jsx +++ b/src/Geopilot.Frontend/src/pages/home/Home.jsx @@ -1,11 +1,12 @@ import "../../app.css"; -import { useState, useEffect, useRef, useCallback } from "react"; +import { useCallback, useEffect, useRef, useState } from "react"; import { Container, Stack } from "react-bootstrap"; import { useTranslation } from "react-i18next"; import { FileDropzone } from "./FileDropzone"; import { Title } from "./Title"; import { Protokoll } from "./Protokoll"; import { DeliveryContainer } from "./DeliveryContainer"; +import Header from "../../Header.jsx"; export const Home = ({ clientSettings, @@ -129,33 +130,36 @@ export const Home = ({ }; return ( -
- - - - <FileDropzone - setUploadLogsEnabled={setUploadLogsEnabled} - setFileToCheck={setFileToCheck} - fileToCheck={fileToCheck} - nutzungsbestimmungenAvailable={nutzungsbestimmungenAvailable} - checkedNutzungsbestimmungen={checkedNutzungsbestimmungen} - checkFile={checkFile} + <> + <Header clientSettings={clientSettings} /> + <main> + <Stack gap={3}> + <Container className="main-container"> + <Title clientSettings={clientSettings} quickStartContent={quickStartContent} /> + <FileDropzone + setUploadLogsEnabled={setUploadLogsEnabled} + setFileToCheck={setFileToCheck} + fileToCheck={fileToCheck} + nutzungsbestimmungenAvailable={nutzungsbestimmungenAvailable} + checkedNutzungsbestimmungen={checkedNutzungsbestimmungen} + checkFile={checkFile} + validationRunning={validationRunning} + setCheckedNutzungsbestimmungen={setCheckedNutzungsbestimmungen} + showNutzungsbestimmungen={showNutzungsbestimmungen} + acceptedFileTypes={validationSettings?.allowedFileExtensions} + fileToCheckRef={fileToCheckRef} + /> + </Container> + <Protokoll + log={log} + statusData={statusData} + fileName={fileToCheck ? fileToCheck.name : ""} validationRunning={validationRunning} - setCheckedNutzungsbestimmungen={setCheckedNutzungsbestimmungen} - showNutzungsbestimmungen={showNutzungsbestimmungen} - acceptedFileTypes={validationSettings?.allowedFileExtensions} - fileToCheckRef={fileToCheckRef} /> - </Container> - <Protokoll - log={log} - statusData={statusData} - fileName={fileToCheck ? fileToCheck.name : ""} - validationRunning={validationRunning} - /> - <DeliveryContainer statusData={statusData} validationRunning={validationRunning} /> - </Stack> - </main> + <DeliveryContainer statusData={statusData} validationRunning={validationRunning} /> + </Stack> + </main> + </> ); }; From 64ea5b5f8e6a61b111da4498c44a7ea6ac2fae78 Mon Sep 17 00:00:00 2001 From: tschumpr <roswita.tschuemperlin@geowerkstatt.ch> Date: Wed, 3 Jul 2024 16:18:56 +0200 Subject: [PATCH 3/5] Redirect to first menu item --- src/Geopilot.Frontend/src/App.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Geopilot.Frontend/src/App.jsx b/src/Geopilot.Frontend/src/App.jsx index 820056de..fc7a1b30 100644 --- a/src/Geopilot.Frontend/src/App.jsx +++ b/src/Geopilot.Frontend/src/App.jsx @@ -198,6 +198,7 @@ export const App = () => { </LoggedOutTemplate> <AdminTemplate> <Routes> + <Route path="admin" element={<Navigate to="/admin/delivery-overview" replace />} /> <Route path="admin" element={<Admin clientSettings={clientSettings} />}> <Route path="delivery-overview" element={<DeliveryOverview />} /> <Route path="users" element={<Users />} /> From 13d4b84f1afba4ea12fca472b1ecbdc94319d885 Mon Sep 17 00:00:00 2001 From: tschumpr <roswita.tschuemperlin@geowerkstatt.ch> Date: Wed, 3 Jul 2024 16:38:38 +0200 Subject: [PATCH 4/5] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0252516..8bcd725f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Add Cypress test support. - Added localization. +- Added separate administration area and user navigation menu to switch between delivery, administration and STAC browser. ### Changed From 6f16bd091b7eaf77011dcda4c420837777edac7a Mon Sep 17 00:00:00 2001 From: tschumpr <roswita.tschuemperlin@geowerkstatt.ch> Date: Wed, 3 Jul 2024 16:41:30 +0200 Subject: [PATCH 5/5] Fix lint error --- src/Geopilot.Frontend/src/pages/admin/Mandates.jsx | 2 +- src/Geopilot.Frontend/src/pages/admin/Organisations.jsx | 2 +- src/Geopilot.Frontend/src/pages/admin/Users.jsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Geopilot.Frontend/src/pages/admin/Mandates.jsx b/src/Geopilot.Frontend/src/pages/admin/Mandates.jsx index 4de3985f..14910fa3 100644 --- a/src/Geopilot.Frontend/src/pages/admin/Mandates.jsx +++ b/src/Geopilot.Frontend/src/pages/admin/Mandates.jsx @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next"; export const Mandates = () => { const { t } = useTranslation(); - return <>Mandates page</>; + return <>{t("mandates")}</>; }; export default Mandates; diff --git a/src/Geopilot.Frontend/src/pages/admin/Organisations.jsx b/src/Geopilot.Frontend/src/pages/admin/Organisations.jsx index 271667d1..16a746b0 100644 --- a/src/Geopilot.Frontend/src/pages/admin/Organisations.jsx +++ b/src/Geopilot.Frontend/src/pages/admin/Organisations.jsx @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next"; export const Organisations = () => { const { t } = useTranslation(); - return <>Organisations page</>; + return <>{t("organisations")}</>; }; export default Organisations; diff --git a/src/Geopilot.Frontend/src/pages/admin/Users.jsx b/src/Geopilot.Frontend/src/pages/admin/Users.jsx index 1c999600..40548175 100644 --- a/src/Geopilot.Frontend/src/pages/admin/Users.jsx +++ b/src/Geopilot.Frontend/src/pages/admin/Users.jsx @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next"; export const Users = () => { const { t } = useTranslation(); - return <>Users page</>; + return <>{t("users")}</>; }; export default Users;