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
[Security Solution][Rule details] - Updates rule details page to allow tabs to be a part of url #139592
Conversation
Pinging @elastic/security-solution (Team: SecuritySolution) |
...k/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx
Outdated
Show resolved
Hide resolved
...k/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @yctercero, for addressing all the comments 🙌
Tested locally and found one last thing. Rule IDs are becoming a part of APM transaction names:
Rule IDs are high cardinality fields and should not be propagated to the execution context. Otherwise, it would be very hard to analyze APM transactions as similar pages wouldn't be appropriately grouped. To fix that, please apply the following diff, it replaces rule IDs with the :detailName
placeholder:
diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx
index fedeb9a1e9c..4dd6f6c9e92 100644
--- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx
+++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx
@@ -805,7 +805,7 @@ const RuleDetailsPageComponent: React.FC<DetectionEngineComponentProps> = ({
</Display>
<StyledMinHeightTabContainer>
<Switch>
- <Route path={`/rules/id/${ruleId}/:tabName(${RuleDetailTabs.alerts})`}>
+ <Route path={`/rules/id/:detailName/:tabName(${RuleDetailTabs.alerts})`}>
<>
<EuiFlexGroup alignItems="center" justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
@@ -855,7 +855,7 @@ const RuleDetailsPageComponent: React.FC<DetectionEngineComponentProps> = ({
)}
</>
</Route>
- <Route path={`/rules/id/${ruleId}/:tabName(${RuleDetailTabs.exceptions})`}>
+ <Route path={`/rules/id/:detailName/:tabName(${RuleDetailTabs.exceptions})`}>
<ExceptionsViewer
ruleId={ruleId ?? ''}
ruleName={rule?.name ?? ''}
@@ -867,10 +867,10 @@ const RuleDetailsPageComponent: React.FC<DetectionEngineComponentProps> = ({
onRuleChange={refreshRule}
/>
</Route>
- <Route path={`/rules/id/${ruleId}/:tabName(${RuleDetailTabs.executionResults})`}>
+ <Route path={`/rules/id/:detailName/:tabName(${RuleDetailTabs.executionResults})`}>
<ExecutionLogTable ruleId={ruleId} selectAlertsTab={navigateToAlertsTab} />
</Route>
- <Route path={`/rules/id/${ruleId}/:tabName(${RuleDetailTabs.executionEvents})`}>
+ <Route path={`/rules/id/:detailName/:tabName(${RuleDetailTabs.executionEvents})`}>
<ExecutionEventsTable ruleId={ruleId} />
</Route>
</Switch>
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! branch tested, all looks good 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Awesome work! LGTM! 🚀
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @yctercero |
…w tabs to be a part of url (elastic#139592) ## Summary Similar to how the Hosts page maintains the tab state in the URL, recreating that in the rule details page. This is in anticipation of some of the exceptions UI changes being worked on where this would create a better user experience.
Summary
Similar to how the Hosts page maintains the tab state in the URL, recreating that in the rule details page. This is in anticipation of some of the exceptions UI changes being worked on where this would create a better user experience.
tabName
param default to theAlerts
tab (this is exactly what happens now, so no change in functionality now)/app/security/rules/id/fbfc7b80-2551-11ed-ac93-0fcc3d73cc25/rule_exceptions
Testing
Alerts
tab activeAlerts
and applies expected filterChecklist