From d03023e7a4009306eaf7119370aa0f649911b16a Mon Sep 17 00:00:00 2001 From: Simon Westlin Green Date: Tue, 21 May 2024 13:34:32 +0200 Subject: [PATCH 1/6] fixed issue with hubbit-backend proxy, and added .vscode to gitignore --- .gitignore | 1 + docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ea2b4f5..b090e28 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .env +.vscode/* target diff --git a/docker-compose.yml b/docker-compose.yml index f386437..684a1d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: context: frontend dockerfile: dev.Dockerfile environment: - BACKEND_ADDRESS: http://hubbit-backend:8080 + BACKEND_ADDRESS: "http://hubbit-backend:8080" ports: - ${FRONTEND_PORT}:3000 volumes: From 63f5c83325cc9e8d8911f9ab4ee3d5f9a4835925 Mon Sep 17 00:00:00 2001 From: Simon Westlin Green Date: Tue, 21 May 2024 14:11:17 +0200 Subject: [PATCH 2/6] Added a rat in the hubb when it's empty --- .../active-users-list/ActiveUserList.tsx | 1 + frontend/src/pages/index.tsx | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/active-users-list/ActiveUserList.tsx b/frontend/src/components/active-users-list/ActiveUserList.tsx index 814e2b4..46d3b87 100644 --- a/frontend/src/components/active-users-list/ActiveUserList.tsx +++ b/frontend/src/components/active-users-list/ActiveUserList.tsx @@ -68,6 +68,7 @@ const ActiveUserList = ({ sessions, loggedInUser }: Props) => { {sortedSessions.map(session => { const startTime = new Date(session.startTime); + console.log(session); return ( > = ({ data }) => { return ; } + const addRatIfNoSessions = (sessions: CurrentSessionFragment[]) => { + if (sessions.length === 0) { + return [ + { + user: { cid: 'rat', nick: 'Hubbenråttan', groups: [{ name: "ratIT", prettyName: "🐀" }]}, + startTime: new Date().toISOString(), + id: 'rat', + }, + ]; + } + return sessions; + }; + return ( <> {createTitle('Who is in the Hubb?')}
- - + +
); From 092649bdef1b4b1139d07cc508da45f47f21cf45 Mon Sep 17 00:00:00 2001 From: Simon Westlin Green Date: Tue, 21 May 2024 14:22:20 +0200 Subject: [PATCH 3/6] removed debug print --- frontend/src/components/active-users-list/ActiveUserList.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/components/active-users-list/ActiveUserList.tsx b/frontend/src/components/active-users-list/ActiveUserList.tsx index 46d3b87..814e2b4 100644 --- a/frontend/src/components/active-users-list/ActiveUserList.tsx +++ b/frontend/src/components/active-users-list/ActiveUserList.tsx @@ -68,7 +68,6 @@ const ActiveUserList = ({ sessions, loggedInUser }: Props) => { {sortedSessions.map(session => { const startTime = new Date(session.startTime); - console.log(session); return ( Date: Tue, 21 May 2024 14:34:31 +0200 Subject: [PATCH 4/6] I am the rat --- frontend/src/pages/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index 1b24a98..7b2e4c8 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -95,7 +95,7 @@ const Home: NextPage> = ({ data }) => { if (sessions.length === 0) { return [ { - user: { cid: 'rat', nick: 'Hubbenråttan', groups: [{ name: "ratIT", prettyName: "🐀" }]}, + user: { cid: 'simongre', nick: 'Hubbenråttan', groups: [{ name: "ratIT", prettyName: "🐀" }]}, startTime: new Date().toISOString(), id: 'rat', }, From d177065714c6d0c2ad590a1a2f3096e9c8fb0ebc Mon Sep 17 00:00:00 2001 From: Simon Westlin Green Date: Thu, 23 May 2024 01:35:19 +0200 Subject: [PATCH 5/6] bruh linting is cringe --- frontend/src/pages/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index 7b2e4c8..13a7421 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -95,7 +95,7 @@ const Home: NextPage> = ({ data }) => { if (sessions.length === 0) { return [ { - user: { cid: 'simongre', nick: 'Hubbenråttan', groups: [{ name: "ratIT", prettyName: "🐀" }]}, + user: { cid: 'simongre', nick: 'Hubbenråttan', groups: [{ name: 'ratIT', prettyName: '🐀' }]}, startTime: new Date().toISOString(), id: 'rat', }, From 6dd29750bc9e63ab46fa2d716b77dd0af55af5ca Mon Sep 17 00:00:00 2001 From: Simon Westlin Green Date: Thu, 23 May 2024 01:36:38 +0200 Subject: [PATCH 6/6] more linting issues --- frontend/src/pages/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index 13a7421..676cb07 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -100,7 +100,7 @@ const Home: NextPage> = ({ data }) => { id: 'rat', }, ]; - } + }; return sessions; };