Skip to content

Commit

Permalink
Minor UI updates for correlations page (#712) (#713)
Browse files Browse the repository at this point in the history
* minor UI updates

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* add loading state on node click

Signed-off-by: Amardeepsingh Siglani <[email protected]>

---------

Signed-off-by: Amardeepsingh Siglani <[email protected]>
(cherry picked from commit 2f5652f)

Co-authored-by: Amardeepsingh Siglani <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and amsiglan authored Sep 7, 2023
1 parent 52d1be6 commit 6c737ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,14 @@ export class Correlations extends React.Component<CorrelationsProps, Correlation
return;
}

this.setState({ loadingGraphData: true });
const allFindings = await DataStore.correlations.fetchAllFindings();
const detectorType = allFindings[findingId].logType;
const correlations = await DataStore.correlations.getCorrelatedFindings(
findingId,
detectorType
);
this.setState({ specificFindingInfo: correlations });
this.setState({ specificFindingInfo: correlations, loadingGraphData: false });
this.updateGraphDataState(correlations);
};

Expand Down Expand Up @@ -469,7 +470,7 @@ export class Correlations extends React.Component<CorrelationsProps, Correlation
/>
<EuiSpacer />
<EuiTitle size="xs">
<p>Correlated Findings()</p>
<p>Correlated Findings ({findingCardsData.correlatedFindings.length})</p>
</EuiTitle>
<EuiText color="subdued" size="xs">
Higher correlation score indicated stronger correlation.
Expand Down
2 changes: 1 addition & 1 deletion public/store/CorrelationsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export class CorrelationsStore implements ICorrelationsStore {
const correlatedFindings = response.response.findings.map((f) => {
return {
...allFindings[f.finding],
correlationScore: f.score.toExponential(2),
correlationScore: f.score < 0.01 ? '0.01' : f.score.toFixed(2),
};
});
return {
Expand Down

0 comments on commit 6c737ce

Please sign in to comment.