Skip to content

Commit

Permalink
Add the UMI_APP_INTRO_PAGE_ENABLED variable for enabling a home page.
Browse files Browse the repository at this point in the history
  • Loading branch information
yjcyxky committed Aug 16, 2024
1 parent 009f64e commit 3b326b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"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 .",
"postinstall": "max setup",
"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"
},
Expand Down
10 changes: 8 additions & 2 deletions studio/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '<your-client-id>';
const AUTH0_DOMAIN = process.env.UMI_APP_AUTH0_DOMAIN ? process.env.UMI_APP_AUTH0_DOMAIN : '<your-domain>';
Expand Down Expand Up @@ -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: () => <Footer />,
menuRender: false,
childrenRender: (children: any, props: any) => {
return { children };
return (
<>
{children}
</>
);
}
}
}
Expand Down

0 comments on commit 3b326b9

Please sign in to comment.