Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f88cf29
changed day title format
CZnavody19 Nov 8, 2023
8f92949
change picker date format
CZnavody19 Nov 19, 2023
b91d8c8
made date title a variable
CZnavody19 Nov 19, 2023
0a679b6
Use unix time (#28)
ZirixCZ Nov 22, 2023
23595fb
Price level api implementation (#12)
ZirixCZ Dec 1, 2023
2070ac1
Merge branch 'master' into stage
ZirixCZ Dec 1, 2023
9ec0250
disable add domain button on preview
ZirixCZ Dec 2, 2023
8622846
fix queue time on desktop
ZirixCZ Dec 3, 2023
728edda
remove recharts & add bundle analyzer
ZirixCZ Dec 4, 2023
7a5d5f0
handle page not found
ZirixCZ Dec 4, 2023
61b36cb
Merge branch 'stage' into selected-day-title
CZnavody19 Dec 5, 2023
2717fbe
Fixed conflicts
CZnavody19 Dec 5, 2023
ce02333
implement domain deletion
ZirixCZ Dec 6, 2023
e73016e
conflict fix
CZnavody19 Dec 6, 2023
ee07898
Merge remote-tracking branch 'origin/stage' into selected-day-title
CZnavody19 Dec 6, 2023
b70d821
Merge pull request #27 from Menuroo/selected-day-title
CZnavody19 Dec 6, 2023
0022876
fix menu heading title
ZirixCZ Dec 7, 2023
d29cc55
update pricelevelgroup modal & table fields
ZirixCZ Dec 7, 2023
7575139
implement sorts for pricelevelgroup table
ZirixCZ Dec 7, 2023
4e372e8
implement sorts for settings tables
ZirixCZ Dec 7, 2023
c616764
limit max length of price level name
ZirixCZ Dec 7, 2023
5179f8c
make ValidTo not required & search input
ZirixCZ Dec 7, 2023
9e934a4
refactor
ZirixCZ Dec 7, 2023
b274728
modify interfaces for ValidFromTo
ZirixCZ Dec 7, 2023
cb56fa5
add search to update modal pricelevelgroup
ZirixCZ Dec 7, 2023
bd57c1d
use czech locale for dates
ZirixCZ Dec 7, 2023
6583aa3
edit create modal text
ZirixCZ Dec 7, 2023
9aa60c7
add min value
ZirixCZ Dec 7, 2023
f871eb6
update favicon
ZirixCZ Dec 7, 2023
0f7e6db
fix date passing into getTime function
ZirixCZ Dec 7, 2023
586b313
Merge remote-tracking branch 'menuroo-admin/master' into stage
ZirixCZ Dec 8, 2023
e91fa42
Merge remote-tracking branch 'menuroo/master' into stage
ZirixCZ Dec 9, 2023
2cb65cb
add pipeline to push to dev
espeletia Dec 9, 2023
0ad89e6
fix pipeline because brain aneurysm
espeletia Dec 9, 2023
b3b4915
fix pipelines to add env vars during build
espeletia Dec 9, 2023
74fdbb6
fix day names not being correct (#32)
ZirixCZ Dec 11, 2023
bd10fc7
revalidate settings data properly (#31)
ZirixCZ Dec 11, 2023
4c83fb9
improve data fetching on admin && menu pages
ZirixCZ Dec 14, 2023
8e2e6cf
Add Jest configuration and LoginTitle component (#33)
ZirixCZ Dec 17, 2023
ab15d83
Implement new design (#37)
ZirixCZ Jan 4, 2024
e118391
fix 404 causing client error
ZirixCZ Jan 4, 2024
e2ff373
Merge branch 'redesign-menutable' into stage
ZirixCZ Jan 4, 2024
f0c7994
bump apollo & remove experimental support
ZirixCZ Jan 5, 2024
1a07d1e
wip
ZirixCZ Jan 12, 2024
6eded7d
load data into modal & close button
ZirixCZ Jan 12, 2024
abec3e7
Merge branch 'jidelni-listek' into stage
ZirixCZ Jan 13, 2024
4da2995
display waiter orders
ZirixCZ Jan 13, 2024
d8dd6f5
fix login not being highlighted after browser creds autofill
ZirixCZ Jan 14, 2024
185daf6
init order overview page
ZirixCZ Jan 14, 2024
4122ac0
fix modal max width
ZirixCZ Jan 14, 2024
cd6e987
init redesigned settings page
ZirixCZ Jan 14, 2024
9921032
init finance page
ZirixCZ Jan 14, 2024
67f4fc3
change menu modal implementation
ZirixCZ Jan 18, 2024
97bc059
init dropdown
ZirixCZ Jan 20, 2024
2c186d9
write some ugly code to make transition work with uknown values
ZirixCZ Jan 20, 2024
c7a3569
make modal item generic
ZirixCZ Jan 20, 2024
850525e
make dropdown consume external reference
ZirixCZ Jan 22, 2024
1128e13
Merge branch 'jidelni-listek-dropdown' into stage
ZirixCZ Jan 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "next",
"rules": {
"no-unused-vars": "warn"
"no-unused-vars": "warn",
"react/display-name": "off"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/push_registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin ${{ secrets.DOCKER_REGISTRY }}

- name: Build Docker Image
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/menuroo-admin:${{ env.SHORT_SHA }} .
run: docker build --build-arg NEXT_PUBLIC_API_URL="https://api.menuroo.cz/query" -t ${{ secrets.DOCKER_USERNAME }}/menuroo-admin:${{ env.SHORT_SHA }} .

- name: Tag Docker Image
run: docker tag ${{ secrets.DOCKER_USERNAME }}/menuroo-admin:${{ env.SHORT_SHA }} ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/menuroo-admin:${{ env.SHORT_SHA }}
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/push_registry_dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Push Docker Image

on:
push:
branches:
- stage


jobs:
build_and_push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Get SHA for last commit
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV


- name: Login to Docker Registry
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin ${{ secrets.DOCKER_REGISTRY }}

- name: Build Docker Image
run: docker build --build-arg NEXT_PUBLIC_API_URL="https://api.dev.menuroo.cz/query" -t ${{ secrets.DOCKER_USERNAME }}/menuroo-admin-dev:${{ env.SHORT_SHA }} .

- name: Tag Docker Image
run: docker tag ${{ secrets.DOCKER_USERNAME }}/menuroo-admin-dev:${{ env.SHORT_SHA }} ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/menuroo-admin-dev:${{ env.SHORT_SHA }}

- name: Push Docker Image
run: docker push ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/menuroo-admin-dev:${{ env.SHORT_SHA }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ jspm_packages
.node_repl_history
.next
.vercel

.DS_Store
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM node:18-alpine

ARG NEXT_PUBLIC_API_URL="https://api.menuroo.com/query"
# Declare a build argument with a default value
ARG NEXT_PUBLIC_API_URL="https://api.dev.menuroo.com/query"

# Set the environment variable with the build argument value
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}

RUN mkdir -p /app
WORKDIR /app
Expand Down
Binary file modified bun.lockb
Binary file not shown.
13 changes: 13 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Config } from "jest";
import nextJest from "next/jest.js";

const createJestConfig = nextJest({
dir: "./",
});

const config: Config = {
coverageProvider: "v8",
testEnvironment: "jsdom",
};

export default createJestConfig(config);
21 changes: 15 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,41 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"analyze": "ANALYZE=true next build"
"analyze": "ANALYZE=true next build",
"test": "jest",
"test:watch": "jest --watch"
},
"dependencies": {
"@ant-design/cssinjs": "^1.17.0",
"@apollo/client": "latest",
"@apollo/experimental-nextjs-app-support": "^0.4.2",
"@apollo/experimental-nextjs-app-support": "^0.5.2",
"@next/bundle-analyzer": "^14.0.3",
"@vercel/analytics": "^1.0.2",
"antd": "^5.9.0",
"classnames": "^2.3.2",
"dayjs": "^1.11.9",
"dayjs-plugin-utc": "^0.1.2",
"graphql": "^16.8.0",
"install": "^0.13.0",
"next": "13.5.4",
"next": "14.0.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
"@types/jest": "^29.5.11",
"@types/node": "20.6.0",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"eslint": "8.49.0",
"eslint-config-next": "13.5.4",
"autoprefixer": "10.4.15",
"eslint": "8.49.0",
"eslint-config-next": "14.0.4",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"postcss": "8.4.29",
"tailwindcss": "3.3.3",
"ts-jest": "^29.1.1",
"ts-node-dev": "^2.0.0",
"typescript": "5.2.2"
}
}
1 change: 0 additions & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
Binary file added public/fonts/Nunito-Black.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-BlackItalic.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-Bold.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-BoldItalic.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-ExtraBold.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-ExtraBoldItalic.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-ExtraLight.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-ExtraLightItalic.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-Italic.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-Light.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-LightItalic.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-Medium.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-MediumItalic.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-Regular.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-SemiBold.ttf
Binary file not shown.
Binary file added public/fonts/Nunito-SemiBoldItalic.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletions public/img/arrowUp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/img/closeCrossRed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/img/cross.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/headerIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/img/redCross.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/smallArrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/img/splitter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions src/app/(admin)/[date]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"use server";

import CreateMenu from "@/modules/CreateMenu/CreateMenu";
import getToken from "@/utils/getToken";
import getMenusByDate from "@/queries/getMenusByDate";
import { getClient } from "@/lib/ssrApolloClient";
import getTime from "@/lib/getTime";

const CreateMenuPage = async ({ params }: { params: { date: string } }) => {
const token = getToken();

const { data: menusByDate } = await getClient()
.query({
query: getMenusByDate,
variables: {
dateFrom: getTime({
date: params.date,
day: "middle",
}),
dateTo: getTime({
date: params.date,
day: "middle",
}),
},
context: {
headers: {
Authorization: getToken(),
},
fetchOptions: {
next: { tags: ["menusByDate"] },
},
},
fetchPolicy: "network-only",
})
.catch((err) => err);

return (
<CreateMenu
params={params}
token={token}
menus={menusByDate?.getMenusByDate ?? []}
/>
);
};

export default CreateMenuPage;
7 changes: 7 additions & 0 deletions src/app/(admin)/finance/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Fragment } from "react";

const Page = async () => {
return <Fragment />;
};

export default Page;
12 changes: 12 additions & 0 deletions src/app/(admin)/jidelni-listek/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"use server";

import AdminPage from "@/modules/AdminPage/AdminPage";
import getMenus from "@/modules/AdminPage/actions/getMenus";

const Page = async () => {
const menusByDate = await getMenus();

return <AdminPage menusByDate={menusByDate || []} />;
};

export default Page;
54 changes: 54 additions & 0 deletions src/app/(admin)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React from "react";
import type { Metadata } from "next";
import { ApolloWrapper } from "../ApolloWrapper";
import { Analytics } from "@vercel/analytics/react";
import { redirect } from "next/navigation";
import { cookies } from "next/headers";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import updateLocale from "dayjs/plugin/updateLocale";
import { AdminLayout } from "@/components/AdminLayout";

import "../globals.css";

export const metadata: Metadata = {
title: "Menuroo",
description: "Menuroo administrace",
};

const Layout = ({ children }: { children: React.ReactNode }) => {
dayjs.extend(updateLocale, utc);
dayjs.updateLocale("en", {
weekStart: 1,
});

const cookieStore = cookies();

const isAdmin = () => {
const jwt = cookieStore.get("token")?.value;
if (jwt) {
const decodedToken = JSON.parse(atob(jwt.split(".")[1]));
return decodedToken.role === "admin";
}

return false;
};

if (!isAdmin()) {
return redirect("/");
}

return (
<html lang="en">
<body>
<ApolloWrapper>
<AdminLayout>
{children} <Analytics />
</AdminLayout>
</ApolloWrapper>
</body>
</html>
);
};

export default Layout;
9 changes: 9 additions & 0 deletions src/app/(admin)/nastaveni/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use server";

import SettingsPage from "@/modules/Settings/SettingsPage";

const Page = async () => {
return <SettingsPage />;
};

export default Page;
11 changes: 11 additions & 0 deletions src/app/(admin)/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { cookies } from "next/headers";
import Link from "next/link";
import React from "react";

const RootNotFound = () => {
const redirectUrl = cookies().get("token") ? "/jidelni-listek" : "/";

return <Link href={redirectUrl}>Domů</Link>;
};

export default RootNotFound;
12 changes: 12 additions & 0 deletions src/app/(admin)/objednavky/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"use server";

import MenuOrdersPage from "@/modules/MenuOrdersPage/MenuOrdersPage";
import getMenuOrders from "@/modules/MenuOrdersPage/actions/getOrders";

const Page = async () => {
const menuOrders = await getMenuOrders();

return <MenuOrdersPage menuOrders={menuOrders || []} />;
};

export default Page;
File renamed without changes.
Loading