follows angular JS decorator pattern to wrap a read only function to add new functionality. Original function ensured that that when the requisition is in approval, then every form field should be read only.
200 line file, original fork had to fork all of that to add a few lines
new pattern has boiler plate code to link into the function , and then write the new function
while original change was very small, and perhaps "easier" to do, the original style caused a fork of 500 lines of code (incl unit tests)
Feedback on questions from dev forum post:
wouldn't be too much boilerplate
MW has forked a # of lines of UI, reduction would be good
new solution feels like what we wanted it to - it's less forking and therefore less to maintain going forward
do we have an example of extending controller / service?
both should be easier than overriding a directive
are we always testing the original function?
with the new approach, the original unit tests still run
when the change is loaded in, it doesn't re-run original unit test
imagine it's a service, you have your unit tests, you create an extension, it returns something different, new unit tests test the new thing. Any other contract check can't see the new change, and so can't check it.
more floor joist changes than siding changes!
these are the small logical changes
could use more evidence - what happened in v2?
have to fork HTML?
yes, we could provide more of an example - Paweł Gesek could bring up things from SELV & SIIL. Extend distribution grid. Coverage screen. Nick Reid to start a wiki page to gather input on different examples and prioritize.
Action items
Nick Reid to make wiki page to gather html extension ideas and prioritize