Skip to content

Commit

Permalink
Merge pull request #4678 from wri/bug/FLAG-911--temp-disable-viirs-as…
Browse files Browse the repository at this point in the history
…-widget-option

FLAG-911: temporary remove VIIIRS from the dataset op…
  • Loading branch information
wri7tno authored Aug 31, 2023
2 parents 22e3ce9 + 24762be commit 34726ef
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 31 deletions.
11 changes: 4 additions & 7 deletions components/widgets/fires/burned-area-cumulative/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const defaultConfig = {
alerts: [
{
id: 'cumulative-burned-areas-1',
text:
'We are preparing to remove MODIS Burned Areas from the Global Forest Watch site and will not be updating the data going forward. Please e-mail [email protected] with any requests to keep this dataset or with suggestions for new fire-related data sets.',
text: 'We are preparing to remove MODIS Burned Areas from the Global Forest Watch site and will not be updating the data going forward. Please e-mail [email protected] with any requests to keep this dataset or with suggestions for new fire-related data sets.',
visible: ['country', 'dashboard'],
},
],
Expand Down Expand Up @@ -99,7 +98,7 @@ const defaultConfig = {
fires: 3,
},
settings: {
dataset: 'modis_burned_area',
dataset: 'modis',
firesThreshold: 0,
},
sentences: {
Expand Down Expand Up @@ -152,12 +151,10 @@ export default {
refetchKeys: ['dataset'],
getWidget: (widgetSettings) => {
// called when settings changes
if (!widgetSettings || !widgetSettings.dataset) {
return defaultConfig;
}
if (widgetSettings.dataset !== 'modis_burned_area') {
if (widgetSettings?.dataset !== 'modis_burned_area') {
return firesAlertsCumulative;
}

return defaultConfig;
},
};
11 changes: 4 additions & 7 deletions components/widgets/fires/burned-area-ranked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ const defaultConfig = {
alerts: [
{
id: 'regions-most-burned-areas-1',
text:
'We are preparing to remove MODIS Burned Areas from the Global Forest Watch site and will not be updating the data going forward. Please e-mail [email protected] with any requests to keep this dataset or with suggestions for new fire-related data sets.',
text: 'We are preparing to remove MODIS Burned Areas from the Global Forest Watch site and will not be updating the data going forward. Please e-mail [email protected] with any requests to keep this dataset or with suggestions for new fire-related data sets.',
visible: ['global', 'country', 'adm0', 'adm1', 'dashboard'],
},
],
Expand Down Expand Up @@ -119,7 +118,7 @@ const defaultConfig = {
page: 0,
period: 'week',
weeks: 4,
dataset: 'modis_burned_area',
dataset: 'modis',
layerStartDate: null,
layerEndDate: null,
firesThreshold: 0,
Expand Down Expand Up @@ -164,12 +163,10 @@ export default {
refetchKeys: ['dataset'],
getWidget: (widgetSettings) => {
// called when settings changes
if (!widgetSettings || !widgetSettings.dataset) {
return defaultConfig;
}
if (widgetSettings.dataset !== 'modis_burned_area') {
if (widgetSettings?.dataset !== 'modis_burned_area') {
return firesRanked;
}

return defaultConfig;
},
};
2 changes: 1 addition & 1 deletion components/widgets/fires/burned-area/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default {
fires: 1,
},
settings: {
dataset: 'modis_burned_area',
dataset: 'modis',
firesThreshold: 0,
},
sentences: {
Expand Down
2 changes: 1 addition & 1 deletion components/widgets/fires/fire-alerts-simple/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default {
},
// initial settings
settings: {
dataset: 'viirs',
dataset: 'modis',
},
getData: async (params) => {
const { VIIRS } = await handleGfwParamsMeta(params);
Expand Down
2 changes: 1 addition & 1 deletion components/widgets/fires/fires-alerts-cumulative/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default {
fires: 2,
},
settings: {
dataset: 'viirs',
dataset: 'modis',
confidence: 'h',
},
sentences: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
colors: 'fires',
metaKey: 'widget_fire_alert_location',
settings: {
dataset: 'viirs',
dataset: 'modis',
},
datasets: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default {
colors: 'fires',
metaKey: 'widget_fire_alert_location',
settings: {
dataset: 'viirs',
dataset: 'modis',
minDate: '2000-01-01',
confidence: '',
},
Expand Down
2 changes: 1 addition & 1 deletion components/widgets/fires/fires-alerts-historical/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default {
colors: 'fires',
metaKey: 'widget_fire_alert_location',
settings: {
dataset: 'viirs',
dataset: 'modis',
minDate: '2000-01-01',
confidence: '',
},
Expand Down
4 changes: 2 additions & 2 deletions components/widgets/fires/fires-alerts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const defaultConfig = {
fires: 1,
},
settings: {
dataset: 'viirs',
dataset: 'modis',
confidence: 'h',
},
sentences: {
Expand Down Expand Up @@ -359,13 +359,13 @@ export default {
proxy: true,
refetchKeys: ['dataset'],
getWidget: (widgetSettings) => {
// called when settings changes
if (!widgetSettings || !widgetSettings.dataset) {
return defaultConfig;
}
if (widgetSettings.dataset === 'modis_burned_area') {
return burnedAreaStats;
}

return defaultConfig;
},
};
2 changes: 1 addition & 1 deletion components/widgets/fires/fires-ranked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default {
page: 0,
period: 'week',
weeks: 4,
dataset: 'viirs',
dataset: 'modis',
layerStartDate: null,
layerEndDate: null,
},
Expand Down
2 changes: 1 addition & 1 deletion components/widgets/fires/fires-within/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default {
settings: {
period: 'week',
weeks: 13,
dataset: 'viirs',
dataset: 'modis',
confidence: 'h',
},
settingsBtnConfig: {
Expand Down
7 changes: 0 additions & 7 deletions data/fires-datasets.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
[
{
"label": "VIIRS Alerts",
"value": "viirs",
"unit": "alerts",
"metaKey": null,
"infoText": "VIIRS alerts have a higher resolution, but are less performant in cloudy areas than MODIS alerts"
},
{
"label": "MODIS Alerts",
"value": "modis",
Expand Down

0 comments on commit 34726ef

Please sign in to comment.