grabbeh / attest

Contract management tool
https://attest.mbg.codes
2 stars 3 forks source link

Comment diffing #16

Open grabbeh opened 6 years ago

grabbeh commented 6 years ago

Adding and deleting a comment shows up, but because editing a field is currently disabled through as it's in the 'E' category and therefore disabled. Need to collect up edits for particular attribute and compare to a) capture edits, and b) avoid categorising change in array position as a change that is displayed (if item at position 1 is deleted, then item at position 2 moves to 1 and shows as change...).

grabbeh commented 6 years ago
  DiffArray {
    kind: 'A',
    path: [ 'comments' ],
    index: 2,
    item: DiffDeleted { kind: 'D', lhs: [Object] } },
  DiffEdit {
    kind: 'E',
    path: [ 'comments', 1, 'name' ],
    lhs: 'World',
    rhs: 'TEST THREE' } ]
[ { attr: [ 'comments', 2 ], removed: { name: 'TEST THREE' } },
{ attr: [ 'comments', 1, 'name' ],
added: 'TEST THREE',
removed: 'World' } ]