diff --git a/catalog/py_package/catalog_build/build.py b/catalog/py_package/catalog_build/build.py index ea0a2aa1..02f341e2 100644 --- a/catalog/py_package/catalog_build/build.py +++ b/catalog/py_package/catalog_build/build.py @@ -1742,4 +1742,4 @@ def get_image_path( else: raise FileNotFoundError( f"No species image found, or missing_image{file_suffix} in {folder_path}" - ) \ No newline at end of file + ) diff --git a/pages/_document.tsx b/pages/_document.tsx index 7eb48653..3fd0d44e 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -1,9 +1,19 @@ import Document, { Head, Html, Main, NextScript } from "next/document"; +const siteConfig = process.env.NEXT_PUBLIC_SITE_CONFIG; const plausibleDomain = process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN; +const isProd = Boolean(siteConfig && siteConfig.endsWith("-prod")); -if (!plausibleDomain) { - throw new Error("NEXT_PUBLIC_PLAUSIBLE_DOMAIN is not defined"); +if (isProd && !plausibleDomain) { + throw new Error( + `NEXT_PUBLIC_PLAUSIBLE_DOMAIN is not defined in production environment for ${siteConfig}` + ); +} + +if (!isProd && plausibleDomain) { + console.warn( + `Plausible is enabled (domain='${plausibleDomain}') while NEXT_PUBLIC_SITE_CONFIG='${siteConfig}'.` + ); } class MyDocument extends Document { @@ -19,11 +29,13 @@ class MyDocument extends Document { href="https://fonts.googleapis.com/css2?family=Inter+Tight:wght@500&display=swap" rel="stylesheet" /> - + {plausibleDomain && ( + + )}
diff --git a/site-config/brc-analytics/dev/.env b/site-config/brc-analytics/dev/.env index 475760a9..2895e7cf 100644 --- a/site-config/brc-analytics/dev/.env +++ b/site-config/brc-analytics/dev/.env @@ -1,5 +1,4 @@ NEXT_PUBLIC_ENA_PROXY_DOMAIN="https://brc-analytics.dev.clevercanary.com" NEXT_PUBLIC_SITE_CONFIG='brc-analytics-dev' NEXT_PUBLIC_GALAXY_INSTANCE_URL="https://test.galaxyproject.org" -NEXT_PUBLIC_PLAUSIBLE_DOMAIN="brc-analytics.org" NEXT_PUBLIC_SENTRY_DSN="https://e9b62a8020d937bef98b86074281fd90@sentry.galaxyproject.org/23" \ No newline at end of file diff --git a/site-config/brc-analytics/local/.env b/site-config/brc-analytics/local/.env index 507530a3..a52da114 100644 --- a/site-config/brc-analytics/local/.env +++ b/site-config/brc-analytics/local/.env @@ -1,6 +1,5 @@ NEXT_PUBLIC_ENA_PROXY_DOMAIN="https://brc-analytics.dev.clevercanary.com" NEXT_PUBLIC_SITE_CONFIG='brc-analytics-local' NEXT_PUBLIC_GALAXY_INSTANCE_URL="https://test.galaxyproject.org" -NEXT_PUBLIC_PLAUSIBLE_DOMAIN="brc-analytics.org" NEXT_PUBLIC_GALAXY_ENV="TEST" NEXT_PUBLIC_BACKEND_URL="http://localhost:8000" diff --git a/site-config/ga2/dev/.env b/site-config/ga2/dev/.env index db3232cb..2eae7c23 100644 --- a/site-config/ga2/dev/.env +++ b/site-config/ga2/dev/.env @@ -1,4 +1,3 @@ NEXT_PUBLIC_ENA_PROXY_DOMAIN="https://brc-analytics.dev.clevercanary.com" NEXT_PUBLIC_SITE_CONFIG='ga2-dev' -NEXT_PUBLIC_GALAXY_INSTANCE_URL="https://test.galaxyproject.org" -NEXT_PUBLIC_PLAUSIBLE_DOMAIN="genomeark2.org" \ No newline at end of file +NEXT_PUBLIC_GALAXY_INSTANCE_URL="https://test.galaxyproject.org" \ No newline at end of file diff --git a/site-config/ga2/local/.env b/site-config/ga2/local/.env index 6d1fb9d4..dfc3e59c 100644 --- a/site-config/ga2/local/.env +++ b/site-config/ga2/local/.env @@ -1,4 +1,3 @@ NEXT_PUBLIC_ENA_PROXY_DOMAIN="https://brc-analytics.dev.clevercanary.com" NEXT_PUBLIC_SITE_CONFIG='ga2-local' -NEXT_PUBLIC_GALAXY_INSTANCE_URL="https://test.galaxyproject.org" -NEXT_PUBLIC_PLAUSIBLE_DOMAIN="genomeark2.org" \ No newline at end of file +NEXT_PUBLIC_GALAXY_INSTANCE_URL="https://test.galaxyproject.org" \ No newline at end of file