Skip to content

Commit

Permalink
Merge pull request #2546 from fedspendingtransparency/hotfix/menu-map…
Browse files Browse the repository at this point in the history
…ping

Hotfix menu mapping in prod
  • Loading branch information
ebdabbs authored May 4, 2021
2 parents 1d2b9d3 + f66e693 commit e46353b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/js/components/sharedComponents/header/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faEnvelope } from "@fortawesome/free-regular-svg-icons";

import Analytics from 'helpers/analytics/Analytics';
import { searchOptions, profileOptions, downloadGlobalNavigationOptions, resourceOptions } from 'dataMapping/navigation/menuOptions';
import { searchOptions, profileOptions, downloadOptions, resourceOptions } from 'dataMapping/navigation/menuOptions';
import EmailSignUp from 'components/homepage/EmailSignUp';

import { DEV } from '../../../GlobalConstants';
Expand Down Expand Up @@ -184,7 +184,7 @@ export default class NavBar extends React.Component {
<Dropdown
title="Download"
label="Download"
items={downloadGlobalNavigationOptions} />
items={downloadOptions} />
</li>
<li
className="full-menu__item"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { withRouter, Link } from 'react-router-dom';

import Analytics from 'helpers/analytics/Analytics';

import { searchOptions, profileOptions, downloadGlobalNavigationOptions, resourceOptions } from 'dataMapping/navigation/menuOptions';
import { searchOptions, profileOptions, downloadOptions, resourceOptions } from 'dataMapping/navigation/menuOptions';

import MobileTop from './MobileTop';
import MobileDropdown from './MobileDropdown';
Expand Down Expand Up @@ -97,7 +97,7 @@ export class MobileNav extends React.Component {
<MobileDropdown
{...this.props}
label="Download Center"
items={downloadGlobalNavigationOptions}
items={downloadOptions}
active={this.state.url} />
<hr className="mobile-nav-content__divider" />
</li>
Expand Down
36 changes: 1 addition & 35 deletions src/js/dataMapping/navigation/menuOptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@

import GlobalConstants from 'GlobalConstants';

const {
QAT,
DEV,
FILES_SERVER_BASE_URL,
API
} = GlobalConstants;

const isLowerEnv = (QAT || DEV);
const { FILES_SERVER_BASE_URL } = GlobalConstants;

export const searchOptions = [
{
Expand Down Expand Up @@ -97,8 +90,6 @@ export const resourceOptions = [
}
];

const underResourcesInLowerEnv = ["api", "data dictionary"];

export const downloadOptions = [
{
label: 'Award Data Archive',
Expand Down Expand Up @@ -155,28 +146,6 @@ export const downloadOptions = [
enabled: true,
internalDomain: true
},
{
label: 'API',
type: '',
url: API.replace("api/", ""),
code: 'api',
description: 'An automated way for advanced users to access all the data behind USAspending.gov. Accessible documentation includes tutorials, best practices, and more.',
callToAction: 'Explore Our API',
shouldOpenNewTab: true,
enabled: true,
internalDomain: true
},
{
label: 'Data Dictionary',
type: 'data-dictionary',
url: '/data-dictionary',
code: 'dictionary',
description: '',
callToAction: 'Explore the Data Dictionary',
shouldOpenNewTab: false,
enabled: true,
externalLink: false
},
{
label: 'Dataset Metadata',
type: 'dataset_metadata',
Expand All @@ -189,6 +158,3 @@ export const downloadOptions = [
externalLink: false
}
];

export const downloadGlobalNavigationOptions = downloadOptions
.filter(({ label }) => !(isLowerEnv && underResourcesInLowerEnv.includes(label.toLowerCase())));

0 comments on commit e46353b

Please sign in to comment.