From 29d9e532c833be07ce29fbf7d78517483c34058a Mon Sep 17 00:00:00 2001 From: Stef Winterswijk Date: Tue, 2 Jul 2024 13:11:24 +0200 Subject: [PATCH 1/4] AB#19675 --- .../SidebarInformation/SidebarInformation.tsx | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/pages/public/MapSearch/SidebarInformation/SidebarInformation.tsx b/src/pages/public/MapSearch/SidebarInformation/SidebarInformation.tsx index 082a6c84..fa8f7f20 100644 --- a/src/pages/public/MapSearch/SidebarInformation/SidebarInformation.tsx +++ b/src/pages/public/MapSearch/SidebarInformation/SidebarInformation.tsx @@ -1,11 +1,10 @@ import { Transition } from '@headlessui/react' -import { FieldSelect, Heading, Text } from '@pzh-ui/components' +import { Heading, Text } from '@pzh-ui/components' import { ArrowLeft, DrawPolygon, LocationDot } from '@pzh-ui/icons' import Leaflet, { latLng } from 'leaflet' -import { ReactNode, useEffect, useMemo, useState } from 'react' +import { ReactNode, useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' -import { useWerkingsgebiedenValidGet } from '@/api/fetchers' import { LeafletSearchInput } from '@/components/Leaflet' import { MAP_SEARCH_PAGE } from '@/constants/leaflet' import useSearchParam from '@/hooks/useSearchParam' @@ -32,24 +31,24 @@ const SidebarInformation = ({ onDraw }: SidebarInformationProps) => { const [werkingsgebied, setWerkingsgebied] = useState(null) - const { data, isLoading } = useWerkingsgebiedenValidGet({ - limit: 1000, - sort_column: 'Title', - sort_order: 'ASC', - }) - const selectedVal = useMemo( - () => data?.results.find(item => item.UUID === paramWerkingsgebied), - [data, paramWerkingsgebied] - ) - - const options = useMemo( - () => - data?.results.map(option => ({ - label: option.Title, - value: option.Area_UUID, - })), - [data] - ) + // const { data, isLoading } = useWerkingsgebiedenValidGet({ + // limit: 1000, + // sort_column: 'Title', + // sort_order: 'ASC', + // }) + // const selectedVal = useMemo( + // () => data?.results.find(item => item.UUID === paramWerkingsgebied), + // [data, paramWerkingsgebied] + // ) + + // const options = useMemo( + // () => + // data?.results.map(option => ({ + // label: option.Title, + // value: option.Area_UUID, + // })), + // [data] + // ) const goBack = () => { navigate(MAP_SEARCH_PAGE) @@ -149,7 +148,7 @@ const SidebarInformation = ({ onDraw }: SidebarInformationProps) => { )} - @@ -186,7 +185,7 @@ const SidebarInformation = ({ onDraw }: SidebarInformationProps) => { ) }} /> - )} + )} */} Date: Tue, 2 Jul 2024 15:11:24 +0200 Subject: [PATCH 2/4] AB#19714 --- src/components/ScrollToTop/ScrollToTop.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ScrollToTop/ScrollToTop.tsx b/src/components/ScrollToTop/ScrollToTop.tsx index 6861e6b3..99ed8d9c 100644 --- a/src/components/ScrollToTop/ScrollToTop.tsx +++ b/src/components/ScrollToTop/ScrollToTop.tsx @@ -5,7 +5,7 @@ import { useLocation } from 'react-router-dom' * Function that can be called to bring the user's screen to the top of the page. */ export default function ScrollToTop() { - const { pathname } = useLocation() + const { pathname, key } = useLocation() useEffect(() => { window.scrollTo({ @@ -13,7 +13,7 @@ export default function ScrollToTop() { top: 0, behavior: 'instant', }) - }, [pathname]) + }, [pathname, key]) return null } From 4d818e15747efc2740162b0690743fdfa21c96c1 Mon Sep 17 00:00:00 2001 From: Stef Winterswijk Date: Tue, 16 Jul 2024 09:28:27 +0200 Subject: [PATCH 3/4] merge --- src/pages/public/Home/SearchSection/SearchSection.tsx | 1 + yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/public/Home/SearchSection/SearchSection.tsx b/src/pages/public/Home/SearchSection/SearchSection.tsx index 1d0c2332..b22634d1 100644 --- a/src/pages/public/Home/SearchSection/SearchSection.tsx +++ b/src/pages/public/Home/SearchSection/SearchSection.tsx @@ -25,6 +25,7 @@ const SearchSection = () => ( controllers={{ showSearch: false, showDraw: true, + showLayers: false, }} className="w-full rounded border border-pzh-gray-300" /> diff --git a/yarn.lock b/yarn.lock index 1bb34ecb..8955e25e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6820,9 +6820,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.30001538, caniuse-lite@npm:^1.0.30001565": - version: 1.0.30001578 - resolution: "caniuse-lite@npm:1.0.30001578" - checksum: 3b1c41e70270839c958c3fefa3430d74021e15f019667c53f44894eff7382c03c1464e68c4aced284a212c1f157888b09f5b7fd5cae163efdc916202ec71a59d + version: 1.0.30001641 + resolution: "caniuse-lite@npm:1.0.30001641" + checksum: d60df2662fcae31efc8f36451929640e9630bb2e936f7449166dc70dcc4a757f6d86a5a089eed763b58354d684404b175e6c8790a9fd95c48abed1fcb7c26225 languageName: node linkType: hard From 343eae8a0f5f4da305bc025e94204cda6d474596 Mon Sep 17 00:00:00 2001 From: Stef Winterswijk Date: Tue, 16 Jul 2024 09:32:08 +0200 Subject: [PATCH 4/4] AB#19859 --- src/validation/zodSchema.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/validation/zodSchema.ts b/src/validation/zodSchema.ts index db0a89a4..32d772ee 100644 --- a/src/validation/zodSchema.ts +++ b/src/validation/zodSchema.ts @@ -5,7 +5,9 @@ export const schemaDefaults = { string({ required_error: msg, invalid_type_error: msg, - }).trim(), + }) + .trim() + .min(1, 'Dit veld is verplicht.'), optionalString: string().optional().nullable(), requiredNumber: (msg = 'Dit veld is verplicht.') => number({