Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main Update #49

Merged
merged 3 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["rome.rome"]
"recommendations": ["rome.rome", "rioukkevin.vscode-git-commit"]
}
89 changes: 88 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,90 @@
{
"files.eol": "\n"
"files.eol": "\n",
"vscodeGitCommit.template": [
"{prefix} ({scope}): {message}",
"branch: {branch}"
],
"vscodeGitCommit.variables": {
"prefix": [
{
"label": "✨ feat",
"detail": "A new feature"
},
{
"label": "🐞 fix",
"detail": "A bugfix"
},
{
"label": "🎨 style",
"detail": "Stylistic changes to the App"
},
{
"label": "🚧 wip",
"detail": "Work in progress"
},
{
"label": "🧼 format & lint",
"detail": "Formatting and linting changes"
},
{
"label": "🔤 typing",
"detail": "Changes to fulfill typing requirements"
},
{
"label": "📚 docs",
"detail": "A documentation update"
},
{
"label": "🚀 perf",
"detail": "A code change that improves performance"
},
{
"label": "🧪 test",
"detail": "A test update"
},
{
"label": "🧹 chore",
"detail": "Project housekeeping"
},
{
"label": "♻️ refactor",
"detail": "Refactor of the code without change in functionality"
},
{
"label": "🏗️ build",
"detail": "Changes that affect the build system or external dependencies"
},
{
"label": "🚦 ci",
"detail": "Changes to CI configuration files and scripts"
},
{
"label": "↩️ revert",
"detail": "Reverts a previous commit"
},
{
"label": "🔀 merge",
"detail": "Use when merging branches"
}
],
"scope": [
{
"label": "CHASE Frontend",
"detail": "Changes to the Chase Frontend"
},
{
"label": "CHASE Backend",
"detail": "Changes to the Chase Backend"
},
{
"label": "AUTH",
"detail": "Changes to the auth system"
},
{
"label": "MUNify",
"detail": "Changes to MUNify in general"
}
],
"branch": "branch"
}
}
25 changes: 20 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,39 @@ Wether you want to tackle an already existing issue or bring you own one, we rec

## Working with branches

Github allows for easy branch creation from an issue. We recommend to do so. We require you to develop on a branch and later create a pull request which will then get reviewed and eventually merged into the main branch. Since code reviews take up a lot of time, please be patient and try to commit well documented and clearly structured code. The best documentation is always the one explaining the *why*.
Github allows for easy branch creation from an issue. We recommend to do so. We require you to develop on a branch and later create a pull request which will then get reviewed and eventually merged into the main branch. Since code reviews take up a lot of time, please be patient and try to commit well documented and clearly structured code. The best documentation is always the one explaining the _why_.

## Commit messages

We try to stick as close to the [conventional commit specification](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) as possible:

- `feat:` a new feature
- `fix:` a bugfix
- `style:` stylistic changes to the App
- `wip:` work in progress
- `format & lint:` formatting and linting changes
- `typing:` changes to fulfill typing requirements
- `perf:` a code change that improves performance
- `docs:` a documentation update
- `test:` a test update
- `chore:` project housekeeping
- `refactor:` refactor of the code without change in functionality
- `build:` changes that affect the build system or external dependencies
- `ci:` changes to CI configuration files and scripts
- `revert:` reverts a previous commit
- `merge:` use when merging branches

If you are using the vscode extension [rioukkevin.vscode-git-commit](https://marketplace.visualstudio.com/items?itemName=rioukkevin.vscode-git-commit), the right settings for the convention above should be applied through the settings.json automatically.

Below are examples of well-formatted commits:

```
feat(chase): implement login button and modal
fix: address error in login body
docs: add examples
```
✨ feat (CHASE Frontend): implement login button and modal
branch: login

🐞 fix (MUNify): address error in login body
branch: login

📚 docs (CHASE Backend): add examples
branch: setup
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the existing components and their directory below


## Develop Locally
Make sure you have docker installed
Make sure you have [Docker](https://www.docker.com/get-started/) and [Node.js](https://nodejs.org/en/download/current) installed

Clone the project

Expand Down
3 changes: 3 additions & 0 deletions chase/backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export let server: FastifyInstance;
},
});

