diff --git a/api/tests/functional/place.spec.ts b/api/tests/functional/place.spec.ts index 7ed6462..de4b69e 100644 --- a/api/tests/functional/place.spec.ts +++ b/api/tests/functional/place.spec.ts @@ -59,10 +59,12 @@ test.group('Place', (group) => { const response = await client.post(`/places/${illustration.id}`).bearerToken(loggedInUser.body().token).json(place) response.assertStatus(200) + // console.log(response.body()) assert.equal(response.body().message, 'Created successfully') - assert.equal(response.body().place.user_id,goodUser.id) assert.isNumber(response.body().id) + const savedPlace = await Place.find(response.body().id) + assert.equal(savedPlace.user_id,goodUser.id) }) diff --git a/frontend/public/GitHub-Mark-32px.png b/frontend/public/GitHub-Mark-32px.png deleted file mode 100644 index 8b25551..0000000 Binary files a/frontend/public/GitHub-Mark-32px.png and /dev/null differ diff --git a/frontend/public/GitHub-Mark-Light-32px.png b/frontend/public/GitHub-Mark-Light-32px.png deleted file mode 100644 index 628da97..0000000 Binary files a/frontend/public/GitHub-Mark-Light-32px.png and /dev/null differ diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico index 718d6fe..16d7339 100644 Binary files a/frontend/public/favicon.ico and b/frontend/public/favicon.ico differ diff --git a/frontend/public/next.svg b/frontend/public/next.svg deleted file mode 100644 index 5174b28..0000000 --- a/frontend/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/public/thirteen.svg b/frontend/public/thirteen.svg deleted file mode 100644 index 8977c1b..0000000 --- a/frontend/public/thirteen.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/public/vercel.svg b/frontend/public/vercel.svg deleted file mode 100644 index d2f8422..0000000 --- a/frontend/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/src/components/Flash.tsx b/frontend/src/components/Flash.tsx index 7fdd13f..df06601 100644 --- a/frontend/src/components/Flash.tsx +++ b/frontend/src/components/Flash.tsx @@ -2,13 +2,13 @@ import { Transition } from '@headlessui/react' import { useAppSelector, useAppDispatch } from '@/hooks' import { useTimeoutFn } from 'react-use' import { selectFlash, setFlash, selectFlashMessage } from '@/features/flash/reducer' +import { useEffect, useState } from 'react' export default function Flash() { const flashOpen = useAppSelector(selectFlash) const flash = useAppSelector(selectFlashMessage) const dispatch = useAppDispatch() - useTimeoutFn(() => dispatch(setFlash(false)), 3500) const handleClose = () => { dispatch(setFlash(false)) }; @@ -32,6 +32,18 @@ export default function Flash() { info: 'border-blue-500', } + useEffect(() => { + const timeId = setTimeout(() => { + handleClose() + }, 2500) + + return () => { + clearTimeout(timeId) + } + }, [flashOpen]); + + if (!flashOpen) return <> + return (
diff --git a/frontend/src/components/TagSelect.tsx b/frontend/src/components/TagSelect.tsx index 8bfbabf..db2f2e9 100644 --- a/frontend/src/components/TagSelect.tsx +++ b/frontend/src/components/TagSelect.tsx @@ -59,6 +59,14 @@ export default function TagSelect({ defaultValue }:{ defaultValue: string | tagT handleTagAdd(inputRef.current.value) } } + if (event.key === 'Tab') { + // so then no tabbing to content? :( + event.preventDefault() + if (inputRef.current) { + // @ts-ignore + handleTagAdd(filteredTags[0].name) + } + } } const handleTagAutoCompleteClicked = (event: any) : void => { diff --git a/frontend/src/features/tags/reducer.ts b/frontend/src/features/tags/reducer.ts index a5ed671..06319d3 100644 --- a/frontend/src/features/tags/reducer.ts +++ b/frontend/src/features/tags/reducer.ts @@ -24,6 +24,7 @@ export const tagReducer = createSlice({ // Remove duplicate tags, must include space to - conversion if (!state.tags) { state.tags = [actions.payload] + return } if (!state.tags.some(item => item.name === actions.payload.name.replace(/ /g, '-'))) { state.tags = [...state.tags, actions.payload] diff --git a/frontend/src/pages/illustration/[id].tsx b/frontend/src/pages/illustration/[id].tsx index 5449eaf..3da0fac 100644 --- a/frontend/src/pages/illustration/[id].tsx +++ b/frontend/src/pages/illustration/[id].tsx @@ -16,6 +16,7 @@ import { selectIllustrationEdit, setIllustrationEdit, selectUpdateUI, setUpdateU import format from 'date-fns/format'; import PlaceConfirmDialog from '@/components/PlaceConfirmDialog'; import { placeType } from '@/library/placeType'; +import Head from 'next/head'; export default function IllustrationWrapper() { const router = useRouter() @@ -102,6 +103,9 @@ export default function IllustrationWrapper() { return ( + + SW | {illustration?.title} + {editIllustration ? : diff --git a/frontend/src/pages/tag/[name].tsx b/frontend/src/pages/tag/[name].tsx index efc2c73..5f92ba7 100644 --- a/frontend/src/pages/tag/[name].tsx +++ b/frontend/src/pages/tag/[name].tsx @@ -9,6 +9,7 @@ import Layout from '@/components/Layout'; import ConfirmDialog from '@/components/ConfirmDialog'; import { PencilSquareIcon, CheckCircleIcon, TrashIcon } from '@heroicons/react/24/solid' import { FormEvent } from 'react'; +import Head from 'next/head'; import { useAppSelector, useAppDispatch } from '@/hooks' import { selectModal, setModal } from '@/features/modal/reducer' @@ -81,6 +82,9 @@ export default function Tag() { return ( + + SW | {name} +
{editTag ?