Skip to content

Commit

Permalink
Merge pull request #22 from Robrey27/master
Browse files Browse the repository at this point in the history
GridView and tagView
  • Loading branch information
Robrey27 authored Dec 20, 2024
2 parents ae1546f + 974df7f commit 3d8ba0c
Show file tree
Hide file tree
Showing 5 changed files with 1,286 additions and 266 deletions.
4 changes: 4 additions & 0 deletions src/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { ImportView } from "./views/ImportView";
import { DeleteImportView } from "./views/DeleteImportView";
import { ImportViewExcel} from "./views/ImportViewExcel";
import GridViewView from "./views/GridViewView";
import TagView from "./views/TagView";

const drawerWidth = 250;

Expand Down Expand Up @@ -121,6 +122,9 @@ export default function Layout() {
<GraphiQLEditor/>
</Paper>
</Route>
<Route path="/tagview">
<TagView/>
</Route>
<Route path="/gridview">
<GridViewView/>
</Route>
Expand Down
85 changes: 51 additions & 34 deletions src/components/AppDrawer.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import * as React from 'react';
import { FunctionComponent } from 'react';
import Drawer, { DrawerProps } from '@material-ui/core/Drawer';
import List from '@material-ui/core/List';
import ListSubheader from '@material-ui/core/ListSubheader';
import makeStyles from '@material-ui/core/styles/makeStyles';
import ListItem, { ListItemProps } from '@material-ui/core/ListItem';
import Tooltip from '@material-ui/core/Tooltip';
import { Link as RouterLink } from 'react-router-dom';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText from '@material-ui/core/ListItemText';
import SearchIcon from '@material-ui/icons/Search';
import HomeIcon from '@material-ui/icons/Home';
import StorageIcon from '@material-ui/icons/Storage';
import AccountCircleIcon from '@material-ui/icons/AccountCircle';
import ImportExportIcon from '@material-ui/icons/ImportExport';
import CodeIcon from '@material-ui/icons/Code';
import ChecklistIcon from '@mui/icons-material/Checklist';
import FileUploadIcon from '@mui/icons-material/FileUpload';
import FileDownloadIcon from '@mui/icons-material/FileDownload';
import PublishIcon from '@mui/icons-material/Publish';
import * as React from "react";
import { FunctionComponent } from "react";
import Drawer, { DrawerProps } from "@material-ui/core/Drawer";
import List from "@material-ui/core/List";
import ListSubheader from "@material-ui/core/ListSubheader";
import makeStyles from "@material-ui/core/styles/makeStyles";
import ListItem, { ListItemProps } from "@material-ui/core/ListItem";
import Tooltip from "@material-ui/core/Tooltip";
import { Link as RouterLink } from "react-router-dom";
import ListItemIcon from "@material-ui/core/ListItemIcon";
import ListItemText from "@material-ui/core/ListItemText";
import SearchIcon from "@material-ui/icons/Search";
import HomeIcon from "@material-ui/icons/Home";
import StorageIcon from "@material-ui/icons/Storage";
import AccountCircleIcon from "@material-ui/icons/AccountCircle";
import LocalOfferIcon from "@mui/icons-material/LocalOffer";
import CodeIcon from "@material-ui/icons/Code";
import ChecklistIcon from "@mui/icons-material/Checklist";
import BookmarksIcon from "@mui/icons-material/Bookmarks";
import FileDownloadIcon from "@mui/icons-material/FileDownload";
import PublishIcon from "@mui/icons-material/Publish";
import {
ClassEntity,
DataTemplateEntity,
Expand All @@ -30,13 +30,13 @@ import {
PropertyGroupEntity,
UnitEntity,
ValueEntity,
} from '../domain';
import AppTitle from './AppTitle';
import { useAdminAccess } from '../hooks/useAuthContext';
} from "../domain";
import AppTitle from "./AppTitle";
import { useAdminAccess } from "../hooks/useAuthContext";

const useStyles = makeStyles((theme) => ({
drawerContainer: {
overflow: 'auto',
overflow: "auto",
},
heading: {
padding: theme.spacing(2),
Expand All @@ -52,10 +52,18 @@ type AppDrawerItemProps = {
onClick: () => void;
};

export const AppDrawerItem: FunctionComponent<AppDrawerItemProps & ListItemProps> = (
props
) => {
const { icon, primary, secondary, tooltip = '', to, disabled, onClick } = props;
export const AppDrawerItem: FunctionComponent<
AppDrawerItemProps & ListItemProps
> = (props) => {
const {
icon,
primary,
secondary,
tooltip = "",
to,
disabled,
onClick,
} = props;

return (
<Tooltip title={tooltip} aria-label={tooltip} arrow enterDelay={500}>
Expand All @@ -80,7 +88,7 @@ const AppDrawer: FunctionComponent<DrawerProps> = (props) => {

const handleItemClick = () => {
if (onClose) {
onClose({}, 'backdropClick');
onClose({}, "backdropClick");
}
};

Expand Down Expand Up @@ -131,7 +139,7 @@ const AppDrawer: FunctionComponent<DrawerProps> = (props) => {
)}

<AppDrawerItem
icon={<FileDownloadIcon />}
icon={<FileDownloadIcon />}
primary="Exportieren"
to="/export"
onClick={handleItemClick}
Expand All @@ -146,11 +154,20 @@ const AppDrawer: FunctionComponent<DrawerProps> = (props) => {
/>
)}

<AppDrawerItem
{isAdmin && (
<AppDrawerItem
icon={<LocalOfferIcon />}
primary="Neue Tags anlegen"
to="/tagview"
onClick={handleItemClick}
/>
)}

<AppDrawerItem
icon={<StorageIcon />}
primary="Tabellenansicht"
to="/gridview"
onClick={handleItemClick}
onClick={handleItemClick}
/>

<ListSubheader disableSticky>Katalog</ListSubheader>
Expand Down Expand Up @@ -220,7 +237,7 @@ const AppDrawer: FunctionComponent<DrawerProps> = (props) => {
/>

<AppDrawerItem
icon={<ValueEntity.Icon />}
icon={<BookmarksIcon />}
primary={ValueEntity.titlePlural}
to={`/${ValueEntity.path}`}
onClick={handleItemClick}
Expand Down
Loading

0 comments on commit 3d8ba0c

Please sign in to comment.