(core) Fix JS error when scrolling with a column of hyperlinks, and use stricter types.

Summary:
When scrolling quicly through a column with hyperlinks, null could be passed to
a function that didn't expect it. Added better types would help catch it.

Test Plan: Tested manually

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2813
This commit is contained in:
Dmitry S
2021-05-12 17:00:55 -04:00
parent d0d3d3d0c9
commit 28cb64f1f7
3 changed files with 12 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ import * as DataTableModel from 'app/client/models/DataTableModel';
import { IRowModel } from 'app/client/models/DocModel';
import { ValidationRec } from 'app/client/models/entities/ValidationRec';
import * as modelUtil from 'app/client/models/modelUtil';
import { ColValues } from 'app/common/DocActions';
import { CellValue, ColValues } from 'app/common/DocActions';
import * as ko from 'knockout';
/**
@@ -16,7 +16,7 @@ export class DataRowModel extends BaseRowModel {
// Instances of this class are indexable, but that is a little awkward to type.
// The cells field gives typed access to that aspect of the instance. This is a
// bit hacky, and should be cleaned up when BaseRowModel is ported to typescript.
public readonly cells: {[key: string]: modelUtil.KoSaveableObservable<any>} = this as any;
public readonly cells: {[key: string]: modelUtil.KoSaveableObservable<CellValue>} = this as any;
public _validationFailures: ko.PureComputed<Array<IRowModel<'_grist_Validations'>>>;
public _isAddRow: ko.Observable<boolean>;