aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-03-04 15:19:09 -0500
committerbobzel <zzzman@gmail.com>2022-03-04 15:19:09 -0500
commitff2602bb598b6e82330a9a0b2453e44d70c94c39 (patch)
tree37a0106c1c23c1bd1c0509cc1e2ebe4e9f703b2b /src/client/views/collections/collectionSchema
parentc015dc3b76ec30e9d7057ee558787e59033af270 (diff)
removed pseudo Doc type system. playing with hot reloading.
Diffstat (limited to 'src/client/views/collections/collectionSchema')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaCells.tsx9
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaCells.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaCells.tsx
index 6a9b27d02..c2bb3b3ac 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaCells.tsx
@@ -2,6 +2,7 @@ import React = require("react");
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { action, computed, observable } from "mobx";
import { observer } from "mobx-react";
+import { extname } from "path";
import DatePicker from "react-datepicker";
import { CellInfo } from "react-table";
import { DateField } from "../../../../fields/DateField";
@@ -10,9 +11,9 @@ import { Id } from "../../../../fields/FieldSymbols";
import { List } from "../../../../fields/List";
import { SchemaHeaderField } from "../../../../fields/SchemaHeaderField";
import { ComputedField } from "../../../../fields/ScriptField";
-import { BoolCast, Cast, DateCast, FieldValue, NumCast, StrCast } from "../../../../fields/Types";
+import { BoolCast, Cast, DateCast, FieldValue, StrCast } from "../../../../fields/Types";
import { ImageField } from "../../../../fields/URLField";
-import { Utils, emptyFunction } from "../../../../Utils";
+import { emptyFunction, Utils } from "../../../../Utils";
import { Docs } from "../../../documents/Documents";
import { DocumentType } from "../../../documents/DocumentTypes";
import { DocumentManager } from "../../../util/DocumentManager";
@@ -27,8 +28,8 @@ import { EditableView } from "../../EditableView";
import { MAX_ROW_HEIGHT } from '../../global/globalCssVariables.scss';
import { DocumentIconContainer } from "../../nodes/DocumentIcon";
import { OverlayView } from "../../OverlayView";
-import "./CollectionSchemaView.scss";
import { CollectionView } from "../CollectionView";
+import "./CollectionSchemaView.scss";
// intialize cell properties
export interface CellProps {
@@ -492,7 +493,7 @@ export class CollectionSchemaImageCell extends CollectionSchemaCell {
if (url.href.indexOf(window.location.origin) === -1) return Utils.CorsProxy(url.href); // otherwise, put it through the cors proxy erver
if (!/\.(png|jpg|jpeg|gif|webp)$/.test(url.href.toLowerCase())) return url.href;//Why is this here — good question
- const ext = "." + url.href.replace(/.*\./, "");// path.extname(url.href); // the extension of the file
+ const ext = extname(url.href);
return url.href.replace(ext, "_o" + ext);
}
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index 83d339f0a..8b73351d5 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -46,7 +46,7 @@ const columnTypes: Map<string, ColumnType> = new Map([
]);
@observer
-export class CollectionSchemaView extends CollectionSubView(doc => doc) {
+export class CollectionSchemaView extends CollectionSubView() {
private _previewCont?: HTMLDivElement;
@observable _previewDoc: Doc | undefined = undefined;