aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-03-10 12:49:40 -0400
committerbobzel <zzzman@gmail.com>2025-03-10 12:49:40 -0400
commit289030cc82c4cef6db46695c841cb99e4cd90101 (patch)
treef60ec8c6af0d437ca60931d5e5ee40483bae251b /src/client/views/collections
parent97f2fd0fe18bf476304af06918de25059d4fd8b5 (diff)
parentdf173b02ffb7e2937d20a02beec1815b3af7c34e (diff)
Merge branch 'master' into aarav_edit
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx12
-rw-r--r--src/client/views/collections/collectionSchema/SchemaCellField.tsx4
-rw-r--r--src/client/views/collections/collectionSchema/SchemaTableCell.tsx6
3 files changed, 11 insertions, 11 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index 5a5cc3622..8e9e8e1cc 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -12,7 +12,7 @@ import { List } from '../../../../fields/List';
import { ColumnType } from '../../../../fields/SchemaHeaderField';
import { BoolCast, NumCast, StrCast } from '../../../../fields/Types';
import { DocUtils } from '../../../documents/DocUtils';
-import { Docs, DocumentOptions, FInfo } from '../../../documents/Documents';
+import { Docs, DocumentOptions, FInfo, FInfoFieldType } from '../../../documents/Documents';
import { DocumentManager } from '../../../util/DocumentManager';
import { DragManager } from '../../../util/DragManager';
import { dropActionType } from '../../../util/DropActionTypes';
@@ -49,14 +49,16 @@ import { SchemaRowBox } from './SchemaRowBox';
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { SCHEMA_NEW_NODE_HEIGHT } = require('../../global/globalCssVariables.module.scss'); // prettier-ignore
-export const FInfotoColType: { [key: string]: ColumnType } = {
+export const FInfotoColType: { [key in FInfoFieldType]: ColumnType } = {
string: ColumnType.String,
number: ColumnType.Number,
boolean: ColumnType.Boolean,
date: ColumnType.Date,
- image: ColumnType.Image,
- rtf: ColumnType.RTF,
- enumeration: ColumnType.Enumeration,
+ richtext: ColumnType.RTF,
+ enum: ColumnType.Enumeration,
+ Doc: ColumnType.Any,
+ list: ColumnType.Any,
+ map: ColumnType.Any,
};
const defaultColumnKeys: string[] = ['title', 'type', 'author', 'author_date', 'text'];
diff --git a/src/client/views/collections/collectionSchema/SchemaCellField.tsx b/src/client/views/collections/collectionSchema/SchemaCellField.tsx
index 5a64ecc62..e6acff061 100644
--- a/src/client/views/collections/collectionSchema/SchemaCellField.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaCellField.tsx
@@ -21,7 +21,7 @@ import DOMPurify from 'dompurify';
*/
export interface SchemaCellFieldProps {
- contents: FieldType;
+ contents: FieldType | undefined;
fieldContents?: FieldViewProps;
editing?: boolean;
oneLine?: boolean;
@@ -107,7 +107,6 @@ export class SchemaCellField extends ObservableReactComponent<SchemaCellFieldPro
this._disposers.fieldUpdate = reaction(
() => this._props.GetValue(),
fieldVal => {
- console.log('Update: ' + this._props.Document.title, this._props.fieldKey, fieldVal);
this._unrenderedContent = fieldVal ?? '';
this.finalizeEdit(false, false, false);
}
@@ -127,7 +126,6 @@ export class SchemaCellField extends ObservableReactComponent<SchemaCellFieldPro
_unmounted = false;
componentWillUnmount(): void {
this._unmounted = true;
- console.log('Unmount: ' + this._props.Document.title, this._props.fieldKey);
this._overlayDisposer?.();
Object.values(this._disposers).forEach(disposer => disposer?.());
this.finalizeEdit(false, true, false);
diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
index c847bc546..d404378eb 100644
--- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
@@ -136,7 +136,7 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro
PanelHeight: props.rowHeight,
rootSelected: props.rootSelected,
};
- const readOnly = getFinfo(fieldKey)?.readOnly ?? false;
+ const readOnly = false; // getFinfo(fieldKey)?.readOnly ?? false;
const cursor = !readOnly ? 'text' : 'default';
const pointerEvents: 'all' | 'none' = !readOnly && isRowActive() ? 'all' : 'none';
return { color, textDecoration, fieldProps, cursor, pointerEvents };
@@ -232,9 +232,8 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro
if (typeof cellValue === 'number') return ColumnType.Any;
if (typeof cellValue === 'string' && columnTypeStr !== FInfoFieldType.enumeration) return ColumnType.Any;
if (typeof cellValue === 'boolean') return ColumnType.Boolean;
- if (columnTypeStr && columnTypeStr in FInfotoColType) return FInfotoColType[columnTypeStr];
- return ColumnType.Any;
+ return columnTypeStr ? FInfotoColType[columnTypeStr] : ColumnType.Any;
}
get content() {
@@ -449,6 +448,7 @@ export class SchemaBoolCell extends ObservableReactComponent<SchemaTableCellProp
return (
<div className="schemaBoolCell" style={{ display: 'flex', color, textDecoration, cursor, pointerEvents }}>
<input
+ onPointerDown={e => e.stopPropagation()}
style={{ marginRight: 4 }}
type="checkbox"
checked={BoolCast(this._props.Document[this._props.fieldKey])}