mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Adds setSelectedRows to the grist api for custom view
Summary: This is needed to let custom widget driver filtering of other widget in the same page. Descripion here: - https://grist.quip.com/ctytAQJoFMsM/Hopefully-Small-Projects#temp:C:NNCfe2030b27647439886ca83595 Test Plan: New api tested in a new nbrowser test Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3253
This commit is contained in:
@@ -74,11 +74,24 @@ function isValidLink(source: LinkNode, target: LinkNode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// cannot select from chart or custom
|
||||
if (['chart', 'custom'].includes(source.widgetType)) {
|
||||
// cannot select from chart
|
||||
if (source.widgetType === 'chart') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (source.widgetType === 'custom') {
|
||||
|
||||
// custom widget do not support linking by columns
|
||||
if (source.tableId !== source.section.table.peek().primaryTableId.peek()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// custom widget must allow select by
|
||||
if (!source.section.allowSelectBy.get()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// The link must not create a cycle
|
||||
if (source.ancestors.has(target.section.getRowId())) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user