// rome-ignore lint: console output is intended
console.log(`
╔══════════════════════════════════════════════════════════════════╗
║ Serving API documentation on http://localhost:${PORT}/documentation ║
Expand Down Expand Up @@ -155,6 +156,7 @@ export let server: FastifyInstance;
if (!process.env.PRODUCTION) {
server.swagger();
}
// rome-ignore lint: console output is intended
console.log(`Running on port ${PORT}`);
await server.listen({ port: PORT, host: "0.0.0.0" });
db?.$disconnect();
Expand All @@ -164,4 +166,5 @@ export let server: FastifyInstance;
}
})();

// rome-ignore lint: console output is intended
console.log("Starting server...");
1 change: 0 additions & 1 deletion chase/frontend/app/chair/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default function ParticipantDashboard() {

useEffect(() => {
const intervalAPICall = setInterval(() => {
console.log("API Call");
setData(apiTestData);
}, 1000);
return () => clearInterval(intervalAPICall);
Expand Down
1 change: 0 additions & 1 deletion chase/frontend/app/chair/speakers/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function ChairSpeakersList() {

useEffect(() => {
const intervalAPICall = setInterval(() => {
console.log("API Call");
setData(apiTestData);
}, 1000);
return () => clearInterval(intervalAPICall);
Expand Down
4 changes: 1 addition & 3 deletions chase/frontend/app/chair/voting/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ export default function ChairVoting() {
label={LL.chairs.voting.BUTTON_NEW_MOTION()}
icon={<FontAwesomeIcon icon={faGavel} className="mr-2" />}
className="w-full"
onClick={() => {
console.log("API call to create a new motion");
}}
onClick={() => {}}
model={[]}
/>
<Motions
Expand Down
5 changes: 1 addition & 4 deletions chase/frontend/app/chair/whiteboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ export default function ChairWhiteboard() {
const [whiteboardContent, setWhiteboardContent] =
React.useState<string>(whiteboardTestData);

const pushWhiteboardContent = () => {
console.log("Pushing whiteboard content to server...", whiteboardContent);
};
const pushWhiteboardContent = () => {};

const resetWhiteboardContent = () => {
console.log("Resetting whiteboard content...");
setWhiteboardContent(whiteboardTestData);
};

Expand Down
42 changes: 22 additions & 20 deletions chase/frontend/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,47 @@ import "primereact/resources/primereact.min.css";
//icons
import "primeicons/primeicons.css";

import Head from 'next/head';
import Head from "next/head";

import { detectLocale, navigatorDetector } from "typesafe-i18n/detectors";
import {
detectLocale,
navigatorDetector,
localStorageDetector,
} from "typesafe-i18n/detectors";
import { loadLocale } from "@/i18n/i18n-util.sync";
import { baseLocale, locales } from "@/i18n/i18n-util";
import TypesafeI18n from "@/i18n/i18n-react";

const inter = Inter({ subsets: ["latin"] });


export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
// TODO inspect the way locale is detected and loaded.
// The Problem was that the locale was not loaded on the client side. There was a build error because the navigator was not defined on the server side.
// // https://github.com/ivanhofer/typesafe-i18n/tree/main/packages/detectors)
// const locale = detectLocale(baseLocale, locales, navigatorDetector);
// loadLocale(locale);

// TadeSF 2023-06-14 suggested solution:
let locale = baseLocale; // default to baseLocale
if (typeof window !== "undefined") {
// Check if window is defined to ensure running on client side
locale = detectLocale(baseLocale, locales, navigatorDetector);
loadLocale(locale);
const isBrowser = typeof window !== "undefined";
let locale = baseLocale;

if (isBrowser) {
// Only run this code in a browser context.
locale = detectLocale(
baseLocale,
locales,
localStorageDetector,
navigatorDetector
);
}

loadLocale(locale);

return (
<TypesafeI18n locale={locale}>
<html lang="de">
<html lang="en">
<Head>
<title>Chase</title> {/* TODO Make title work */}
</Head>
<body className={inter.className}>
{children}
</body>
<body className={inter.className}>{children}</body>
</html>
</TypesafeI18n>
);
}
}
1 change: 0 additions & 1 deletion chase/frontend/app/participant/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default function participant_dashboard() {

useEffect(() => {
const intervalAPICall = setInterval(() => {
console.log("API Call");
setData(apiTestData);
}, 1000);
return () => clearInterval(intervalAPICall);
Expand Down
1 change: 0 additions & 1 deletion chase/frontend/app/participant/speakers/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default function SpeakersList() {

useEffect(() => {
const intervalAPICall = setInterval(() => {
console.log("API Call");
setData(apiTestData);
}, 1000);
return () => clearInterval(intervalAPICall);
Expand Down
4 changes: 1 addition & 3 deletions chase/frontend/components/navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ export default function Navbar({ children }: { children: React.ReactNode }) {
router.push("/login/participant");
};

const rejectLogout = () => {
console.log("Logout rejected");
};
const rejectLogout = () => {};

const confirmLogout = () => {
confirmDialog({
Expand Down
Loading