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

Disable sending empty ticket / project #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Disable sending empty ticket / project #10

wants to merge 1 commit into from

Conversation

alenkacz
Copy link
Collaborator

But I am afraid you are not going to like it. Also ... not sure, that this is the right way to test, that resource was not added (and XHR request was not fired)

@vojtajina
Copy link
Owner

Why are you sending pull request with something you think I don't like ? :-D

I can see three ways of doing this:

  1. in the controller, which means you have to do it twice and test it twice as well (tickets, projects)
  2. in the $resource service - must be general
  3. as form validation

The third option sounds as the best solution to me, unfortunately, there isn't currently enough flexible form system in angular which would allow us to make it easily... (Misko is working hard on that...)

So I like your decision to do it in $resource, but then, it must be flexible enough...

Your code does not send empty ticket, which is fine, but it allows me to create a project with empty name, that's odd...

$resource service is general purpose service, it knows nothing about tickets neither projects. So we need to add a configuration property, something like "mandatory fields" and then, if any of mandatory field is empty ignore creating...

WRT test, I commented in the commit...

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.

2 participants