diff options
| author | bobzel <zzzman@gmail.com> | 2023-12-27 16:18:31 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2023-12-27 16:18:31 -0500 |
| commit | 3f5a1d34d4aa90f605500d464660c896e8168808 (patch) | |
| tree | 066c1cbff295f9fc8a557d31792a2b4e13478413 /src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | |
| parent | f78d2b3a6ca65a691e4591e07b03f265b699a2d5 (diff) | |
closing info ui restores background of collection.
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 88cdd51ff..1574deede 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -1435,7 +1435,9 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection return anchor; }; - infoUI = () => (this.Document.annotationOn ? null : <CollectionFreeFormInfoUI Document={this.Document} Freeform={this} />); + @observable _hideInfo = false; + @action closeInfo = () => (this._hideInfo = true); + infoUI = () => (this._hideInfo || this.Document.annotationOn ? null : <CollectionFreeFormInfoUI Document={this.Document} Freeform={this} close={this.closeInfo} />); componentDidMount() { this._props.setContentView?.(this); @@ -1985,38 +1987,38 @@ ScriptingGlobals.add(function sendToBack(doc: Doc) { }); ScriptingGlobals.add(function datavizFromSchema(doc: Doc) { SelectionManager.Views.forEach(view => { - if (!view.layoutDoc.schema_columnKeys){ - view.layoutDoc.schema_columnKeys = new List<string>(['title', 'type', 'author', 'author_date']) + if (!view.layoutDoc.schema_columnKeys) { + view.layoutDoc.schema_columnKeys = new List<string>(['title', 'type', 'author', 'author_date']); } - const keys = Cast(view.layoutDoc.schema_columnKeys, listSpec('string'))?.filter(key => key!="text"); + const keys = Cast(view.layoutDoc.schema_columnKeys, listSpec('string'))?.filter(key => key != 'text'); if (!keys) return; const children = DocListCast(view.Document[Doc.LayoutFieldKey(view.Document)]); let csvRows = []; csvRows.push(keys.join(',')); - for (let i=0; i < children.length; i++) { + for (let i = 0; i < children.length; i++) { let eachRow = []; - for (let j=0; j<keys.length; j++){ + for (let j = 0; j < keys.length; j++) { var cell = children[i][keys[j]]; - if (cell && cell as string) cell = cell.toString().replace(/\,/g, ''); + if (cell && (cell as string)) cell = cell.toString().replace(/\,/g, ''); eachRow.push(cell); } csvRows.push(eachRow); } const blob = new Blob([csvRows.join('\n')], { type: 'text/csv' }); - const options = { x:0, y:-300, title: 'schemaTable', _width: 300, _height: 100, type: 'text/csv' }; + const options = { x: 0, y: -300, title: 'schemaTable', _width: 300, _height: 100, type: 'text/csv' }; const file = new File([blob], 'schemaTable', options); const loading = Docs.Create.LoadingDocument(file, options); loading.presentation_openInLightbox = true; DocUtils.uploadFileToDoc(file, {}, loading); if (view.ComponentView?.addDocument) { - // loading.dataViz_fromSchema = true; + // loading.dataViz_fromSchema = true; loading.dataViz_asSchema = view.layoutDoc; SchemaCSVPopUp.Instance.setView(view); SchemaCSVPopUp.Instance.setTarget(view.layoutDoc); SchemaCSVPopUp.Instance.setDataVizDoc(loading); SchemaCSVPopUp.Instance.setVisible(true); } - }) + }); }); |
