-
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
[Security Solution] Case ui enhancement #91863
Changes from 24 commits
4803fcf
c1acfba
fab3950
9b80fa9
6dc3ca6
5e8dcc3
46335f0
baef996
0ed83b3
0bddbf9
d7107bd
e0c29b7
5342462
f412d15
b9da2f9
8e0251e
08e3516
6986423
46e4684
385a6fa
d7554cd
1d4f9ab
067b20e
94da327
e1c285f
c1508ba
a453269
a812a98
f4624bc
d05c171
89be6cf
173dac0
a6c372c
b250898
92a57fd
efdaf6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import { | |
CasesFindRequestRt, | ||
throwErrors, | ||
caseStatuses, | ||
AllCaseType, | ||
} from '../../../../common/api'; | ||
import { transformCases, wrapError, escapeHatch } from '../utils'; | ||
import { RouteDeps } from '../types'; | ||
|
@@ -37,17 +38,14 @@ export function initFindCasesApi({ caseService, router, logger }: RouteDeps) { | |
CasesFindRequestRt.decode(request.query), | ||
fold(throwErrors(Boom.badRequest), identity) | ||
); | ||
|
||
const queryArgs = { | ||
tags: queryParams.tags, | ||
reporters: queryParams.reporters, | ||
sortByField: queryParams.sortField, | ||
status: queryParams.status, | ||
status: queryParams.status === AllCaseType ? undefined : queryParams.status, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if the status is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we use status to build query statement, if it is undefined, it won't appear in the statement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm could we instead not pass |
||
caseType: queryParams.type, | ||
}; | ||
|
||
const caseQueries = constructQueryOptions(queryArgs); | ||
|
||
const cases = await caseService.findCasesGroupedByID({ | ||
client, | ||
caseOptions: { ...queryParams, ...caseQueries.case }, | ||
|
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.
Do you think there's a way we could avoid adding
all
to the status types? If we add it here that means a case could potentially have a status of typeall
which wouldn't really make sense 🤔Would it be easy to have the API call from the front end just not include any status in the query parameters? On the backend we'll automatically get all of them.
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.
@angorayc I agree with @jonathan-buttner . It will nice if we can avoid it.
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.
I see how you meant. I have
CaseStatusRt
that doesn't includeall
for cases, and useCaseStatusFilterRt
just for rendering the filter relevant stuff.I also remove the status from api call if the filter is set to
all
. Hope this makes it a bit clearer.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.
@angorayc As we discuss I removed the
CaseStatusFilterRt
.