mpdroog / invoiced

Simple hour registration + invoice generator.
BSD 2-Clause "Simplified" License
13 stars 5 forks source link

Error Messages repeatedly received when any mandatory fields are empty #20

Closed c-nv-s closed 3 years ago

c-nv-s commented 3 years ago

Steps to reproduce:

  1. open "Invoices" tab and scroll to "Quantity" field in the Invoice Line Items section
  2. select the value so that the mouse cursor is at the furthest position on the right
  3. press "backspace" until the contents of the field are empty
  4. receive a Not a Number error below
  5. error message repeatedly displayed if trying to select anywhere else in the page
{"pageErrorType":"window.onerror","pageMessage":"BigError: NaN","pageURL":"http://localhost:9999/static/#name/2021/invoices/edit/concepts/boie65xtutjp","pageStack":"throwErr@http://localhost:9999/static/assets/vendor.js:2326:19\nparse@http://localhost:9999/static/assets/vendor.js:2193:21\nBig@http://localhost:9999/static/assets/vendor.js:2099:22\nP.times@http://localhost:9999/static/assets/vendor.js:2931:23\nInvoiceEdit</InvoiceEdit.prototype.lineUpdate@http://localhost:9999/static/assets/app.js:1255:42\nInvoiceEdit</InvoiceEdit.prototype.triggerChange@http://localhost:9999/static/assets/app.js:1246:42\nInvoiceEdit</InvoiceEdit.prototype.handleChange@http://localhost:9999/static/assets/app.js:1283:14\ndispatchEvent@http://localhost:9999/static/assets/vendor.js:19916:18\n","serverResponse":null,"serverURL":null}

Expected behaviour: the empty field's box should change to a warning color or outline or something to indicate that the field cannot be left empty. an error message should then be received if the user tries to submit the form with any mandatory fields still missing

mpdroog commented 3 years ago

1- Adjusted quantity+price fields to auto-set 0.00-format.

This is no perfect solution but it does make stuff extremely simple in regards to the quantity+price fields.

mpdroog commented 3 years ago

2- Invoice.Save now return JSON-struct with error details Did a patch to show an modal error summarizing input errors (making a minor improvement on usability)

mpdroog commented 3 years ago

Considering ticket closed.