feat: clean object before showing changes

This commit is contained in:
lefuturiste 2020-07-30 12:59:36 +02:00
parent b5cafef408
commit f9614b55fb

View file

@ -677,12 +677,25 @@ export default {
openDiffModal () { openDiffModal () {
this.diffModal = true this.diffModal = true
const clean = unordered => {
// Object.keys(unordered).sort().forEach(key => {
// ordered[key] = unordered[key]
// })
return {
name: unordered.name,
descriptionShort: unordered.descriptionShort,
descriptionLong: unordered.descriptionLong,
thumbnail: unordered.thumbnail,
contacts: unordered.contacts,
...unordered
}
}
this.diffText = diff( this.diffText = diff(
JSON.stringify( JSON.stringify(
this.toApproveItem.publishedVersion, '', 2 clean(this.toApproveItem.publishedVersion), '', 2
), ),
JSON.stringify( JSON.stringify(
this.toApproveItem.proposedVersion, '', 2 clean(this.toApproveItem.proposedVersion), '', 2
), ),
{ {
green: (v) => '<GREEN>' + v + '</GREEN>', green: (v) => '<GREEN>' + v + '</GREEN>',