Skip to content

Commit

Permalink
Merge pull request #829 from Provincie-Zuid-Holland/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
Stefwint authored Jul 25, 2024
2 parents dfaf793 + 7ad3811 commit 25194e4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/components/ScrollToTop/ScrollToTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ 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({
left: 0,
top: 0,
behavior: 'instant',
})
}, [pathname])
}, [pathname, key])

return null
}
1 change: 1 addition & 0 deletions src/pages/public/Home/SearchSection/SearchSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const SearchSection = () => (
controllers={{
showSearch: false,
showDraw: true,
showLayers: false,
}}
className="w-full rounded border border-pzh-gray-300"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -32,24 +31,24 @@ const SidebarInformation = ({ onDraw }: SidebarInformationProps) => {
const [werkingsgebied, setWerkingsgebied] =
useState<Leaflet.TileLayer.WMS | null>(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)
Expand Down Expand Up @@ -149,7 +148,7 @@ const SidebarInformation = ({ onDraw }: SidebarInformationProps) => {
</>
)}

<InfoText
{/* <InfoText
title="Werkingsgebied"
description="Selecteer een werkingsgebied om het gekoppelde beleid in te zien."
/>
Expand Down Expand Up @@ -186,7 +185,7 @@ const SidebarInformation = ({ onDraw }: SidebarInformationProps) => {
)
}}
/>
)}
)} */}
</Transition>

<Transition
Expand Down
4 changes: 3 additions & 1 deletion src/validation/zodSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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({
Expand Down

0 comments on commit 25194e4

Please sign in to comment.