diff --git a/ROADMAP.md b/ROADMAP.md index c085b9a0..7672048a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -68,6 +68,7 @@ ### Functionality: - Sort rows +- reorder columns - Locked columns - Table view only mode - SubCollection tables diff --git a/src/components/Fields/File.tsx b/src/components/Fields/File.tsx index 9cfee923..f86073ba 100644 --- a/src/components/Fields/File.tsx +++ b/src/components/Fields/File.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useState } from "react"; +import React, { useCallback } from "react"; import { useDropzone } from "react-dropzone"; import useUploader from "../../hooks/useFiretable/useUploader"; diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index 1f6f4576..dab7b09a 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -132,6 +132,20 @@ function Table(props: any) { onColumnResize={(idx, width) => tableActions.column.resize(idx, width) } + emptyRowsView={() => { + return ( +
+

no data to show

+ +
+ ); + }} /> { const createTable = (name: string, collection: string) => { const { tables } = settingsState; // updates the setting doc - documentDispatch({ - action: DocActions.update, - data: { tables: [...tables, { name, collection }] }, - }); + if (tables) { + documentDispatch({ + action: DocActions.update, + data: { tables: [...tables, { name, collection }] }, + }); + } else { + db.doc("_FIRETABLE_/settings").set( + { tables: [{ name, collection }] }, + { merge: true } + ); + } //create the firetable collection doc with empty columns db.collection(collection) .doc("_FIRETABLE_")