The diff looks extensive only because I renamed a lot of variables while working through the code to make sense of it (everything in the binding contexts are called 'metadata' and they're all different objects!). I decided to keep these changes since it made the code easier to follow.
the meat of the logic changes is in ticket-item-row.js
essentially, TicketItemEditor is being composited into TicketItemRow so that the pricebook rules get enforced and the layout gets cloned for each row
The initial approach I did with the help of Craig extended the inheritance chain to incorporate TicketItemRow from DetailListItem to make sure each row had it's own copy of the field metadata. The code eventually worked, but broke the normal detail form in the process. It also inadvertently applied ticket item validations to any type of list item.
After going in circles for a while, I realized that I couldn't really fix this the 'proper' way without rewriting a large portion of forms and the display/editor bindings to honor the "editability" of a field independent of the layout. I'm not about to do that so close to a release...
So, yeah, it's not an ideal solution but it's the cheaper option (both risk and memory-wise) to just clone the layout metadata for each row (instead of cloning the field metadata for each row).
Mingle Card: 1385 Transcribing pull request notes from here: https://github.com/Liquidframeworks/alpine-mobile/pull/101
The diff looks extensive only because I renamed a lot of variables while working through the code to make sense of it (everything in the binding contexts are called 'metadata' and they're all different objects!). I decided to keep these changes since it made the code easier to follow.
The initial approach I did with the help of Craig extended the inheritance chain to incorporate TicketItemRow from DetailListItem to make sure each row had it's own copy of the field metadata. The code eventually worked, but broke the normal detail form in the process. It also inadvertently applied ticket item validations to any type of list item.
After going in circles for a while, I realized that I couldn't really fix this the 'proper' way without rewriting a large portion of forms and the display/editor bindings to honor the "editability" of a field independent of the layout. I'm not about to do that so close to a release...
So, yeah, it's not an ideal solution but it's the cheaper option (both risk and memory-wise) to just clone the layout metadata for each row (instead of cloning the field metadata for each row).