Skip to content

Commit

Permalink
feat(junior): configure pix matomo tag manager lib
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelie-crouillebois committed Nov 25, 2024
1 parent 705dbf3 commit f48e2e4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
2 changes: 2 additions & 0 deletions junior/app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { service } from '@ember/service';

export default class ApplicationRoute extends Route {
@service intl;
@service metrics;

async beforeModel() {
/*
Expand All @@ -16,5 +17,6 @@ export default class ApplicationRoute extends Route {
Pour régler ce problème, il faut définir une locale ayant un fichier dans le dossier de traduction.
*/
this.intl.setLocale('fr');
this.metrics.initialize();
}
}
19 changes: 5 additions & 14 deletions junior/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ module.exports = function (environment) {
environment,
locationType: 'history',
rootURL: '/',
matomo: {},

metrics: {
enabled: analyticsEnabled,
matomoUrl: process.env.WEB_ANALYTICS_URL,
},
EmberENV: {
EXTEND_PROTOTYPES: false,
FEATURES: {
Expand Down Expand Up @@ -46,10 +48,6 @@ module.exports = function (environment) {
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
// ENV.APP.LOG_VIEW_LOOKUPS = true;
if (analyticsEnabled) {
ENV.matomo.url = process.env.WEB_ANALYTICS_URL;
ENV.matomo.debug = true;
}
}

if (environment === 'test') {
Expand All @@ -62,15 +60,8 @@ module.exports = function (environment) {

ENV.APP.rootElement = '#ember-testing';
ENV.APP.autoboot = false;

ENV.APP.CHALLENGE_DISPLAY_DELAY = 0;
}

if (environment === 'production') {
// here you can enable a production-specific feature
if (analyticsEnabled) {
ENV.matomo.url = process.env.WEB_ANALYTICS_URL;
}
ENV.metrics.enabled = false;
}

ENV['ember-component-css'] = {
Expand Down
10 changes: 10 additions & 0 deletions junior/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions junior/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"test:lint": "run-p --continue-on-error test lint"
},
"devDependencies": {
"@1024pix/ember-matomo-tag-manager": "^2.4.3",
"@1024pix/ember-testing-library": "^3.0.6",
"@1024pix/eslint-config": "^1.3.8",
"@1024pix/pix-ui": "^46.15.2",
Expand Down

0 comments on commit f48e2e4

Please sign in to comment.