Skip to content

Commit

Permalink
Merge pull request #837 from Vizzuality/fix/tooltips-undefined
Browse files Browse the repository at this point in the history
Fix: tooltips undefined
  • Loading branch information
sorodrigo authored May 21, 2019
2 parents eafc611 + 6487042 commit d5afb2c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions frontend/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ DATA_DOWNLOAD_ENABLED=true
SHOW_WORLD_MAP_IN_EXPLORE=true
ALWAYS_DISPLAY_DASHBOARD_INFO=true
ENABLE_DASHBOARDS=true
ENABLE_COOKIE_BANNER=true
ENABLE_LOGISTICS_MAP=true
ENABLE_LEGACY_TOOL_SEARCH=false
DISABLE_MULTIPLE_CONTEXT_PROFILES=false
Expand Down
1 change: 1 addition & 0 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"NODE_ENV_DEV": true,
"API_V3_URL": true,
"ENABLE_DASHBOARDS": true,
"ENABLE_COOKIE_BANNER": true,
"ENABLE_LOGISTICS_MAP": true,
"ENABLE_LEGACY_TOOL_SEARCH": true,
"DISABLE_MULTIPLE_CONTEXT_PROFILES": true,
Expand Down
1 change: 1 addition & 0 deletions frontend/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module.exports = {
SHOW_WORLD_MAP_IN_EXPLORE: process.env.SHOW_WORLD_MAP_IN_EXPLORE === 'true',
ALWAYS_DISPLAY_DASHBOARD_INFO: process.env.ALWAYS_DISPLAY_DASHBOARD_INFO === 'true',
ENABLE_DASHBOARDS: process.env.ENABLE_DASHBOARDS === 'true',
ENABLE_COOKIE_BANNER: process.env.ENABLE_COOKIE_BANNER === 'true',
GFW_WIDGETS_BASE_URL: JSON.stringify(process.env.GFW_WIDGETS_BASE_URL),
ENABLE_LOGISTICS_MAP: process.env.ENABLE_LOGISTICS_MAP === 'true',
ENABLE_LEGACY_TOOL_SEARCH: process.env.ENABLE_LEGACY_TOOL_SEARCH === 'true',
Expand Down
1 change: 1 addition & 0 deletions frontend/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ ENABLE_LOGISTICS_MAP: if set to true, the logistics map section will be visible
GFW_WIDGETS_BASE_URL: URL to load GFW widgets from. You probably want to use `www.globalforestwatch.org` here.
ENABLE_LEGACY_TOOL_SEARCH: if set to false the search algorithm in the tool will use `indexOf(query)` instead of fuzzy search.
DISABLE_MULTIPLE_CONTEXT_PROFILES: if set to true, only Brazil-Soy will be available at the profiles page -->
ENABLE_COOKIE_BANNER: if true, the cookie banner will appear for first time users
```

If you are using the included development server, you can set those variables in the `.env` file (use the included `.env.sample` as an example)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const mapStateToProps = state => ({
recolorBys: getRecolorByOptions(state),
recolorGroups: getToolRecolorByGroups(state),
selectedRecolorBy: getSelectedRecolorByValue(state),
tooltip: state.app.tooltips.sankey.nav.colorBy.main
tooltip: state.app.tooltips?.sankey.nav.colorBy.main
});

const mapDispatchToProps = dispatch => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const getSelectionRecolorBy = createSelector(
groupNumber: -1,
label: 'Selection',
years: selectedYears,
description: tooltips.sankey.nav.colorBy.none
description: tooltips?.sankey.nav.colorBy.none
})
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Text from 'react-components/shared/text';
import 'react-components/shared/cookie-banner/cookie-banner.scss';

function CookieBanner({ setAccepted, accepted }) {
return accepted ? null : (
return accepted || !ENABLE_COOKIE_BANNER ? null : (
<div className="c-cookie-banner">
<div className="row">
<div className="cookie-content">
Expand Down

0 comments on commit d5afb2c

Please sign in to comment.