Skip to content

Commit

Permalink
set host commands based on portal environment
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyjux committed Jul 3, 2024
1 parent 09299f4 commit f55b4a3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/nextapp/.env.local
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
NEXT_PUBLIC_APP_VERSION=0.0.0
NEXT_PUBLIC_APP_REVISION=000000000000000000000000
NEXT_PUBLIC_API_ROOT=http://oauth2proxy.localtest.me:4180/
NEXT_PUBLIC_GRAFANA_URL=https://grafana-apps-gov-bc-ca.dev.api.gov.bc.ca
NEXT_PUBLIC_KUBE_CLUSTER=local
NEXT_PUBLIC_HELP_DESK_URL=https://dpdd.atlassian.net/servicedesk/customer/portal/1/group/2
Expand All @@ -9,4 +10,3 @@ NEXT_PUBLIC_HELP_API_DOCS_URL=/ds/api/v3/console/
NEXT_PUBLIC_HELP_SUPPORT_URL=https://dev.developer.gov.bc.ca/docs/default/component/aps-infra-platform-docs/
NEXT_PUBLIC_HELP_RELEASE_URL=https://dev.developer.gov.bc.ca/docs/default/component/aps-infra-platform-docs/reference/releases/
NEXT_PUBLIC_HELP_STATUS_URL=https://uptime.com/s/bcgov-dss

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const GatewayGetStarted: React.FC = () => {
const QuickStartUrl = global?.helpLinks.helpSupportUrl + 'tutorials/quick-start'
const GwaInstallUrl = global?.helpLinks.helpSupportUrl + 'how-to/gwa-install'
const GwaCommandsUrl = global?.helpLinks.helpSupportUrl + 'resources/gwa-commands'
const apiRootUrl = global?.apiRootUrl
const configHost = apiRootUrl ? apiRootUrl.replace('https://', '').replace('http://', '') : ''

return (
<>
Expand Down Expand Up @@ -304,11 +306,13 @@ const GatewayGetStarted: React.FC = () => {
</Box>
<Box>
<Heading size="md" fontSize="18px" pt={10} pb={6}>Prepare your configuration</Heading>
<CliCommand
title='Use the test environment'
description='Configure the CLI to run against a test environment while you are getting familiarized with the API Services Portal.'
command='gwa config set host api-gov-bc-ca.test.api.gov.bc.ca'
/>
{global?.apiRootUrl && (
<CliCommand
title='Use the test environment'
description='Configure the CLI to run against a test environment while you are getting familiarized with the API Services Portal.'
command={`gwa config set host ${configHost}`}
/>
)}
<CliCommand
title='Log in'
description='Log in via device with your IDIR.'
Expand Down
2 changes: 2 additions & 0 deletions src/nextapp/shared/services/global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type GlobalContent = {
readonly version: string;
readonly revision: string;
readonly cluster: string;
readonly apiRootUrl: string;
readonly accountLinks: Record<string, string>;
readonly helpLinks: Record<string, string>;
readonly identities: {
Expand All @@ -18,6 +19,7 @@ const defaultState = {
version: '',
revision: '',
cluster: '',
apiRootUrl: '',
identities: {
developer: ['idir'],
provider: ['idir'],
Expand Down
1 change: 1 addition & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ const configureExpress = (app: any) => {
version: process.env.NEXT_PUBLIC_APP_VERSION,
revision: process.env.NEXT_PUBLIC_APP_REVISION,
cluster: process.env.NEXT_PUBLIC_KUBE_CLUSTER,
apiRootUrl: process.env.NEXT_PUBLIC_API_ROOT,
identities: {
developer: (process.env.NEXT_PUBLIC_DEVELOPER_IDS || '').split(','),
provider: (process.env.NEXT_PUBLIC_PROVIDER_IDS || '').split(','),
Expand Down

0 comments on commit f55b4a3

Please sign in to comment.