Change folder structure

This commit is contained in:
Sina Blattmann 2023-03-06 09:32:43 +01:00
parent 8dd591d752
commit 8112e1ed8b
24 changed files with 531 additions and 601 deletions

View File

@ -1,50 +0,0 @@
{
"alarms": {
"defaultMessage": "Alarms"
},
"allInstallations": {
"defaultMessage": "All installations"
},
"applyChanges": {
"defaultMessage": "Apply changes"
},
"country": {
"defaultMessage": "Country"
},
"customerName": {
"defaultMessage": "Customer name"
},
"english": {
"defaultMessage": "English"
},
"german": {
"defaultMessage": "German"
},
"installation": {
"defaultMessage": "Installation"
},
"location": {
"defaultMessage": "Location"
},
"log": {
"defaultMessage": "Log"
},
"logout": {
"defaultMessage": "Logout"
},
"orderNumbers": {
"defaultMessage": "Order number"
},
"region": {
"defaultMessage": "Region"
},
"search": {
"defaultMessage": "Search"
},
"updatedSuccessfully": {
"defaultMessage": "Updated successfully"
},
"users": {
"defaultMessage": "Users"
}
}

View File

@ -7,11 +7,10 @@ import { IntlProvider } from "react-intl";
import { useState } from "react";
import en from "./lang/en.json";
import de from "./lang/de.json";
import LanguageSelect from "./components/LanguageSelect";
import LogoutButton from "./components/LogoutButton";
import Installations from "./routes/Installations";
import Groups from "./routes/Groups";
import Installations from "./components/Installations/Installations";
import LanguageSelect from "./components/Layout/LanguageSelect";
import LogoutButton from "./components/Layout/LogoutButton";
import Groups from "./components/Groups/Groups";
const App = () => {
const { token, setToken, removeToken } = useToken();

View File

@ -1,8 +1,8 @@
import React, { useState } from "react";
import { Alert, Button, CircularProgress, Grid } from "@mui/material";
import Container from "@mui/material/Container";
import InnovenergyTextfield from "./components/InnovenergyTextfield";
import { axiosConfigWithoutToken } from "./config/axiosConfig";
import InnovenergyTextfield from "./components/Layout/InnovenergyTextfield";
const loginUser = async (username: string, password: string) => {
return axiosConfigWithoutToken.post("/Login", {

View File

@ -1,5 +0,0 @@
import axios from 'axios';
export const API = axios.create({
baseURL: `https://localhost:7291/`
});

View File

@ -2,8 +2,8 @@ import { Box, CircularProgress, Alert } from "@mui/material";
import { AxiosError } from "axios";
import { useState, useEffect } from "react";
import { useParams } from "react-router-dom";
import axiosConfig from "../config/axiosConfig";
import { I_Installation } from "../util/types";
import axiosConfig from "../../config/axiosConfig";
import { I_Installation } from "../../util/types";
const Group = () => {
const { id } = useParams();

View File

@ -3,8 +3,8 @@ import Tabs from "@mui/material/Tabs";
import Tab from "@mui/material/Tab";
import Box from "@mui/material/Box";
import { Link } from "react-router-dom";
import routes from "../routes.json";
import useRouteMatch from "../hooks/useRouteMatch";
import routes from "../../routes.json";
import useRouteMatch from "../../hooks/useRouteMatch";
import { useIntl } from "react-intl";
const GroupTabs = () => {

View File

@ -3,9 +3,10 @@ import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
import { ReactNode, useEffect, useState } from "react";
import { TreeItem } from "@mui/lab";
import { I_Folder, I_Installation } from "../util/types";
import axiosConfig from "../config/axiosConfig";
import { Link } from "react-router-dom";
import axiosConfig from "../../config/axiosConfig";
import { I_Folder, I_Installation } from "../../util/types";
const GroupTree = () => {
const [data, setData] = useState<(I_Folder | I_Installation)[]>();

View File

@ -1,11 +1,11 @@
import { Grid } from "@mui/material";
import { Container } from "@mui/system";
import { Routes, Route } from "react-router";
import GroupTabs from "../components/GroupTabs";
import NavigationButtons from "../components/NavigationButtons";
import UserTree from "../components/GroupTree";
import routes from "../routes.json";
import routes from "../../routes.json";
import NavigationButtons from "../Layout/NavigationButtons";
import Group from "./Group";
import GroupTabs from "./GroupTabs";
import GroupTree from "./GroupTree";
const Groups = () => {
return (
@ -13,7 +13,7 @@ const Groups = () => {
<Grid container spacing={2}>
<Grid item xs={3}>
<NavigationButtons />
<UserTree />
<GroupTree />
</Grid>
<Grid item xs={9}>
<GroupTabs />

View File

@ -2,9 +2,9 @@ import { Alert, Button, Grid, Snackbar } from "@mui/material";
import { useFormik } from "formik";
import { useState } from "react";
import { FormattedMessage, useIntl } from "react-intl";
import axiosConfig from "../config/axiosConfig";
import { I_Installation } from "../util/types";
import InnovenergyTextfield from "./InnovenergyTextfield";
import axiosConfig from "../../config/axiosConfig";
import { I_Installation } from "../../util/types";
import InnovenergyTextfield from "../Layout/InnovenergyTextfield";
interface I_CustomerFormProps {
values: I_Installation;
@ -26,7 +26,7 @@ const CustomerForm = (props: I_CustomerFormProps) => {
},
onSubmit: (formikValues) => {
axiosConfig
.put("https://localhost:7087/api/UpdateInstallation", {
.put("/UpdateInstallation", {
...formikValues,
id,
})

View File

@ -2,9 +2,9 @@ import { Alert, Box, CircularProgress } from "@mui/material";
import { AxiosError } from "axios";
import { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import CustomerForm from "../components/CustomerForm";
import axiosConfig from "../config/axiosConfig";
import { I_Installation } from "../util/types";
import CustomerForm from "./CustomerForm";
import axiosConfig from "../../config/axiosConfig";
import { I_Installation } from "../../util/types";
const InstallationDetail = () => {
const { id } = useParams();

View File

@ -3,11 +3,11 @@ import ListItemButton from "@mui/material/ListItemButton";
import ListItemText from "@mui/material/ListItemText";
import { CircularProgress, Divider, Grid } from "@mui/material";
import { Link } from "react-router-dom";
import useRouteMatch from "../hooks/useRouteMatch";
import routes from "../routes.json";
import useRouteMatch from "../../hooks/useRouteMatch";
import routes from "../../routes.json";
import { Fragment, useEffect, useState } from "react";
import { I_Installation } from "../util/types";
import axiosConfig from "../config/axiosConfig";
import { I_Installation } from "../../util/types";
import axiosConfig from "../../config/axiosConfig";
interface InstallationListProps {
searchQuery: string;

View File

@ -3,8 +3,8 @@ import Tabs from "@mui/material/Tabs";
import Tab from "@mui/material/Tab";
import Box from "@mui/material/Box";
import { Link } from "react-router-dom";
import routes from "../routes.json";
import useRouteMatch from "../hooks/useRouteMatch";
import routes from "../../routes.json";
import useRouteMatch from "../../hooks/useRouteMatch";
import { useIntl } from "react-intl";
const InstallationTabs = () => {

View File

@ -1,14 +1,14 @@
import { Grid } from "@mui/material";
import { Container } from "@mui/system";
import { Routes, Route } from "react-router";
import InstallationTabs from "../components/InstallationTabs";
import NavigationButtons from "../components/NavigationButtons";
import BasicTable from "../components/Table";
import NavigationButtons from "../Layout/NavigationButtons";
import Sidebar from "../Layout/Sidebar";
import BasicTable from "../Layout/Table";
import Alarms from "./Alarms";
import InstallationDetail from "./Installation";
import InstallationTabs from "./InstallationTabs";
import Log from "./Log";
import routes from "../routes.json";
import Sidebar from "../components/Sidebar";
import routes from "../../routes.json";
const Installations = () => {
return (

View File

@ -1,7 +1,7 @@
import { Button } from "@mui/material";
import { FormattedMessage } from "react-intl";
import axiosConfig from "../config/axiosConfig";
import { useNavigate } from "react-router-dom";
import axiosConfig from "../../config/axiosConfig";
interface LogoutButtonProps {
removeToken: () => void;

View File

@ -1,8 +1,8 @@
import { ToggleButton, ToggleButtonGroup } from "@mui/material";
import { FormattedMessage } from "react-intl";
import { Link } from "react-router-dom";
import useRouteMatch from "../hooks/useRouteMatch";
import routes from "../routes.json";
import useRouteMatch from "../../hooks/useRouteMatch";
import routes from "../../routes.json";
const NavigationButtons = () => {
const routeMatch = useRouteMatch([
@ -27,7 +27,11 @@ const NavigationButtons = () => {
defaultMessage="All installations"
/>
</ToggleButton>
<ToggleButton value={routes.groups + "*"} component={Link} to={routes.groups}>
<ToggleButton
value={routes.groups + "*"}
component={Link}
to={routes.groups}
>
<FormattedMessage id="groups" defaultMessage="Groups" />
</ToggleButton>
</ToggleButtonGroup>

View File

@ -1,7 +1,7 @@
import { TextField } from "@mui/material";
import { useState } from "react";
import { useIntl } from "react-intl";
import InstallationList from "./InstallationList";
import InstallationList from "../Installations/InstallationList";
const Sidebar = () => {
const [searchQuery, setSearchQuery] = useState("");

View File

@ -1,3 +0,0 @@
.link {
text-decoration: none;
}

View File

@ -1,16 +0,0 @@
import AppBar from '@mui/material/AppBar';
import Toolbar from '@mui/material/Toolbar';
import { Link } from 'react-router-dom';
function Navigation() {
return (
<AppBar position="static">
<Toolbar disableGutters>
<Link to="/" >All installations</Link>
<Link to="/anotherPath">Users</Link>
</Toolbar>
</AppBar>
);
}
export default Navigation;