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

T667 validate unique project name in creation form #299

Merged
merged 6 commits into from
Apr 7, 2017

Conversation

OndraZizka
Copy link
Contributor

Still something is missing, not sure what

@klinki
Copy link
Collaborator

klinki commented Apr 6, 2017

@OndraZizka I'm afraid this will require async server based validation and AFAIK it is not currently supported by Angular :(

Edit: Yep, situation still hasn't changed. See those issues:
angular/angular#6895
angular/angular#9119
angular/angular#8923

(I'm kind of monitoring this, because I already wanted to do that, but currently it seems either not possible at all or possible with some very hacky complicated workarounds :( )

@OndraZizka
Copy link
Contributor Author

@klinki
Copy link
Collaborator

klinki commented Apr 6, 2017

Give it a try. Maybe it won't be such a big problem as I thought... It has been while since I last tried to do something similar, so maybe there is some solution now.

@jsight
Copy link
Member

jsight commented Apr 6, 2017

@klinki - We have been doing async server-side validation for the file paths for a long time now. :)

I sent @OndraZizka a PR to fix the issues here yesterday. It seemed to work?

@klinki
Copy link
Collaborator

klinki commented Apr 6, 2017

@jsight Yep, I realized that now. But I think we are using 2 kinds of forms - template driven and class driven? So maybe it doesn't work for one of them... But maybe this is not an issue after all.

I think I might have mistaken the issue with different one - I remember I wanted to do similar thing once, but I wanted to use debounceTime on input, to limit number of validation requests. So I guess the issue is with async input for validation.

Sorry for causing confusion.

@jsight
Copy link
Member

jsight commented Apr 6, 2017

@klinki - No worries... I actually sent him a PR last night that seemed to make it work: OndraZizka#4

@jsight
Copy link
Member

jsight commented Apr 6, 2017

@klinki - Interestingly, when I did the file validator, I actually did model driven in large part because I thought that it wasn't possible to do it as a directive. I think that I was probably wrong back then, too. :)

@klinki
Copy link
Collaborator

klinki commented Apr 6, 2017

@jsight Anyway, based on github issues, there are still multiple problems with async validation. But in our case, we are lucky enough by not having multiple validation steps on single field, so those issues don't affect us that much :) (especially one with race conditions among sync/async validation results)

@jsight
Copy link
Member

jsight commented Apr 6, 2017

@klinki - Haha, yeah, I can imagine that it could get complicated if we had more complex requirements.

…tName

Ondra zizka t667 validator dupl project name
@OndraZizka OndraZizka merged commit 7dfb64d into windup:master Apr 7, 2017
@OndraZizka OndraZizka deleted the T667-validatorDuplProjectName branch April 7, 2017 17:47
@klinki
Copy link
Collaborator

klinki commented Apr 7, 2017

@jsight Now the fun begins - we will have 2 validators :) sync for length and async for project name...

@jsight
Copy link
Member

jsight commented Apr 7, 2017

@klinki I didn't have any problems with them when I tested it. Obviously that wasn't comprehensive, though.

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.

3 participants