Skip to content

Commit

Permalink
Merge pull request #4725 from wri/develop
Browse files Browse the repository at this point in the history
Deploy
  • Loading branch information
willian-viana authored Nov 9, 2023
2 parents 9fafaae + b8e4d93 commit 42624ca
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 520 deletions.
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

0 comments on commit 42624ca

Please sign in to comment.