aboutsummaryrefslogtreecommitdiff
path: root/src/client/views
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-12-04 16:00:53 -0500
committersrichman333 <sarah_n_richman@brown.edu>2023-12-04 16:00:53 -0500
commit966c93e3a5b70e5e579b4b67061c859df1ac357d (patch)
treed0f6941c82471a4c9724a68bf4976c9a747e4c48 /src/client/views
parentfa2d4e4e66f7f1de51a579b3a121ca1a2a7d56a8 (diff)
default keys bug fix + image to drag
Diffstat (limited to 'src/client/views')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx7
-rw-r--r--src/client/views/nodes/DataVizBox/SchemaCSVPopUp.tsx4
2 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 19689f972..3a1ea766a 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1976,9 +1976,10 @@ ScriptingGlobals.add(function sendToBack(doc: Doc) {
});
ScriptingGlobals.add(function datavizFromSchema(doc: Doc) {
SelectionManager.Views().forEach(view => {
- const keys = Cast(view.rootDoc.schema_columnKeys, listSpec('string'))?.filter(key => key!="text");
-
- if (!keys) return;
+ var keys = Cast(view.layoutDoc.schema_columnKeys, listSpec('string'))?.filter(key => key!="text");
+ const defaultColumnKeys: string[] = ['title', 'type', 'author', 'author_date'];
+ if (!keys) keys = Cast(view.layoutDoc.schema_columnKeys, listSpec('string'), defaultColumnKeys);;
+
const children = DocListCast(view.rootDoc[Doc.LayoutFieldKey(view.rootDoc)]);
let csvRows = [];
csvRows.push(keys.join(','));
diff --git a/src/client/views/nodes/DataVizBox/SchemaCSVPopUp.tsx b/src/client/views/nodes/DataVizBox/SchemaCSVPopUp.tsx
index 0114721a2..309297307 100644
--- a/src/client/views/nodes/DataVizBox/SchemaCSVPopUp.tsx
+++ b/src/client/views/nodes/DataVizBox/SchemaCSVPopUp.tsx
@@ -55,9 +55,9 @@ export class SchemaCSVPopUp extends React.Component<SchemaCSVPopUpProps> {
{this.heading('Schema Table as Data Visualization Doc')}
<div className="image-content-wrapper">
<div className="img-wrapper">
- <div className="img-container" style={{background: "blue"}} onPointerDown={e => this.drag(e)}>
+ <div className="img-container" onPointerDown={e => this.drag(e)}>
<img
- width={150} height={150}
+ width={150} height={150} src={"/assets/dataVizBox.png"}
/>
</div>
</div>