Skip to content

Commit

Permalink
feat(orga): updating matomo config
Browse files Browse the repository at this point in the history
  • Loading branch information
alicegoarnisson committed Dec 5, 2024
1 parent e65a74f commit 458d2d8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
2 changes: 2 additions & 0 deletions orga/app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ export default class ApplicationRoute extends Route {
@service currentUser;
@service session;
@service intl;
@service metrics;

async beforeModel(transition) {
this.metrics.initialize();
await this.session.setup();
await this.featureToggles.load();
const isFranceDomain = this.currentDomain.isFranceDomain;
Expand Down
17 changes: 6 additions & 11 deletions orga/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ module.exports = function (environment) {
warnIfNoIconsIncluded: false,
},

matomo: {},

'ember-cli-notifications': {
autoClear: true,
clearDuration: 5000,
Expand All @@ -120,6 +118,11 @@ module.exports = function (environment) {
'ember-cli-mirage': {
usingProxy: true,
},

metrics: {
enabled: analyticsEnabled,
matomoUrl: process.env.WEB_ANALYTICS_URL,
},
};

if (environment === 'development') {
Expand All @@ -132,10 +135,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 @@ -157,16 +156,12 @@ module.exports = function (environment) {
autoClear: null,
clearDuration: null,
};

ENV.metrics.enabled = false;
ENV.pagination.debounce = 0;
}

if (environment === 'production') {
// here you can enable a production-specific feature

if (analyticsEnabled) {
ENV.matomo.url = process.env.WEB_ANALYTICS_URL;
}
}

return ENV;
Expand Down
11 changes: 11 additions & 0 deletions orga/package-lock.json

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

2 changes: 1 addition & 1 deletion orga/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
},
"devDependencies": {
"@1024pix/ember-cli-notifications": "^8.0.2",
"@1024pix/ember-matomo-tag-manager": "^2.4.3",
"@1024pix/ember-testing-library": "^3.0.6",
"@1024pix/eslint-config": "^1.3.8",
"@1024pix/pix-ui": "^48.7.1",
Expand Down Expand Up @@ -80,7 +81,6 @@
"ember-cli-dependency-checker": "^3.3.2",
"ember-cli-htmlbars": "^6.3.0",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-matomo-tag-manager": "^1.3.1",
"ember-cli-mirage": "^3.0.4",
"ember-cli-sass": "^11.0.1",
"ember-click-outside": "^6.1.1",
Expand Down

0 comments on commit 458d2d8

Please sign in to comment.