From 398a50bc1d7e77691620a4a6752fd38d4bb391b0 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 2 Mar 2022 14:43:48 -0500 Subject: upgraded to typescript 4.6.2 --- .../collectionSchema/CollectionSchemaCells.tsx | 7 ++---- .../collectionSchema/CollectionSchemaView.tsx | 25 +++++++++++----------- .../collections/collectionSchema/SchemaTable.tsx | 1 - 3 files changed, 14 insertions(+), 19 deletions(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaCells.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaCells.tsx index a439a7998..6a9b27d02 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaCells.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaCells.tsx @@ -3,9 +3,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { action, computed, observable } from "mobx"; import { observer } from "mobx-react"; import DatePicker from "react-datepicker"; -import "react-datepicker/dist/react-datepicker.css"; import { CellInfo } from "react-table"; -import "react-table/react-table.css"; import { DateField } from "../../../../fields/DateField"; import { Doc, DocListCast, Field, Opt } from "../../../../fields/Doc"; import { Id } from "../../../../fields/FieldSymbols"; @@ -31,7 +29,6 @@ import { DocumentIconContainer } from "../../nodes/DocumentIcon"; import { OverlayView } from "../../OverlayView"; import "./CollectionSchemaView.scss"; import { CollectionView } from "../CollectionView"; -const path = require('path'); // intialize cell properties export interface CellProps { @@ -495,8 +492,8 @@ 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 = path.extname(url.href); // the extension of the file - return url.href.replace(ext, "_o" + path.extname(url.href)); + const ext = "." + url.href.replace(/.*\./, "");// path.extname(url.href); // the extension of the file + return url.href.replace(ext, "_o" + ext); } render() { diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index b89246489..83d339f0a 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -4,7 +4,6 @@ import { action, computed, observable, untracked, trace } from "mobx"; import { observer } from "mobx-react"; import Measure from "react-measure"; import { Resize } from "react-table"; -import "react-table/react-table.css"; import { Doc, Opt } from "../../../../fields/Doc"; import { List } from "../../../../fields/List"; import { listSpec } from "../../../../fields/Schema"; @@ -147,43 +146,43 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) { const anyType =
this.setColumnType(col, ColumnType.Any)}> - Any -
; + Any + ; const numType =
this.setColumnType(col, ColumnType.Number)}> - Number -
; + Number + ; const textType =
this.setColumnType(col, ColumnType.String)}> Text -
; + ; const boolType =
this.setColumnType(col, ColumnType.Boolean)}> Checkbox -
; + ; const listType =
this.setColumnType(col, ColumnType.List)}> List -
; + ; const docType =
this.setColumnType(col, ColumnType.Doc)}> Document -
; + ; const imageType =
this.setColumnType(col, ColumnType.Image)}> Image -
; + ; const dateType =
this.setColumnType(col, ColumnType.Date)}> - Date -
; + Date + ; const allColumnTypes =
@@ -557,7 +556,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) { style={{ overflow: this.props.scrollOverflow === true ? "scroll" : undefined, backgroundColor: "white", pointerEvents: this.props.Document._searchDoc !== undefined && !this.props.isContentActive() && !SnappingManager.GetIsDragging() ? "none" : undefined, - width: name === "collectionSchemaView-searchContainer" ? "auto" : this.props.PanelWidth() || "100%", height: this.props.PanelHeight() || "100%", position: "relative", + width: this.props.PanelWidth() || "100%", height: this.props.PanelHeight() || "100%", position: "relative", }} >