Skip to content

Commit

Permalink
Merge pull request #2612 from Amsterdam/improvement/update-dependencies
Browse files Browse the repository at this point in the history
Updated linting and dep
  • Loading branch information
remyvdwereld authored Sep 4, 2024
2 parents 63a4f72 + 825fc83 commit 7db36b6
Show file tree
Hide file tree
Showing 16 changed files with 448 additions and 322 deletions.
722 changes: 429 additions & 293 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@amsterdam/amsterdam-react-final-form": "^0.1.141",
"@amsterdam/asc-assets": "^0.38.0",
"@amsterdam/asc-ui": "^0.38.0",
"@amsterdam/wonen-ui": "^1.0.50",
"@amsterdam/wonen-ui": "^1.0.55",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@testing-library/jest-dom": "^5.16.5",
Expand Down Expand Up @@ -65,7 +65,7 @@
"react-router-dom": "^6.22.3",
"styled-components": "^5.3.11",
"typescript": "5.1.6",
"vite": "^5.2.10",
"vite": "^5.2.13",
"vite-tsconfig-paths": "^4.3.1"
},
"devDependencies": {
Expand Down Expand Up @@ -117,4 +117,4 @@
"@testing-library/jest-dom/extend-expect"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const General: FC<Props> = ({ caseId }) => {

const fraudPrediction = !caseData.day_settings_id || (daySettings && daySettings.team_settings.fraud_prediction_model) ? caseData.fraud_prediction : undefined
const hasProject = caseData?.project?.name !== undefined
console.log("CASE DATA => ", caseData)

return (
<Section>
<SectionRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ItineraryForm: FC<Props> = ({ teamSettings }) => {
// @ts-ignore
await execPost(mapPostValues(values))
await navigateTo("/lijst")
}, [ execPost ])
}, [execPost, navigateTo])

if (!users) {
return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const CreateItineraryPage: React.FC = () => {
if (redirectToExistingItinerary) {
redirectToCorrectItineraryPage(data?.itineraries)
}
}, [ redirectToExistingItinerary, data ])
}, [redirectToExistingItinerary, data, redirectToCorrectItineraryPage])

if (!teamSettings) {
return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ const ItineraryPage: React.FC = () => {

useEffect(() => {
redirectToCorrectItineraryPage(itineraries?.itineraries, itineraryId)
}, [ itineraries, itineraryId ])
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [itineraries, itineraryId])

const { data: itinerary, isBusy } = useItinerary(parseInt(itineraryId!), { keepUsingInvalidCache: true })
const { execDelete } = useDeleteItinerary(itineraryId!, { lazy: true }) // <- NOTE: we need a extra hook here,
Expand All @@ -97,7 +98,7 @@ const ItineraryPage: React.FC = () => {
await execDelete()
await navigateTo("/lijst")
}
}, [ execDelete ])
}, [execDelete, navigateTo])

const items = itinerary?.items as unknown as ItineraryItem[]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ListItinerariesPage: React.FC = () => {

useEffect(() => {
redirectToCorrectItineraryPage(data?.itineraries)
}, [ data ])
}, [data, redirectToCorrectItineraryPage])

return (
<DefaultLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const AddDaySettingsButton: React.FC<Props> = ({ teamSettingsId, dayOfTheWeekId

const handleClick = useCallback(
() => navigate(`/team-settings/${ teamSettingsId }/nieuw?d=${ dayOfTheWeekId }`),
[ teamSettingsId, dayOfTheWeekId ]
[navigate, teamSettingsId, dayOfTheWeekId]
)

return <Button variant="primaryInverted" onClick={ handleClick }>Toevoegen</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const DeleteDaySettingsButton: React.FC<Props> = ({ teamSettingsId, daySettingsI
await navigateTo("/team-settings/:teamSettingsId", { teamSettingsId })
return execDelete()
}
}, [ execDelete, teamSettingsId ])
}, [execDelete, navigateTo, teamSettingsId])

return <Button variant="primaryInverted" onClick={ handleClick }>Verwijderen</Button>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const CreateDaySettingsForm: React.FC<Props> = ({ teamSettingsId }) => {
setErrorMessage(error.response.data.message)
return error
}
}, [ execPost, setErrorMessage, teamSettingsId ])
}, [execPost, navigateTo, teamSettingsId])

if (!districts || isBusyDistricts) {
return <CenteredSpinner explanation="Instellingen ophalen…" size={ 60 } />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const ItineraryItemCard: React.FC<Props> = (
if (href) {
return navigate(href)
}
}, [ href ])
}, [href, navigate])

return (
<Wrap backgroundColor={ backgroundColor } deleted={ deleted }>
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/shared/components/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const HomePage: React.FC = () => {

useEffect(() => {
redirectToCorrectItineraryPage(data?.itineraries)
}, [ data ])
}, [data, redirectToCorrectItineraryPage])

return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const DeleteVisitButton: React.FC<Props> = ({ visitId, itineraryId, caseId }) =>
clearSteps()
return execDelete()
}
}, [ execDelete, itineraryId, clearSteps ])
}, [navigateTo, itineraryId, clearSteps, execDelete])

return <StyledButton variant="blank" onClick={ handleClick } icon={ <TrashBin /> } />
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const NoteWizard: React.FC<Props> = ({ itineraryId, caseId, onSubmit, valuesFrom
}

return Promise.resolve(true)
}, [ pushStep, clearSteps, setValues, wizardStep, onSubmit, itineraryId, itineraryItem, user, moveItemToBottomList ])
}, [setValues, wizardStep, onSubmit, itineraryItem?.id, itineraryItem?.case?.id, user, clearSteps, moveItemToBottomList, navigateTo, itineraryId, pushStep])

return (
itinerary && itineraryItem && user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Props = {
const NoteWizardModal: React.FC<Props> = ({ children, itineraryId }) => {
const { navigateTo } = useNavigation()

const handleClose = useCallback(() => navigateTo("/lijst/:itineraryId", { itineraryId }), [ itineraryId ])
const handleClose = useCallback(() => navigateTo("/lijst/:itineraryId", { itineraryId }), [itineraryId, navigateTo])

return (
<DefaultModal title="Verwerken bezoek" onClose={ handleClose }>
Expand Down
13 changes: 1 addition & 12 deletions src/app/state/rest/hooks/useApiRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,7 @@ const useApiRequest = <Schema, Payload = Partial<Schema>> (
throw error
}
}
}, [
isProtected,
request,
protectedRequest,
logout,
url,
clearCache,
setCacheItem,
handleError,
addErrorToCacheItem,
noForbiddenRedirect
])
}, [isProtected, protectedRequest, request, url, clearCache, setCacheItem, addErrorToCacheItem, handleError, logout, noForbiddenRedirect, navigateTo])

/**
* Queues an API request
Expand Down

0 comments on commit 7db36b6

Please sign in to comment.