diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2020-01-27 17:32:50 -0500 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2020-01-27 17:32:50 -0500 |
| commit | d866969264e96d97f77f80727df53a66865f463f (patch) | |
| tree | 913c931d135b24c81f54c2f5d3b55dd20cd8f5f7 /src/client/views/collections/CollectionPivotView.tsx | |
| parent | 5e67aa8ab95e40730acb584cb5ff812fe470608f (diff) | |
| parent | 9a9524b4c6e2980eb37ece288890d6cb746eb81c (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/collections/CollectionPivotView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionPivotView.tsx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/client/views/collections/CollectionPivotView.tsx b/src/client/views/collections/CollectionPivotView.tsx index a44f990e1..98fc54b3b 100644 --- a/src/client/views/collections/CollectionPivotView.tsx +++ b/src/client/views/collections/CollectionPivotView.tsx @@ -16,6 +16,8 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { List } from "../../../new_fields/List"; import { Set } from "typescript-collections"; import { PrefetchProxy } from "../../../new_fields/Proxy"; +import { EditableView } from "../EditableView"; +import { listSpec } from "../../../new_fields/Schema"; @observer export class CollectionPivotView extends CollectionSubView(doc => doc) { @@ -76,6 +78,13 @@ export class CollectionPivotView extends CollectionSubView(doc => doc) { const found = DocListCast(facetCollection.data).findIndex(doc => doc.title === facetHeader); if (found !== -1) { (facetCollection.data as List<Doc>).splice(found, 1); + const docFilter = Cast(this.props.Document._docFilter, listSpec("string")); + if (docFilter) { + let index: number; + while ((index = docFilter.findIndex(item => item === facetHeader)) !== -1) { + docFilter.splice(index, 3); + } + } } else { const newFacet = Docs.Create.TreeDocument([], { title: facetHeader, treeViewOpen: true, isFacetFilter: true }); const capturedVariables = { layoutDoc: this.props.Document, dataDoc: this.dataDoc }; @@ -129,6 +138,19 @@ export class CollectionPivotView extends CollectionSubView(doc => doc) { ); return !facetCollection ? (null) : <div className="collectionPivotView"> + <div className={"pivotKeyEntry"}> + <EditableView + contents={this.props.Document.pivotField} + GetValue={() => StrCast(this.props.Document.pivotField)} + SetValue={value => { + if (value && value.length) { + this.props.Document.pivotField = value; + return true; + } + return false; + }} + /> + </div> <div className="collectionPivotView-dragger" key="dragger" onPointerDown={this.onPointerDown} style={{ transform: `translate(${this._facetWidth}px, 0px)` }} > <span title="library View Dragger" style={{ width: "5px", position: "absolute", top: "0" }} /> </div> |
