Skip to content

Commit

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

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* add loading state on node click

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 2f5652f)

Co-authored-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
  • Loading branch information
opensearch-trigger-bot[bot] and amsiglan committed Nov 30, 2023
1 parent 1d2f409 commit 5a46e04
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 5a46e04

Please sign in to comment.