aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/SchemaTable.tsx
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-06-28 02:31:02 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-06-28 02:31:02 -0500
commitfd613140e169912f44966fdc6f25fafd85bae7a1 (patch)
treea06a69a10db950a68879acb2b9975fb21bbd1eae /src/client/views/collections/SchemaTable.tsx
parentaf7b4994fa97a2aee0a2e90b30d21d4b030bd2b7 (diff)
started adding date types
Diffstat (limited to 'src/client/views/collections/SchemaTable.tsx')
-rw-r--r--src/client/views/collections/SchemaTable.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx
index 176091661..eb0d234c0 100644
--- a/src/client/views/collections/SchemaTable.tsx
+++ b/src/client/views/collections/SchemaTable.tsx
@@ -19,7 +19,7 @@ import { undoBatch } from "../../util/UndoManager";
import { COLLECTION_BORDER_WIDTH } from '../../views/globalCssVariables.scss';
import { ContextMenu } from "../ContextMenu";
import '../DocumentDecorations.scss';
-import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell, CollectionSchemaImageCell, CollectionSchemaListCell } from "./CollectionSchemaCells";
+import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell, CollectionSchemaImageCell, CollectionSchemaListCell, CollectionSchemaDateCell } from "./CollectionSchemaCells";
import { CollectionSchemaAddColumnHeader, KeysDropdown } from "./CollectionSchemaHeaders";
import { MovableColumn, MovableRow } from "./CollectionSchemaMovableTableHOC";
import "./CollectionSchemaView.scss";
@@ -36,7 +36,8 @@ enum ColumnType {
Boolean,
Doc,
Image,
- List
+ List,
+ Date
}
// this map should be used for keys that should have a const type of value
@@ -195,7 +196,8 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
const icon: IconProp = this.getColumnType(col) === ColumnType.Number ? "hashtag" : this.getColumnType(col) === ColumnType.String ? "font" :
this.getColumnType(col) === ColumnType.Boolean ? "check-square" : this.getColumnType(col) === ColumnType.Doc ? "file" :
- this.getColumnType(col) === ColumnType.Image ? "image" : this.getColumnType(col) === ColumnType.List ? "list-ul" : "align-justify";
+ this.getColumnType(col) === ColumnType.Image ? "image" : this.getColumnType(col) === ColumnType.List ? "list-ul" :
+ this.getColumnType(col) === ColumnType.Date ? "calendar" : "align-justify";
const headerText = this._showTitleDropdown ? keysDropdown : <div
onClick={this.changeTitleMode}
@@ -270,6 +272,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
if (colType === ColumnType.Doc) return <CollectionSchemaDocCell {...props} />;
if (colType === ColumnType.Image) return <CollectionSchemaImageCell {...props} />;
if (colType === ColumnType.List) return <CollectionSchemaListCell {...props} />;
+ if (colType === ColumnType.Date) return <CollectionSchemaDateCell {...props} />;
return <CollectionSchemaCell {...props} />;
},
minWidth: 200,