Skip to content

Commit c1de43d

Browse files
committed
Fix lint errors
1 parent 012300e commit c1de43d

5 files changed

Lines changed: 14 additions & 223 deletions

File tree

Contact_Form_ Kevin.eml

Lines changed: 0 additions & 209 deletions
This file was deleted.

_TODO.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ https://aws.plainenglish.io/how-to-build-a-chatbot-using-aws-lex-and-lambda-in-2
2727

2828
- Finish styling
2929

30-
## Env Vars
31-
32-
- Add HubSpot env vars to Vercel
33-
34-
## Content Issues
35-
36-
- Need an article on OpenStack
37-
3830
## Contact Form
3931

4032
- `0/2000` characters should show number of characters left instead

src/actions/contact/responder.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ const allowedAttachmentTypes = [
3636
'text/plain',
3737
] as const
3838

39+
type AllowedAttachmentType = (typeof allowedAttachmentTypes)[number]
40+
41+
const isAllowedAttachmentType = (mimeType: string): mimeType is AllowedAttachmentType => {
42+
return allowedAttachmentTypes.some(allowedAttachmentType => allowedAttachmentType === mimeType)
43+
}
44+
3945
const normalizeMimeType = (mimeType: string): string => {
4046
return mimeType.split(';')[0]?.trim().toLowerCase() || ''
4147
}
@@ -151,7 +157,7 @@ export async function parseAttachments(form: FormData): Promise<FileAttachment[]
151157

152158
const normalizedType = normalizeMimeType(value.type)
153159

154-
if (!allowedAttachmentTypes.includes(normalizedType)) {
160+
if (!isAllowedAttachmentType(normalizedType)) {
155161
throw new ActionsFunctionError(`File type ${value.type} not allowed`, { status: 400 })
156162
}
157163

@@ -191,7 +197,7 @@ export async function parseAttachmentsFromInput(
191197

192198
const normalizedType = normalizeMimeType(value.type)
193199

194-
if (!allowedAttachmentTypes.includes(normalizedType)) {
200+
if (!isAllowedAttachmentType(normalizedType)) {
195201
throw new ActionsFunctionError(`File type ${value.type} not allowed`, { status: 400 })
196202
}
197203

src/components/Pages/Contact/index.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Contact Page
44
*
55
* Use query parameters to view prefilled form states for testing:
6+
*
67
* - /contact/?projectType=web-development (prefills project type dropdown)
78
* - /contact/?formState=success (shows success message)
89
* - /contact/?formState=error (shows error message)

src/pages/testing/comps/scratchpad.astro

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ const path = '/testing/comps/scratchpad'
77
---
88

99
<BaseLayout pageDescription={pageDescription} noindex={true} pageTitle={pageTitle} path={path}>
10+
{/** The svg elements on the site are rendering the <path> "fill-rule" attribute as "fillRule" */}
1011
<div class="uppy-Audio-buttonContainer">
1112
<button class="uppy-u-reset uppy-c-btn uppy-Audio-button uppy-Audio-button--submit" type="button" title="Submit recorded file" aria-label="Submit recorded file" data-uppy-super-focusable="true">
1213
<svg width="12" height="9" viewBox="0 0 12 9" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" class="uppy-c-icon">
13-
<path fill="#fff" fillRule="nonzero" d="M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"></path>
14+
<path fill="#fff" fill-rule="nonzero" d="M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"></path>
1415
</svg>
1516
</button>
1617
<button class="uppy-u-reset uppy-c-btn uppy-Audio-button" type="button" title="Discard recorded file" aria-label="Discard recorded file" data-uppy-super-focusable="true">
1718
<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="uppy-c-icon">
18-
<g fill="#FFF" fillRule="evenodd">
19+
<g fill="#FFF" fill-rule="evenodd">
1920
<path d="M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"></path>
2021
<path d="M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"></path>
2122
</g>
@@ -25,12 +26,12 @@ const path = '/testing/comps/scratchpad'
2526
<div class="uppy-Audio-buttonContainer">
2627
<button class="uppy-u-reset uppy-c-btn uppy-Audio-button uppy-Audio-button--submit" type="button" title="Submit recorded file" aria-label="Submit recorded file" data-uppy-super-focusable="true">
2728
<svg width="12" height="9" viewBox="0 0 12 9" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" class="uppy-c-icon">
28-
<path fill="#fff" fillRule="nonzero" d="M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"></path>
29+
<path fill="#fff" fill-rule="nonzero" d="M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"></path>
2930
</svg>
3031
</button>
3132
<button class="uppy-u-reset uppy-c-btn uppy-Audio-button" type="button" title="Discard recorded file" aria-label="Discard recorded file" data-uppy-super-focusable="true">
3233
<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="uppy-c-icon">
33-
<g fill="#FFF" fillRule="evenodd">
34+
<g fill="#FFF" fill-rule="evenodd">
3435
<path d="M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"></path>
3536
<path d="M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"></path>
3637
</g>

0 commit comments

Comments
 (0)