From 5a9fe0ea27635ad6d2f0bf26ee6daec729416f84 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 11 Nov 2020 12:11:06 -0500 Subject: [PATCH] (core) show differences in card views when comparing documents Summary: This makes a small tweak to show cell and row changes in card views and card list views, and adds a test for it. Test Plan: added tests Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2660 --- app/client/components/DetailView.js | 4 ++++ app/client/models/DataTableModelWithDiff.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/client/components/DetailView.js b/app/client/components/DetailView.js index c7099248..11c3d16e 100644 --- a/app/client/components/DetailView.js +++ b/app/client/components/DetailView.js @@ -370,6 +370,10 @@ DetailView.prototype.makeRecord = function(record) { return dom( this.recordLayout.buildLayoutDom(record), kd.cssClass(() => 'detail_theme_record_' + this.viewSection.themeDef()), + this.comparison ? kd.cssClass(() => { + const rowType = this.extraRows.getRowType(record.id()); + return rowType && `diff-${rowType}` || ''; + }) : null, kd.toggleClass('active', () => (this.cursor.rowIndex() === record._index() && this.viewSection.hasFocus())), // 'detailview_record_single' or 'detailview_record_detail' doesn't need to be an observable, // since a change to parentKey would cause a separate call to makeRecord. diff --git a/app/client/models/DataTableModelWithDiff.ts b/app/client/models/DataTableModelWithDiff.ts index 79883190..325590c1 100644 --- a/app/client/models/DataTableModelWithDiff.ts +++ b/app/client/models/DataTableModelWithDiff.ts @@ -111,7 +111,7 @@ export class DataTableModelWithDiff extends DisposableWithEvents implements Data } public createFloatingRowModel(optRowModelClass: any): BaseRowModel { - return this.core.createFloatingRowModel(optRowModelClass); + return this._wrappedModel.createFloatingRowModel(optRowModelClass); } public fetch(force?: boolean): Promise {