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

[Actions] Removing placeholders and updating validation messages on connector forms #82734

Merged
merged 9 commits into from
Nov 12, 2020

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Nov 5, 2020

Resolves #81943

Summary

On connector forms, placeholders were used in URL fields. Removed the inconsistent placeholders and updated the URL validation message to be more specific. Screenshots attached of the validation messages:

JIRA Connector (requires https://)
Screen Shot 2020-11-06 at 8 50 06 AM
Screen Shot 2020-11-06 at 8 31 24 AM

IBM Resilient Connector (requires https://)
Screen Shot 2020-11-06 at 8 49 46 AM
Screen Shot 2020-11-06 at 8 49 54 AM

ServiceNow Connector (requires https://)
Screen Shot 2020-11-06 at 8 50 06 AM
Screen Shot 2020-11-06 at 8 51 05 AM

@ymao1 ymao1 changed the title Removing placeholders. Updating validation messages [Actions] Removing placeholders and updating validation messages on connector forms Nov 5, 2020
@ymao1 ymao1 self-assigned this Nov 5, 2020
@ymao1 ymao1 added Feature:Actions release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 v8.0.0 labels Nov 5, 2020
@ymao1 ymao1 marked this pull request as ready for review November 5, 2020 17:54
@ymao1 ymao1 requested a review from a team as a code owner November 5, 2020 17:54
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@ymao1
Copy link
Contributor Author

ymao1 commented Nov 5, 2020

@gchaps Do the updated URL validation messages look ok?

@YulNaumenko
Copy link
Contributor

UX improvement is great, but I think it make sense to split the validation to the Valid URL and Valid URL protocol. Because currently the message is URL is invalid. URL must start with http:// or https:// will appear in all cases. What if we have just invalid URL but the correct protocol?

@gchaps
Copy link
Contributor

gchaps commented Nov 5, 2020

I'd remove "URL is invalid" and just go with the line "URL must start with http//." This is a sentence, so should end with a period.

@ymao1
Copy link
Contributor Author

ymao1 commented Nov 6, 2020

I think it make sense to split the validation to the Valid URL and Valid URL protocol. Because currently the message is URL is invalid. URL must start with http:// or https:// will appear in all cases. What if we have just invalid URL but the correct protocol?

Good call on splitting up the validation! Pushed changes to do this and updated the screenshots.

I did notice that the URL validation doesn't actually fail on invalid URLs:

  • If I enter a URL with spaces like http://i have a space, the URL parser auto-replaces the spaces with %20
  • If I enter a URL with backslashes like http://google\.com, the URL parser parses it to http://goog but doesn't fail the validation.

@gchaps
Copy link
Contributor

gchaps commented Nov 6, 2020

For the validation messages that simply say "URL is invalid" can we give some advice on what is needed to make it valid?

@ymao1
Copy link
Contributor Author

ymao1 commented Nov 6, 2020

For the validation messages that simply say "URL is invalid" can we give some advice on what is needed to make it valid?

Maybe we can create a separate issue to improve the URL validation and update the message? So far, I've only see the "URL is invalid" message for inputs that don't have an http or https protocol.

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -47,7 +47,6 @@ const SlackActionFields: React.FunctionComponent<ActionConnectorFieldsProps<
isInvalid={errors.webhookUrl.length > 0 && webhookUrl !== undefined}
name="webhookUrl"
readOnly={readOnly}
placeholder="Example: https://hooks.slack.com/services"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: For a Slack webhook URL we should not be able to pass non https protocol or invalid URL. But we don't have URL validation on the API level and on the UI level. I think it would be nice to have it here. Anyway, we have a documentation for a Slack configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added URL and protocol validation to the slack webhook url

@gmmorris gmmorris self-requested a review November 10, 2020 14:13
@ymao1
Copy link
Contributor Author

ymao1 commented Nov 11, 2020

@elasticmachine merge upstream

@ymao1
Copy link
Contributor Author

ymao1 commented Nov 11, 2020

UX improvement is great, but I think it make sense to split the validation to the Valid URL and Valid URL protocol. Because currently the message is URL is invalid. URL must start with http:// or https:// will appear in all cases. What if we have just invalid URL but the correct protocol?

@YulNaumenko I started making an issue for this but looked into why the current validation is not failing URLs with spaces or backslashes and it looks like the link you sent is Google's rules for invalid URLs and not a broad definition of invalid URLs. Spaces and backslashes are allowed generally in URLs, which is why when we use the Typescript URL object for validation, it does not fail. Do you think this is still an issue worth investigating more? We would likely have to write our own URL validator for more custom behavior. Have we had issues with users specifying invalid URLs in connectors?

@YulNaumenko
Copy link
Contributor

YulNaumenko commented Nov 12, 2020

UX improvement is great, but I think it make sense to split the validation to the Valid URL and Valid URL protocol. Because currently the message is URL is invalid. URL must start with http:// or https:// will appear in all cases. What if we have just invalid URL but the correct protocol?

@YulNaumenko I started making an issue for this but looked into why the current validation is not failing URLs with spaces or backslashes and it looks like the link you sent is Google's rules for invalid URLs and not a broad definition of invalid URLs. Spaces and backslashes are allowed generally in URLs, which is why when we use the Typescript URL object for validation, it does not fail. Do you think this is still an issue worth investigating more? We would likely have to write our own URL validator for more custom behavior. Have we had issues with users specifying invalid URLs in connectors?

I think we can skip this validation till we get the real issue. 👍

Copy link
Contributor

@gmmorris gmmorris left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@ymao1
Copy link
Contributor Author

ymao1 commented Nov 12, 2020

@elasticmachine merge upstream

@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
triggersActionsUi 1.4MB 1.4MB -207.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 140.0KB 141.9KB +1.9KB

History

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

@ymao1 ymao1 merged commit 3412843 into elastic:master Nov 12, 2020
ymao1 added a commit to ymao1/kibana that referenced this pull request Nov 12, 2020
…onnector forms (elastic#82734)

* Removing placeholders. Updating validation messages

* Splitting out url and protocol validation

* Adding url validation for slack webhook urls

* Fixing test

Co-authored-by: Kibana Machine <[email protected]>
ymao1 added a commit that referenced this pull request Nov 12, 2020
…onnector forms (#82734) (#83336)

* Removing placeholders. Updating validation messages

* Splitting out url and protocol validation

* Adding url validation for slack webhook urls

* Fixing test

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Nov 16, 2020
* master:
  [Security Solution][Detections] Adds framework for replacing API schemas (elastic#82462)
  [Enterprise Search] Share Loading component (elastic#83246)
  Consolidates Jest configuration files and scripts (elastic#82671)
  APM header changes (elastic#82870)
  [Security Solutions] Adds a default for indicator match custom query of *:* (elastic#81727)
  [Security Solution] Note 10k object paging limit on Endpoint list (elastic#82889)
  [packerCache] fix gulp usage, don't archive node_modules (elastic#83327)
  Upgrade Node.js to version 12 (elastic#61587)
  [Actions] Removing placeholders and updating validation messages on connector forms (elastic#82734)
  [Fleet] Rename ingest_manager_api_integration tests fleet_api_integration (elastic#83011)
  [DOCS] Updates Discover docs (elastic#82773)
  [ML] Data frame analytics: Adds map view (elastic#81666)
  enables actions scoped within the stack to register at Basic license (elastic#82931)
@mikecote mikecote added release_note:enhancement and removed release_note:skip Skip the PR/issue when compiling release notes labels Dec 16, 2020
@ymao1 ymao1 deleted the actions/placeholders branch February 4, 2021 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Actions release_note:enhancement Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent and hard to read placeholders used in connector forms
7 participants