From 9baff8ea81ad854eea0bea5b28025f627c7e833b Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Wed, 29 Nov 2023 13:34:07 -0300 Subject: [PATCH] feat(fao-cover): removing noPrimary sentence for global location We always have primary forest in a global scale (at least for now) --- components/widgets/land-cover/fao-cover/index.js | 2 -- components/widgets/land-cover/fao-cover/selectors.js | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/widgets/land-cover/fao-cover/index.js b/components/widgets/land-cover/fao-cover/index.js index 0838f4a17f..1b0ae8836a 100644 --- a/components/widgets/land-cover/fao-cover/index.js +++ b/components/widgets/land-cover/fao-cover/index.js @@ -31,8 +31,6 @@ export default { sentences: { globalInitial: 'According to the FAO, in {year}, {percent} ({amountInHectares}) of the globe was covered by forest. {primaryPercent} of that forest was classified as primary forest.', - globalNoPrimary: - 'According to the FAO, in {year},{primaryPercent} ({extent}) of the world was covered by forest.', initial: 'According to the FAO, in {year}, {percent} ({amountInHectares}) of {country} was covered by forest. {primaryPercent} of that forest was classified as primary forest.', noPrimary: diff --git a/components/widgets/land-cover/fao-cover/selectors.js b/components/widgets/land-cover/fao-cover/selectors.js index 0962949690..276e1e3eeb 100644 --- a/components/widgets/land-cover/fao-cover/selectors.js +++ b/components/widgets/land-cover/fao-cover/selectors.js @@ -62,7 +62,7 @@ export const parseSentence = createSelector( (data, locationName, sentences, settings) => { if (isEmpty(data)) return null; - const { initial, noPrimary, globalInitial, globalNoPrimary } = sentences; + const { initial, noPrimary, globalInitial } = sentences; const { area_ha, extent, forest_primary } = data; const { faoYear } = settings; @@ -85,10 +85,13 @@ export const parseSentence = createSelector( }), country: locationName, }; + let sentence = forest_primary > 0 ? initial : noPrimary; + if (locationName === 'global') { - sentence = forest_primary > 0 ? globalInitial : globalNoPrimary; + sentence = globalInitial; } + return { sentence, params,