Skip to content

Commit ecbeb32

Browse files
authored
PXP-11233: add ability to hide login link in navigation (#1469)
1 parent ae07063 commit ecbeb32

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

docs/portal_config.md

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ Below is an example, with inline comments describing what each JSON block config
149149
"contact": "If you have any questions about access or the registration process, please contact ", // optional; text for the contact section of the login page
150150
"email": "[email protected]", // optional; email for contact
151151
"image": "gene" // optional; images displayed on the login page
152+
"hideNavLink": false// optional default false; hide login link in main naviagion
152153
},
153154
"systemUse" : { // optional; will show a Use Message in a popup, to inform users of the use policy of the commons. It will display a message which requires acceptance before a user can use the site.
154155
"systemUseTitle" : "", // required; Title of the popup dialog

src/components/layout/TopBar.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
55
import TopIconButton from './TopIconButton';
66
import './TopBar.less';
77
import { useArboristUI, hideSubmissionIfIneligible } from '../../configs';
8-
import { discoveryConfig } from '../../localconf';
8+
import { discoveryConfig, topNavLogin } from '../../localconf';
99
import { userHasCreateOrUpdateOnAnyProject } from '../../authMappingUtils';
1010
import Banner from '../Banner';
1111

@@ -148,6 +148,7 @@ class TopBar extends Component {
148148
)
149149
}
150150
{
151+
topNavLogin &&
151152
typeof this.props.user.username === 'undefined'
152153
&& (
153154
<React.Fragment>

src/localconf.js

+3
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,8 @@ function buildConfig(opts) {
479479

480480
};
481481

482+
const topNavLogin = !components?.login?.hideNavLink;
483+
482484
return {
483485
app,
484486
basename,
@@ -591,6 +593,7 @@ function buildConfig(opts) {
591593
showSystemUseOnlyOnLogin,
592594
Error403Url,
593595
bundle,
596+
topNavLogin,
594597
};
595598
}
596599

0 commit comments

Comments
 (0)