Skip to content

Commit

Permalink
Fix env vars (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
thoomasbro authored Jan 20, 2023
2 parents efb3997 + ab162a1 commit 3a397b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions frontend/src/features/map/layers/BaseLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import XYZ from 'ol/source/XYZ'
import React, { useEffect, useState } from 'react'

import { BaseLayers, Layers } from '../../../domain/entities/layers/constants'
import { MAPBOX_KEY, SHOM_KEY } from '../../../env'
import { useAppSelector } from '../../../hooks/useAppSelector'

export type BaseLayerProps = {
Expand All @@ -17,7 +18,7 @@ function UnmemoizedBaseLayer({ map }: BaseLayerProps) {
const [baseLayersObjects] = useState({
LIGHT: () =>
new MapboxVector({
accessToken: process.env.REACT_APP_MAPBOX_KEY,
accessToken: MAPBOX_KEY,
className: Layers.BASE_LAYER.code,
styleUrl: 'mapbox://styles/monitorfish/ckrbusml50wgv17nrzy3q374b',
zIndex: 0
Expand All @@ -36,7 +37,7 @@ function UnmemoizedBaseLayer({ map }: BaseLayerProps) {
className: Layers.BASE_LAYER.code,
source: new XYZ({
maxZoom: 19,
url: `https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.jpg90?access_token=${process.env.REACT_APP_MAPBOX_KEY}`
url: `https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.jpg90?access_token=${MAPBOX_KEY}`
}),
zIndex: 0
}),
Expand All @@ -49,7 +50,7 @@ function UnmemoizedBaseLayer({ map }: BaseLayerProps) {
// Countries have transparency, so do not fade tiles:
transition: 0,

url: `https://services.data.shom.fr/${process.env.REACT_APP_SHOM_KEY}/wms/r`
url: `https://services.data.shom.fr/${SHOM_KEY}/wms/r`
}),
zIndex: 0
})
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/features/missions/MissionForm/ActionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function ActionCard({ action, duplicateAction, removeAction, selectAction
<ControlIcon />
<SummaryContent>
<Title>
Contrôle{action.actionNumberOfControls && action.actionNumberOfControls > 1 ? 's ' : ' '}
Contrôle{!!action.actionNumberOfControls && action.actionNumberOfControls > 1 ? 's ' : ' '}
{action.actionTheme ? (
<Accented>{`${action.actionTheme} ${
action.actionSubTheme ? ` - ${action.actionSubTheme}` : ''
Expand All @@ -53,19 +53,19 @@ export function ActionCard({ action, duplicateAction, removeAction, selectAction
'à renseigner'
)}
</Title>
{action.actionNumberOfControls && action.actionNumberOfControls > 0 && (
{!!action.actionNumberOfControls && action.actionNumberOfControls > 0 && (
<ControlSummary>
<Accented>{action.actionNumberOfControls}</Accented>
{` contrôle${action.actionNumberOfControls > 1 ? 's' : ''} réalisé${
action.actionNumberOfControls > 1 ? 's' : ''
} sur des cibles de type `}
<Accented>
{(action.actionTargetType && actionTargetTypeEnum[action.actionTargetType]?.libelle) ||
{(!!action.actionTargetType && actionTargetTypeEnum[action.actionTargetType]?.libelle) ||
'non spécifié'}
</Accented>
</ControlSummary>
)}
{action.actionNumberOfControls && action.actionNumberOfControls > 0 && (
{!!action.actionNumberOfControls && action.actionNumberOfControls > 0 && (
<ControlInfractionsTags
actionNumberOfControls={action.actionNumberOfControls}
infractions={action?.infractions}
Expand All @@ -88,7 +88,7 @@ export function ActionCard({ action, duplicateAction, removeAction, selectAction
'à renseigner'
)}
</Title>
{action.duration > 0 && (
{!!action.duration && action.duration > 0 && (
<DurationWrapper>
<Accented>{action.duration} heure(s)&nbsp;</Accented>
de surveillance
Expand Down

0 comments on commit 3a397b7

Please sign in to comment.