-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Endpoint] ERT-82 Alerts search bar #59702
Conversation
Pinging @elastic/endpoint-response (Team:Endpoint Response) |
Pinging @elastic/endpoint-app-team (Feature:Endpoint) |
Would love to talk about what tests you want to put in for this, what we think is warranted and useful. If you can help find and link file for the search bar component that we're re-using that would help to know what tests it already has so we can focus this pr to testing only what is needed and at what right level. |
query: request.query.query, | ||
query: | ||
request.query.query !== undefined | ||
? ((decode(request.query.query) as unknown) as Query) |
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.
Does decode
need any error handling or anything? Curious because this will have typescript trust that the value is a Query. What happens if the decode fails?
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.
@oatkiller In this case, the schema will have already validated the input, so we should be okay, no? Or do you think we should handle this differently? In any case, we should have API-level tests to check for a 400
and ensure there's no 500
when invalid input is provided. @peluja1012 <<<
export const alertMiddlewareFactory: MiddlewareFactory<AlertListState> = (coreStart, depsStart) => { | ||
async function fetchIndexPatterns(): Promise<IIndexPattern[]> { | ||
const { indexPatterns } = depsStart.data; | ||
// TODO: what's the best way to get the index pattern? |
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.
this seems fine
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.
removed
uiQueryParams, | ||
({ query }) => { | ||
if (query !== undefined) { | ||
return (decode(query) as unknown) as Query; |
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.
this unsafe cast makes me think we might need error handling
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.
@@ -48,37 +49,37 @@ export const substateMiddlewareFactory = <Substate>( | |||
}; | |||
}; | |||
|
|||
export const appStoreFactory: ( | |||
export const appStoreFactory: (middlewareDeps?: { |
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.
Could you add a doc comment here explaining the behavior when no middleware deps are passed
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.
done
8b07361
to
8008245
Compare
@@ -44,10 +43,10 @@ export const alertingIndexGetQuerySchema = schema.object( | |||
schema.string({ | |||
validate(value) { | |||
try { | |||
fromKueryExpression(value); | |||
decode(value); |
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.
Shouldn't this be decoded and then run through fromKueryExpression
still? To check both cases? Or are we changing the format of query
?
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.
@madirey We're changing the format of query to be of type Query
, which has a query
and a language
(kql or lucene)
ae84cea
to
c76d52e
Compare
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* master: [Alerting] extend Alert Type with names/descriptions of action variables (elastic#59756) [Ingest] Fix data source creation and double system data source (elastic#60069) Add button to view full service map (elastic#59394) unskip tests for code coverage (elastic#59725) [Ingest] Add Fleet & EPM features (elastic#59376) [Logs UI] Show navigation bar while loading source configurati… (elastic#59997) [Endpoint] ERT-82 Alerts search bar (elastic#59702) Aggregate queue types being used by Beats (elastic#59850) skip flaky suite (elastic#59541) Convert Timeline to TypeScript (elastic#59966) Make context.core required argument to context providers (elastic#59996)
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
* Add SearchBar UI. Query, filter, and dateRange work * Sync url with search bar, fix excluded filters on BE * fix welcome title * Use KibanaReactContext, fix indexPattern fetch * Mock data plugin, api and ui tests pass * Add view and functional tests * use observables to handle filter updates * address comments
Summary
Integrates Stateful Search Bar (from
kibana/src/plugins/data
) into the Endpoint App's Alerts page. This PR also syncs the Search Bar's state with the browser url.Checklist
Delete any items that are not applicable to this PR.
For maintainers