-
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] [Endpoint] Event filters uses the new card design #114126
[Security Solution] [Endpoint] Event filters uses the new card design #114126
Conversation
</p> | ||
</EuiText> | ||
) : ( | ||
<CardComments comments={artifact.comments} /> |
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.
As this component just displays the show/hide comments button if there is a comment, I'm thinking if we can just render it always and just let the condition for the description (if trustedApp then display description else null). Toughs?
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.
did you forget to set data-test-subj
here?
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.
Left some questions, but overall looks awesome
{artifact.description || getEmptyValue()} | ||
</p> | ||
</EuiText> | ||
{isTrustedApp(item as AnyArtifact) ? ( |
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.
in order to avoid having to carry AnyArtifact
checks, I would suggest adding an optional prop to this component called hideDescription
instead. and maybe a second named hideComments
. By default, both would be shown and then different implementation can hide them. So in Event filters, we would hide the description and in Trusted apps we would hide comments.
Note that if you go down that path, also review the props for the Collapsible card, since it inherits props from here and I don't think these new props would apply there.
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.
Yeah, like it!
return getFormattedComments(comments); | ||
}, [comments]); | ||
|
||
const getButtonText = useCallback( |
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.
🤔 feels like this should just be a useMemo
instead of callback
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.
absolutely
</p> | ||
</EuiText> | ||
) : ( | ||
<CardComments comments={artifact.comments} /> |
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.
did you forget to set data-test-subj
here?
onClick={onCommentsClick} | ||
flush="left" | ||
size="xs" | ||
data-test-subj={getTestId('comments-label')} |
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.
probably don't need the comments
prefix here and below.
x-pack/plugins/security_solution/public/management/components/artifact_entry_card/types.ts
Show resolved
Hide resolved
timelineIcon: ( | ||
<EuiAvatar | ||
size="s" | ||
color={euiLightVars.euiColorLightestShade} |
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.
is this safe? what happens in dark theme? wondering if there is a way to grab the euiColorLIghtestShade
that is theme agonistic?
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 think I can use the useTheme hook but not sure at all. Will try it
export const getFormattedComments = (comments: CommentsArray): EuiCommentProps[] => { | ||
return comments.map((commentItem) => ({ | ||
username: commentItem.created_by, | ||
timestamp: moment(commentItem.created_at).format('MMM D, YYYY'), |
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.
is this what they use in Exceptions? or are they using one of the Date formatters we define here: x-pack/plugins/security_solution/public/common/components/formatted_date/index.tsx
(look at the <PreferenceFormattedDate />
or (my favorite) <FormattedRelativePreferenceDate />
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.
Yes, this is a copy paste from the exception. I will take a look at the others, thanks
@elasticmachine merge upstream |
Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt) |
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. Awesome to see Event Filters cards match that of Trusted apps.
🚢
import { usePolicyNavLinks } from './hooks/use_policy_nav_links'; | ||
import { MaybeImmutable } from '../../../../common/endpoint/types'; | ||
|
||
export interface ArtifactEntryCardProps extends CommonProps { | ||
export interface CommonArtifactEntryCardProps extends CommonProps { |
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.
++1 on the name change
@@ -44,6 +46,14 @@ export const getExceptionProvider = () => { | |||
}, | |||
], | |||
tags: ['policy:all'], | |||
comments: [ | |||
{ | |||
id: uuid.v4(), |
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'm assuming it does not matter at this point, maybe because we are not looking for this data, but we might want to make this id
and the created_at
values static so that they are always the same for testing
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / general / X-Pack Detection Engine API Integration Tests.x-pack/test/detection_engine_api_integration/security_and_spaces/tests/aliases·ts.detection engine api security and spaces enabled Tests involving aliases of source indexes and the signals index should keep the original alias value such as "host_alias" from a source index when the value is indexedStandard Out
Stack Trace
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
…elastic#114126) * Adds new card design to event filters and also adds comments list * Adds nested comments * Hides comments if there are no commentes * Fixes i18n check error because duplicated key * Fix wrong type and unit test * Fixes ts error * Address pr comments and fix unit tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…#114126) (#114772) * Adds new card design to event filters and also adds comments list * Adds nested comments * Hides comments if there are no commentes * Fixes i18n check error because duplicated key * Fix wrong type and unit test * Fixes ts error * Address pr comments and fix unit tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: David Sánchez <davidsansol92@gmail.com>
…ide-users-to-saving-ux * 'master' of github.com:elastic/kibana: (133 commits) [DOCS] Indicate reports are a subscription feature (elastic#114653) Update namespace for indices (elastic#114612) [DOCS] Adds Logstash pipeline settings (elastic#114648) Bump EPR snapshot version used for tests (elastic#114529) [Security Solution] [Endpoint] Fleet summary card adjustments (elastic#114291) skip flaky suite (elastic#68400) [Visualizations] fix usage of optional dependencies (elastic#114286) [Security Solution] [Detections] Improves custom query rule upgrade test (elastic#114454) [fleet] Add Integration Preference selector (elastic#114432) [Reporting] Add new `data-render-error` attribute (elastic#114472) Replace EuiCodeEditor with CodeEditor in app-services code (elastic#114316) [data views] add getDefaultDataView method (elastic#113891) [Security Solution] [Endpoint] Event filters uses the new card design (elastic#114126) [fleet] Tweak Header UI (elastic#114704) [APM] Filter on tx metrics for instance stats (elastic#114758) [APM] Fix typo in linting docs (elastic#114764) [Discover] Removing SavedObject usage for savedSearch (elastic#112983) [Fleet] Add Integration Policy Page Improvements (elastic#114556) [Lens] Keep the custom label when transitioning to/from Formula (elastic#114270) [Security Solution][Endpoint] Host Isolation API changes (elastic#113621) ...
Summary
WIP
For maintainers