Skip to content

Commit 8a0b2b5

Browse files
author
Sean Sundberg
committed
Allow header prefix and name to be changed via env vars
Signed-off-by: Sean Sundberg <seansund@us.ibm.com>
1 parent e75611d commit 8a0b2b5

File tree

5 files changed

+35
-12
lines changed

5 files changed

+35
-12
lines changed

config/config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const {
2727
// Secret
2828
APPID_CONFIG,
2929
OCP_OAUTH_CONFIG,
30+
HEADER_PREFIX,
31+
HEADER_NAME,
3032
} = process.env;
3133

3234
console.log('NODE_ENV: ', NODE_ENV)
@@ -61,5 +63,7 @@ module.exports = {
6163
apiHost: API_HOST ?? 'http://localhost:3001',
6264
region: REGION ?? 'unknown',
6365
authProvider: OCP_OAUTH_CONFIG ? "openshift" : "appid",
64-
authConfig: authConfig
66+
authConfig: authConfig,
67+
headerPrefix: HEADER_PREFIX,
68+
headerName: HEADER_NAME,
6569
};

server/server.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const config = require('../config/config');
1212
const LOGIN_URL = "/login";
1313
const LOGOUT_URL = "/logout";
1414
const CALLBACK_URL = "/login/callback";
15+
const CONFIG_URL = "/config";
1516

1617
const conf = {
1718
applicationUrl: config.externalUri,
@@ -115,6 +116,14 @@ const config = require('../config/config');
115116
if (req.session) console.log('test', req.session.redirectUrl);
116117
res.redirect(req.session?.redirectUrl ? req.session.redirectUrl : '/');
117118
}
119+
app.get(CONFIG_URL, (req, res) => {
120+
res.header("Content-Type", "application/json; charset=utf-8")
121+
res.status(200);
122+
res.json({
123+
headerPrefix: config.headerPrefix,
124+
headerName: config.headerName,
125+
});
126+
});
118127
app.get(CALLBACK_URL, passport.authenticate(config.authProvider), redirectAfterLogin);
119128
app.get(LOGIN_URL, passport.authenticate(config.authProvider), redirectAfterLogin);
120129
app.get(LOGOUT_URL, function (req, res, next) {

src/components/OverView.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ class OverView extends Component {
1919
<Row className="compliance-page__row">
2020
<Column lg={{span: 12}}>
2121
<h2 style={{ margin: "30px 0" }} >
22-
TechZone Deployer
22+
Solution Deployer
2323
</h2>
2424

2525
<p style={{ lineHeight: "20px" }}>
26-
The goal of this tool is to accelerate adoption of IBM Software on Hybrid-Cloud. TechZone Deployer drastically reduces the time and effort it takes
27-
to deploy solutions leveraging IBM Software on any Cloud, by providing a modular automation framework allowing users to build their
26+
The goal of this tool is to accelerate solution value in a hybrid-cloud landscape. Solution Deployer drastically reduces the time and effort it takes
27+
to deploy solutions on any cloud or on-premise infrastructure, by providing a modular automation framework allowing users to build their
2828
custom solutions and automate their deployment using our solution builder features.
2929
It simplifies the complexity of the data attributes that surround a reference architecture for enterprise workloads with regulatory compliance.
3030
When we review the regulatory controls the number of cloud services and the possible reference

src/components/builder/solutions/CreateSolutionView.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class CreateSolutionview extends Component {
270270
</p>
271271
<br />
272272
<p>
273-
Then, you will have to pick the IBM Software cartridges you need as part of your solution, from individual components of IBM Cloud Paks,
273+
Then, you will have to pick the software cartridges you need as part of your solution, from individual components of IBM Cloud Paks,
274274
Sustainability Software, or bringing your own custom Software tiles. Once you have completed all these steps you will be redirected to
275275
your new solution and can download the automation to support the provisioning into your own environment.
276276
</p>
@@ -417,7 +417,7 @@ class CreateSolutionview extends Component {
417417
<form className="plans">
418418

419419
<div className="title">
420-
Now you have selected your reference architecture you will require some file storage for your IBM Software
420+
Now you have selected your reference architecture you will require some file storage for your software selections.
421421
</div>
422422

423423
{
@@ -581,7 +581,7 @@ class CreateSolutionview extends Component {
581581

582582
<div className="summary">
583583

584-
<p>You have chosen to create an IBM Technology solution called <strong>{this.state.fields?.name}</strong></p>
584+
<p>You have chosen to create a solution called <strong>{this.state.fields?.name}</strong></p>
585585

586586
<div className='arch'>
587587
<p>You want to <strong>{persona?.displayName}</strong> <img loading="lazy" src={persona?.iconUrl} alt={persona?.displayName ?? ""} /></p>
@@ -591,7 +591,7 @@ class CreateSolutionview extends Component {
591591
</div>
592592

593593
<p>
594-
You have chosen the following IBM Software to help get your solution started:
594+
You have chosen the following software to help get your solution started:
595595
<ul>
596596
{software?.map(sw => (
597597
<li key={sw.name}>{sw.displayName ?? sw.name}</li>

src/components/ui-shell/UIShell.jsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ class UIShell extends Component {
4545
patternName: "Overview",
4646
profileExpanded: false,
4747
content: defaultConfig,
48-
notifications: []
48+
notifications: [],
49+
headerPrefix: '',
50+
headerName: 'Solution Deployer'
4951
};
5052
}
5153

@@ -121,6 +123,14 @@ class UIShell extends Component {
121123
}
122124
})
123125
.catch(console.error);
126+
127+
fetch('/config')
128+
.then(res => res.json())
129+
.then(config => {
130+
if (config.headerPrefix !== undefined) this.setState({ headerPrefix: config.headerPrefix });
131+
if (config.headerName !== undefined) this.setState({ headerName: config.headerName });
132+
})
133+
.catch(console.error);
124134
}
125135

126136
fetchToken() {
@@ -145,7 +155,7 @@ class UIShell extends Component {
145155
render={({ isSideNavExpanded, onClickSideNavExpand }) => (
146156

147157

148-
<Header aria-label="IBM">
158+
<Header aria-label="CNTK">
149159

150160
<SkipToContent />
151161

@@ -155,8 +165,8 @@ class UIShell extends Component {
155165
isActive={isSideNavExpanded}
156166
/>
157167

158-
<HeaderName prefix={ApplicationMode.isFsControlsMode() ? 'IBM Cloud' : 'IBM Technology Zone'}>
159-
{ApplicationMode.isFsControlsMode() ? 'Controls Catalog' : 'Deployer'}
168+
<HeaderName prefix={this.state.headerPrefix}>
169+
{this.state.headerName}
160170
</HeaderName>
161171

162172
<HeaderNavigation aria-label="navigation">

0 commit comments

Comments
 (0)