Skip to content

Commit

Permalink
Merge pull request #1863 from BaseAdresseNationale/feat/adresse-v2-ca…
Browse files Browse the repository at this point in the history
…rto-ban

Feat/adresse v2 carto ban
  • Loading branch information
nkokla authored Oct 31, 2024
2 parents 50b9a20 + 75eca68 commit dbadf2f
Show file tree
Hide file tree
Showing 66 changed files with 3,370 additions and 239 deletions.
3 changes: 3 additions & 0 deletions .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ NEXT_PUBLIC_CERTIFICAT_NUMEROTATION_ENABLED=0
# DEPRECATED : A voir pour supprimer cette variable qui utilise la lib helmet
ENABLE_HELMET=0

# Internal URL
NEXT_PUBLIC_URL_CARTOGRAPHY_BAN = '/carte-base-adresse-nationale'

# -----------------------------------------------
# --- Parametres URL Externe autre projet BAN ---
# -----------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ env:
S3_CONFIG_REGION: ${{ secrets.S3_CONFIG_REGION }}
S3_CONFIG_ENDPOINT: ${{ secrets.S3_CONFIG_ENDPOINT }}

# MATOMO
# MATOMO
NEXT_PUBLIC_MATOMO_URL: ${{secrets.NEXT_PUBLIC_MATOMO_URL}}
NEXT_PUBLIC_MATOMO_SITE_ID: ${{secrets.NEXT_PUBLIC_MATOMO_SITE_ID}}


jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ services:
# App Configuration
- NEXT_PUBLIC_CERTIFICAT_NUMEROTATION_ENABLED=${NEXT_PUBLIC_CERTIFICAT_NUMEROTATION_ENABLED}
- ENABLE_HELMET=${ENABLE_HELMET}
- NEXT_PUBLIC_URL_CARTOGRAPHY_BAN=${NEXT_PUBLIC_URL_CARTOGRAPHY_BAN}
# External URLs
- NEXT_PUBLIC_API_GEO_URL=${NEXT_PUBLIC_API_GEO_URL}
- NEXT_PUBLIC_API_ETABLISSEMENTS_PUBLIC=${NEXT_PUBLIC_API_ETABLISSEMENTS_PUBLIC}
Expand Down
94 changes: 50 additions & 44 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const defaultEnvVarRaw = dotenv.parse(fs.readFileSync(defaultEnvVarFile))
const defaultEnvVar = getNextEnv(defaultEnvVarRaw)
const envVar = getNextEnv(process.env)

const URL_CARTOGRAPHY_BAN = process.env.NEXT_PUBLIC_URL_CARTOGRAPHY_BAN
const NEXT_PUBLIC_GHOST_URL_IMAGES_SOURCE = process.env.NEXT_PUBLIC_GHOST_URL_IMAGES_SOURCE
const imagesDomains = ['static.data.gouv.fr']
if (NEXT_PUBLIC_GHOST_URL_IMAGES_SOURCE) {
Expand All @@ -25,55 +26,60 @@ const withBundleAnalyzer = NextBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})

const nextConfig = withBundleAnalyzer({
async redirects() {
return [
{
source: '/gerer-mes-adresses',
destination: '/programme-bal',
permanent: true,
},
{
source: '/bases-locales/charte',
destination: '/communaute/charte-base-adresse-locale',
permanent: true,
},
{
source: '/bases-locales/charte/communes',
destination: '/communaute/communes-partenaires',
permanent: true,
},
{
source: '/bases-locales/charte/companies',
destination: '/communaute/societes-partenaires',
permanent: true,
},
{
source: '/bases-locales/charte/organismes',
destination: '/communaute/organismes-partenaires',
permanent: true,
},
{
source: '/bases-locales/validateur',
destination: '/outils/validateur-bal',
permanent: true,
},
{
source: '/bases-locales/publication',
destination: '/outils/formulaire-de-publication',
permanent: true,
},
{
source: '/bases-locales/validator-documentation',
destination: '/outils/formulaire-de-publication',
permanent: true,
},
]
const redirects = async () => [
{
source: '/gerer-mes-adresses',
destination: '/programme-bal',
permanent: true,
},
{
source: '/bases-locales/charte',
destination: '/communaute/charte-base-adresse-locale',
permanent: true,
},
{
source: '/bases-locales/charte/communes',
destination: '/communaute/communes-partenaires',
permanent: true,
},
{
source: '/bases-locales/charte/companies',
destination: '/communaute/societes-partenaires',
permanent: true,
},
{
source: '/bases-locales/charte/organismes',
destination: '/communaute/organismes-partenaires',
permanent: true,
},
{
source: '/bases-locales/validateur',
destination: '/outils/validateur-bal',
permanent: true,
},
{
source: '/bases-locales/publication',
destination: '/outils/formulaire-de-publication',
permanent: true,
},
{
source: '/bases-locales/validator-documentation',
destination: '/outils/formulaire-de-publication',
permanent: true,
},
{
source: '/base-adresse-nationale/:path',
destination: `${URL_CARTOGRAPHY_BAN}?id=:path`,
permanent: true,
},
]

const nextConfig = withBundleAnalyzer({
env: {
...defaultEnvVar,
...envVar,
},
redirects,
images: {
remotePatterns: imagesDomains.map(domain => ({
protocol: 'https',
Expand Down
Loading

0 comments on commit dbadf2f

Please sign in to comment.