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

Form fixes #2000

Merged
merged 11 commits into from Jan 29, 2019
Merged

Form fixes #2000

merged 11 commits into from Jan 29, 2019

Conversation

noirbizarre
Copy link
Contributor

@noirbizarre noirbizarre commented Jan 28, 2019

This PR fixes some major bugs in forms:

  • forms errors were mispositionned and not injected into vue.js forms
  • server side error were silently ignored
  • success notification was always dispatched even on on transport or server-side error
  • some forms were using 2 differents models (Dataset and Resource) for the same thing
  • some forms were never able to dispatch a success notification
  • hide-notification was never true
  • there was no deletion success notification

The fixes are:

  • rely on the updated event to consider a form successfuly submitted and only then route to the next view or close modal and show the success notification
  • ensure jQuery.validate properly inject errors into vue.js forms
  • ensure server-side errors are properly injected into vue.js forms
  • ensure only one object/model is managed by each form
  • use the same notification logic for deletion
  • dispatch a notification for non-field errors
  • fix the error labels style

This PR is a quick and temporary fix but this need a major refactoring (Vuex, promise, async... whatever)

Copy link
Contributor

@abulte abulte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks way cleaner and more robust 💪

js/utils.js Outdated Show resolved Hide resolved
@noirbizarre
Copy link
Contributor Author

Yep, I tried to be stricter on separation of concerns between forms, views and models.
But, OMG, I'd like to have Vuex and async !!!!

@noirbizarre noirbizarre changed the title WIP: Form fixes Form fixes Jan 29, 2019
@noirbizarre noirbizarre merged commit fe22588 into opendatateam:master Jan 29, 2019
@noirbizarre noirbizarre deleted the form-fixes branch January 29, 2019 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants