Allowing new row on recrod card

This commit is contained in:
Jarosław Sadziński 2024-10-09 11:12:21 +02:00
parent 9806e1a4c0
commit 4cde2202b5
2 changed files with 3 additions and 2 deletions

View File

@ -701,7 +701,7 @@ export class GristDoc extends DisposableWithEvents {
const {recordCard, rowId} = popupOptions.hash;
if (recordCard) {
if (!rowId || rowId === 'new') {
if (!rowId) {
// Should be unreachable, but just to be sure (and to satisfy type checking)...
throw new Error('Unable to open Record Card: undefined row id');
}

View File

@ -7,13 +7,14 @@ import {ViewSectionRec} from 'app/client/models/DocModel';
import {ChangeType, RowList} from 'app/client/models/rowset';
import {theme} from 'app/client/ui2018/cssVars';
import {DisposableWithEvents} from 'app/common/DisposableWithEvents';
import {UIRowId} from 'app/plugin/GristAPI';
import {dom, makeTestId, styled} from 'grainjs';
const testId = makeTestId('test-record-card-popup-');
interface RecordCardPopupOptions {
gristDoc: GristDoc;
rowId: number;
rowId: UIRowId;
viewSection: ViewSectionRec;
onClose(): void;
}