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_SOLUTION][ENDPOINT] Trusted App Create Form show inline validations errors #78305

Conversation

paul-tavares
Copy link
Contributor

Summary

Display form validation errors inline with the appropriate form fields. Validation are only displayed after the user has"visited" (clicked into/out of) a field. Required fields are also marked as such and thus display the EUI required field indicator (red bottom border).

emt-252-trusted-app-create-form-validations

In addition: this PR also removes use of snapshot tests in Trusted Apps page view

Checklist

Delete any items that are not applicable to this PR.

@paul-tavares paul-tavares added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Endpoint Management Feature:Endpoint Elastic Endpoint feature v7.10.0 labels Sep 23, 2020
@paul-tavares paul-tavares requested review from a team as code owners September 23, 2020 15:30
@paul-tavares paul-tavares self-assigned this Sep 23, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-management (Team:Endpoint Management)

@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-app-team (Feature:Endpoint)

@kevinlog
Copy link
Contributor

LGTM, just looks like some test and type errors

@paul-tavares
Copy link
Contributor Author

Thanks @kevinlog . yes, the CI errors were expected and should now (that I pushed the tests) be addressed.

…ted-app-create-form-validations

# Conflicts:
#	x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/__snapshots__/trusted_apps_page.test.tsx.snap
const [formValues, setFormValues] = useState<NewTrustedApp>({
name: '',
os: 'windows',
entries: [generateNewEntry()],
description: '',
});

const [validationResult, setValidationResult] = useState<ValidationResult>(() =>
Copy link
Contributor

Choose a reason for hiding this comment

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

when are we using react's state vs redux state?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😝 answer here 👉 https://www.elastic.co/about/our-source-code#it-depends


😄 to expand on my reasoning:

For this one - the entire thing - it was developed as a "pure" component and it is not tied to the Store. I did not see the benefit of storing this in Redux while the data is being collected from the user. Another reason, but one that really would probably not have convinced me to change the approach, was that at the time I started it, the trusted apps store setup was not yet available (pending PR).

Copy link
Contributor

@parkiino parkiino left a comment

Choose a reason for hiding this comment

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

lgtm

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id value diff baseline
securitySolution 10.2MB +8.0KB 10.2MB

History

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

@paul-tavares paul-tavares merged commit 41927d9 into elastic:master Sep 24, 2020
@paul-tavares paul-tavares deleted the task/emt-252-trusted-app-create-form-validations branch September 24, 2020 16:25
paul-tavares added a commit to paul-tavares/kibana that referenced this pull request Sep 24, 2020
…idations errors (elastic#78305)

* Updated structure for `ValidationResult` type
* show errors on the ui if field is invalid
* Support for tracking visited fields
* Remove use of Snapshots in Trusted Apps tests

# Conflicts:
#	x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/__snapshots__/trusted_apps_page.test.tsx.snap
paul-tavares added a commit that referenced this pull request Sep 25, 2020
…idations errors (#78305) (#78449)

* Updated structure for `ValidationResult` type
* show errors on the ui if field is invalid
* Support for tracking visited fields
* Remove use of Snapshots in Trusted Apps tests


Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Endpoint Elastic Endpoint feature release_note:skip Skip the PR/issue when compiling release notes v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants