Skip to content

Commit

Permalink
Main Update (#49)
Browse files Browse the repository at this point in the history
* 📚 docs (contributions): VS Code Extension Recommendation – Commit Messages Template (#43)

* 📚 docs (contributions): VS Code Extension Recommendation
by @TadeSF
branch: vs-code-commit-extension

* 🧼 format & lint (MUNify)
by @TadeSF
branch: vs-code-commit-extension

* 🧹 chore (MUNify): add git commit config to vcs
branch: vs-code-commit-extension

* 📚 docs (MUNify): Contributing Update
branch: vs-code-commit-extension

* 📚 docs (MUNify): Contributing Update
branch: vs-code-commit-extension

* 📚 docs (MUNify): Contributing Update
branch: vs-code-commit-extension

---------

Co-authored-by: m1212e <[email protected]>

* Locale detection and language selection (#45)

* 🐞 fix: Fix title in base layout

* ✨feature: Chair Page Setup, Navigation and Speakers List

* ✨feature: Attendance Page

* ✨feature: i18n

* ✨feature: Whiteboard Update and Chair Editing Support

* 🐞 fix: Formatting

* 🔵 other: Color Pallet update

* 🐞 fix: any -> unknown

* 📄 docs: Clearer Documentation

* ✨feature: Dark Mode

* ✨feature: System Color Mode detection & High Contrast Mode

* ✨feature: Changing Speech times

* ✨feature: Navbar Button Titles & New Chair Presentation Window Button in Navbar

* ✨feature: Navbar Button Titles & New Chair Presentation Window Button in Navbar

* 🐞 fix: Few Theme related design changes

* ✨feature: Fuse.js Fuzzy Search for Countries

* ✨feature: Add Country to List Toast and other minor changes

* ✨feature: Change Speakers Time: Show warning if wrong format and show success toast on success

* ✨feature: Chair Voting Page

* 🐞 fix: I18n Type Error fix

* 🐞 fix: I18n Type Error fix

* 🐞 fix: install fuse in the frontend project

* ✨ feat (CHASE Frontend): Local Storage Locale Detection and Settings option for selecting language / Local Storing of current theme preferance
branch: locale-detection-and-language-selection

* 🧼 format & lint (CHASE Frontend)
branch: locale-detection-and-language-selection

* 🐞 fix (CHASE Frontend): Window Build Error
branch: locale-detection-and-language-selection

* 🧼 format & lint (CHASE Frontend): Removing (or ignoring) all console.log to make linter test pass
branch: locale-detection-and-language-selection

* Revert "🐞 fix (CHASE Frontend): Window Build Error"

This reverts commit 51ceeef.

* Revert "Revert "🐞 fix (CHASE Frontend): Window Build Error""

This reverts commit 95c04e6.

* Revert "🧼 format & lint (CHASE Frontend): Removing (or ignoring) all console.log to make linter test pass"

This reverts commit 4920427.

* 🧼 format & lint (CHASE Frontend): Removing (or ignoring) all console.log to make linter test pass
branch: locale-detection-and-language-selection

* 🐞 fix (CHASE Frontend): using useState and useEffect in layout file
branch: locale-detection-and-language-selection

* 🐞 fix (CHASE-Frontend): SSR and localStorage
branch: locale-detection-and-language-selection

* 🧼 format & lint (CHASE-Frontend): lint
branch: locale-detection-and-language-selection

* 🐞 fix (CHASE-Frontend): Adding Localisation
branch: locale-detection-and-language-selection

---------

Co-authored-by: m1212e <[email protected]>

* Update README.md

---------

Co-authored-by: m1212e <[email protected]>
  • Loading branch information
Strehk and m1212e authored Jul 10, 2023
1 parent 634bac9 commit 5a9c2e6
Show file tree
Hide file tree
Showing 21 changed files with 363 additions and 84 deletions.
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

0 comments on commit 5a9c2e6

Please sign in to comment.