From c5fb77102bc8d02b737ebeb32487aa65671781f3 Mon Sep 17 00:00:00 2001 From: Kurt Lourens Date: Wed, 19 Jun 2024 21:10:07 +0200 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=9A=A7=20API=20redirect=20to=20form?= =?UTF-8?q?=20app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.ts | 3 ++- src/api/misc/misc.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api/api.ts b/src/api/api.ts index d5aad8a..2db79c5 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -16,7 +16,7 @@ import { AppType } from '@constants/enum/appType'; import { APP_TYPE, BOT_PATH, getBotPath, getConfig } from '@services/internal/configService'; import { getLog } from '@services/internal/logService'; import { handleRouteLookup } from './handleRouteLookup'; -import { versionEndpoint } from './misc/misc'; +import { defaultEndpoint, versionEndpoint } from './misc/misc'; import { baseFormHandler } from './routes/baseFormHandler'; import { baseStatusHandler } from './routes/baseStatusHandler'; import { baseVerifyHandler } from './routes/baseVerifyHandler'; @@ -43,6 +43,7 @@ const main = async () => { const swaggerBuilder = new SwaggerBuilder(); const router = new Router(); + router.get('/', defaultEndpoint); router.post( `/${api.routes.form}`, bodyOptions, diff --git a/src/api/misc/misc.ts b/src/api/misc/misc.ts index 5859f25..dd136aa 100644 --- a/src/api/misc/misc.ts +++ b/src/api/misc/misc.ts @@ -9,8 +9,8 @@ export const defaultEndpoint = async ( ctx: Koa.DefaultContext, next: () => Promise, ) => { - ctx.body = '

You should not be here... Well done I guess 🤔

'; - ctx.response.status = 200; + ctx.response.status = 303; + ctx.redirect(getConfig().getNmsUdFormWebUrl()); await next(); }; From 2638275b4a1f6a1939efc7d84a6b0c2780fe3fc7 Mon Sep 17 00:00:00 2001 From: Lenni Date: Wed, 19 Jun 2024 22:08:23 +0200 Subject: [PATCH 2/7] add scrollbar gutter to body --- .vitepress/theme/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css index 12494f2..e855a0c 100644 --- a/.vitepress/theme/style.css +++ b/.vitepress/theme/style.css @@ -167,3 +167,7 @@ main.main img { border-radius: 8px; background-color: var(--vp-c-brand-soft); } + +body { + scrollbar-gutter: stable; +} From 6a985d2864bd58cecdd22d0d6c56defdc0ef4483 Mon Sep 17 00:00:00 2001 From: Kurt Lourens Date: Wed, 19 Jun 2024 22:30:39 +0200 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=91=B7=20Debug=20Github=20Action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 4ae5abd..5a1d4f8 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -3,7 +3,7 @@ run-name: GithubPages on: push: - branches: ['main'] + branches: ['main', 'develop'] concurrency: group: 'githubpages' @@ -27,11 +27,9 @@ jobs: run: npm ci - name: Setup variables - env: - WEB_UI_CONFIG: ${{ secrets.WEB_UI_CONFIG }} run: | touch .env - echo ${WEB_UI_CONFIG} >> .env + echo ${{ secrets.WEB_UI_CONFIG }} >> .env - name: Build web UI run: | From b0e222dcd5dd483521e0db2ef125506af0444e7a Mon Sep 17 00:00:00 2001 From: Kurt Lourens Date: Wed, 19 Jun 2024 22:39:28 +0200 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=92=84=20Fix=20styling=20diff=20on=20?= =?UTF-8?q?release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/web/scss/_form.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/scss/_form.scss b/src/web/scss/_form.scss index 99e4842..e8f3107 100644 --- a/src/web/scss/_form.scss +++ b/src/web/scss/_form.scss @@ -62,11 +62,11 @@ } } -.floating-button { +button.floating-button { position: fixed; bottom: 2em; right: 2em; border-radius: 100%; padding: 1.5em 0.85em; z-index: 2; -} +} \ No newline at end of file From 0a5c2450777ff3d7c7b2e830f4efb38526c9b1ee Mon Sep 17 00:00:00 2001 From: Kurt Lourens Date: Wed, 19 Jun 2024 22:52:51 +0200 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=91=B7=20Undo=20CI=20debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages.yml | 2 +- src/web/scss/_assistantApps.scss | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 5a1d4f8..927462c 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -3,7 +3,7 @@ run-name: GithubPages on: push: - branches: ['main', 'develop'] + branches: ['main'] concurrency: group: 'githubpages' diff --git a/src/web/scss/_assistantApps.scss b/src/web/scss/_assistantApps.scss index 08669fd..481f076 100644 --- a/src/web/scss/_assistantApps.scss +++ b/src/web/scss/_assistantApps.scss @@ -1,4 +1,5 @@ .full-page-app-notice { --aa-app-notice-grid-columns: 1; - margin-top: 2em; -} + margin-top: 1em; + margin-bottom: 1em; +} \ No newline at end of file From 3dae7543326e20559ac3e966e27eb1eb6746f333 Mon Sep 17 00:00:00 2001 From: Kurt Lourens Date: Wed, 19 Jun 2024 22:58:45 +0200 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=94=96=201.0.19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.template | 2 +- .github/workflows/github-pages.yml | 7 ++++++- .vscode/settings.json | 1 + CHANGELOG.md | 6 ++++++ package.json | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.env.template b/.env.template index 1631be7..c8a0529 100644 --- a/.env.template +++ b/.env.template @@ -25,5 +25,5 @@ GITHUB_ACTION_MINUTES_BETWEEN_RUN= GITHUB_AUTH_TOKEN= VITE_ENABLE_CAPTCHA= -HCAPTCHA_SECRET= VITE_HCAPTCHA_SITE_KEY= +HCAPTCHA_SECRET= diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 927462c..8564400 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -29,7 +29,12 @@ jobs: - name: Setup variables run: | touch .env - echo ${{ secrets.WEB_UI_CONFIG }} >> .env + echo "${{ secrets.VITE_NMSUD_FORM_WEB_URL }}" >> .env + echo "${{ secrets.VITE_NMSUD_API_URL }}" >> .env + echo "${{ secrets.VITE_NMSUD_FORM_DATA_URL }}" >> .env + echo "${{ secrets.VITE_NMSUD_FORM_DOCS_URL }}" >> .env + echo "${{ secrets.VITE_ENABLE_CAPTCHA }}" >> .env + echo "${{ secrets.VITE_HCAPTCHA_SITE_KEY }}" >> .env - name: Build web UI run: | diff --git a/.vscode/settings.json b/.vscode/settings.json index 164ddff..4713761 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -79,6 +79,7 @@ "typedi", "typeof", "uuidv", + "VITE", "vitepress", "Xata", "xatarc", diff --git a/CHANGELOG.md b/CHANGELOG.md index fefd947..eb86a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.19](https://github.com/NMSUD/Form/compare/1.0.19...1.0.18) - 2024-06-19 + +### Fixed + +- Production only bugs & styling + ## [1.0.18](https://github.com/NMSUD/Form/compare/1.0.18...1.0.16) - 2024-06-19 ### Changed diff --git a/package.json b/package.json index 3008b1c..bb0b866 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nmsud.form", - "version": "1.0.18", + "version": "1.0.19", "author": "Kurt Lourens", "type": "module", "description": "A custom solution for capturing data for the yearly Unification Days event", From 47b6055cc634a3f0bc2a108e91cde455efe1bf0d Mon Sep 17 00:00:00 2001 From: Kurt Lourens Date: Wed, 19 Jun 2024 23:03:00 +0200 Subject: [PATCH 7/7] =?UTF-8?q?=E2=9C=85=20Fix=20unit=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/misc/misc.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/misc/misc.test.ts b/src/api/misc/misc.test.ts index 853fca8..feaa480 100644 --- a/src/api/misc/misc.test.ts +++ b/src/api/misc/misc.test.ts @@ -1,18 +1,18 @@ import 'reflect-metadata'; -import { test, describe, expect, vi } from 'vitest'; +import { describe, expect, test, vi } from 'vitest'; -import { defaultEndpoint, versionEndpoint } from './misc'; -import { apiParams, ApiStatusErrorCode } from '@constants/api'; import { fakePromise } from '@helpers/typescriptHacks'; +import { defaultEndpoint, versionEndpoint } from './misc'; describe('Misc endpoints', () => { test('default endpoint returns 200 OK', async () => { const ctx: any = { response: {}, + redirect: () => {}, }; const next = vi.fn().mockResolvedValue(fakePromise()); await defaultEndpoint(ctx, next); - expect(ctx.response.status).toBe(200); + expect(ctx.response.status).toBe(303); }); test('version endpoint with correct authToken', async () => { const authToken = 'testertest';