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 4ae5abd..8564400 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -27,11 +27,14 @@ 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.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/.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; +} 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", 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.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'; 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(); }; 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 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