-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
127 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { useEffect } from 'react'; | ||
import { useLocation } from 'react-router-dom'; | ||
|
||
const useMatomoTracking = (): void => { | ||
const location = useLocation(); | ||
|
||
useEffect(() => { | ||
if (typeof _paq !== 'undefined') { | ||
_paq.push(['setCustomUrl', window.location.href]); | ||
_paq.push(['setDocumentTitle', document.title]); | ||
_paq.push(['trackPageView']); | ||
} | ||
}, [location]); | ||
}; | ||
|
||
export default useMatomoTracking; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useEffect } from 'react'; | ||
import { useLocation } from 'react-router-dom'; | ||
|
||
const pageTitles: { [key: string]: string } = { | ||
'/project/:projectId/tableau-de-bord/synthesis': 'Synthèse', | ||
'/project/:projectId/tableau-de-bord/consommation': 'Consommation d\'espaces NAF', | ||
'/project/:projectId/tableau-de-bord/trajectoires': 'Trajectoire ZAN', | ||
'/project/:projectId/tableau-de-bord/découvrir-l-ocsge': 'Usage et couverture du sol (OCS GE)', | ||
'/project/:projectId/tableau-de-bord/artificialisation': 'Artificialisation', | ||
'/project/:projectId/tableau-de-bord/impermeabilisation': 'Impermeabilisation', | ||
'/project/:projectId/tableau-de-bord/zonages-d-urbanisme': 'Artificialisation des zonages d\'urbanisme', | ||
'/project/:projectId/tableau-de-bord/rapport-local': 'Rapport triennal local', | ||
'/project/:projectId/edit': 'Paramètres du diagnostic', | ||
}; | ||
|
||
const usePageTitle = (): void => { | ||
const location = useLocation(); | ||
|
||
useEffect(() => { | ||
const currentPath = location.pathname; | ||
|
||
const projectIdMatch = currentPath.match(/\/project\/([^\/]+)\//); | ||
const projectId = projectIdMatch ? projectIdMatch[1] : ''; | ||
|
||
const pageTitle = Object.keys(pageTitles).find(path => | ||
currentPath.includes(path.replace(':projectId', projectId)) | ||
); | ||
|
||
document.title = pageTitle ? `${pageTitles[pageTitle]} | Mon Diagnostic Artificialisation` : 'Mon Diagnostic Artificialisation'; | ||
}, [location]); | ||
}; | ||
|
||
export default usePageTitle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ declare module '*.geojson' { | |
const value: any; | ||
export default value; | ||
} | ||
|
||
declare var _paq: any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% extends "project/layout/base.html" %} | ||
|
||
{% block pagetitle %}{{ project.name }} | Mon Diagnostic Artificialisation{% endblock pagetitle %} | ||
{% block pagetitle %}Artificialisation | Mon Diagnostic Artificialisation{% endblock pagetitle %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% extends "project/layout/base.html" %} | ||
|
||
{% block pagetitle %}{{ project.name }} | Mon Diagnostic Artificialisation{% endblock pagetitle %} | ||
{% block pagetitle %}Consommation d'espaces NAF | Mon Diagnostic Artificialisation{% endblock pagetitle %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% extends "project/layout/base.html" %} | ||
|
||
{% block pagetitle %}{{ project.name }} | Mon Diagnostic Artificialisation{% endblock pagetitle %} | ||
{% block pagetitle %}Artificialisation des zonages d'urbanisme | Mon Diagnostic Artificialisation{% endblock pagetitle %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% extends "project/layout/base.html" %} | ||
|
||
{% block pagetitle %}{{ project.name }} | Mon Diagnostic Artificialisation{% endblock pagetitle %} | ||
{% block pagetitle %}Imperméabilisation | Mon Diagnostic Artificialisation{% endblock pagetitle %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% extends "project/layout/base.html" %} | ||
|
||
{% block pagetitle %}{{ project.name }} | Mon Diagnostic Artificialisation{% endblock pagetitle %} | ||
{% block pagetitle %}Usage et couverture du sol (OCS GE) | Mon Diagnostic Artificialisation{% endblock pagetitle %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% extends "project/layout/base.html" %} | ||
|
||
{% block pagetitle %}{{ project.name }} | Mon Diagnostic Artificialisation{% endblock pagetitle %} | ||
{% block pagetitle %}Rapport triennal local | Mon Diagnostic Artificialisation{% endblock pagetitle %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% extends "project/layout/base.html" %} | ||
|
||
{% block pagetitle %}{{ project.name }} | Mon Diagnostic Artificialisation{% endblock pagetitle %} | ||
{% block pagetitle %}Synthèse | Mon Diagnostic Artificialisation{% endblock pagetitle %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% extends "project/layout/base.html" %} | ||
|
||
{% block pagetitle %}{{ project.name }} | Mon Diagnostic Artificialisation{% endblock pagetitle %} | ||
{% block pagetitle %}Trajectoire ZAN | Mon Diagnostic Artificialisation{% endblock pagetitle %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% extends "project/layout/base.html" %} | ||
|
||
{% block pagetitle %}{{ project.name }} | Mon Diagnostic Artificialisation{% endblock pagetitle %} | ||
{% block pagetitle %}Paramètres du diagnostic | Mon Diagnostic Artificialisation{% endblock pagetitle %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.