Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fix bug where undefined is shown on UI for estimatedMins in case of ingestion data missing #301

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion public/pages/DetectorResults/containers/AnomalyResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ export function AnomalyResults(props: AnomalyResultsProps) {
};

const getInitProgressMessage = () => {
return detector && isDetectorInitializing && detector.initProgress
return detector &&
isDetectorInitializing &&
detector.initProgress &&
Copy link
Contributor

@ylwu-amzn ylwu-amzn Sep 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use lodash get ?
get(detector, 'initProgress. estimatedMinutesLeft')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will use it

Copy link
Contributor

@ohltyler ohltyler Sep 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, probably many places within this page and other places in the plugin where we should change to use lodash get to make it simpler

detector.initProgress.estimatedMinutesLeft
? `The detector needs ${detector.initProgress.estimatedMinutesLeft} minutes for initializing. If your data stream is not continuous, it may take even longer. `
: '';
};
Expand Down