zulip-desktop icon indicating copy to clipboard operation
zulip-desktop copied to clipboard

server_form: Added autocomplete function to url.

Open aryanshridhar opened this issue 4 years ago • 2 comments

Added functionality for autocomplete when the user only passes a Organization URL string . As discussed here :

The following interpretation is made keeping the rest as it is : foo → https://foo.zulipchat.com

Fixes #1012

You have tested this PR on:

  • [ ] Windows
  • [x] Linux/Ubuntu
  • [ ] macOS

aryanshridhar avatar Nov 18 '20 19:11 aryanshridhar

I think when the user enters the actual Url that is https://foo.zulipchat.com your code would still add the suffix and prefix.

https://foo.zulipchat.com →https://https://foo.zulipchat.com.zulipchat.com

That's interesting ! , It returns false when such a Url is passed , hence not adding the suffix and prefix.

> const pattern = /^[a-zA-Z\d-]*$/;
undefined
> pattern.test("https://foo.zulipchat.com");
false
> 

aryanshridhar avatar Dec 27 '20 15:12 aryanshridhar

Heads up @aryanshridhar, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main branch and resolve your pull request's merge conflicts accordingly.

zulipbot avatar Nov 24 '21 02:11 zulipbot