7 Commits

12 changed files with 8375 additions and 5397 deletions

View File

@ -1,5 +1,4 @@
FROM 063932952339.dkr.ecr.us-west-2.amazonaws.com/alpine-nim:nim-1.6.10 AS build
MAINTAINER jonathan@jdbernard.com
COPY hff_entry_forms_api.nimble /hff_entry_forms_api/
COPY src /hff_entry_forms_api/src

View File

@ -13,6 +13,8 @@ endif
# The server to target when publishing the API
TARGET_SERVER ?= sobeck.jdb-software.com
TARGET_ENV ?= local
# The Notion integration token.
AUTH_SECRET ?= 123abc

View File

@ -1,6 +1,6 @@
# Package
version = "0.3.2-rc2"
version = "0.3.3-rc1"
author = "Jonathan Bernard"
description = "Hope Family Fellowship entry forms."
license = "GPL-3.0-or-later"

View File

@ -30,9 +30,10 @@ proc loadConfig(args: Table[string, docopt.Value]): HffEntryFormsApiConfig =
debug: cfg.hasKey("debug") and cfg.getVal("debug") == "true",
eventParentId: cfg.getVal("event-parent-id"),
integrationToken: cfg.getVal("integration-token"),
knownOrigins: cfg.getVal("known-origins")[1..^2].split(',').mapIt(it[1..^2]),
knownOrigins: cfg.getVal("known-origins")[1..^2].split(',').mapIt(it.strip[1..^2]),
notionApiBaseUrl: cfg.getVal("notion-api-base-url"),
notionVersion: cfg.getVal("notion-version"),
notionConfigDbId: cfg.getVal("notion-config-db-id"),
port: parseInt(cfg.getVal("port", "8300")))
when isMainModule:

View File

@ -39,6 +39,8 @@ template jsonResp(code: HttpCode,
}
else: @{:}
debug "Request origin: $#\nKnown origins: $#\nAdding headers:\n$#" %
[ reqOrigin, cfg.knownOrigins.join(" | "), $corsHeaders ]
halt(
code,
headersToSend & corsHeaders & @{

View File

@ -11,7 +11,7 @@ proc getNotionClient(cfg: HffEntryFormsApiConfig): NotionClient =
notionClient = some(initNotionClient(NotionClientConfig(
apiVersion: cfg.notionVersion,
apiBaseUrl: cfg.notionApiBaseUrl,
configDbId: "",
configDbId: cfg.notionConfigDbId,
integrationToken: cfg.integrationToken)))
return notionClient.get

View File

@ -12,6 +12,7 @@ type
knownOrigins*: seq[string]
notionApiBaseUrl*: string
notionVersion*: string
notionConfigDbId*: string
port*: int
proc newApiError*(parent: ref Exception = nil, respCode: HttpCode, respMsg: string, msg = ""): ref ApiError =

View File

@ -1 +1 @@
const HFF_ENTRY_FORMS_API_VERSION* = "0.3.2-rc2"
const HFF_ENTRY_FORMS_API_VERSION* = "0.3.3-rc1"

13739
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "hff-entry-form-web",
"version": "0.3.2-rc2",
"version": "0.3.3-rc1",
"private": true,
"scripts": {
"serve": "npx servor dist",

View File

@ -1,4 +1,4 @@
import { defineComponent, Ref, ref } from 'vue';
import { defineComponent, ref } from 'vue';
import { logService } from '@jdbernard/logging';
import {
default as api,
@ -28,8 +28,8 @@ export default defineComponent({
props: {},
components: { CircleCheckIcon, CircleCrossIcon, HourGlassIcon, SpinnerIcon },
setup: function TheProposeEventView() {
const departments: Ref<{ value: string; color: string }[]> = ref([]);
const formState: Ref<FormState> = ref('loading');
const departments = ref<{ value: string; color: string }[]>([]);
const formState = ref<FormState>('loading');
setTimeout(async () => {
departments.value = (await api.getEventProposalConfig()).departments;
@ -62,14 +62,14 @@ export default defineComponent({
if (await api.proposeEvent(formVal.event)) {
formState.value = 'success';
successes.push(
`We've recorded the proposed details for ${formVal.event.name}.`
`We've recorded the proposed details for ${formVal.event.name}.`,
);
} else {
formState.value = 'error';
errors.push(
'We were unable to record the proposed details for ' +
formVal.event.name +
". Poke Jonathan and tell him it's broken."
". Poke Jonathan and tell him it's broken.",
);
}

View File

@ -18,7 +18,11 @@
</label>
<label>
<span>Date and time</span>
<input type="date" name="date" v-model="formVal.event.date" />
<input
type="datetime-local"
name="date"
v-model="formVal.event.date"
/>
</label>
<label>
<span>Department / Event Type</span>