DanielCaspers / DigitalInspection

Murphy Automotive's Digital Inspection App for making vehicle inspection checklists a better experience from technician to customer.
4 stars 0 forks source link

Improve dynamic input usability #54

Open DanielCaspers opened 7 years ago

DanielCaspers commented 7 years ago

Motivation Dynamic inputs will play a large role in the app, as many multi-line text inputs need to be able to remove previous line entries, or add a new line entry, without ever reloading the page.

Current known inputs which require this

  1. Phone Numbers (#39)
  2. Vehicle Notes (#38)
  3. Customer Notes (#39)
  4. Work Description (#38)
  5. Canned Responses
  6. Measurements
  7. Edit Tags - Can use dynamic approach to avoid maintaining an entirely separate page to do the same thing as the dialog

Difficulty Model binding in ASP.NET prepares the client view to be ready to talk back to the server. However, we'll need to manually manipulate all HTML to meet the same auto-generated spec so that form/url submission will provide our newly added/removed values.

Approach After working on #42, I finally found a long awaited answer of the proper pattern for this in ASP.NET MVC

  1. Submit POST request via HtmlHelpers.RawActionLink() which uses JQuery-Unobtrusive-AJAX under the hood.
  2. Process request, returning HTML PartialViewResult
  3. Replace current content in DOM with step 2's content without duplicate script loading.
DanielCaspers commented 7 years ago

@scaspers , let me know if you'd like this usability feature prioritized after you attempt some more configuration tomorrow.

DanielCaspers commented 6 years ago

@scaspers , I had originally prioritized this for V1.0. Is this still in the V1.0 priority or has this been deprioritized to a later update?

This really only affects the ability to add/remove lines from an existing field. Not being able to update one that already existed.

DanielCaspers commented 6 years ago

@scaspers, @YoMurphy if this becomes a big need, I'd like to invest time moving to Angular 6 as the client side framework before proceeding. Hence, I'm categorizing this as a v2.0 feature.

This problem is much easier to solve there, and whatever solution I'd be devising between now and then is unfortunately throwaway code.