diff --git a/.gitignore b/.gitignore index 8f9be7b..bdbfff8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,12 @@ bin database.txt +plantuml.jar db.sqlite3 -*.png +diagram.puml +backend/*.png +backend/*.jpg +backend/*.svg # Test binary, built with `go test -c` *.test diff --git a/README.md b/README.md index d75861a..e7b2dfe 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,21 @@ You should consult the [WSL documentation](https://docs.microsoft.com/en-us/wind wsl --install -d Ubuntu-22.04 # To get a somewhat recent version of Go ``` +After this, you can open a (wsl) terminal and run the commands: + +```bash +sudo apt update && sudo apt upgrade +sudo apt install -y make podman + +sudo add-apt-repository ppa:longsleep/golang-backports +sudo apt update +sudo apt install golang-go + +# For a recent version of node: +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash +nvm install node +``` + If you get any errors related to virtualization, you will need to enable virtualization in the BIOS. This is a common issue, and you can find a guide for your specific motherboard online. This is a one-time operation and will not affect your windows installation. This setting is usually called "VT-x" or "AMD-V" and is usually found in the CPU settings. If you can't find it, shoot me a message and I'll find it for you. If you're **still dead set** on using a vanilla Windows environment, you will need the following: diff --git a/backend/Makefile b/backend/Makefile index 2547900..9cfa335 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -27,6 +27,10 @@ clean: $(GOCLEAN) rm -rf bin rm -f db.sqlite3 + rm -f diagram* + rm -f plantuml.jar + rm -f erd.png + rm -f config.toml # Test target test: db.sqlite3 @@ -98,6 +102,18 @@ install-lint: @echo "Installing golangci-lint" @curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.42.1 +# Fetches the latest plantuml.jar and checks its SHA256 hash +plantuml.jar: + curl -sSfL https://github.com/plantuml/plantuml/releases/download/v1.2024.3/plantuml.jar -o plantuml.jar \ + && echo "519a4a7284c6a0357c369e4bb0caf72c4bfbbde851b8c6d6bbdb7af3c01fc82f plantuml.jar" | sha256sum -c + +# Generate UML diagrams diagral.png & diagram.svg +.PHONY: uml +uml: plantuml.jar + goplantuml -recursive . > diagram.puml + java -jar plantuml.jar -tpng diagram.puml + java -jar plantuml.jar -tsvg diagram.puml + # Convenience target to install just (requires sudo privileges) install-just: @echo "Installing just" diff --git a/frontend/src/Components/Header.tsx b/frontend/src/Components/Header.tsx index 5c642b8..ba0a939 100644 --- a/frontend/src/Components/Header.tsx +++ b/frontend/src/Components/Header.tsx @@ -15,7 +15,7 @@ function Header({ username }: { username: string }): JSX.Element { > TTIME Logo diff --git a/frontend/src/Components/Register.tsx b/frontend/src/Components/Register.tsx index 8181774..d0e3da6 100644 --- a/frontend/src/Components/Register.tsx +++ b/frontend/src/Components/Register.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { NewUser, User } from "../Types/Users"; +import { NewUser } from "../Types/Users"; import { api } from "../API/API"; export default function Register(): JSX.Element { @@ -8,7 +8,7 @@ export default function Register(): JSX.Element { const handleRegister = async (): Promise => { const newUser: NewUser = { userName: username, password }; - const user = await api.registerUser(newUser); + await api.registerUser(newUser); // TODO: Handle errors }; return ( diff --git a/frontend/src/Components/TimeReport.tsx b/frontend/src/Components/TimeReport.tsx new file mode 100644 index 0000000..c4ddc38 --- /dev/null +++ b/frontend/src/Components/TimeReport.tsx @@ -0,0 +1,59 @@ +function NewTimeReport(): JSX.Element { + const activities = [ + "Development", + "Meeting", + "Administration", + "Own Work", + "Studies", + "Testing", + ]; + + return ( + <> +
+ { + event.preventDefault(); + }} + onPaste={(event) => { + event.preventDefault(); + }} + /> + + + + + + + + + {activities.map((activity, index) => ( + + + + + ))} + +
Activity + Total Time (min) +
{activity} + { + const keyValue = event.key; + if (!/\d/.test(keyValue) && keyValue !== "Backspace") + event.preventDefault(); + }} + /> +
+
+ + ); +} + +export default NewTimeReport; diff --git a/frontend/src/Pages/AdminPages/AdminAddProject.tsx b/frontend/src/Pages/AdminPages/AdminAddProject.tsx new file mode 100644 index 0000000..9fd8bed --- /dev/null +++ b/frontend/src/Pages/AdminPages/AdminAddProject.tsx @@ -0,0 +1,26 @@ +import BasicWindow from "../../Components/BasicWindow"; +import Button from "../../Components/Button"; + +function AdminAddProject(): JSX.Element { + const content = <>; + + const buttons = ( + <> +