Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 137
    • Merge requests 137
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !686

Merged
Created May 30, 2018 by Ayush Tiwari@tiwariayushContributor3 of 3 tasks completed3/3 tasks

ERP5 Diff Tool

  • Overview 107
  • Commits 4
  • 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
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: erp5_diff
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7