diff options
| author | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-02-23 10:34:47 -0500 |
|---|---|---|
| committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-02-23 10:34:47 -0500 |
| commit | 02bceed486ecb03b94c757ae669f69912f282cdd (patch) | |
| tree | 3582896965b9615224c179c160cc91b0ba162a80 /src/client/views/nodes | |
| parent | 3f954b00b8624861386b23bdb75291bd6a260de8 (diff) | |
current collection vs dashboard works a bit better - they have different filterdocs now
Diffstat (limited to 'src/client/views/nodes')
| -rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 4 | ||||
| -rw-r--r-- | src/client/views/nodes/FilterBox.tsx | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index f99eb1b3b..ee4df97ed 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -120,8 +120,8 @@ export interface DocumentViewSharedProps { cantBrush?: boolean; // whether the document doesn't show brush highlighting pointerEvents?: string; scriptContext?: any; // can be assigned anything and will be passed as 'scriptContext' to any OnClick script that executes on this document - filterSaveCallback?: () => void; - myFiltersCallback?: (doc: Doc) => void; + createNewFilterDoc?: () => void; + updateFilterDoc?: (doc: Doc) => void; } export interface DocumentViewProps extends DocumentViewSharedProps { // properties specific to DocumentViews but not to FieldView diff --git a/src/client/views/nodes/FilterBox.tsx b/src/client/views/nodes/FilterBox.tsx index 987939d65..a3a3ec662 100644 --- a/src/client/views/nodes/FilterBox.tsx +++ b/src/client/views/nodes/FilterBox.tsx @@ -48,7 +48,7 @@ export class FilterBox extends ViewBoxBaseComponent<FieldViewProps, FilterBoxDoc public static LayoutString(fieldKey: string) { return FieldView.LayoutString(FilterBox, fieldKey); } public _filterBoolean = "AND"; - public static _filterScope = "Current Dashboard"; + @observable public static _filterScope = "Current Dashboard"; public _filterSelected = false; public _filterMatch = "matched"; // private myFiltersRef = React.createRef<HTMLDivElement>(); @@ -309,7 +309,7 @@ export class FilterBox extends ViewBoxBaseComponent<FieldViewProps, FilterBoxDoc const flyout = DocListCast(Doc.UserDoc().savedFilters).map(doc => { // console.log("mapping"); return <> - <div className="???" onWheel={e => e.stopPropagation()} style={{ height: 50, border: "2px" }} onPointerDown={() => this.props.myFiltersCallback?.(doc)}> + <div className="???" onWheel={e => e.stopPropagation()} style={{ height: 50, border: "2px" }} onPointerDown={() => this.props.updateFilterDoc?.(doc)}> {StrCast(doc.title)} </div> </>; @@ -419,7 +419,7 @@ export class FilterBox extends ViewBoxBaseComponent<FieldViewProps, FilterBoxDoc </div> <div className="filterBox-saveWrapper"> <div className="filterBox-saveBookmark" - onPointerDown={this.props.filterSaveCallback} + onPointerDown={this.props.createNewFilterDoc} > <div>NEW</div> </div> |
