Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLAG-965] Fix VIIRS dropdown #4721

Merged
merged 8 commits into from
Nov 8, 2023
20 changes: 16 additions & 4 deletions components/widgets/fires/fires-alerts-cumulative/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const getSentences = (state) => state.sentences || null;
const getLocationName = (state) => state.locationLabel;
const getOptionsSelected = (state) => state.optionsSelected;
const getIndicator = (state) => state.indicator;
const getSettings = (state) => state.settings;

export const getCompareYears = createSelector(
[getCompareYear, getAllYears],
Expand Down Expand Up @@ -401,9 +402,9 @@ export const parseSentence = createSelector(
getDataset,
getLocationName,
getStartIndex,
// getEndIndex,
getOptionsSelected,
getIndicator,
getSettings,
],
(
raw_data,
Expand All @@ -413,18 +414,29 @@ export const parseSentence = createSelector(
dataset,
location,
startIndex,
// endIndex //broken?
options,
indicator
indicator,
settings
) => {
if (!data || isEmpty(data)) return null;

const {
highConfidence,
allAlerts,
highConfidenceWithInd,
allAlertsWithInd,
} = sentences;
const { confidence } = options;
const { confidenceToggle } = settings;
let { confidence } = options;

/*
Validation for the Analysis
*/
if (confidenceToggle) {
confidence =
confidenceToggle === 'true' ? { value: 'h' } : { value: 'all' };
}

const indicatorLabel =
indicator && indicator.label ? indicator.label : null;
const start = startIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const getAlerts = (state) => state.data;
const getColors = (state) => state.colors || null;
const getStartDate = (state) => state.settings.startDate;
const getEndDate = (state) => state.settings.endDate;
const getSettings = (state) => state.settings;
const getSentences = (state) => state.sentences || null;
const getLocationObject = (state) => state.location;
const getOptionsSelected = (state) => state.optionsSelected;
Expand Down Expand Up @@ -87,6 +88,7 @@ export const parseSentence = createSelector(
getEndDate,
getOptionsSelected,
getIndicator,
getSettings,
],
(
data,
Expand All @@ -96,11 +98,24 @@ export const parseSentence = createSelector(
startDate,
endDate,
options,
indicator
indicator,
settings
) => {
if (!data) return null;
const { initial, withInd, highConfidence } = sentences;
const { confidence, dataset } = options;
const { confidenceToggle } = settings;
const { dataset } = options;

let { confidence } = options;

/*
Validation for the Analysis
*/
if (confidenceToggle) {
confidence =
confidenceToggle === 'true' ? { value: 'h' } : { value: 'all' };
}

const indicatorLabel =
indicator && indicator.label ? indicator.label : null;
const total = sumBy(data, 'alert__count');
Expand Down
288 changes: 0 additions & 288 deletions components/widgets/fires/fires-alerts-historical-old/index.js

This file was deleted.

Loading
Loading