mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Support 'new' row in anchor links.
Summary: - Anchor links with row of 'new' could be created but weren't parsed or used correctly. This fixes it. - Also adds UIRowId type for row IDs which includes the special 'new' row. It's already been used in places as `number|'new'`, this diff gives it a name usable in app/common (it doesn't touch another name, RowId, that's been available in app/client). Test Plan: Added a test assert for anchor links to new row Reviewers: alexmojaki Reviewed By: alexmojaki Differential Revision: https://phab.getgrist.com/D3039
This commit is contained in:
@@ -65,7 +65,7 @@ export interface WebHookSecret {
|
||||
// An instance of this class should have .handle() called on it exactly once.
|
||||
export class TriggersHandler {
|
||||
// Converts a column ref to colId by looking it up in _grist_Tables_column
|
||||
private _getColId: (rowId: (number | "new")) => string;
|
||||
private _getColId: (rowId: number) => string|undefined;
|
||||
|
||||
constructor(private _activeDoc: ActiveDoc) {
|
||||
}
|
||||
@@ -82,7 +82,7 @@ export class TriggersHandler {
|
||||
|
||||
const triggersByTableRef = _.groupBy(triggersTable.getRecords(), "tableRef");
|
||||
for (const [tableRef, triggers] of _.toPairs(triggersByTableRef)) {
|
||||
const tableId = getTableId(Number(tableRef)); // groupBy makes tableRef a string
|
||||
const tableId = getTableId(Number(tableRef))!; // groupBy makes tableRef a string
|
||||
const tableDelta = summary.tableDeltas[tableId];
|
||||
if (!tableDelta) {
|
||||
continue; // this table was not modified by these actions
|
||||
|
||||
Reference in New Issue
Block a user