Skip to content

Commit

Permalink
#5017 Support link added
Browse files Browse the repository at this point in the history
  • Loading branch information
ramyaragupathy authored and Aadesh-Baral committed Mar 29, 2022
1 parent 5b58ada commit 155207f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 12 additions & 1 deletion frontend/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Popup from 'reactjs-popup';
import { FormattedMessage } from 'react-intl';

import messages from './messages';
import { ORG_URL, ORG_NAME, ORG_LOGO } from '../../config';
import { ORG_URL, ORG_NAME, ORG_LOGO, SERVICE_DESK } from '../../config';
import logo from '../../assets/img/main-logo.svg';
import { ExternalLinkIcon } from '../svgIcons';
import { Dropdown } from '../dropdown';
Expand Down Expand Up @@ -33,6 +33,7 @@ function getMenuItensForUser(userDetails, organisations) {
{ label: messages.manage, link: 'manage', authenticated: true, manager: true },
{ label: messages.learn, link: 'learn', showAlways: true },
{ label: messages.about, link: 'about', showAlways: true },
{ label: messages.support, link: SERVICE_DESK, showAlways: true, serviceDesk: true },
];
let filteredMenuItems;
if (userDetails.username) {
Expand Down Expand Up @@ -114,6 +115,16 @@ const PopupItems = (props) => {
</Link>
</p>
))}

{props.menuItems
.filter((item) => item.serviceDesk === true)
.map((item, n) => (
<p key={n}>
<Link to={{pathname: "%SERVICE_DESK%"}} target="_blank" className={props.linkCombo} onClick={props.close}>
<FormattedMessage {...item.label} />
</Link>
</p>
))}
{/* user links */}
{props.userDetails.username && (
<>
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/header/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default defineMessages({
id: 'header.nav.aboutLink',
defaultMessage: 'About',
},
support: {
id: 'header.nav.support',
defaultMessage: 'Support',
},
myContributions: {
id: 'header.nav.my_contributions',
defaultMessage: 'My contributions',
Expand Down

0 comments on commit 155207f

Please sign in to comment.