Skip to content

Commit

Permalink
🔀 Merge pull request #24 from NMSUD/develop
Browse files Browse the repository at this point in the history
🔖 1.0.19
  • Loading branch information
Khaoz-Topsy committed Jun 19, 2024
2 parents 92d201d + 47b6055 commit 9e5b8d6
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ GITHUB_ACTION_MINUTES_BETWEEN_RUN=
GITHUB_AUTH_TOKEN=

VITE_ENABLE_CAPTCHA=
HCAPTCHA_SECRET=
VITE_HCAPTCHA_SITE_KEY=
HCAPTCHA_SECRET=
9 changes: 6 additions & 3 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 4 additions & 0 deletions .vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,7 @@ main.main img {
border-radius: 8px;
background-color: var(--vp-c-brand-soft);
}

body {
scrollbar-gutter: stable;
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"typedi",
"typeof",
"uuidv",
"VITE",
"vitepress",
"Xata",
"xatarc",
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -43,6 +43,7 @@ const main = async () => {
const swaggerBuilder = new SwaggerBuilder();
const router = new Router();

router.get('/', defaultEndpoint);
router.post(
`/${api.routes.form}`,
bodyOptions,
Expand Down
8 changes: 4 additions & 4 deletions src/api/misc/misc.test.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions src/api/misc/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const defaultEndpoint = async (
ctx: Koa.DefaultContext,
next: () => Promise<Koa.BaseResponse>,
) => {
ctx.body = '<p>You should <b>not</b> be here... Well done I guess 🤔</p>';
ctx.response.status = 200;
ctx.response.status = 303;
ctx.redirect(getConfig().getNmsUdFormWebUrl());

await next();
};
Expand Down
5 changes: 3 additions & 2 deletions src/web/scss/_assistantApps.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.full-page-app-notice {
--aa-app-notice-grid-columns: 1;
margin-top: 2em;
}
margin-top: 1em;
margin-bottom: 1em;
}
4 changes: 2 additions & 2 deletions src/web/scss/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 9e5b8d6

Please sign in to comment.