Skip to content

Commit

Permalink
Merge branch 'master' into j-saur-fix-typo
Browse files Browse the repository at this point in the history
  • Loading branch information
vinsag authored Jun 12, 2024
2 parents 3b57bb6 + cb69aae commit 8e90cd9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ FROM node:18.19-alpine3.18 as builder

WORKDIR /app

WORKDIR /app
COPY package.json yarn.lock .
ENV YARN_LOG_DIR=/tmp
RUN mkdir public
RUN yarn

Expand All @@ -25,6 +27,8 @@ COPY --from=builder /app/server ./server
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/scripts/ ./scripts

RUN yarn build-available-flags
USER node
EXPOSE 3000

CMD ["sh", "-c", "yarn build-available-flags && yarn start"]
CMD ["sh", "-c", "yarn start"]
28 changes: 14 additions & 14 deletions components/bases-locales/deploiement-bal/panel-bal.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ function PanelBal({filteredCodesCommmune}) {
const [bals, setBals] = useState([])
const [dataStats, setDataStats] = useState(initialStats)

const setDataStatsWithBal = useCallback(data => {
setDataStats(dataStats => {
return {
...dataStats,
datasets: [
{
...dataStats.datasets[0],
data
}
]
}
})
}, [])

useEffect(() => {
async function loadBalsStatus() {
const balsStatus = await getBalsStatus()
Expand Down Expand Up @@ -75,20 +89,6 @@ function PanelBal({filteredCodesCommmune}) {
return groupBy(bals, 'commune')
}, [bals])

const setDataStatsWithBal = useCallback(data => {
setDataStats(dataStats => {
return {
...dataStats,
datasets: [
{
...dataStats.datasets[0],
data
}
]
}
})
}, [])

return (
<div>
<br />
Expand Down
20 changes: 10 additions & 10 deletions components/maplibre/ban-map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,6 @@ function BanMap({address, bbox, onSelect, isMobile}) {
const [bound, setBound] = useState()
const [infoPopup, setInfoPopup] = useState(null)

const onLeave = useCallback(() => {
if (hoveredFeature) {
highLightAdressesByProperties(false, hoveredFeature)
}

setInfoPopup(null)
map.current.getCanvas().style.cursor = 'grab'
hoveredFeature = null
}, [map, highLightAdressesByProperties])

const highLightAdressesByProperties = useCallback((isHovered, hoveredFeature) => {
const {nom, id} = hoveredFeature
forEach(SOURCES, sourceLayer => {
Expand All @@ -141,6 +131,16 @@ function BanMap({address, bbox, onSelect, isMobile}) {
})
}, []) // eslint-disable-line react-hooks/exhaustive-deps

const onLeave = useCallback(() => {
if (hoveredFeature) {
highLightAdressesByProperties(false, hoveredFeature)
}

setInfoPopup(null)
map.current.getCanvas().style.cursor = 'grab'
hoveredFeature = null
}, [map, highLightAdressesByProperties])

const onHover = useCallback(e => {
if (e.features.length > 0) {
if (hoveredFeature) {
Expand Down

0 comments on commit 8e90cd9

Please sign in to comment.