mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) add more detail to /compare endpoint
Summary: * Extends `/api/docs/docId1/compare/docId2` endpoint with a `detail=1` option to include details of what changed in the document content. * Adds an `/api/docs/docId/compare?left=HASH&right=HASH` endpoint for comparing two versions of a single document. This is needed to implement the extension to `/api/docs/docId1/compare/docId2`. * Adds a `HashUtil` class to allow hash aliases like `HEAD` and `HEAD~`. Everything is a bit crude: * Changes are expressed as ActionSummary objects, which aren't fully fleshed out. * Extra data about formula columns is inserted in an inflexible way. This is extracted and cleaned up from https://phab.getgrist.com/D2600. Test Plan: added tests Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2614
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {CellDelta, TabularDiff, TabularDiffs} from 'app/common/TabularDiff';
|
||||
import toPairs = require('lodash/toPairs');
|
||||
import { RowRecord } from 'app/plugin/GristData';
|
||||
|
||||
/**
|
||||
* An ActionSummary represents the overall effect of changes that took place
|
||||
@@ -90,6 +91,13 @@ export interface TableDelta {
|
||||
/** Partial record of cell-level changes - large bulk changes not included. */
|
||||
columnDeltas: {[colId: string]: ColumnDelta};
|
||||
columnRenames: LabelDelta[]; /** a list of column renames/additions/removals */
|
||||
|
||||
/*
|
||||
* A snapshot of row content for added and updated rows, including formula columns.
|
||||
* Not included in regular summaries, but used in comparisons. Hopefully this
|
||||
* can evaporate in future.
|
||||
*/
|
||||
finalRowContent?: {[rowId: number]: RowRecord};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user