-
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 Solutions][Timeline] Added createFrom in action to hide #98144
[Security Solutions][Timeline] Added createFrom in action to hide #98144
Conversation
I am working on adding some test cases for this. I will open the PR when done |
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
@elasticmachine merge upstream |
@@ -253,7 +253,10 @@ export const QueryBarDefineRule = ({ | |||
} | |||
}; | |||
|
|||
const actionTimelineToHide = useMemo<ActionTimelineToShow[]>(() => ['duplicate'], []); | |||
const actionTimelineToHide = useMemo<ActionTimelineToShow[]>( |
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 doesn't change, please consider put this as a constant and move out of the component.
const actionTimelineToHide = ['duplicate', 'createFrom'];
wrapper.find('[data-test-subj="settings-plus-in-circle"]').last().simulate('click'); | ||
expect(wrapper.find('[data-test-subj="create-default-btn"]').exists()).toBeTruthy(); | ||
}); | ||
wrapper.find('[data-test-subj="settings-plus-in-circle"]').last().simulate('click').update(); |
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 for fixing the tests!! Could we try putting back waitFor
and just moving ...simulate(click)
out of waitFor? If that works fine, let's apply this to rest of the tests in this file.
@@ -47,6 +48,8 @@ const AddTimelineButtonComponent: React.FC<AddTimelineButtonComponentProps> = ({ | |||
[onButtonClick] | |||
); | |||
|
|||
const actionTimelineToHide = useMemo<ActionTimelineToShow[]>(() => ['createFrom'], []); |
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.
We could put this as a constant and move out of the component as well.
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 👍
I was thinking to do so, but I followed the same way as it was in query_bar
…hub.com/semd/kibana into sergi-hide_create_template_action-97093
…_template_action-97093
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 for fixing this, looks good to merge. 👍
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.
Fantastic first PR @semd! Thank you for taking the time to write thorough tests and fix flakey ones. Great work, so happy to have you on the team. LGTM! 🏁 🏎️ 🎆 🥳 🇪🇸 🥇
@@ -59,7 +59,7 @@ describe('QueryBarDefineRule', () => { | |||
expect(wrapper.dive().find('[data-test-subj="query-bar-define-rule"]')).toHaveLength(1); | |||
}); | |||
|
|||
it('renders import query from saved timeline modal with no timeline action correctly', () => { | |||
it('renders import query from saved timeline modal actions hidden correctly', () => { |
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.
hooray! thank you
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @semd |
let me know if you need help with the backport PRs! you should kick them off as soon as you merge this |
…astic#98144) * added createFrom in action to hide * prettier configured * tests to check timeline modal table actions * test changes and contant extract * removed unused dependency * prevent adding empty column to timeline table when no action need * test updated Co-authored-by: Kibana Machine <[email protected]>
…astic#98144) * added createFrom in action to hide * prettier configured * tests to check timeline modal table actions * test changes and contant extract * removed unused dependency * prevent adding empty column to timeline table when no action need * test updated Co-authored-by: Kibana Machine <[email protected]>
…8144) (#98713) * added createFrom in action to hide * prettier configured * tests to check timeline modal table actions * test changes and contant extract * removed unused dependency * prevent adding empty column to timeline table when no action need * test updated Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
…8144) (#98714) * added createFrom in action to hide * prettier configured * tests to check timeline modal table actions * test changes and contant extract * removed unused dependency * prevent adding empty column to timeline table when no action need * test updated Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
Summary
Create template from timeline action button hidden in the "open timeline" and "Import query from saved timeline" modals.
This is a fix for the issue: 97093
As I needed to add a test case, I also changed and unskipped the test that was skipped in: 96691🤞
before
after
Checklist
Delete any items that are not applicable to this PR.