mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
Linkstate refactor (#609)
* Linkingstate Refactor, and displaying link info in rightpanel
Big refactor to LinkingState
Collects descriptive/user-facing labels into FilterState
Unifies/cleans up some logic
Adds LinkTypeDescription, a string enum which can be used
to easily switch/case between various cases of linking, and
codifies the logic in one place (currently only used for linkInfo)
Adds Link info to creator panel, near SelectBy dropdown
Bugfix: Disables linking from Attachment columns
Bugfix/Behavior change: changed linking with empty RefLists to better
match behavior of refs.
for context: Linking by a blank Ref filters to show records with a
blank value for that Ref. Previously this didn't work with RefLists.
Linking from a blank refList would show no records
(except in some cases involving summary tables)
Fixed this so that linking by a blank val consistently means "show
all records where the corresponding col is blank"
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import BaseView from 'app/client/components/BaseView';
|
||||
import {LinkingState} from 'app/client/components/LinkingState';
|
||||
import {EmptyFilterColValues, LinkingState} from 'app/client/components/LinkingState';
|
||||
import {KoArray} from 'app/client/lib/koArray';
|
||||
import {ColumnToMapImpl} from 'app/client/models/ColumnToMap';
|
||||
import {
|
||||
@@ -637,7 +637,7 @@ export function createViewSectionRec(this: ViewSectionRec, docModel: DocModel):
|
||||
}));
|
||||
|
||||
this.linkingFilter = this.autoDispose(ko.pureComputed(() => {
|
||||
return this.linkingState()?.filterColValues?.() || {filters: {}, operations: {}};
|
||||
return this.linkingState()?.filterColValues?.() || EmptyFilterColValues;
|
||||
}));
|
||||
|
||||
// If the view instance for this section is instantiated, it will be accessible here.
|
||||
|
||||
Reference in New Issue
Block a user