diff --git a/app.config.environment.dev.js b/app.config.environment.dev.js index 8fdfb95ec375a64914ab9c12b04aae0512ff4636..31cbe4a8ce3c192dae0a38450fa5cfafbb4af6aa 100644 --- a/app.config.environment.dev.js +++ b/app.config.environment.dev.js @@ -19,6 +19,7 @@ const stackProvidedLibsConfig = { new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('development'), __IS_ALPHA__: true, + __DEVELOPMENT__: true, __STACK_ASSETS__: true, __PIWIK_TRACKER_URL__: JSON.stringify('http://localhost:9800/'), __PIWIK_SITEID__: 1, diff --git a/src/components/App.tsx b/src/components/App.tsx index d29f436c5a6c27593e90755ff4ff8a2fefd37726..ec4fdf7de2ab6c2a17a1fb7328696db6cfb79865 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -23,7 +23,7 @@ export const App = ({ tracker }: AppProps) => { (state: AppStore) => state.ecolyo.profile ) const { termsStatus } = useSelector((state: AppStore) => state.ecolyo.global) - const isDev = new EnvironmentService().isDev() + const isDev = new EnvironmentService().isLocal() console.log(isDev) diff --git a/src/components/Options/MatomoOptOut.tsx b/src/components/Options/MatomoOptOut.tsx index 52c0804e717e0de0f27acb83e9ce7dfec0195b7a..54d780be75539c5375afd0077781fa3534ad7b79 100644 --- a/src/components/Options/MatomoOptOut.tsx +++ b/src/components/Options/MatomoOptOut.tsx @@ -1,9 +1,14 @@ import React from 'react' import { useI18n } from 'cozy-ui/transpiled/react/I18n' import './matomoOptOut.scss' +import EnvironmentService from '../../services/environment.service' export const MatomoOptOut: React.FC = () => { const { t } = useI18n() + const isDev = new EnvironmentService().isLocal() + const baseUrl = isDev + ? 'http://localhost:9800' + : 'https://statweb.grandlyon.com' return ( <div className="matomo-opt-out-container"> <div className="matomo-opt-out"> @@ -12,7 +17,7 @@ export const MatomoOptOut: React.FC = () => { </div> <iframe style={{ height: '430px' }} - src="http://localhost:9800/index.php?module=CoreAdminHome&action=optOut&language=fr&backgroundColor=121212&fontColor=e0e0e0&fontSize=&fontFamily=Lato" + src={`${baseUrl}/index.php?module=CoreAdminHome&action=optOut&language=fr&backgroundColor=121212&fontColor=e0e0e0&fontSize=&fontFamily=Lato`} ></iframe> </div> </div> diff --git a/src/services/environment.service.ts b/src/services/environment.service.ts index 4537dc15976b1cf42f08d60968eac65aa9535d47..116c1bcc9e0e09afbb2128774fdb9710927f33a8 100644 --- a/src/services/environment.service.ts +++ b/src/services/environment.service.ts @@ -23,7 +23,7 @@ export default class EnvironmentService { } } - public isDev() { + public isLocal() { return __DEVELOPMENT__ } } diff --git a/src/utils/matomoTracker.ts b/src/utils/matomoTracker.ts index 00a649b5716b7a8f1926b8c6aa33beb1f91b23ed..1afb34486aa3badd66f427661e23e9ef838ed56b 100644 --- a/src/utils/matomoTracker.ts +++ b/src/utils/matomoTracker.ts @@ -97,7 +97,6 @@ export default class MatomoTracker { } track(loc: Location) { - console.log(loc) if (typeof window === 'undefined') { return }