Skip to content
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

Merged
merged 10 commits into from
Apr 29, 2021

Conversation

semd
Copy link
Contributor

@semd semd commented Apr 23, 2021

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
Captura de Pantalla 2021-04-23 a les 16 25 28
Captura de Pantalla 2021-04-23 a les 16 25 40
after
Captura de Pantalla 2021-04-23 a les 16 13 44
Captura de Pantalla 2021-04-23 a les 16 17 06

Checklist

Delete any items that are not applicable to this PR.

@semd semd requested review from angorayc and XavierM April 23, 2021 15:05
@semd
Copy link
Contributor Author

semd commented Apr 23, 2021

I am working on adding some test cases for this. I will open the PR when done

@semd semd added bug Fixes for quality problems that affect the customer experience v7.13.0 v7.14.0 v8.0.0 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team labels Apr 26, 2021
@semd semd changed the title added createFrom in action to hide [Security Solutions][Timeline] Added createFrom in action to hide Apr 26, 2021
@cnasikas cnasikas added the release_note:skip Skip the PR/issue when compiling release notes label Apr 26, 2021
@semd semd self-assigned this Apr 26, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@semd
Copy link
Contributor Author

semd commented Apr 27, 2021

@elasticmachine merge upstream

@@ -253,7 +253,10 @@ export const QueryBarDefineRule = ({
}
};

const actionTimelineToHide = useMemo<ActionTimelineToShow[]>(() => ['duplicate'], []);
const actionTimelineToHide = useMemo<ActionTimelineToShow[]>(
Copy link
Contributor

@angorayc angorayc Apr 27, 2021

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();
Copy link
Contributor

@angorayc angorayc Apr 27, 2021

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'], []);
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

@angorayc angorayc left a 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. 👍

Copy link
Contributor

@stephmilovic stephmilovic left a 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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hooray! thank you

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 7.0MB 7.0MB +59.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @semd

@stephmilovic
Copy link
Contributor

stephmilovic commented Apr 28, 2021

let me know if you need help with the backport PRs! you should kick them off as soon as you merge this

@semd semd merged commit 3f48479 into elastic:master Apr 29, 2021
semd added a commit to semd/kibana that referenced this pull request Apr 29, 2021
…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 <42973632+kibanamachine@users.noreply.github.com>
semd added a commit to semd/kibana that referenced this pull request Apr 29, 2021
…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 <42973632+kibanamachine@users.noreply.github.com>
semd added a commit that referenced this pull request Apr 29, 2021
…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 <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
semd added a commit that referenced this pull request Apr 29, 2021
…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 <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team v7.13.0 v7.14.0 v8.0.0
Projects
None yet
6 participants