From 3b326b9ac433a50ecbca08aa1b4fe12d7de6c235 Mon Sep 17 00:00:00 2001 From: Jingcheng Yang Date: Fri, 16 Aug 2024 18:26:37 -0400 Subject: [PATCH] Add the UMI_APP_INTRO_PAGE_ENABLED variable for enabling a home page. --- studio/package.json | 4 ++-- studio/src/app.tsx | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/studio/package.json b/studio/package.json index 82f627d..ca85386 100644 --- a/studio/package.json +++ b/studio/package.json @@ -8,7 +8,7 @@ "dev": "max dev", "build": "max build", "build:embed": "cross-env UMI_APP_IS_STATIC=true UMI_ENV=embed max build", - "build:biomedgps-embed": "cross-env UMI_APP_IS_STATIC=true UMI_ENV=embed UMI_APP_AUTH0_CLIENT_ID=Y08FauV1dAEiocNIZt5LiOifzNgXr6Uo UMI_APP_AUTH0_DOMAIN=biomedgps.jp.auth0.com max build", + "build:biomedgps-embed": "cross-env UMI_APP_INTRO_PAGE_ENABLED=true UMI_APP_IS_STATIC=true UMI_ENV=embed UMI_APP_AUTH0_CLIENT_ID=Y08FauV1dAEiocNIZt5LiOifzNgXr6Uo UMI_APP_AUTH0_DOMAIN=biomedgps.jp.auth0.com max build", "build:rapex-embed": "cross-env UMI_APP_IS_STATIC=true UMI_ENV=embed UMI_APP_HEADER_HIDDEN=true max build", "build:analyze": "cross-env ANALYZE=true max build", "format": "prettier --cache --write .", @@ -16,7 +16,7 @@ "setup": "max setup", "start": "npm run dev", "start:local-dev": "cross-env UMI_APP_API_PREFIX=http://localhost:3000 max dev", - "start:biomedgps-remote-dev": "cross-env UMI_APP_API_PREFIX=https://drugs.3steps.cn UMI_APP_AUTH0_CLIENT_ID=Y08FauV1dAEiocNIZt5LiOifzNgXr6Uo UMI_APP_AUTH0_DOMAIN=biomedgps.jp.auth0.com max dev", + "start:biomedgps-remote-dev": "cross-env UMI_APP_INTRO_PAGE_ENABLED=true UMI_APP_API_PREFIX=https://drugs.3steps.cn UMI_APP_AUTH0_CLIENT_ID=Y08FauV1dAEiocNIZt5LiOifzNgXr6Uo UMI_APP_AUTH0_DOMAIN=biomedgps.jp.auth0.com max dev", "start:rapex-remote-dev": "cross-env UMI_APP_API_PREFIX=https://rapex.prophetdb.org UMI_APP_HEADER_HIDDEN=true max dev", "openapi": "max openapi" }, diff --git a/studio/src/app.tsx b/studio/src/app.tsx index 3e90803..304319b 100644 --- a/studio/src/app.tsx +++ b/studio/src/app.tsx @@ -45,6 +45,8 @@ const defaultCustomSettings = { } const isDev = process.env.NODE_ENV === 'development'; +const version = process.env.UMI_APP_VERSION ? process.env.UMI_APP_VERSION : 'unknown'; +const introPageEnabled = process.env.UMI_APP_INTRO_PAGE_ENABLED ? process.env.UMI_APP_INTRO_PAGE_ENABLED === 'true' : false; const apiPrefix = process.env.UMI_APP_API_PREFIX ? process.env.UMI_APP_API_PREFIX : window.location.origin; const CLIENT_ID = process.env.UMI_APP_AUTH0_CLIENT_ID ? process.env.UMI_APP_AUTH0_CLIENT_ID : ''; const AUTH0_DOMAIN = process.env.UMI_APP_AUTH0_DOMAIN ? process.env.UMI_APP_AUTH0_DOMAIN : ''; @@ -184,13 +186,17 @@ export const layout: RuntimeConfig = (initialState: any) => { const { location } = history; const isHomePage = location.pathname === '/'; - if (isHomePage) { + if (isHomePage && introPageEnabled) { return { headerRender: false, footerRender: () =>