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

fix(url): show error if urls dont have protocol and disable test run … #517

Merged
merged 2 commits into from
Nov 3, 2020

Conversation

anusha5695
Copy link
Contributor

@anusha5695 anusha5695 commented Oct 24, 2020

Issue:
URL w/o protocol fails to get fired

Fix:
1.Show error message if urls dont begin with http:// or https://
2.Disable save and run buttons if above error occurs

Question Answer
Bug fix
New feature
Breaking change.
Deprecations
Documentation
Tests added

1. Save and run buttons enabled when no error
image

2. Save and run buttons disabled when base url has errors with red error message
image

3. Save and run buttons disabled when scenario url has errors with red error message
image

Related issues: #461

  • Have extracted constants for error messages, regex, titles, etc.
  • Created isValidUrl function that uses regex for url starting with "http:// and https://" protocol
  • Created common setValidationError and resetValidationError functions that is extensible, so that tomorrow if there are any new validations that have to be added, it' ll work out of the box by just adding the field name. This can also be extracted as a separate framework or helper util

@anusha5695
Copy link
Contributor Author

Hey @enudler, tagging you here

@enudler
Copy link
Collaborator

enudler commented Oct 24, 2020

Hi @anusha5695 thanks again for this great PR
If there is a valid base URL with protocol
the step URL doesn't have to be with protocol

examples

  1. baseUrl: http://www.google.com; stepUrl: /test => GOOD

  2. baeUrl: empty, stepUrl : http://www.google.com => GOOD

  3. baseUrl: http://www.google.com; stepUrl: http://www.google.com/test => GOOD

  4. baseUrl: google.com => BAD

  5. baseUrl: empty; stepUrl: www.google.com => BAD

  6. baseUrl: empty; stepUrl: empty => BAD

@anusha5695
Copy link
Contributor Author

anusha5695 commented Oct 24, 2020

Oh. Sorry will make changes now. @enudler
Just confirming some scenarios that aren't a bit clear

Base : empty , step: empty - BAD
Base : empty , step: http - GOOD
Base : http, step : empty - GOOD
Base : http , step : http - GOOD
Base : www , step: http - ??
Base : http, step: www - ??
Base: www, step: www - BAD

Would you fill in the question marks alone? Just for clarity?

@enudler
Copy link
Collaborator

enudler commented Oct 24, 2020

hi @anusha5695
Base : empty , step: empty - BAD
Base : empty , step: http - GOOD
Base : http, step : empty - GOOD
Base : http , step : http - GOOD
Base : www , step: http - GOOD (step overrides base when protocol used)
Base : http, step: www - GOOD (actually it's bad but I am not sure on an easy way to find this)
Base: www, step: www - BAD

@manorlh
Copy link
Collaborator

manorlh commented Oct 24, 2020

thanks for your PR:)
The input component is not aligned when an error is showed.
think that need to add height for all input components so when there is an error it will be already aligned

Screen Shot 2020-10-24 at 19 02 07

@anusha5695
Copy link
Contributor Author

@enudler @manorlh
Thanks both of you. 👍 will fix both the issues.

@anusha5695
Copy link
Contributor Author

hi @enudler fixed the combination of errors according to this:

Base : empty , step: empty - BAD
Base : empty , step: http - GOOD
Base : http, step : empty - GOOD
Base : http , step : http - GOOD
Base : www , step: http - GOOD
Base : http, step: www - GOOD
Base: www, step: www - BAD


hi @manorlh, sorry couldn't fix the styling feedback immediately though. hurrying for a vacation. could you open a separate bug card. I ll fix the styling once back?

TIA. :)

@manorlh
Copy link
Collaborator

manorlh commented Oct 25, 2020

we can wait for it, we want to avoid inserting bugs to master.
thanks

@enudler
Copy link
Collaborator

enudler commented Oct 30, 2020

hi @anusha5695
are you able to finish this PR?

@enudler enudler linked an issue Nov 3, 2020 that may be closed by this pull request
@enudler enudler merged commit c5250bc into Zooz:master Nov 3, 2020
@anusha5695 anusha5695 deleted the ISSUE-461 branch November 9, 2020 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: Add grafana_url param to settings page
3 participants