Skip to content

[Security Solution][Exceptions] - Fix exceptions builder validation bug#131989

Merged
yctercero merged 2 commits intoelastic:mainfrom
yctercero:exceptions_builder_validation_bug
May 11, 2022
Merged

[Security Solution][Exceptions] - Fix exceptions builder validation bug#131989
yctercero merged 2 commits intoelastic:mainfrom
yctercero:exceptions_builder_validation_bug

Conversation

@yctercero
Copy link
Copy Markdown
Contributor

@yctercero yctercero commented May 10, 2022

Summary

Addresses #86258

The variable tracking state needed to be cleared on operator change. If you didn't change operators, then invalidating and then validating an entry worked as expected, but if you switched operators, the error state was not being cleared causing the builder to read that there was an error state.

Added cypress test to avoid regressions.

exceptions_bug_fix.mov

Checklist

@yctercero yctercero self-assigned this May 10, 2022
@yctercero yctercero added bug Fixes for quality problems that affect the customer experience release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Security Solution Platform v8.3.0 labels May 10, 2022
@yctercero yctercero marked this pull request as ready for review May 11, 2022 03:59
@yctercero yctercero requested review from a team as code owners May 11, 2022 03:59
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@yctercero
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@dhurley14 dhurley14 left a comment

Choose a reason for hiding this comment

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

LGTM!!

([newOperator]: OperatorOption[]): void => {
const { updatedEntry, index } = getEntryOnOperatorChange(entry, newOperator);

handleError(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I'm understanding this correctly, setting the errorsExist state to false here will allow for the submit button to be enabled, right? Along with the other validations on that text.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct. Essentially the parent builder component was still seeing the error state of the previously selected operator, so even on operator switch and adding a valid value, it read that there was still an error. We need to clear that error state on operator switch.

@kibana-ci
Copy link
Copy Markdown

💚 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
lists 147.0KB 147.0KB +8.0B

History

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

cc @yctercero

@yctercero yctercero merged commit 4235294 into elastic:main May 11, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label May 11, 2022
@yctercero yctercero deleted the exceptions_builder_validation_bug branch August 4, 2022 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting bug Fixes for quality problems that affect the customer experience release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants