-
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
[Actions] Removing placeholders and updating validation messages on connector forms #82734
Conversation
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
@gchaps Do the updated URL validation messages look ok? |
UX improvement is great, but I think it make sense to split the validation to the |
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. |
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:
|
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. |
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.
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" |
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.
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.
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.
Added URL and protocol validation to the slack webhook url
@elasticmachine merge upstream |
@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. 👍 |
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.
LGTM 👍
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
…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]>
…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]>
* 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)
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://
)IBM Resilient Connector (requires
https://
)ServiceNow Connector (requires
https://
)