From bc6ecedf0a9e4c8708048a512475ad501ee2df1b Mon Sep 17 00:00:00 2001 From: Rafal Gumienny Date: Tue, 18 Nov 2025 12:24:59 +0100 Subject: [PATCH] 4153 Exposed releaseNotesURL env variable --- apps/platform/.env | 3 ++- apps/platform/docs/CUSTOM_CONFIG.md | 4 ++++ apps/platform/src/pages/HomePage/HomePage.tsx | 2 +- packages/ot-config/src/environment.ts | 4 ++++ packages/ot-config/src/index.ts | 1 + packages/ot-config/src/types.ts | 1 + 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/platform/.env b/apps/platform/.env index 6db39f0c9..0b38512b9 100644 --- a/apps/platform/.env +++ b/apps/platform/.env @@ -1,3 +1,4 @@ VITE_API_URL=https://dev.opentargets.xyz/api/v4/graphql VITE_AI_API_URL=https://dev-ai-api-w37vlfsidq-ew.a.run.app -VITE_PROFILE=platform \ No newline at end of file +VITE_PROFILE=platform +VITE_RELEASE_NOTES_URL="https://platform-docs.opentargets.org/release-notes" \ No newline at end of file diff --git a/apps/platform/docs/CUSTOM_CONFIG.md b/apps/platform/docs/CUSTOM_CONFIG.md index efe590a1a..633fd42cf 100644 --- a/apps/platform/docs/CUSTOM_CONFIG.md +++ b/apps/platform/docs/CUSTOM_CONFIG.md @@ -32,6 +32,10 @@ URL for links to corresponding pages of the Open Targets Genetics portal, no trailing slash; defaults to `https://genetics.opentargets.org` +### configReleaseNotesURL + +Release notes URL. Defaults to `https://platform-docs.opentargets.org/release-notes`. + #### configPrimaryColor Define the primary colour used by the Material UI components and visualisations. Default Open Targets blue is `#3489ca`. diff --git a/apps/platform/src/pages/HomePage/HomePage.tsx b/apps/platform/src/pages/HomePage/HomePage.tsx index 3be3e6898..08616ac59 100644 --- a/apps/platform/src/pages/HomePage/HomePage.tsx +++ b/apps/platform/src/pages/HomePage/HomePage.tsx @@ -136,7 +136,7 @@ function HomePage(): JSX.Element { const { isPartnerPreview } = usePermissions(); const releaseNotesURL = isPartnerPreview ? "http://home.opentargets.org/ppp-release-notes" - : "https://platform-docs.opentargets.org/release-notes"; + : config.releaseNotesUrl; const classes = useStyles(); const handleScrollDown = (): void => { diff --git a/packages/ot-config/src/environment.ts b/packages/ot-config/src/environment.ts index 8b1d81c00..0168e5ac6 100644 --- a/packages/ot-config/src/environment.ts +++ b/packages/ot-config/src/environment.ts @@ -9,6 +9,7 @@ export const getEnvironmentConfig = (env: Environment): Config => { googleTagManagerID: null, geneticsPortalUrl: "https://genetics.opentargets.org", gitVersion: "", + releaseNotesUrl: "https://platform-docs.opentargets.org/release-notes", }, production: { urlApi: "https://api.platform.opentargets.org", @@ -17,6 +18,7 @@ export const getEnvironmentConfig = (env: Environment): Config => { googleTagManagerID: "GTM-XXXXX", geneticsPortalUrl: "https://genetics.opentargets.org", gitVersion: "", + releaseNotesUrl: "https://platform-docs.opentargets.org/release-notes", }, }; @@ -27,6 +29,7 @@ export const getEnvironmentConfig = (env: Environment): Config => { const ENV_API_URL: string | undefined = import.meta.env.VITE_API_URL; const ENV_AI_API_URL: string | undefined = import.meta.env.VITE_AI_API_URL; const ENV_GIT_VERSION: string | undefined = import.meta.env.VITE_GIT_VERSION; +const ENV_RELEASE_NOTES_URL: string | undefined = import.meta.env.VITE_RELEASE_NOTES_URL; export const getConfig = (): Config => { return { @@ -36,5 +39,6 @@ export const getConfig = (): Config => { profile: window.configProfile ?? { isPartnerPreview: false }, googleTagManagerID: window.configGoogleTagManagerID ?? null, geneticsPortalUrl: window.configGeneticsPortalUrl ?? "https://genetics.opentargets.org", + releaseNotesUrl: window.configReleaseNotesUrl ?? ENV_RELEASE_NOTES_URL ?? "https://platform-docs.opentargets.org/release-notes/production", }; }; diff --git a/packages/ot-config/src/index.ts b/packages/ot-config/src/index.ts index c77c6da82..ffeec52d2 100644 --- a/packages/ot-config/src/index.ts +++ b/packages/ot-config/src/index.ts @@ -11,5 +11,6 @@ declare global { configGoogleTagManagerID?: string; configGeneticsPortalUrl?: string; gitVersion?: string; + configReleaseNotesUrl?: string; } } diff --git a/packages/ot-config/src/types.ts b/packages/ot-config/src/types.ts index 636e3355f..9affc1d52 100644 --- a/packages/ot-config/src/types.ts +++ b/packages/ot-config/src/types.ts @@ -5,6 +5,7 @@ export interface Config { googleTagManagerID: string | null; geneticsPortalUrl: string; gitVersion: string; + releaseNotesUrl: string; } export type Environment = "development" | "production";