diff --git a/front/src/app/NavigationRoutes.js b/front/src/app/NavigationRoutes.js
index c2fdd7a..8ab17ec 100644
--- a/front/src/app/NavigationRoutes.js
+++ b/front/src/app/NavigationRoutes.js
@@ -5,18 +5,12 @@ import NotFoundPage from "./pages/notFound/NotFoundPage";
import {UserLayout} from "./layout/UserLayout";
import {HomeRedirect} from "./HomeRedirect";
import {PublicLayout} from "./layout/PublicLayout";
-import QueuePage from "./pages/queue/QueuePage";
import LoginPage from "./pages/auth/sign-in/loginPage";
import {TelegramCode} from "./pages/auth/sign-in/telegram-code";
import {IngredientsPage} from "./pages/ingredients/IngredientsPage";
import {MenuPage} from "./pages/cocktails/MenuPage";
-import {AllCocktailsPage} from "./pages/cocktails/AllCocktailsPage";
import {EditIngredientPage} from "./pages/ingredients/EditIngredientPage";
import {EditCocktailPage} from "./pages/cocktails/EditCocktailPage";
-import {MyQueuePage} from "./pages/queue/MyQueuePage";
-import {VisitorPage} from "./pages/VisitorPage";
-import {CocktailMenuBarPage} from "./pages/cocktails/CocktailMenuBarPage";
-import {MyBarPage} from "./pages/MyBarPage";
import {useEffect, useState} from "react";
export function NavigationRoutes() {
@@ -70,47 +64,17 @@ const authPages = [
children: (),
exact: true,
},
- {
- path: paths.bar.cocktails,
- isPrivate: true,
- children: ()
- },
- {
- path: paths.bar.list,
- isPrivate: true,
- children: ()
- },
- {
- path: paths.orders.my,
- isPrivate: true,
- children: ()
- },
{
path: paths.bar.ingredients,
isPrivate: true,
children: ()
},
- {
- path: paths.bar.ordersQueue,
- isPrivate: true,
- children: (),
- },
- {
- path: paths.visitor.inBar,
- isPrivate: true,
- children: ()
- },
{
path: paths.bar.ingredientEdit,
isPrivate: true,
forAdmin: true,
children: ()
},
- {
- path: paths.bar.menu,
- isPrivate: true,
- children: ()
- },
{
path: paths.bar.cocktailEdit,
isPrivate: true,
diff --git a/front/src/app/pages/MyBarPage.js b/front/src/app/pages/MyBarPage.js
deleted file mode 100644
index b0d3c56..0000000
--- a/front/src/app/pages/MyBarPage.js
+++ /dev/null
@@ -1,62 +0,0 @@
-import Box from "@mui/material/Box";
-import Toolbar from "@mui/material/Toolbar";
-import Typography from "@mui/material/Typography";
-import Paper from "@mui/material/Paper";
-import {FormControl, InputAdornment, InputLabel, OutlinedInput, Tabs} from "@mui/material";
-import IconButton from "@mui/material/IconButton";
-import SearchIcon from "@mui/icons-material/Search";
-import * as React from "react";
-import {useState} from "react";
-import Tab from "@mui/material/Tab";
-import {a11yProps} from "../../components/core/tabProps";
-import {CustomTabPanel} from "../../components/core/TabPanel";
-import {BarList} from "../../components/bar/BarList";
-
-export function MyBarPage() {
- const [value, setValue] = React.useState(0);
- const handleChange = (event, newValue) => setValue(newValue);
- const [findString, setFindString] = useState("");
-
- return (
-
- {/*Заголовок*/}
-
- Мои бары
-
- {/*Поиск*/}
-
-
- Поиск
- setFindString(e.target.value)}
- label="With normal TextField"
- startAdornment={
-
-
-
-
-
- }
- />
-
-
- {/*Рабочее поле ингредиентов*/}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {/*Модальное окно информации об ингредиенте*/}
- {/**/}
-
- )
-}
\ No newline at end of file
diff --git a/front/src/app/pages/VisitorPage.js b/front/src/app/pages/VisitorPage.js
deleted file mode 100644
index 1fea703..0000000
--- a/front/src/app/pages/VisitorPage.js
+++ /dev/null
@@ -1,77 +0,0 @@
-import Box from "@mui/material/Box";
-import {useEffect, useState} from "react";
-import {api} from "../../lib/clients/api";
-import {requests} from "../../requests";
-import {useAlert} from "../../hooks/useAlert";
-import Typography from "@mui/material/Typography";
-import {VisitorItem} from "../../components/visitor/VisitorItem";
-import Toolbar from "@mui/material/Toolbar";
-import * as React from "react";
-import Button from "@mui/material/Button";
-import {useUser} from "../../hooks/useUser";
-
-export function VisitorPage() {
- const {session, checkSession} = useUser();
- const [visitors, setVisitors] = useState([])
- const [open, setOpen] = useState(false);
- const {createError} = useAlert();
-
- useEffect(() => {
- api().get(requests.visitors.all)
- .then((r) => {
- setVisitors(r.data)
- })
- .catch(() => createError("Ошибка получения данных"))
- // eslint-disable-next-line
- }, []);
- useEffect(() => {
- setOpen(session.isActive);
- }, [session, checkSession])
-
- const changeHandler = (visitor) => {
- const arr = visitors.map((v) => {
- if(v.id === visitor.id) {
- return {
- ...visitor,
- invited: !visitor.invited
- }
- }
- return v;
- })
- api().post(`${requests.visitors.invite}id=${visitor.id}&value=${!visitor.invited}`)
- .then(() => setVisitors(arr))
- .catch(() => createError("Ошибка запроса"))
-
- }
- const changeShift = () => {
- api().post(`${requests.bar.session.change}?value=${!open}`)
- .then(() => {
- checkSession?.();
- setOpen(!open)
- })
- .catch(() => createError("Ошибка закрытия сессии"))
- }
-
- return (
-
- {/*Заголовок*/}
-
- Посетители
-
-
- {visitors.map((v) => {
- return (
-
- )
- })}
-
-
-
-
-
- )
-}
\ No newline at end of file
diff --git a/front/src/app/pages/cocktails/AllCocktailsPage.js b/front/src/app/pages/cocktails/AllCocktailsPage.js
deleted file mode 100644
index 875364c..0000000
--- a/front/src/app/pages/cocktails/AllCocktailsPage.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import CocktailsPageContent from "./CocktailsPageContent";
-
-export function AllCocktailsPage() {
- return (
-
- )
-}
\ No newline at end of file
diff --git a/front/src/app/pages/cocktails/CocktailMenuBarPage.js b/front/src/app/pages/cocktails/CocktailMenuBarPage.js
deleted file mode 100644
index 531bfe8..0000000
--- a/front/src/app/pages/cocktails/CocktailMenuBarPage.js
+++ /dev/null
@@ -1,122 +0,0 @@
-import Box from "@mui/material/Box";
-import Toolbar from "@mui/material/Toolbar";
-import Typography from "@mui/material/Typography";
-import Paper from "@mui/material/Paper";
-import {Fab, FormControl, FormControlLabel, InputAdornment, InputLabel, OutlinedInput} from "@mui/material";
-import IconButton from "@mui/material/IconButton";
-import SearchIcon from "@mui/icons-material/Search";
-import Switch from "@mui/material/Switch";
-import {blue} from "@mui/material/colors";
-import UpIcon from "@mui/icons-material/KeyboardArrowUp";
-import {Loading} from "../../../components/core/Loading";
-import * as React from "react";
-import {useEffect, useMemo, useState} from "react";
-import {CocktailsList} from "../../../components/cocktails/CocktailsList";
-import {requests} from "../../../requests";
-import {api} from "../../../lib/clients/api";
-import {useAlert} from "../../../hooks/useAlert";
-import {CocktailInfoModal} from "../../../components/cocktails/CocktailInfoModal";
-import {useSelect} from "../../../hooks/useSelect";
-
-export function CocktailMenuBarPage() {
- const {createError} = useAlert();
- const [grouping, setGrouping] = useState(true);
- const [findString, setFindString] = useState("");
- const [loading, setLoading] = useState(true);
- const [cocktails, setCocktails] = useState([]);
- const {setCocktail, state} = useSelect();
-
- useEffect(() => {
- api().get(`${requests.cocktails.menu}?all=true`)
- .then((r) => {
- setCocktails(r.data);
- setLoading(false);
- })
- .catch(() => createError("Ошибка получения данных"))
- // eslint-disable-next-line
- }, []);
-
-
- const handleOpenModal = (row) => {
- setCocktail(row);
- }
- const changeHandler = (row, value) => {
- const newState = cocktails.map((r) => {
- if (r.id !== row.id) {
- return r;
- }
- return {
- ...r,
- inMenu: value
- }
- });
- api().post(`${requests.cocktails.menu}?id=${row.id}&value=${value}`)
- .then(() => {
- setCocktails(newState);
- }).catch(() => createError("Ошибка сохранения данных"))
- }
-
- const visibleRows = useMemo(() => {
- if (findString === "") {
- return cocktails;
- }
- let regExp = new RegExp("(.*?)" + findString + "(.*?)", "i");
- return cocktails
- .filter((row) => row.name.split(" ").map((n) => n.match(regExp) !== null).includes(true))
- // eslint-disable-next-line
- }, [cocktails, findString])
-
- return (
-
- {/*Заголовок*/}
-
- Меню бара
-
- {/*Поиск*/}
-
-
- Поиск
- setFindString(e.target.value)}
- label="With normal TextField"
- startAdornment={
-
-
-
-
-
- }
- />
-
- }
- onClick={() => setGrouping(!grouping)}
- label="Группировать"
- labelPlacement="end"/>
-
- {/*Рабочее поле коктейлей*/}
-
- {/*Иконка возврата наверх*/}
- window.window.scrollTo(0, 0)}
- aria-label='Expand'
- color='inherit'>
-
-
- {/*Загрузчик*/}
-
- {/*Модальное окно информации об ингредиенте*/}
-
-
- )
-}
\ No newline at end of file
diff --git a/front/src/app/pages/cocktails/CocktailsPageContent.js b/front/src/app/pages/cocktails/CocktailsPageContent.js
index 6b46ac6..677bbc4 100644
--- a/front/src/app/pages/cocktails/CocktailsPageContent.js
+++ b/front/src/app/pages/cocktails/CocktailsPageContent.js
@@ -22,6 +22,7 @@ import {getComparator} from "../../../components/core/getComparator";
const emptyFilter = {
search: "",
+ all: false,
hidden: true,
onlyFavourite: false,
glass: [],
@@ -34,7 +35,7 @@ const emptyFilter = {
sorting: "Название по возрастанию"
}
-const CocktailsPageContent = ({all}) => {
+const CocktailsPageContent = () => {
const {user} = useUser();
const {createError, createSuccess} = useAlert();
const [allowIngredients, setAllowIngredients] = useState([])
@@ -56,7 +57,6 @@ const CocktailsPageContent = ({all}) => {
setLoad(true);
const request = {
...filter,
- all: all,
sort: sortList.find((s) => s.name === filter.sorting).id,
page: page + 1,
size: size,
@@ -110,7 +110,7 @@ const CocktailsPageContent = ({all}) => {
// eslint-disable-next-line
}, [filter])
useEffect(() => {
- if (!all) {
+ if (!filter.all) {
return;
}
const ingredients = new Set();
@@ -197,7 +197,7 @@ const CocktailsPageContent = ({all}) => {
if (r.id !== row.id) {
return r;
}
- if (all) {
+ if (filter.all) {
return {
...r,
inMenu: value
@@ -233,12 +233,10 @@ const CocktailsPageContent = ({all}) => {
handleFilterChange={handleFilterChange}
handleClearFilter={handleFilterClear}
barmen={user.role !== 'USER'}
- all={all}
/>
- {/*todo: доделать фильтр по количеству недостающих ингредиентов*/}
{
- (all && filter.iCount === 1) && (
+ (filter.all && filter.iCount === 1) && (
+
)
}
\ No newline at end of file
diff --git a/front/src/app/pages/ingredients/IngredientsPage.js b/front/src/app/pages/ingredients/IngredientsPage.js
index 41c5c93..9e7145d 100644
--- a/front/src/app/pages/ingredients/IngredientsPage.js
+++ b/front/src/app/pages/ingredients/IngredientsPage.js
@@ -23,7 +23,6 @@ import {useSelect} from "../../../hooks/useSelect";
export function IngredientsPage() {
const [value, setValue] = React.useState(0);
- const [grouping, setGrouping] = useState(true);
const handleChange = (event, newValue) => setValue(newValue);
const [loading, setLoading] = useState(true);
const [findString, setFindString] = useState("");
@@ -101,11 +100,6 @@ export function IngredientsPage() {
}
/>
- }
- onClick={() => setGrouping(!grouping)}
- label="Группировать"
- labelPlacement="end"/>
{/*Рабочее поле ингредиентов*/}
@@ -117,11 +111,11 @@ export function IngredientsPage() {
+ infoHandler={handleOpenModal}/>
+ infoHandler={handleOpenModal}/>
- )
-}
\ No newline at end of file
diff --git a/front/src/app/pages/queue/QueueContent.js b/front/src/app/pages/queue/QueueContent.js
deleted file mode 100644
index dc66fbf..0000000
--- a/front/src/app/pages/queue/QueueContent.js
+++ /dev/null
@@ -1,82 +0,0 @@
-import {useEffect, useMemo, useState} from "react";
-import {useAlert} from "../../../hooks/useAlert";
-import * as React from "react";
-import {api} from "../../../lib/clients/api";
-import {requests} from "../../../requests";
-import {createHeadCell} from "../../../components/orders/createHeadCelll";
-import {Loading} from "../../../components/core/Loading";
-import OrderModal from "../../../components/orders/OrderModal";
-import EnhancedTable from "../../../components/orders/EnhancedTable";
-
-export function QueueContent({my}) {
- const [load, setLoad] = useState(false);
- const [orders, setOrders] = useState([]);
- const {createSuccess, createError} = useAlert();
- const [openModal, setOpenModal] = React.useState(false);
- const [selected, setSelected] = useState(null);
-
- useEffect(() => {
- setLoad(false);
- const url = my ? requests.bar.myOrders : requests.bar.order;
- api().get(url)
- .then(r => {
- setOrders(r.data);
- setLoad(true);
- })
- .catch(() => {
- createError("Ошибка при получении заказов");
- setLoad(true)
- })
- // eslint-disable-next-line
- }, []);
-
- const sliced = useMemo(() => orders.sort((a, b) => b.id - a.id), [orders])
-
- const cells = [
- createHeadCell('id', true, true, 'Номер заказа', "20px"),
- createHeadCell('cocktail.name', true, false, 'Коктейль', "40px"),
- createHeadCell('visitor.name', true, false, 'Клиент', "40px"),
- createHeadCell('status', true, true, 'Статус', "30px"),
- ];
-
- const changeOrderHandle = (row, status) => {
- let url = requests.bar.order + "?id=" + row.id;
- let isCancel = status === "CANCEL";
- let request = isCancel ? api().delete(url) : api().put(url);
- request
- .then(() => {
- createSuccess(isCancel ? "Заказ отменен" : "Заказ готов");
- let newArr = orders.filter((order) => {
- if (order.id !== row.id) {
- row.status = isCancel ? "CANCEL" : "DONE";
- return row;
- }
- return order;
- })
- setOrders(newArr);
- setSelected(null);
- setOpenModal(false);
- })
- .catch(() => createError("Ошибка изменения заказа"))
- }
- const handleSelect = (row) => {
- setSelected(row);
- setOpenModal(true);
- }
- const handleCloseModal = () => {
- setOpenModal(false);
- setSelected(null);
- };
-
- const filterValues = !my ? ["DONE", "CANCEL"] : [];
-
- return (
- <>
-
-
-
- >
- )
-}
\ No newline at end of file
diff --git a/front/src/app/pages/queue/QueuePage.js b/front/src/app/pages/queue/QueuePage.js
deleted file mode 100644
index 639ade7..0000000
--- a/front/src/app/pages/queue/QueuePage.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import * as React from "react";
-import {QueueContent} from "./QueueContent";
-
-const QueuePage = () => {
- return (
-
- )
-}
-
-export default QueuePage;
\ No newline at end of file
diff --git a/front/src/components/Ingredients/IngredientList.js b/front/src/components/Ingredients/IngredientList.js
index ac74e11..e4e5aea 100644
--- a/front/src/components/Ingredients/IngredientList.js
+++ b/front/src/components/Ingredients/IngredientList.js
@@ -7,32 +7,12 @@ import Typography from "@mui/material/Typography";
import {getComparator} from "../core/getComparator";
import {groupByForLoop} from "../core/groupByForLoop";
-export function IngredientList({rows, value, infoHandler, changeHandler, grouping}) {
- const [size, setSize] = useState(10);
- window.addEventListener('scroll', () => {
- if (window.innerHeight + window.scrollY >= (document.documentElement.scrollHeight - 100)) {
- if (!grouping) {
- setSize(size + 10)
- }
- }
- });
-
+export function IngredientList({rows, value, infoHandler, changeHandler}) {
const visibleRows = useMemo(() => {
let res = [];
if (rows.length === 0) {
return null;
}
- if (!grouping) {
- return rows
- .sort(getComparator("asc", "name"))
- .slice(0, size)
- .map((row) => {
- return (
-
- )
- })
- }
const group = groupByForLoop(rows, "type")
if (!group || group.size === 0) {
@@ -65,7 +45,7 @@ export function IngredientList({rows, value, infoHandler, changeHandler, groupin
})
return res;
// eslint-disable-next-line
- }, [size, rows])
+ }, [rows])
return (
diff --git a/front/src/components/cocktails/Cocktail.js b/front/src/components/cocktails/Cocktail.js
index ddfb922..91fe6e0 100644
--- a/front/src/components/cocktails/Cocktail.js
+++ b/front/src/components/cocktails/Cocktail.js
@@ -71,12 +71,6 @@ export function Cocktail({row, handleFavourite, handleChangeRating, handleSelect
{row.name}
-
- {(row.isAllowed && session.isActive && user.invited) &&
-
- }
- {editMenuBlock(row)}
-
diff --git a/front/src/components/cocktails/CocktailDescription.js b/front/src/components/cocktails/CocktailDescription.js
index db6b9e2..c07c1fe 100644
--- a/front/src/components/cocktails/CocktailDescription.js
+++ b/front/src/components/cocktails/CocktailDescription.js
@@ -27,10 +27,6 @@ export function CocktailDescription({row}) {
{"Состав: " + row.components}
- {(row.tags && row.tags.length > 0) && (
-
- {"Теги: " + row.tags.replaceAll(',', ', ')}
- )}
)
}
\ No newline at end of file
diff --git a/front/src/components/cocktails/FilterBlock.js b/front/src/components/cocktails/FilterBlock.js
index c500a77..61c0199 100644
--- a/front/src/components/cocktails/FilterBlock.js
+++ b/front/src/components/cocktails/FilterBlock.js
@@ -26,7 +26,7 @@ const inMenuFilter = [
}
]
-export function FilterBlock({filter, handleFilterChange, handleClearFilter, barmen, all}) {
+export function FilterBlock({filter, handleFilterChange, handleClearFilter, barmen}) {
const {createError} = useAlert();
const [glass, setGlass] = useState([]);
const [category, setCategory] = useState([]);
@@ -111,14 +111,6 @@ export function FilterBlock({filter, handleFilterChange, handleClearFilter, barm
{/*Блок фильтров*/}
- {/*Фильтр по меню*/}
- {(barmen && all) && (
-
- )}
{/*Фильтр по избранным*/}
+ {/*Фильтр по избранным*/}
+ handleFilterChange("all", !filter.all)}
+ />
+ }
+ label={!filter.all ? "Полный список" : "Только доступные"}
+ sx={{ml: 1}}
+ />
{/*Фильтр по алкогольности*/}
@@ -143,8 +145,7 @@ export function FilterBlock({filter, handleFilterChange, handleClearFilter, barm
{tags.length > 0 && ()}
{/*Фильтр по нехватке ингредиентов*/}
- {/*todo: доделать эти фильтры в беке*/}
- {(barmen && all) && ()}
diff --git a/front/src/components/navigation/MainNav.js b/front/src/components/navigation/MainNav.js
index 9ed3151..62bd779 100644
--- a/front/src/components/navigation/MainNav.js
+++ b/front/src/components/navigation/MainNav.js
@@ -5,7 +5,6 @@ import IconButton from '@mui/material/IconButton';
import Stack from '@mui/material/Stack';
import {List as ListIcon} from '@phosphor-icons/react/dist/ssr/List';
// import NotificationsIcon from '@mui/icons-material/Notifications';
-
import {usePopover} from "../../hooks/usePopover";
import {MobileNav} from "./MobileNav";
import {UserPopover} from "../core/UserPopover";
@@ -15,8 +14,6 @@ import {UserPopover} from "../core/UserPopover";
export function MainNav() {
const [openNav, setOpenNav] = React.useState(false);
- // const {notImplement} = useAlert();
-
const userPopover = usePopover();
return (
@@ -40,13 +37,6 @@ export function MainNav() {
- {/* notImplement()}>*/}
- {/* */}
- {/* */}
- {/* */}
- {/* */}
- {/* */}
- {/**/}
diff --git a/front/src/components/navigation/NavigationMenu.js b/front/src/components/navigation/NavigationMenu.js
index 4af0066..b95118c 100644
--- a/front/src/components/navigation/NavigationMenu.js
+++ b/front/src/components/navigation/NavigationMenu.js
@@ -12,8 +12,6 @@ import Typography from "@mui/material/Typography";
function renderSpecialItems(items, label, pathname) {
return (
-
- {label}
{renderNavItems({items: items, pathname: pathname})}
)
diff --git a/front/src/components/orders/EnhancedTable.js b/front/src/components/orders/EnhancedTable.js
deleted file mode 100644
index 3f97b88..0000000
--- a/front/src/components/orders/EnhancedTable.js
+++ /dev/null
@@ -1,113 +0,0 @@
-import * as React from "react";
-import Box from "@mui/material/Box";
-import Paper from "@mui/material/Paper";
-import TableContainer from "@mui/material/TableContainer";
-import Table from "@mui/material/Table";
-import TableBody from "@mui/material/TableBody";
-import TableRow from "@mui/material/TableRow";
-import TableCell from "@mui/material/TableCell";
-import TablePagination from "@mui/material/TablePagination";
-import {getComparator} from "../core/getComparator";
-import {EnhancedTableToolbar} from "./EnhancedTableToolbar";
-import {EnhancedTableHead} from "./EnhancedTableHead";
-
-export default function EnhancedTable({name, rows, cells, handleSelect, filterField, filterEqual, filterValue}) {
- //сортировка убывание/возрастание
- const [order, setOrder] = React.useState('desc');
- //По какому полю сортируем
- const [orderBy, setOrderBy] = React.useState('id');
- //выбранная страница
- const [page, setPage] = React.useState(0);
- //количество элементов на странице
- const [rowsPerPage, setRowsPerPage] = React.useState(10);
-
- const handleRequestSort = (event, property) => {
- const isAsc = orderBy === property && order === 'asc';
- setOrder(isAsc ? 'desc' : 'asc');
- setOrderBy(property);
- };
- const handleChangePage = (event, newPage) => {
- setPage(newPage);
- };
- const handleChangeRowsPerPage = (event) => {
- setRowsPerPage(parseInt(event.target.value, 10));
- setPage(0);
- };
- const getTableValue = (obj, index) => {
- let indexArr = index.split(".");
- let object = obj;
- for (let i of indexArr) {
- object = object[i];
- }
- return object;
- }
-
- const visibleRows = React.useMemo(() =>
- [...rows]
- .filter((row) => {
- if (!filterField) {
- return true;
- }
- for (let field of filterField) {
- for (let value of filterValue) {
- let eq = (row[field] === value) === filterEqual;
- if (!eq) {
- return false;
- }
- }
- }
- return true;
- })
- .sort(getComparator(order, orderBy))
- .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage),
- [order, orderBy, page, rowsPerPage, rows, filterEqual, filterField, filterValue],
- );
-
- const renderTable = (row) => {
- // const isItemSelected = selected.includes(row.id);
- const isItemSelected = false;
- return (
- handleSelect(row)} role="checkbox"
- aria-checked={isItemSelected} tabIndex={-1} key={row.id} selected={isItemSelected}
- sx={{cursor: 'pointer'}}>
- {cells.map((cell) => {
- return (
- {getTableValue(row, cell.id)}
- )
- })}
-
- );
- }
- const emptyRow = () => {
- return (
-
-
- Нет заказов
-
-
- )
- }
-
- return (
-
-
-
-
-
-
-
- {visibleRows.map((row) => renderTable(row))}
- {visibleRows.length === 0 && emptyRow()}
-
-
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/front/src/components/orders/EnhancedTableHead.js b/front/src/components/orders/EnhancedTableHead.js
deleted file mode 100644
index bac679c..0000000
--- a/front/src/components/orders/EnhancedTableHead.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import TableHead from "@mui/material/TableHead";
-import TableRow from "@mui/material/TableRow";
-import TableCell from "@mui/material/TableCell";
-import TableSortLabel from "@mui/material/TableSortLabel";
-import Box from "@mui/material/Box";
-import {visuallyHidden} from "@mui/utils";
-import * as React from "react";
-
-export function EnhancedTableHead(props) {
- const {order, orderBy, onRequestSort, cells} = props;
- const createSortHandler = (property) => (event) => {onRequestSort(event, property);};
-
- return (
-
-
- {cells.map((headCell) => (
-
-
- {headCell.label}
- {orderBy === headCell.id ? (
-
- {order === 'desc' ? 'sorted descending' : 'sorted ascending'}
-
- ) : null}
-
-
- ))}
-
-
- );
-}
\ No newline at end of file
diff --git a/front/src/components/orders/EnhancedTableToolbar.js b/front/src/components/orders/EnhancedTableToolbar.js
deleted file mode 100644
index 7abab77..0000000
--- a/front/src/components/orders/EnhancedTableToolbar.js
+++ /dev/null
@@ -1,64 +0,0 @@
-import Toolbar from "@mui/material/Toolbar";
-import {alpha} from "@mui/material/styles";
-import Typography from "@mui/material/Typography";
-import Tooltip from "@mui/material/Tooltip";
-import IconButton from "@mui/material/IconButton";
-import DeleteIcon from "@mui/icons-material/Delete";
-import FilterListIcon from "@mui/icons-material/FilterList";
-import PropTypes from "prop-types";
-import * as React from "react";
-
-export function EnhancedTableToolbar(props) {
- const { numSelected, name } = props;
- return (
- 0 && {
- bgcolor: (theme) =>
- alpha(theme.palette.primary.main, theme.palette.action.activatedOpacity),
- },
- ]}
- >
- {numSelected > 0 ? (
-
- {numSelected} selected
-
- ) : (
-
- {name}
-
- )}
- {numSelected > 0 ? (
-
-
-
-
-
- ) : (
-
-
-
-
-
- )}
-
- );
-}
-
-EnhancedTableToolbar.propTypes = {
- numSelected: PropTypes.number.isRequired,
-};
\ No newline at end of file
diff --git a/front/src/components/orders/OrderModal.js b/front/src/components/orders/OrderModal.js
deleted file mode 100644
index 907842d..0000000
--- a/front/src/components/orders/OrderModal.js
+++ /dev/null
@@ -1,105 +0,0 @@
-import * as React from 'react';
-import {useEffect, useState} from 'react';
-import Box from '@mui/material/Box';
-import Button from '@mui/material/Button';
-import Dialog from '@mui/material/Dialog';
-import DialogActions from '@mui/material/DialogActions';
-import DialogContent from '@mui/material/DialogContent';
-import DialogContentText from '@mui/material/DialogContentText';
-import DialogTitle from '@mui/material/DialogTitle';
-import Stack from "@mui/material/Stack";
-import Typography from "@mui/material/Typography";
-import {ButtonGroup} from "@mui/material";
-import {requests} from "../../requests";
-import {useAlert} from "../../hooks/useAlert";
-import {api} from "../../lib/clients/api";
-
-function renderButtons(row, my, handleChange) {
- if (my) {
- if (row.status === "NEW") {
- return (
-
-
-
- );
- } else {
- return null;
- }
- } else {
- return (
-
-
-
-
- )
- }
-}
-
-export default function OrderModal({row, handleClose, open, handleChange, my}) {
- const [receipt, setReceipt] = useState([]);
- const [instructions, setInstructions] = useState();
- const {createError} = useAlert();
-
- useEffect(() => {
- if (!row) {
- return;
- }
- api().get(requests.bar.receipts + row.cocktail.id)
- .then((r) => setReceipt(r.data))
- .catch(() => createError("Ошибка получения рецепта"))
-
- api().get(requests.cocktails.instructions + row.cocktail.id)
- .then((r) => setInstructions(r.data))
- .catch(() => createError("Ошибка получения инструкции"))
- // eslint-disable-next-line
- }, [row]);
-
- if (!row) {
- return null;
- }
- return (
-
- );
-}
\ No newline at end of file
diff --git a/front/src/components/orders/createHeadCelll.js b/front/src/components/orders/createHeadCelll.js
deleted file mode 100644
index fd26562..0000000
--- a/front/src/components/orders/createHeadCelll.js
+++ /dev/null
@@ -1,9 +0,0 @@
-export function createHeadCell(id, numeric, padding, label, width) {
- return {
- id: id,
- numeric: numeric,
- disablePadding: padding,
- label: label,
- width: width
- }
-}
\ No newline at end of file
diff --git a/front/src/components/visitor/VisitorItem.js b/front/src/components/visitor/VisitorItem.js
deleted file mode 100644
index 13c5290..0000000
--- a/front/src/components/visitor/VisitorItem.js
+++ /dev/null
@@ -1,49 +0,0 @@
-import Typography from "@mui/material/Typography";
-import {Card, FormControlLabel} from "@mui/material";
-import Stack from "@mui/material/Stack";
-import Box from "@mui/material/Box";
-import Switch from "@mui/material/Switch";
-import * as React from "react";
-
-export function VisitorItem({visitor, changeHandler, open}) {
-
- const getRole = (role) => {
- switch (role) {
- case "USER":
- return 'Посетитель';
- case "BARMEN":
- return 'Бармен';
- case "ADMIN":
- return 'Админ';
- default:
- return "Посетитель";
- }
- }
-
- return (
-
-
- {`${visitor.name} ${!visitor.lastName ? "" : visitor.lastName}`}
-
- {getRole(visitor.role)}
-
-
- changeHandler(visitor)}
- />}
- label="Приглашен" labelPlacement='start'/>
-
-
- {visitor.isActive ? "В баре" : "Не вошел в бар"}
-
-
-
- )
-}
\ No newline at end of file
diff --git a/front/src/navItems.js b/front/src/navItems.js
index 4b5e203..9515d23 100644
--- a/front/src/navItems.js
+++ b/front/src/navItems.js
@@ -2,13 +2,7 @@ import {paths} from "./path";
export const navItems = [
{key: 'menu', title: 'Меню', href: paths.dashboard.overview, icon: 'menu'},
- {key: 'cocktailList', title: 'Коктейльная база', href: paths.bar.cocktails, icon: 'list'},
- {key: 'myOrders', title: "Мои заказы", href: paths.orders.my, icon: 'wallet'},
- {key: 'myBar', title: "Мои бары", href: paths.bar.list, icon: 'storefront'},
- {key: 'queue', title: 'Очередь заказов', href: paths.bar.ordersQueue, icon: 'orders', forBarmen: true},
- {key: 'ingredients', title: 'Ингредиенты в баре', href: paths.bar.ingredients, icon: 'basket', forBarmen: true},
- {key: 'visitors', title: "Посетители", href: paths.visitor.inBar, icon: 'visitors', forBarmen: true},
- // {key: 'editMenu', title: "Редактировать меню", href: paths.bar.menu, icon: 'menu', forBarmen: true},
+ {key: 'ingredients', title: 'Список ингредиентов', href: paths.bar.ingredients, icon: 'basket', forBarmen: true},
{key: 'ingredientEdit', title: 'Ингредиенты', href: paths.bar.ingredientEdit, icon: 'ingredients', forAdmin: true},
{key: 'cocktailEdit', title: 'Коктейли', href: paths.bar.cocktailEdit, icon: 'cocktail', forAdmin: true}
];