From b2918427c71eed810ee7271dc82a3dbf5c9b4c45 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Fri, 19 Apr 2024 14:02:16 -0300 Subject: [PATCH 1/5] chore(tcl): remove extra download link from the dashboard --- data/dashboard-summary-sentence.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/data/dashboard-summary-sentence.js b/data/dashboard-summary-sentence.js index 9ff227943f..b2114a762a 100644 --- a/data/dashboard-summary-sentence.js +++ b/data/dashboard-summary-sentence.js @@ -1,11 +1,11 @@ export default { global: { summary: - 'Explore interactive charts and maps that summarize key statistics about global forests. Statistics and global rankings – including rates of forest change, forest extent and drivers of deforestation – can be customized, easily shared and downloaded for offline use. Download global 2023 tree cover loss data by country here.', + 'Explore interactive charts and maps that summarize key statistics about global forests. Statistics and global rankings – including rates of forest change, forest extent and drivers of deforestation – can be customized, easily shared and downloaded for offline use.', 'land-cover': 'Explore interactive charts and maps that summarize global forest extent. Statistics – including rankings of countries with the most forest – can be customized, easily shared and downloaded for offline use.', 'forest-change': - 'Explore interactive charts and maps that summarize global rates of forest change. Statistics – including rankings of countries with the most forest loss and gain, and drivers of deforestation – can be customized, easily shared and downloaded for offline use. Download global 2023 tree cover loss data by country here.', + 'Explore interactive charts and maps that summarize global rates of forest change. Statistics – including rankings of countries with the most forest loss and gain, and drivers of deforestation – can be customized, easily shared and downloaded for offline use.', fires: 'Explore real-time fire alerts and identify countries with the most significant number of fires based on historical trends. The interactive chart can be customized, easily shared and downloaded for offline use.', climate: @@ -13,11 +13,11 @@ export default { }, country: { summary: - 'Explore interactive charts and maps that summarize key statistics about forests in {location}. Statistics – including rates of forest change, forest extent, drivers of deforestation, and deforestation and fire alerts – can be customized, easily shared and downloaded for offline use. Download global 2023 tree cover loss data by country here.', + 'Explore interactive charts and maps that summarize key statistics about forests in {location}. Statistics – including rates of forest change, forest extent, drivers of deforestation, and deforestation and fire alerts – can be customized, easily shared and downloaded for offline use.', 'land-cover': 'Explore interactive charts and maps that summarize forest extent in {location}. Statistics – including rankings of regions with the most forest – can be customized, easily shared and downloaded for offline use.', 'forest-change': - 'Explore interactive charts and maps that summarize rates of forest change in {location}. Statistics – including rankings of regions with the most forest loss and gain – can be customized, easily shared and downloaded for offline use. Download global 2023 tree cover loss data by country here.', + 'Explore interactive charts and maps that summarize rates of forest change in {location}. Statistics – including rankings of regions with the most forest loss and gain – can be customized, easily shared and downloaded for offline use.', 'land-use': 'Explore interactive charts and maps that summarize the human use of land in {location}. Statistics – including export flows of agricultural commodities, the economic impact of forests and forestry employment – can be customized, easily shared and downloaded for offline use.', fires: @@ -27,11 +27,11 @@ export default { }, adm1: { summary: - 'Explore interactive charts and maps that summarize key statistics about forests in {adm1}, {location}. Statistics – including rates of forest change and forest extent – can be customized, easily shared and downloaded for offline use. Download global 2023 tree cover loss data by country here.', + 'Explore interactive charts and maps that summarize key statistics about forests in {adm1}, {location}. Statistics – including rates of forest change and forest extent – can be customized, easily shared and downloaded for offline use.', 'land-cover': 'Explore interactive charts and maps that summarize forest extent in {adm1}, {location}. Statistics – including rankings of regions with the most forest – can be customized, easily shared and downloaded for offline use.', 'forest-change': - 'Explore interactive charts and maps that summarize rates of forest change in {adm1}, {location}. Statistics – including rankings of regions with the most forest loss and gain – can be customized, easily shared and downloaded for offline use. Download global 2023 tree cover loss data by country here.', + 'Explore interactive charts and maps that summarize rates of forest change in {adm1}, {location}. Statistics – including rankings of regions with the most forest loss and gain – can be customized, easily shared and downloaded for offline use.', fires: 'Explore interactive charts and maps that summarize forest fires in {adm1}, {location}. Statistics – including regions with the most fire alerts and how current fires compare to historical trends – can be customized, easily shared and downloaded for offline use.', climate: @@ -39,11 +39,11 @@ export default { }, adm2: { summary: - 'Explore interactive charts and maps that summarize key statistics about forests in {adm2}, {adm1}, {location}. Statistics – including rates of forest change and forest extent – can be customized, easily shared and downloaded for offline use. Download global 2023 tree cover loss data by country here.', + 'Explore interactive charts and maps that summarize key statistics about forests in {adm2}, {adm1}, {location}. Statistics – including rates of forest change and forest extent – can be customized, easily shared and downloaded for offline use.', 'land-cover': 'Explore interactive charts and maps that summarize forest extent in {adm2}, {adm1}, {location}. Statistics – including types of forest cover – can be customized, easily shared and downloaded for offline use.', 'forest-change': - 'Explore interactive charts and maps that summarize rates of forest change in {adm2}, {adm1}, {location}. Forest cover change statistics – including rankings of regions with the most forest loss and gain – can be customized, easily shared and downloaded for offline use. Download global 2023 tree cover loss data by country here.', + 'Explore interactive charts and maps that summarize rates of forest change in {adm2}, {adm1}, {location}. Forest cover change statistics – including rankings of regions with the most forest loss and gain – can be customized, easily shared and downloaded for offline use.', fires: 'Explore interactive charts and maps that summarize forest fires in {adm2}, {adm1}, {location}. Fire statistics – including how current fires compare to historical trends – can be customized, easily shared and downloaded for offline use.', climate: From 654ad620b030f0806cebc60597999e8a96575400 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Fri, 19 Apr 2024 14:14:33 -0300 Subject: [PATCH 2/5] chore(tcl): remove caveats from widgets --- components/widgets/climate/carbon-flux/index.js | 8 -------- .../widgets/climate/emissions-deforestation/index.js | 8 -------- components/widgets/fires/tree-loss-fires-annual/index.js | 8 -------- .../widgets/fires/tree-loss-fires-proportion/index.js | 8 -------- components/widgets/fires/tree-loss-fires/index.js | 8 -------- .../widgets/forest-change/tree-loss-drivers/index.js | 6 ------ 6 files changed, 46 deletions(-) diff --git a/components/widgets/climate/carbon-flux/index.js b/components/widgets/climate/carbon-flux/index.js index 05f01cc285..7e0b2749c8 100644 --- a/components/widgets/climate/carbon-flux/index.js +++ b/components/widgets/climate/carbon-flux/index.js @@ -35,14 +35,6 @@ export default { categories: ['climate'], types: ['geostore', 'global', 'country', 'aoi', 'use', 'wdpa'], admins: ['global', 'adm0', 'adm1', 'adm2'], - alerts: [ - { - id: 'carbon-flux-1', - text: `2023 loss data is currently available only for specific analyses. Note that this widget does not reflect updated data. [Click here](https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx) to access a file with country-level 2023 loss data.`, - icon: 'warning', - visible: ['global', 'country', 'geostore', 'aoi', 'wdpa', 'use'], - }, - ], chartType: 'verticalComposedChart', settingsConfig: [ { diff --git a/components/widgets/climate/emissions-deforestation/index.js b/components/widgets/climate/emissions-deforestation/index.js index 0bb2b61e21..71b56ce082 100644 --- a/components/widgets/climate/emissions-deforestation/index.js +++ b/components/widgets/climate/emissions-deforestation/index.js @@ -31,14 +31,6 @@ export default { categories: ['climate'], types: ['geostore', 'country', 'aoi', 'use', 'wdpa'], admins: ['adm0', 'adm1', 'adm2'], - alerts: [ - { - id: 'emissions-deforestation-1', - text: `2023 loss data is currently available only for specific analyses. Note that this widget does not reflect updated data. [Click here](https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx) to access a file with country-level 2023 loss data.`, - icon: 'warning', - visible: ['geostore', 'country', 'aoi', 'use', 'wdpa'], - }, - ], chartType: 'composedChart', settingsConfig: [ { diff --git a/components/widgets/fires/tree-loss-fires-annual/index.js b/components/widgets/fires/tree-loss-fires-annual/index.js index 308b0b3e2b..b41100f238 100644 --- a/components/widgets/fires/tree-loss-fires-annual/index.js +++ b/components/widgets/fires/tree-loss-fires-annual/index.js @@ -34,14 +34,6 @@ export default { categories: ['summary', 'fires'], types: ['global', 'country', 'geostore', 'aoi', 'wdpa', 'use'], admins: ['global', 'adm0', 'adm1', 'adm2'], - alerts: [ - { - id: 'tree-loss-fires-annual-1', - text: `2023 loss data is currently available only for specific analyses. Note that this widget does not reflect updated data. [Click here](https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx) to access a file with country-level 2023 loss data.`, - icon: 'warning', - visible: ['global', 'country', 'geostore', 'aoi', 'wdpa', 'use'], - }, - ], large: true, visible: ['dashboard', 'analysis'], chartType: 'composedChart', diff --git a/components/widgets/fires/tree-loss-fires-proportion/index.js b/components/widgets/fires/tree-loss-fires-proportion/index.js index f1eccc3b66..5cf7e8f3ea 100644 --- a/components/widgets/fires/tree-loss-fires-proportion/index.js +++ b/components/widgets/fires/tree-loss-fires-proportion/index.js @@ -33,14 +33,6 @@ export default { categories: ['fires'], types: ['global', 'country', 'geostore', 'aoi', 'wdpa', 'use'], admins: ['global', 'adm0', 'adm1', 'adm2'], - alerts: [ - { - id: 'tree-loss-fires-proportion-1', - text: `2023 loss data is currently available only for specific analyses. Note that this widget does not reflect updated data. [Click here](https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx) to access a file with country-level 2023 loss data.`, - icon: 'warning', - visible: ['global', 'country', 'geostore', 'aoi', 'wdpa', 'use'], - }, - ], large: false, visible: ['dashboard', 'analysis'], chartType: 'pieChart', diff --git a/components/widgets/fires/tree-loss-fires/index.js b/components/widgets/fires/tree-loss-fires/index.js index 7374b4f5de..927f3b0503 100644 --- a/components/widgets/fires/tree-loss-fires/index.js +++ b/components/widgets/fires/tree-loss-fires/index.js @@ -27,14 +27,6 @@ export default { categories: ['fires'], types: ['global', 'country'], admins: ['global', 'adm0', 'adm1'], - alerts: [ - { - id: 'tree-loss-fires-1', - text: `2023 loss data is currently available only for specific analyses. Note that this widget does not reflect updated data. [Click here](https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx) to access a file with country-level 2023 loss data.`, - icon: 'warning', - visible: ['global', 'country'], - }, - ], settingsConfig: [ { key: 'forestType', diff --git a/components/widgets/forest-change/tree-loss-drivers/index.js b/components/widgets/forest-change/tree-loss-drivers/index.js index 5dfa1375ee..1b9f7c2cdc 100644 --- a/components/widgets/forest-change/tree-loss-drivers/index.js +++ b/components/widgets/forest-change/tree-loss-drivers/index.js @@ -30,12 +30,6 @@ export default { admins: ['global', 'adm0'], alerts: { default: [ - { - id: 'tree-loss-drivers-alert-2', - text: `2023 loss data is currently available only for specific analyses. Note that this widget does not reflect updated data. [Click here](https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx) to access a file with country-level 2023 loss data.`, - icon: 'warning', - visible: ['global', 'country', 'geostore', 'aoi', 'wdpa', 'use'], - }, { id: 'tree-loss-drivers-alert-1', text: `The methods behind this data have changed over time. Be cautious comparing old and new, data especially before/after 2015. [Read more here](https://www.globalforestwatch.org/blog/data-and-research/tree-cover-loss-satellite-data-trend-analysis/).`, From 1fe9daaa4e3669744e1c0719b0cb26339a4d3ad4 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Fri, 19 Apr 2024 14:23:41 -0300 Subject: [PATCH 3/5] chore(tcl): remove validation to hide carbon message --- components/widgets/forest-change/tree-loss/selectors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/widgets/forest-change/tree-loss/selectors.js b/components/widgets/forest-change/tree-loss/selectors.js index 1bf7db06cf..627b803b00 100644 --- a/components/widgets/forest-change/tree-loss/selectors.js +++ b/components/widgets/forest-change/tree-loss/selectors.js @@ -136,7 +136,7 @@ const parseSentence = createSelector( if (totalLoss === 0) { sentence = indicator ? noLossWithIndicator : noLoss; } - if (tropical && totalLoss > 0 && endYear !== 2023) { + if (tropical && totalLoss > 0) { sentence = `${sentence}, ${co2Emissions}`; } sentence = `${sentence}.`; From 1ddf0ce2f950851ef02bcc87151f0695ec944295 Mon Sep 17 00:00:00 2001 From: Luis Zenteno Date: Fri, 19 Apr 2024 12:35:17 -0600 Subject: [PATCH 4/5] chore(tcl): remove validations from MVP tickets 1075 and 1077 --- .../widgets/fires/tree-loss-fires-annual/index.js | 4 +--- .../widgets/fires/tree-loss-fires-annual/selectors.js | 2 +- .../widgets/fires/tree-loss-fires-proportion/index.js | 4 +--- .../fires/tree-loss-fires-proportion/selectors.js | 2 +- .../widgets/forest-change/tree-loss-drivers/index.js | 1 - .../forest-change/tree-loss-global/selectors.js | 6 +----- .../forest-change/tree-loss-plantations/selectors.js | 11 +---------- services/get-where-query.js | 8 +------- services/sentences.js | 8 -------- 9 files changed, 7 insertions(+), 39 deletions(-) diff --git a/components/widgets/fires/tree-loss-fires-annual/index.js b/components/widgets/fires/tree-loss-fires-annual/index.js index b41100f238..d5b49ab264 100644 --- a/components/widgets/fires/tree-loss-fires-annual/index.js +++ b/components/widgets/fires/tree-loss-fires-annual/index.js @@ -660,10 +660,8 @@ export default { return lossFetch.then((loss) => { let data = {}; if (loss && loss.data) { - const filteredLoss = loss.data.data.filter((item) => item.year < 2023); - data = { - loss: filteredLoss, + loss: loss.data.data, }; } diff --git a/components/widgets/fires/tree-loss-fires-annual/selectors.js b/components/widgets/fires/tree-loss-fires-annual/selectors.js index 722fea1035..1abb06bf39 100644 --- a/components/widgets/fires/tree-loss-fires-annual/selectors.js +++ b/components/widgets/fires/tree-loss-fires-annual/selectors.js @@ -176,7 +176,7 @@ const parseSentence = createSelector( indicator: indicator && indicator.label, location: locationLabel, startYear, - endYear: endYear === 2023 ? endYear - 1 : endYear, // TODO: Remove this for TCL 2023 update full release!! + endYear, treeCoverLossFires: formatNumber({ num: treeCoverLossFires, unit: 'ha', diff --git a/components/widgets/fires/tree-loss-fires-proportion/index.js b/components/widgets/fires/tree-loss-fires-proportion/index.js index 5cf7e8f3ea..8d2c65665e 100644 --- a/components/widgets/fires/tree-loss-fires-proportion/index.js +++ b/components/widgets/fires/tree-loss-fires-proportion/index.js @@ -128,10 +128,8 @@ export default { return lossFetch.then((loss) => { let data = {}; if (loss && loss.data) { - const filteredLoss = loss.data.data.filter((item) => item.year < 2023); - data = { - loss: filteredLoss, + loss: loss.data.data, }; } diff --git a/components/widgets/fires/tree-loss-fires-proportion/selectors.js b/components/widgets/fires/tree-loss-fires-proportion/selectors.js index 97c72fd60d..ed22f6f87a 100644 --- a/components/widgets/fires/tree-loss-fires-proportion/selectors.js +++ b/components/widgets/fires/tree-loss-fires-proportion/selectors.js @@ -94,7 +94,7 @@ const parseSentence = createSelector( indicator: indicator && indicator.label, location: locationLabel, startYear, - endYear: endYear === 2023 ? endYear - 1 : endYear, // TODO: Remove this for TCL 2023 update full release!!, + endYear, lossFiresPercentage: formatNumber({ num: lossFiresPercentage, unit: '%', diff --git a/components/widgets/forest-change/tree-loss-drivers/index.js b/components/widgets/forest-change/tree-loss-drivers/index.js index 1b9f7c2cdc..b4acb60e28 100644 --- a/components/widgets/forest-change/tree-loss-drivers/index.js +++ b/components/widgets/forest-change/tree-loss-drivers/index.js @@ -149,7 +149,6 @@ export default { landCategory: 'tsc', lossTsc: true, download: true, - widgetId: 'treeLossTsc', }), getExtent({ ...params, download: true }), ], diff --git a/components/widgets/forest-change/tree-loss-global/selectors.js b/components/widgets/forest-change/tree-loss-global/selectors.js index b120084a0d..2facfa0fa2 100644 --- a/components/widgets/forest-change/tree-loss-global/selectors.js +++ b/components/widgets/forest-change/tree-loss-global/selectors.js @@ -175,11 +175,7 @@ export const parseSentence = createSelector( const percentageLoss = (totalLoss && totalExtent && (totalLoss / totalExtent) * 100) || 0; - let sentence = indicator ? withInd : initial; - - if (endYear === 2023) { - sentence = sentence.replace(' and {emissions} of CO₂ emissions', ''); - } + const sentence = indicator ? withInd : initial; const params = { indicator: indicator && indicator.label, diff --git a/components/widgets/forest-change/tree-loss-plantations/selectors.js b/components/widgets/forest-change/tree-loss-plantations/selectors.js index a585d6ef29..c63206ecef 100644 --- a/components/widgets/forest-change/tree-loss-plantations/selectors.js +++ b/components/widgets/forest-change/tree-loss-plantations/selectors.js @@ -140,17 +140,8 @@ export const parseSentence = createSelector( percentage: formatNumber({ num: percentage, unit: '%' }), }; - let finalSentence = sentence; - - if (endYear === 2023) { - finalSentence = sentence.replace( - ' The total loss within natural forest was equivalent to {value} of CO\u2082e emissions.', - '' - ); - } - return { - sentence: finalSentence, + sentence, params, }; } diff --git a/services/get-where-query.js b/services/get-where-query.js index 61a39b5423..b00d854c68 100644 --- a/services/get-where-query.js +++ b/services/get-where-query.js @@ -8,7 +8,7 @@ const isNumber = (value) => !!(typeof value === 'number' || !isNaN(value)); // build {where} statement for query export const getWHEREQuery = (params = {}) => { - const { type, dataset, widgetId } = params || {}; + const { type, dataset } = params || {}; const allFilterOptions = forestTypes.concat(landCategories); const allowedParams = ALLOWED_PARAMS[params.dataset || 'annual']; @@ -97,12 +97,6 @@ export const getWHEREQuery = (params = {}) => { }`; } - // this is a temporary patch, it should be removed soon for the full TCL release!! - // see https://gfw.atlassian.net/browse/FLAG-1077 - if (widgetId === 'treeLossTsc') { - WHERE = `${WHERE} AND umd_tree_cover_loss__year < 2023 `; - } - if (isLastParameter) { WHERE = `${WHERE} `; } else { diff --git a/services/sentences.js b/services/sentences.js index fee06759b6..d656e07a6b 100644 --- a/services/sentences.js +++ b/services/sentences.js @@ -291,14 +291,6 @@ export const parseSentence = ( sentence = countrySpecific[adm0]; } - // 2023 TCL MVP - // removing last part of paragraph - // see: https://gfw.atlassian.net/browse/FLAG-1070 - sentence = sentence.replace( - ', equivalent to {emissions} of CO₂ emissions', - '' - ); - return { sentence, params, From 415a475f88b01f2cff05ab30ad234dbc89712450 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Thu, 25 Apr 2024 12:05:52 -0300 Subject: [PATCH 5/5] fix(emissions): replace emissions variable to use emissionsTreeCover for Co2Emissions property --- services/sentences.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/sentences.js b/services/sentences.js index d656e07a6b..61461470c6 100644 --- a/services/sentences.js +++ b/services/sentences.js @@ -37,7 +37,7 @@ export const adminSentences = { countrySpecific: { IDN: 'In 2001, {location} had {primaryForest} of primary forest*, extending over {percentagePrimaryForest} of its land area. In {year}, it lost {primaryLoss} of primary forest*, equivalent to {emissionsPrimary} of CO₂ emissions.', }, - co2Emissions: ', equivalent to {emissions} of CO\u2082 emissions.', + co2Emissions: ', equivalent to {emissionsTreeCover} of CO\u2082 emissions.', end: '.', };