Skip to content

Commit

Permalink
Revert "NDCS/LTS/Net-Zero Explore to only show individual EU members …
Browse files Browse the repository at this point in the history
…checkbox if all EU members displayed"

This reverts commit e9aeea6.
  • Loading branch information
SARodrigues committed Jul 20, 2023
1 parent e9aeea6 commit 9e64812
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ function LTSExploreMap(props) {
handlePngDownloadModal,
pngSelectionSubtitle,
selectActiveDonutIndex,
pngDownloadId,
showEUCountriesCheckbox
pngDownloadId
} = props;
useEffect(() => {
selectActiveDonutIndex(0);
Expand Down Expand Up @@ -307,14 +306,12 @@ function LTSExploreMap(props) {
<span data-tour="lts-explore-03">
{renderMap({ isTablet })}
</span>
{showEUCountriesCheckbox && (
<CheckInput
theme={blueCheckboxTheme}
label="Visualize individual submissions of EU Members on the map"
checked={checked}
onChange={() => handleOnChangeChecked(!checked)}
/>
)}
<CheckInput
theme={blueCheckboxTheme}
label="Visualize individual submissions of EU Members on the map"
checked={checked}
onChange={() => handleOnChangeChecked(!checked)}
/>
{countryData && (
<ExploreMapTooltip
id={TOOLTIP_ID}
Expand Down Expand Up @@ -378,8 +375,7 @@ LTSExploreMap.propTypes = {
handlePngDownloadModal: PropTypes.func.isRequired,
pngSelectionSubtitle: PropTypes.string,
pngDownloadId: PropTypes.string.isRequired,
donutActiveIndex: PropTypes.number,
showEUCountriesCheckbox: PropTypes.bool
donutActiveIndex: PropTypes.number
};

export default LTSExploreMap;
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
selectedCountriesISOFunction,
selectedMapCountriesISOFunction,
selectedCountriesFunction,
getIsEUDisplayedFunction,
categoryIndicatorsFunction,
pathsWithStylesFunction,
locationsNamesFunction,
Expand Down Expand Up @@ -139,11 +138,6 @@ export const getSelectedCountriesISO = createSelector(
selectedCountriesISOFunction
);

export const getShowEUCountriesCheckbox = createSelector(
[getSelectedCountriesISO],
getIsEUDisplayedFunction
);

export const getSelectedMapCountriesISO = createSelector(
[getIsShowEUCountriesChecked, getSelectedCountriesISO],
selectedMapCountriesISOFunction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ import {
getDonutActiveIndex,
getPngSelectionSubtitle,
getLocations,
getSelectedLocations,
getShowEUCountriesCheckbox
getSelectedLocations
} from './lts-explore-map-selectors';

const actions = {
Expand Down Expand Up @@ -77,8 +76,7 @@ const mapStateToProps = (state, { location }) => {
donutActiveIndex: getDonutActiveIndex(LTSWithSelection),
pngSelectionSubtitle: getPngSelectionSubtitle(LTSWithSelection),
locations: getLocations(LTSWithSelection),
selectedLocations: getSelectedLocations(LTSWithSelection),
showEUCountriesCheckbox: getShowEUCountriesCheckbox(LTSWithSelection)
selectedLocations: getSelectedLocations(LTSWithSelection)
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ function NDCSExploreMap(props) {
checked,
pngDownloadId,
secondCardSelectedTab,
setSecondCardSelectedTab,
showEUCountriesCheckbox
setSecondCardSelectedTab
} = props;

const tooltipParentRef = useRef(null);
Expand Down Expand Up @@ -362,14 +361,12 @@ function NDCSExploreMap(props) {
<span data-tour="ndc-explore-04">
{renderMap({ isTablet })}
</span>
{showEUCountriesCheckbox && (
<CheckInput
theme={blueCheckboxTheme}
label="Visualize individual submissions of EU Members on the map"
checked={checked}
onChange={() => handleOnChangeChecked(!checked)}
/>
)}
<CheckInput
theme={blueCheckboxTheme}
label="Visualize individual submissions of EU Members on the map"
checked={checked}
onChange={() => handleOnChangeChecked(!checked)}
/>
{countryData && (
<ExploreMapTooltip
id={TOOLTIP_ID}
Expand Down Expand Up @@ -449,8 +446,7 @@ NDCSExploreMap.propTypes = {
checked: PropTypes.bool,
donutActiveIndex: PropTypes.number,
secondCardSelectedTab: PropTypes.string,
setSecondCardSelectedTab: PropTypes.string,
showEUCountriesCheckbox: PropTypes.bool
setSecondCardSelectedTab: PropTypes.string
};

export default NDCSExploreMap;
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
selectedCountriesISOFunction,
selectedMapCountriesISOFunction,
selectedCountriesFunction,
getIsEUDisplayedFunction,
categoryIndicatorsFunction,
pathsWithStylesFunction,
getColorException,
Expand Down Expand Up @@ -229,11 +228,6 @@ export const getSelectedCountriesISO = createSelector(
selectedCountriesISOFunction
);

export const getShowEUCountriesCheckbox = createSelector(
[getSelectedCountriesISO],
getIsEUDisplayedFunction
);

export const getSelectedMapCountriesISO = createSelector(
[getIsShowEUCountriesChecked, getSelectedCountriesISO],
selectedMapCountriesISOFunction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ import {
getPngSelectionSubtitle,
getLocations,
getSelectedLocations,
getVulnerabilityData,
getShowEUCountriesCheckbox
getVulnerabilityData
} from './ndcs-explore-map-selectors';

const actions = { ...modalActions, ...exploreMapActions, ...pngModalActions };
Expand Down Expand Up @@ -80,10 +79,7 @@ const mapStateToProps = (state, { location }) => {
checked: getIsShowEUCountriesChecked(ndcsExploreWithSelection),
pngSelectionSubtitle: getPngSelectionSubtitle(ndcsExploreWithSelection),
locations: getLocations(ndcsExploreWithSelection),
vulnerabilityData: getVulnerabilityData(ndcsExploreWithSelection),
showEUCountriesCheckbox: getShowEUCountriesCheckbox(
ndcsExploreWithSelection
)
vulnerabilityData: getVulnerabilityData(ndcsExploreWithSelection)
};
};
const pngDownloadId = 'ndcs-explore-map';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ function NetZeroMap(props) {
tooltipValues,
donutActiveIndex,
selectActiveDonutIndex,
pngDownloadId,
showEUCountriesCheckbox
pngDownloadId
} = props;
useEffect(() => {
selectActiveDonutIndex(0);
Expand Down Expand Up @@ -306,14 +305,12 @@ function NetZeroMap(props) {
text="The map reflects latest communication of each country. Explore which countries have adopted a net-zero target below and click on a country to see its climate profile."
/>
{renderMap({ isTablet })}
{showEUCountriesCheckbox && (
<CheckInput
theme={blueCheckboxTheme}
label="Visualize individual targets of EU Members on the map"
checked={checked}
onChange={() => handleOnChangeChecked(!checked)}
/>
)}
<CheckInput
theme={blueCheckboxTheme}
label="Visualize individual targets of EU Members on the map"
checked={checked}
onChange={() => handleOnChangeChecked(!checked)}
/>
{countryData && (
<ExploreMapTooltip
id={TOOLTIP_ID}
Expand Down Expand Up @@ -377,8 +374,7 @@ NetZeroMap.propTypes = {
pngSelectionSubtitle: PropTypes.string,
pngDownloadId: PropTypes.string.isRequired,
selectActiveDonutIndex: PropTypes.func.isRequired,
donutActiveIndex: PropTypes.number,
showEUCountriesCheckbox: PropTypes.bool
donutActiveIndex: PropTypes.number
};

export default NetZeroMap;
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
selectedMapCountriesISOFunction,
selectedCountriesISOFunction,
selectedCountriesFunction,
getIsEUDisplayedFunction,
categoryIndicatorsFunction,
pathsWithStylesFunction,
locationsNamesFunction,
Expand Down Expand Up @@ -145,11 +144,6 @@ export const getSelectedCountriesISO = createSelector(
selectedCountriesISOFunction
);

export const getShowEUCountriesCheckbox = createSelector(
[getSelectedCountriesISO],
getIsEUDisplayedFunction
);

export const getSelectedMapCountriesISO = createSelector(
[getIsShowEUCountriesChecked, getSelectedCountriesISO],
selectedMapCountriesISOFunction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ import {
getDonutActiveIndex,
getPngSelectionSubtitle,
getLocations,
getSelectedLocations,
getShowEUCountriesCheckbox
getSelectedLocations
} from './net-zero-map-selectors';

const actions = {
Expand Down Expand Up @@ -77,8 +76,7 @@ const mapStateToProps = (state, { location }) => {
donutActiveIndex: getDonutActiveIndex(netZeroWithSelection),
pngSelectionSubtitle: getPngSelectionSubtitle(netZeroWithSelection),
selectedLocations: getSelectedLocations(netZeroWithSelection),
locations: getLocations(netZeroWithSelection),
showEUCountriesCheckbox: getShowEUCountriesCheckbox(netZeroWithSelection)
locations: getLocations(netZeroWithSelection)
};
};

Expand Down

0 comments on commit 9e64812

Please sign in to comment.