Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • erp5 erp5
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 142
    • Merge requests 142
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • erp5erp5
  • Merge requests
  • !686

ERP5 Diff Tool

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Ayush Tiwari requested to merge tiwariayush/erp5:erp5_diff into master May 30, 2018
  • Overview 107
  • Commits 4
  • Pipelines 0
  • Changes 32

ERP5 Diff Tool is used to get beautified diff between any 2 ERP5 objects as well as different revisions of a single ERP5 object (both in XHTML as well as renderJS UI)

This would be helpful in:

  • ZODB History Tab to check the edit workflow history.
  • Revision of the ERP5 object, for example: web pages, documents, etc
  • Business Template installation

Diff Tool will also make it able to patch one ERP5 object from the diff (for version 1, we only patch objects which are of same portal type). The current version of Diff Tool uses deepdiff python library which provides us with patch which can complies(not completely) with CRDT datatype, thanks to which patch application can be less painful.

Diff Tool is able to differentiate between the diff according to type of user, for example, we do not want a normal user to be looking at diff of some internal properties of object(for ex: workflows), but for a developer user, we are fine with it.

How we calculate the Diff of any two objects:

  1. Convert the objects to their JSON format.
  2. Use deepdiff to find out the diff for the 2 JSON objects.
  3. Return a beautified JSON Diff

NOTE: This MR succeeds the MR related to create correct URL for History tabs: !695 (merged) !683 (merged)

TODO:

  • Add tests for beautified diff and patch.
  • Diff tool should be working in new UI.
  • Fix the pagination.

Example Diff Tool in both UIs:

XHTML UI Diff

renderJS UI Diff

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: erp5_diff
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7