Skip to content

Commit

Permalink
Merge pull request #4786 from wri/chore/remove-MVP-items-FLAG-1094
Browse files Browse the repository at this point in the history
[FLAG-1094] Remove MVP items
  • Loading branch information
willian-viana authored Apr 25, 2024
2 parents 0ca759b + 415a475 commit f9dd8a5
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 95 deletions.
8 changes: 0 additions & 8 deletions components/widgets/climate/carbon-flux/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down
8 changes: 0 additions & 8 deletions components/widgets/climate/emissions-deforestation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down
12 changes: 1 addition & 11 deletions components/widgets/fires/tree-loss-fires-annual/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -668,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,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
12 changes: 1 addition & 11 deletions components/widgets/fires/tree-loss-fires-proportion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -136,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,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: '%',
Expand Down
8 changes: 0 additions & 8 deletions components/widgets/fires/tree-loss-fires/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
7 changes: 0 additions & 7 deletions components/widgets/forest-change/tree-loss-drivers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/).`,
Expand Down Expand Up @@ -155,7 +149,6 @@ export default {
landCategory: 'tsc',
lossTsc: true,
download: true,
widgetId: 'treeLossTsc',
}),
getExtent({ ...params, download: true }),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
Expand Down
2 changes: 1 addition & 1 deletion components/widgets/forest-change/tree-loss/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}.`;
Expand Down
16 changes: 8 additions & 8 deletions data/dashboard-summary-sentence.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
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. <a href="https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx">Download global 2023 tree cover loss data by country here.</a>',
'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. <a href="https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx">Download global 2023 tree cover loss data by country here.</a>',
'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:
'Explore interactive charts and maps that summarize the role forests play in climate change and managing the global carbon budget. Forest carbon statistics – including how much carbon forests store, emit and sequester (remove) – can be customized, easily shared and downloaded for offline use.',
},
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. <a href="https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx">Download global 2023 tree cover loss data by country here.</a>',
'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. <a href="https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx">Download global 2023 tree cover loss data by country here.</a>',
'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:
Expand All @@ -27,23 +27,23 @@ 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. <a href="https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx">Download global 2023 tree cover loss data by country here.</a>',
'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. <a href="https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx">Download global 2023 tree cover loss data by country here.</a>',
'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:
'Explore interactive charts and maps that summarize the role forests play in climate change in {adm1}, {location}. Forest carbon statistics – including how forests store, emit and sequester (remove) carbon – can be customized, easily shared and downloaded for offline use.',
},
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. <a href="https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx">Download global 2023 tree cover loss data by country here.</a>',
'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. <a href="https://gfw2-data.s3.amazonaws.com/country-pages/country_stats/download/gfw_2023_statistics_summary.xlsx">Download global 2023 tree cover loss data by country here.</a>',
'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:
Expand Down
8 changes: 1 addition & 7 deletions services/get-where-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 1 addition & 9 deletions services/sentences.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '.',
};

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit f9dd8a5

Please sign in to comment.