From 0b0070f185515a101f380a62a40494426b9921dd Mon Sep 17 00:00:00 2001 From: AvilaAndre Date: Sat, 16 Nov 2024 15:53:26 +0000 Subject: [PATCH 01/11] minor: change form method to avoid showing password on url --- src/routes/(app)/login/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(app)/login/+page.svelte b/src/routes/(app)/login/+page.svelte index c80169d..c5d9fb9 100644 --- a/src/routes/(app)/login/+page.svelte +++ b/src/routes/(app)/login/+page.svelte @@ -23,7 +23,7 @@
-
+

Área Membro

Date: Sat, 16 Nov 2024 17:40:33 +0000 Subject: [PATCH 02/11] chore: replace docker-compose and add localhost to container --- dev.sh | 9 ++++----- docker-compose.yml | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dev.sh b/dev.sh index 9127222..956d37f 100755 --- a/dev.sh +++ b/dev.sh @@ -1,17 +1,17 @@ #!/bin/env bash -which docker-compose &> /dev/null +which docker &> /dev/null if [ $? -ne 0 ]; then echo "Docker compose not installed" echo "Please read the README at https://github.com/NIAEFEUP/website-niaefeup-frontend" exit fi -docker-compose up -d website-niaefeup-frontend-dev -docker-compose up -d website-niaefeup-frontend-storybook +docker compose up -d website-niaefeup-frontend-dev +docker compose up -d website-niaefeup-frontend-storybook trap_ctrl_c() { - docker-compose down + docker compose down clear exit @@ -19,7 +19,6 @@ trap_ctrl_c() { trap "trap_ctrl_c" 2 -clear echo "Containers are up and running" echo "" echo "Press Ctrl-C to exit" diff --git a/docker-compose.yml b/docker-compose.yml index 485747d..94d25a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,8 @@ services: - ./static:/usr/src/website-niaefeup-frontend/static environment: - PORT=3000 + extra_hosts: + - "host.docker.internal:host-gateway" website-niaefeup-frontend-storybook: build: From b5b9f23ebe8bbac750459f4383cf4655adff7a11 Mon Sep 17 00:00:00 2001 From: AvilaAndre Date: Sat, 16 Nov 2024 17:41:14 +0000 Subject: [PATCH 03/11] fix: dont show password on url --- src/routes/(app)/login/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(app)/login/+page.svelte b/src/routes/(app)/login/+page.svelte index c5d9fb9..b7833a3 100644 --- a/src/routes/(app)/login/+page.svelte +++ b/src/routes/(app)/login/+page.svelte @@ -23,7 +23,7 @@
- +

Área Membro

Date: Sat, 16 Nov 2024 17:51:02 +0000 Subject: [PATCH 04/11] chore: use host network in dev to access backend --- docker-compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 94d25a9..088a446 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,8 +11,7 @@ services: - ./static:/usr/src/website-niaefeup-frontend/static environment: - PORT=3000 - extra_hosts: - - "host.docker.internal:host-gateway" + network_mode: "host" # do not add this to prod! website-niaefeup-frontend-storybook: build: From d73fd105078d49030a5d60cad4dc22ca04ca2ff5 Mon Sep 17 00:00:00 2001 From: AvilaAndre Date: Sat, 16 Nov 2024 18:38:59 +0000 Subject: [PATCH 05/11] minor: make component value bindable --- .../(app)/login/_components/variable-visibility-input.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/(app)/login/_components/variable-visibility-input.svelte b/src/routes/(app)/login/_components/variable-visibility-input.svelte index 1092331..59cf368 100644 --- a/src/routes/(app)/login/_components/variable-visibility-input.svelte +++ b/src/routes/(app)/login/_components/variable-visibility-input.svelte @@ -2,6 +2,7 @@ import Icon from '@/lib/components/icons/icon.svelte'; import Icons from '@/lib/components/icons/icons'; + export let value: any; let visible = false; $: type = visible ? 'text' : 'password'; $: icon = visible ? Icons.Hidden : Icons.Visible; @@ -9,11 +10,12 @@
Iniciar Sessão

{message}

From 03ee834e9b3086f235b7af1a617a8af70bb314a1 Mon Sep 17 00:00:00 2001 From: AvilaAndre Date: Sat, 16 Nov 2024 19:08:12 +0000 Subject: [PATCH 07/11] feat: redirect if auth success --- src/routes/(app)/login/+page.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/routes/(app)/login/+page.svelte b/src/routes/(app)/login/+page.svelte index 0ecc580..3453799 100644 --- a/src/routes/(app)/login/+page.svelte +++ b/src/routes/(app)/login/+page.svelte @@ -16,7 +16,11 @@ password }) }).then((res) => res.ok); + message = success ? 'Login successful' : 'Login failed'; + if (success == true) { + window.location.href = '/'; + } } From 8b1338725236747b73da2c8eec368c4a9f61888b Mon Sep 17 00:00:00 2001 From: AvilaAndre Date: Sat, 16 Nov 2024 19:10:10 +0000 Subject: [PATCH 08/11] lint: docker compose prettier --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 088a446..25673b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: - ./static:/usr/src/website-niaefeup-frontend/static environment: - PORT=3000 - network_mode: "host" # do not add this to prod! + network_mode: 'host' # do not add this to prod! website-niaefeup-frontend-storybook: build: From 7e6be6eb2dd31730bb32defcd5fd6c90e277623d Mon Sep 17 00:00:00 2001 From: AvilaAndre Date: Tue, 26 Nov 2024 22:21:59 +0000 Subject: [PATCH 09/11] minor: remove version from docker compose --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 25673b7..dbdb6e5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3' services: website-niaefeup-frontend-dev: build: From 247a9da4711ff330dddd3e3d0829fc5c7a3c60ed Mon Sep 17 00:00:00 2001 From: AvilaAndre Date: Tue, 26 Nov 2024 22:25:41 +0000 Subject: [PATCH 10/11] chore: replaced docker-compose in test.sh --- test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.sh b/test.sh index a31865b..60fd737 100755 --- a/test.sh +++ b/test.sh @@ -1,10 +1,10 @@ #!/bin/env bash -which docker-compose &> /dev/null +which docker &> /dev/null if [ $? -ne 0 ]; then echo "Docker compose not installed" echo "Please read the README at https://github.com/NIAEFEUP/website-niaefeup-frontend" exit fi -docker-compose run --rm website-niaefeup-frontend-test +docker compose run --rm website-niaefeup-frontend-test From b08cae8fb801d92116f2ccf7fbeb7f441bdb7089 Mon Sep 17 00:00:00 2001 From: AvilaAndre Date: Tue, 26 Nov 2024 23:38:22 +0000 Subject: [PATCH 11/11] lint: added type to variable --- .../(app)/login/_components/variable-visibility-input.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(app)/login/_components/variable-visibility-input.svelte b/src/routes/(app)/login/_components/variable-visibility-input.svelte index 59cf368..1886e34 100644 --- a/src/routes/(app)/login/_components/variable-visibility-input.svelte +++ b/src/routes/(app)/login/_components/variable-visibility-input.svelte @@ -2,7 +2,7 @@ import Icon from '@/lib/components/icons/icon.svelte'; import Icons from '@/lib/components/icons/icons'; - export let value: any; + export let value: string; let visible = false; $: type = visible ? 'text' : 'password'; $: icon = visible ? Icons.Hidden : Icons.Visible;