From 64562d86d3c1492aedabe1df3ad3414d5a320002 Mon Sep 17 00:00:00 2001 From: Joshua Jones Date: Wed, 25 May 2022 15:42:12 -0700 Subject: [PATCH 01/21] Add version to footer. --- .../components/app-version/app-version.tsx | 44 +++++++++++++++++++ src/nextapp/components/app-version/index.ts | 1 + src/nextapp/pages/_app.tsx | 6 +-- src/test/mock-server/server.js | 7 +++ 4 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 src/nextapp/components/app-version/app-version.tsx create mode 100644 src/nextapp/components/app-version/index.ts diff --git a/src/nextapp/components/app-version/app-version.tsx b/src/nextapp/components/app-version/app-version.tsx new file mode 100644 index 000000000..9bbb69fed --- /dev/null +++ b/src/nextapp/components/app-version/app-version.tsx @@ -0,0 +1,44 @@ +import * as React from 'react'; +import { Text, Tooltip } from '@chakra-ui/react'; +import { useRestApi } from '@/shared/services/api'; + +type Result = { + version: string; + revision: string; + cluster: string; +}; +const AppVersion: React.FC = () => { + const { data, isLoading, isSuccess } = useRestApi( + 'version', + '/about', + { + suspense: false, + } + ); + const label = React.useMemo(() => { + if (isSuccess) { + return ( + <> +
{`Cluster: ${data.cluster}`}
+
{`Revision: ${data.revision}`}
+ + ); + } + return ''; + }, [data, isSuccess]); + return ( + + + {isLoading && '...'} + {isSuccess && `Version ${data.version.replace('v', '')}`} + + + ); +}; + +export default AppVersion; diff --git a/src/nextapp/components/app-version/index.ts b/src/nextapp/components/app-version/index.ts new file mode 100644 index 000000000..6085d0efd --- /dev/null +++ b/src/nextapp/components/app-version/index.ts @@ -0,0 +1 @@ +export { default } from './app-version'; diff --git a/src/nextapp/pages/_app.tsx b/src/nextapp/pages/_app.tsx index 43d77155d..ad5e59d46 100644 --- a/src/nextapp/pages/_app.tsx +++ b/src/nextapp/pages/_app.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import AppVersion from '@/components/app-version'; import { Box, ChakraProvider, @@ -116,8 +117,7 @@ const App: React.FC = ({ Component, pageProps }) => { > = ({ Component, pageProps }) => { display="flex" flexDirection={{ base: 'column', md: 'row' }} flexWrap={{ base: 'nowrap', md: 'wrap' }} - alignItems="center" color="#fff" sx={{ '& li:last-child a': { border: 'none' } }} > @@ -146,6 +145,7 @@ const App: React.FC = ({ Component, pageProps }) => { ))} + diff --git a/src/test/mock-server/server.js b/src/test/mock-server/server.js index 06b0c2674..e71855f86 100644 --- a/src/test/mock-server/server.js +++ b/src/test/mock-server/server.js @@ -559,6 +559,13 @@ app.post('/gql/api', async (req, res) => { res.json(response); }); +app.use('/about', (_, res) => { + res.json({ + version: 'v1.0.68', + revision: casual.uuid, + cluster: 'gold', + }); +}); app.use('/admin', adminApi); app.use('/ds/api', dsApi); app.listen(port, () => console.log(`Mock server running on port ${port}`)); From ecb256ef20898c837dbac03631fec58b4698ea15 Mon Sep 17 00:00:00 2001 From: Joshua Jones Date: Thu, 26 May 2022 23:53:23 -0700 Subject: [PATCH 02/21] Menu adjustments. --- .../components/auth-action/auth-action.tsx | 2 + .../components/auth-action/help-menu.tsx | 189 ++++++++++++++++++ .../namespace-menu/namespace-menu.tsx | 11 +- 3 files changed, 201 insertions(+), 1 deletion(-) create mode 100644 src/nextapp/components/auth-action/help-menu.tsx diff --git a/src/nextapp/components/auth-action/auth-action.tsx b/src/nextapp/components/auth-action/auth-action.tsx index 794723ab5..a14e42c6d 100644 --- a/src/nextapp/components/auth-action/auth-action.tsx +++ b/src/nextapp/components/auth-action/auth-action.tsx @@ -16,6 +16,7 @@ import { FaChevronDown } from 'react-icons/fa'; import { useAuth } from '@/shared/services/auth'; import NamespaceMenu from '../namespace-menu'; import Link from 'next/link'; +import HelpMenu from './help-menu'; interface AuthActionProps { site: string; @@ -46,6 +47,7 @@ const Signin: React.FC = ({ site }) => { spacing={4} > {user.roles.includes('portal-user') && } + { + const { isOpen, onOpen, onClose } = useDisclosure(); + return ( + <> + + + + Support Links + + + + + + Submit product and service requests using the Data Systems and + Services request system + + + + + + Chat with us in Rocket Chat + + + + + + Create an issue in Github + + + + + + + + + + + + + + + Help + + + + + + Api Docs + + + + APS Support + + + + Release Notes + + + + + + + Support Links + + + + + + Status + + + + Version: 1.0.68 revision: be1712 + Cluster: gold + + + + + + + ); +}; +export default HelpMenu; diff --git a/src/nextapp/components/namespace-menu/namespace-menu.tsx b/src/nextapp/components/namespace-menu/namespace-menu.tsx index 84642029c..5b87d3a65 100644 --- a/src/nextapp/components/namespace-menu/namespace-menu.tsx +++ b/src/nextapp/components/namespace-menu/namespace-menu.tsx @@ -81,7 +81,16 @@ const NamespaceMenu: React.FC = ({ user }) => { {user?.namespace ?? 'No Active Namespace'}{' '} - + <> {isLoading && Loading namespaces...} {isError && ( From 216bb005e3d9575964146a4e857453ccb7a484ca Mon Sep 17 00:00:00 2001 From: Joshua Jones Date: Fri, 27 May 2022 11:22:13 -0700 Subject: [PATCH 03/21] Remove API based version (stubbed for now), add links --- .../components/app-version/app-version.tsx | 44 ------------------- src/nextapp/components/app-version/index.ts | 1 - .../components/auth-action/help-menu.tsx | 43 ++++++++++-------- src/nextapp/pages/_app.tsx | 6 ++- 4 files changed, 28 insertions(+), 66 deletions(-) delete mode 100644 src/nextapp/components/app-version/app-version.tsx delete mode 100644 src/nextapp/components/app-version/index.ts diff --git a/src/nextapp/components/app-version/app-version.tsx b/src/nextapp/components/app-version/app-version.tsx deleted file mode 100644 index 9bbb69fed..000000000 --- a/src/nextapp/components/app-version/app-version.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import * as React from 'react'; -import { Text, Tooltip } from '@chakra-ui/react'; -import { useRestApi } from '@/shared/services/api'; - -type Result = { - version: string; - revision: string; - cluster: string; -}; -const AppVersion: React.FC = () => { - const { data, isLoading, isSuccess } = useRestApi( - 'version', - '/about', - { - suspense: false, - } - ); - const label = React.useMemo(() => { - if (isSuccess) { - return ( - <> -
{`Cluster: ${data.cluster}`}
-
{`Revision: ${data.revision}`}
- - ); - } - return ''; - }, [data, isSuccess]); - return ( - - - {isLoading && '...'} - {isSuccess && `Version ${data.version.replace('v', '')}`} - - - ); -}; - -export default AppVersion; diff --git a/src/nextapp/components/app-version/index.ts b/src/nextapp/components/app-version/index.ts deleted file mode 100644 index 6085d0efd..000000000 --- a/src/nextapp/components/app-version/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './app-version'; diff --git a/src/nextapp/components/auth-action/help-menu.tsx b/src/nextapp/components/auth-action/help-menu.tsx index 4861f1fe7..0be6843c3 100644 --- a/src/nextapp/components/auth-action/help-menu.tsx +++ b/src/nextapp/components/auth-action/help-menu.tsx @@ -22,7 +22,8 @@ import { ListItem, Link, } from '@chakra-ui/react'; -import { FaChevronDown, FaExternalLinkAlt } from 'react-icons/fa'; +import { FaChevronDown } from 'react-icons/fa'; +import { BiLinkExternal } from 'react-icons/bi'; const HelpMenu: React.FC = () => { const { isOpen, onOpen, onClose } = useDisclosure(); @@ -47,30 +48,34 @@ const HelpMenu: React.FC = () => { }} > - + Submit product and service requests using the Data Systems and Services request system - + Chat with us in Rocket Chat - + Create an issue in Github - + @@ -116,40 +121,40 @@ const HelpMenu: React.FC = () => { Api Docs - + APS Support - + Release Notes - + @@ -160,14 +165,14 @@ const HelpMenu: React.FC = () => { Status - + = ({ Component, pageProps }) => { ))} - + + Version 1.5.2 +
From cfd1b360ec10b1787d851dc9cf067b79f3f2aa14 Mon Sep 17 00:00:00 2001 From: Joshua Jones Date: Mon, 30 May 2022 14:31:14 -0700 Subject: [PATCH 04/21] Use env variables for reading and displaying app details --- src/nextapp/components/auth-action/help-menu.tsx | 5 +++-- src/nextapp/shared/config.ts | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nextapp/components/auth-action/help-menu.tsx b/src/nextapp/components/auth-action/help-menu.tsx index 0be6843c3..2b688e3b0 100644 --- a/src/nextapp/components/auth-action/help-menu.tsx +++ b/src/nextapp/components/auth-action/help-menu.tsx @@ -24,6 +24,7 @@ import { } from '@chakra-ui/react'; import { FaChevronDown } from 'react-icons/fa'; import { BiLinkExternal } from 'react-icons/bi'; +import { appCluster, appRevision, appVersion } from '@/shared/config'; const HelpMenu: React.FC = () => { const { isOpen, onOpen, onClose } = useDisclosure(); @@ -181,8 +182,8 @@ const HelpMenu: React.FC = () => { alignItems="flex-start" data-testid="help-menu-version" > - Version: 1.0.68 revision: be1712 - Cluster: gold + {`Version: ${appVersion} revision: ${appRevision}`} + {`Cluster: ${appCluster}`} diff --git a/src/nextapp/shared/config.ts b/src/nextapp/shared/config.ts index 8cd0f717a..67b696ac1 100644 --- a/src/nextapp/shared/config.ts +++ b/src/nextapp/shared/config.ts @@ -2,3 +2,6 @@ export const env = process.env.NODE_ENV || ''; export const apiHost = process.env.NEXT_PUBLIC_API_ROOT || ''; export const grafanaUrl = process.env.NEXT_PUBLIC_GRAFANA_URL || ''; export const apiInternalHost = process.env.SSR_API_ROOT || ''; +export const appVersion = process.env.NEXT_PUBLIC_APP_VERSION ?? ''; +export const appRevision = process.env.NEXT_PUBLIC_APP_REVISION ?? ''; +export const appCluster = process.env.NEXT_PUBLIC_APP_CLUSTER ?? ''; From e5ac512ea489818f868b9701da12fb0370addb68 Mon Sep 17 00:00:00 2001 From: ikethecoder Date: Mon, 30 May 2022 14:54:44 -0700 Subject: [PATCH 05/21] include nextjs env vars for support page --- .github/workflows/ci-build-deploy.yaml | 2 ++ src/server.ts | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-build-deploy.yaml b/.github/workflows/ci-build-deploy.yaml index d4bf13449..8944731fb 100644 --- a/.github/workflows/ci-build-deploy.yaml +++ b/.github/workflows/ci-build-deploy.yaml @@ -223,6 +223,8 @@ jobs: value: 'https://api-services-portal-${{ steps.set-deploy-id.outputs.DEPLOY_ID }}.apps.silver.devops.gov.bc.ca' NEXT_PUBLIC_GRAFANA_URL: value: 'https://grafana-apps-gov-bc-ca.dev.api.gov.bc.ca' + NEXT_PUBLIC_KUBE_CLUSTER: + value: 'feature-silver' GWA_API_URL: value: 'https://gwa-api-gov-bc-ca.dev.api.gov.bc.ca' GWA_PROD_ENV_SLUG: diff --git a/src/server.ts b/src/server.ts index ce34241d8..c7ae9b550 100644 --- a/src/server.ts +++ b/src/server.ts @@ -352,9 +352,9 @@ const configureExpress = (app: any) => { app.get('/about', (req: any, res: any) => { res.status(200).json({ - version: process.env.APP_VERSION, - revision: process.env.APP_REVISION, - cluster: process.env.KUBE_CLUSTER, + version: process.env.NEXT_PUBLIC_APP_VERSION, + revision: process.env.NEXT_PUBLIC_APP_REVISION, + cluster: process.env.NEXT_PUBLIC_KUBE_CLUSTER, }); }); From 27ab7e84c69fef5e0aadf3c44ecbae33b0efe88b Mon Sep 17 00:00:00 2001 From: ikethecoder Date: Mon, 30 May 2022 14:56:03 -0700 Subject: [PATCH 06/21] upd dockerfile with app version and rev for nextjs --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2dafadf2a..2409eec62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ FROM node:16.14.2-alpine3.15 ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION} +ENV NEXT_PUBLIC_APP_VERSION=${APP_VERSION} ARG APP_REVISION -ENV APP_REVISION=${APP_REVISION} +ENV NEXT_PUBLIC_APP_REVISION=${APP_REVISION} RUN apk add curl jq RUN npm install -g npm@7.11.2 From 12b9b33c03e40c9bd472f39f098755d893320678 Mon Sep 17 00:00:00 2001 From: ikethecoder Date: Mon, 30 May 2022 14:58:35 -0700 Subject: [PATCH 07/21] minor fix for kube_cluster env var --- src/nextapp/shared/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nextapp/shared/config.ts b/src/nextapp/shared/config.ts index 67b696ac1..c1933e76b 100644 --- a/src/nextapp/shared/config.ts +++ b/src/nextapp/shared/config.ts @@ -4,4 +4,4 @@ export const grafanaUrl = process.env.NEXT_PUBLIC_GRAFANA_URL || ''; export const apiInternalHost = process.env.SSR_API_ROOT || ''; export const appVersion = process.env.NEXT_PUBLIC_APP_VERSION ?? ''; export const appRevision = process.env.NEXT_PUBLIC_APP_REVISION ?? ''; -export const appCluster = process.env.NEXT_PUBLIC_APP_CLUSTER ?? ''; +export const appCluster = process.env.NEXT_PUBLIC_KUBE_CLUSTER ?? ''; From 2958250fe2f6087c68415610c93544b0b973a7a0 Mon Sep 17 00:00:00 2001 From: Joshua Jones Date: Mon, 30 May 2022 15:56:33 -0700 Subject: [PATCH 08/21] Add missing target blank and proper version in footer. --- src/nextapp/components/auth-action/help-menu.tsx | 2 ++ src/nextapp/pages/_app.tsx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nextapp/components/auth-action/help-menu.tsx b/src/nextapp/components/auth-action/help-menu.tsx index 2b688e3b0..a7fce8c86 100644 --- a/src/nextapp/components/auth-action/help-menu.tsx +++ b/src/nextapp/components/auth-action/help-menu.tsx @@ -136,6 +136,8 @@ const HelpMenu: React.FC = () => { color="bc-blue" href="https://bcgov.github.io/aps-infra-platform/" data-testid="help-menu-aps-support" + target="_blank" + rel="noopener noreferrer" > APS Support diff --git a/src/nextapp/pages/_app.tsx b/src/nextapp/pages/_app.tsx index 8036a46a3..6124a469b 100644 --- a/src/nextapp/pages/_app.tsx +++ b/src/nextapp/pages/_app.tsx @@ -20,6 +20,7 @@ import theme from '@/shared/theme'; import links from '@/shared/data/links'; import AuthAction from '@/components/auth-action'; import { ReactQueryDevtools } from 'react-query/devtools'; +import { appVersion } from '@/shared/config'; import type { AppProps } from 'next/app'; import '@bcgov/bc-sans/css/BCSans.css'; @@ -146,7 +147,7 @@ const App: React.FC = ({ Component, pageProps }) => { ))} - Version 1.5.2 + {`Version ${appVersion}`} From e2c55e0cc34286aca8c18fc2e7be2d15599b3cfe Mon Sep 17 00:00:00 2001 From: ikethecoder Date: Mon, 30 May 2022 16:08:12 -0700 Subject: [PATCH 09/21] add help links to feature deploy --- .github/workflows/ci-build-deploy.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci-build-deploy.yaml b/.github/workflows/ci-build-deploy.yaml index 8944731fb..c3deb6973 100644 --- a/.github/workflows/ci-build-deploy.yaml +++ b/.github/workflows/ci-build-deploy.yaml @@ -225,6 +225,20 @@ jobs: value: 'https://grafana-apps-gov-bc-ca.dev.api.gov.bc.ca' NEXT_PUBLIC_KUBE_CLUSTER: value: 'feature-silver' + NEXT_PUBLIC_HELP_DESK_URL: + value: 'https://dpdd.atlassian.net/servicedesk/customer/portal/1/group/2' + NEXT_PUBLIC_HELP_CHAT_URL: + value: 'https://chat.developer.gov.bc.ca/channel/aps-ops' + NEXT_PUBLIC_HELP_ISSUE_URL: + value: 'https://github.com/bcgov/api-services-portal/issues' + NEXT_PUBLIC_HELP_API_DOCS_URL: + value: '/ds/api/v2/console/' + NEXT_PUBLIC_HELP_SUPPORT_URL: + value: 'https://bcgov.github.io/aps-infra-platform/' + NEXT_PUBLIC_HELP_RELEASE_URL: + value: 'https://bcgov.github.io/aps-infra-platform/releases/2022-may/' + NEXT_PUBLIC_HELP_STATUS_URL: + value: 'https://uptime.com/s/bcgov-dss' GWA_API_URL: value: 'https://gwa-api-gov-bc-ca.dev.api.gov.bc.ca' GWA_PROD_ENV_SLUG: From 3597f13388d32ba4755cfb2e70960737420233c4 Mon Sep 17 00:00:00 2001 From: Joshua Jones Date: Mon, 30 May 2022 17:10:17 -0700 Subject: [PATCH 10/21] Update links and add help when logged out. --- .../components/auth-action/auth-action.tsx | 14 +++++--- .../components/auth-action/help-menu.tsx | 32 +++++++++++++------ src/nextapp/shared/config.ts | 7 ++++ 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/nextapp/components/auth-action/auth-action.tsx b/src/nextapp/components/auth-action/auth-action.tsx index a14e42c6d..8d347d465 100644 --- a/src/nextapp/components/auth-action/auth-action.tsx +++ b/src/nextapp/components/auth-action/auth-action.tsx @@ -3,6 +3,7 @@ import { Avatar, Box, Button, + Flex, Icon, Menu, MenuButton, @@ -31,11 +32,14 @@ const Signin: React.FC = ({ site }) => { if (!user) { return ( - - - + + + + + + ); } diff --git a/src/nextapp/components/auth-action/help-menu.tsx b/src/nextapp/components/auth-action/help-menu.tsx index a7fce8c86..29a138597 100644 --- a/src/nextapp/components/auth-action/help-menu.tsx +++ b/src/nextapp/components/auth-action/help-menu.tsx @@ -24,7 +24,18 @@ import { } from '@chakra-ui/react'; import { FaChevronDown } from 'react-icons/fa'; import { BiLinkExternal } from 'react-icons/bi'; -import { appCluster, appRevision, appVersion } from '@/shared/config'; +import { + appCluster, + appRevision, + appVersion, + helpDeskUrl, + helpChatUrl, + helpIssueUrl, + helpApiDocsUrl, + helpSupportUrl, + helpReleaseUrl, + helpStatusUrl, +} from '@/shared/config'; const HelpMenu: React.FC = () => { const { isOpen, onOpen, onClose } = useDisclosure(); @@ -50,7 +61,7 @@ const HelpMenu: React.FC = () => { > @@ -61,7 +72,7 @@ const HelpMenu: React.FC = () => { @@ -71,7 +82,7 @@ const HelpMenu: React.FC = () => { @@ -123,7 +134,7 @@ const HelpMenu: React.FC = () => { { { { { alignItems="flex-start" data-testid="help-menu-version" > - {`Version: ${appVersion} revision: ${appRevision}`} + {`Version: ${appVersion} revision: ${appRevision.slice( + 0, + 9 + )}`} {`Cluster: ${appCluster}`} diff --git a/src/nextapp/shared/config.ts b/src/nextapp/shared/config.ts index c1933e76b..a79b0e6f2 100644 --- a/src/nextapp/shared/config.ts +++ b/src/nextapp/shared/config.ts @@ -5,3 +5,10 @@ export const apiInternalHost = process.env.SSR_API_ROOT || ''; export const appVersion = process.env.NEXT_PUBLIC_APP_VERSION ?? ''; export const appRevision = process.env.NEXT_PUBLIC_APP_REVISION ?? ''; export const appCluster = process.env.NEXT_PUBLIC_KUBE_CLUSTER ?? ''; +export const helpDeskUrl = process.env.NEXT_PUBLIC_HELP_DESK_URL ?? ''; +export const helpChatUrl = process.env.NEXT_PUBLIC_HELP_CHAT_URL ?? ''; +export const helpIssueUrl = process.env.NEXT_PUBLIC_HELP_ISSUE_URL ?? ''; +export const helpApiDocsUrl = process.env.NEXT_PUBLIC_HELP_API_DOCS_URL ?? ''; +export const helpSupportUrl = process.env.NEXT_PUBLIC_HELP_SUPPORT_URL ?? ''; +export const helpReleaseUrl = process.env.NEXT_PUBLIC_HELP_RELEASE_URL ?? ''; +export const helpStatusUrl = process.env.NEXT_PUBLIC_HELP_STATUS_URL ?? ''; From 7b0b1d9faad7e2a5b357a34e2ceb3c1dbaf0571b Mon Sep 17 00:00:00 2001 From: ikethecoder Date: Tue, 31 May 2022 10:19:04 -0700 Subject: [PATCH 11/21] try fixing the config env var blank issue --- src/nextapp/shared/config.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/nextapp/shared/config.ts b/src/nextapp/shared/config.ts index a79b0e6f2..e1934b783 100644 --- a/src/nextapp/shared/config.ts +++ b/src/nextapp/shared/config.ts @@ -2,13 +2,13 @@ export const env = process.env.NODE_ENV || ''; export const apiHost = process.env.NEXT_PUBLIC_API_ROOT || ''; export const grafanaUrl = process.env.NEXT_PUBLIC_GRAFANA_URL || ''; export const apiInternalHost = process.env.SSR_API_ROOT || ''; -export const appVersion = process.env.NEXT_PUBLIC_APP_VERSION ?? ''; -export const appRevision = process.env.NEXT_PUBLIC_APP_REVISION ?? ''; -export const appCluster = process.env.NEXT_PUBLIC_KUBE_CLUSTER ?? ''; -export const helpDeskUrl = process.env.NEXT_PUBLIC_HELP_DESK_URL ?? ''; -export const helpChatUrl = process.env.NEXT_PUBLIC_HELP_CHAT_URL ?? ''; -export const helpIssueUrl = process.env.NEXT_PUBLIC_HELP_ISSUE_URL ?? ''; -export const helpApiDocsUrl = process.env.NEXT_PUBLIC_HELP_API_DOCS_URL ?? ''; -export const helpSupportUrl = process.env.NEXT_PUBLIC_HELP_SUPPORT_URL ?? ''; -export const helpReleaseUrl = process.env.NEXT_PUBLIC_HELP_RELEASE_URL ?? ''; -export const helpStatusUrl = process.env.NEXT_PUBLIC_HELP_STATUS_URL ?? ''; +export const appVersion = process.env.NEXT_PUBLIC_APP_VERSION || ''; +export const appRevision = process.env.NEXT_PUBLIC_APP_REVISION || ''; +export const appCluster = process.env.NEXT_PUBLIC_KUBE_CLUSTER || ''; +export const helpDeskUrl = process.env.NEXT_PUBLIC_HELP_DESK_URL || ''; +export const helpChatUrl = process.env.NEXT_PUBLIC_HELP_CHAT_URL || ''; +export const helpIssueUrl = process.env.NEXT_PUBLIC_HELP_ISSUE_URL || ''; +export const helpApiDocsUrl = process.env.NEXT_PUBLIC_HELP_API_DOCS_URL || ''; +export const helpSupportUrl = process.env.NEXT_PUBLIC_HELP_SUPPORT_URL || ''; +export const helpReleaseUrl = process.env.NEXT_PUBLIC_HELP_RELEASE_URL || ''; +export const helpStatusUrl = process.env.NEXT_PUBLIC_HELP_STATUS_URL || ''; From 8055183576018cc50a638b2570c679d709607f23 Mon Sep 17 00:00:00 2001 From: ikethecoder Date: Tue, 31 May 2022 11:26:53 -0700 Subject: [PATCH 12/21] try fixing the config env var blank issue with inline --- .../components/auth-action/help-menu.tsx | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/nextapp/components/auth-action/help-menu.tsx b/src/nextapp/components/auth-action/help-menu.tsx index 29a138597..528e4b884 100644 --- a/src/nextapp/components/auth-action/help-menu.tsx +++ b/src/nextapp/components/auth-action/help-menu.tsx @@ -24,21 +24,33 @@ import { } from '@chakra-ui/react'; import { FaChevronDown } from 'react-icons/fa'; import { BiLinkExternal } from 'react-icons/bi'; -import { - appCluster, - appRevision, - appVersion, - helpDeskUrl, - helpChatUrl, - helpIssueUrl, - helpApiDocsUrl, - helpSupportUrl, - helpReleaseUrl, - helpStatusUrl, -} from '@/shared/config'; +// import { +// appCluster, +// appRevision, +// appVersion, +// helpDeskUrl, +// helpChatUrl, +// helpIssueUrl, +// helpApiDocsUrl, +// helpSupportUrl, +// helpReleaseUrl, +// helpStatusUrl, +// } from '@/shared/config'; const HelpMenu: React.FC = () => { const { isOpen, onOpen, onClose } = useDisclosure(); + + const appVersion = process.env.NEXT_PUBLIC_APP_VERSION || ''; + const appRevision = process.env.NEXT_PUBLIC_APP_REVISION || ''; + const appCluster = process.env.NEXT_PUBLIC_KUBE_CLUSTER || ''; + const helpDeskUrl = process.env.NEXT_PUBLIC_HELP_DESK_URL || ''; + const helpChatUrl = process.env.NEXT_PUBLIC_HELP_CHAT_URL || ''; + const helpIssueUrl = process.env.NEXT_PUBLIC_HELP_ISSUE_URL || ''; + const helpApiDocsUrl = process.env.NEXT_PUBLIC_HELP_API_DOCS_URL || ''; + const helpSupportUrl = process.env.NEXT_PUBLIC_HELP_SUPPORT_URL || ''; + const helpReleaseUrl = process.env.NEXT_PUBLIC_HELP_RELEASE_URL || ''; + const helpStatusUrl = process.env.NEXT_PUBLIC_HELP_STATUS_URL || ''; + return ( <> From cb713f591f2de08c9db1115414eaac7a2e343f75 Mon Sep 17 00:00:00 2001 From: ikethecoder Date: Tue, 31 May 2022 12:03:52 -0700 Subject: [PATCH 13/21] resolve help menu missing vars --- .../components/auth-action/auth-action.tsx | 9 ++-- .../components/auth-action/help-menu.tsx | 52 ++++++++++--------- src/nextapp/pages/_app.tsx | 29 ++++++++++- 3 files changed, 59 insertions(+), 31 deletions(-) diff --git a/src/nextapp/components/auth-action/auth-action.tsx b/src/nextapp/components/auth-action/auth-action.tsx index 8d347d465..52c87b54c 100644 --- a/src/nextapp/components/auth-action/auth-action.tsx +++ b/src/nextapp/components/auth-action/auth-action.tsx @@ -17,13 +17,14 @@ import { FaChevronDown } from 'react-icons/fa'; import { useAuth } from '@/shared/services/auth'; import NamespaceMenu from '../namespace-menu'; import Link from 'next/link'; -import HelpMenu from './help-menu'; +import HelpMenu, { HelpMenuProps } from './help-menu'; interface AuthActionProps { site: string; + helpMenuProps: HelpMenuProps; } -const Signin: React.FC = ({ site }) => { +const Signin: React.FC = ({ site, helpMenuProps }) => { const { user } = useAuth(); if (site === 'redirect') { @@ -33,7 +34,7 @@ const Signin: React.FC = ({ site }) => { if (!user) { return ( - +