Skip to content

Commit

Permalink
Merge pull request #2283 from bcgov/chore/remove-snowplow
Browse files Browse the repository at this point in the history
chore: remove snowplow analytics
  • Loading branch information
pbastia authored Jun 13, 2024
2 parents 9b35a02 + dda0afa commit bc6e154
Show file tree
Hide file tree
Showing 10 changed files with 318 additions and 1,009 deletions.
36 changes: 0 additions & 36 deletions app/components/Layout/Analytics.jsx

This file was deleted.

1 change: 0 additions & 1 deletion app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = withSentryConfig(
publicRuntimeConfig: {
ADMIN_EMAIL: process.env.ADMIN_EMAIL,
SUPPORT_EMAIL: process.env.SUPPORT_EMAIL,
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
SITEWIDE_NOTICE: process.env.SITEWIDE_NOTICE,
ENABLE_DB_MOCKS: process.env.ENABLE_DB_MOCKS,
SENTRY_ENVIRONMENT: process.env.SENTRY_ENVIRONMENT,
Expand Down
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"improved-yarn-audit": "^3.0.0",
"jest": "^27.2.4",
"jest-canvas-mock": "^2.3.1",
"jest-extended": "^0.11.5",
"jest-extended": "^4.0.2",
"jest-mock-random": "^1.1.1",
"jest-raw-loader": "^1.0.1",
"json-schema-faker": "^0.5.0-rc23",
Expand Down Expand Up @@ -179,7 +179,7 @@
"setupFilesAfterEnv": [
"<rootDir>tests/setupTests.ts",
"jest-canvas-mock",
"jest-extended"
"jest-extended/all"
],
"transform": {
".*(ts|tsx|js|jsx)$": "babel-jest",
Expand Down
5 changes: 0 additions & 5 deletions app/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React from "react";
import Document, { Html, Head, Main, NextScript } from "next/document";
import Analytics from "components/Layout/Analytics";
import getConfig from "next/config";

const CONFIG = getConfig()?.publicRuntimeConfig;

class MyDocument extends Document {
render() {
Expand Down Expand Up @@ -42,7 +38,6 @@ class MyDocument extends Document {
<body>
<Main />
<NextScript />
{CONFIG?.ENABLE_ANALYTICS === "true" && <Analytics />}
</body>
</Html>
);
Expand Down
4 changes: 0 additions & 4 deletions app/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const dev = process.env.NODE_ENV !== "production";
const app = nextjs({ dev });
const handle = app.getRequestHandler();
const bodyParser = require("body-parser");
const cors = require("cors");
const UNSUPPORTED_BROWSERS = require("../data/unsupported-browsers");
const { run } = require("graphile-worker");
const path = require("path");
Expand Down Expand Up @@ -88,9 +87,6 @@ app.prepare().then(async () => {

server.use(bodyParser.json({ limit: "50mb" }));

// Only allow CORS for the <Analytics /> component
server.use(cors({ origin: "https://www2.gov.bc.ca" }));

// Tell search + crawlers not to index non-production environments:
server.use(({ res, next }) => {
if (!process.env.NAMESPACE || !process.env.NAMESPACE.endsWith("-prod")) {
Expand Down
Loading

0 comments on commit bc6e154

Please sign in to comment.