this._props.resizeColumn(e, this._props.columnIndex)} />
-
{this.editableView}
+
{this.editableView}
-
- {this.displayButton ? this.headerButton : null}
+
+ {this.headerButton}
diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
index c9feeac6b..077d95c57 100644
--- a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
@@ -97,10 +97,6 @@ export class SchemaRowBox extends ViewBoxBaseComponent
() {
return ''
}
- @computed get refSelectModeInfo() {
- return this.schemaView._referenceSelectMode;
- }
-
@computed get menuInfos() {
const infos: Array = [];
if (this.Document._lockedSchemaEditing) infos.push('lock');
@@ -178,7 +174,7 @@ export class SchemaRowBox extends ViewBoxBaseComponent() {
{this.schemaView?.columnKeys?.map((key, index) => (
{
// private _fieldRef: SchemaCellField | null = null;
+ private _submittedValue: string = '';
constructor(props: SchemaTableCellProps) {
super(props);
@@ -157,19 +159,31 @@ export class SchemaTableCell extends ObservableReactComponent {
- const idPattern = /idToDoc\((.*?)\)/g;
let modField = field.slice();
+ let eqSymbol: string = '';
+ if (modField.startsWith('=')) {modField = modField.substring(1); eqSymbol += '=';}
+ if (modField.startsWith(':=')) {modField = modField.substring(2); eqSymbol += ':=';}
+
+ const idPattern = /idToDoc\((.*?)\)/g;
let matches;
let results = new Array<[id: string, func: string]>();
while ((matches = idPattern.exec(field)) !== null) {results.push([matches[0], matches[1].replace(/"/g, '')]); }
results.forEach((idFuncPair) => {modField = modField.replace(idFuncPair[0], 'd' + (DocumentView.getDocViewIndex(IdToDoc(idFuncPair[1]))).toString());})
- if (modField.charAt(modField.length - 1) === ';') modField = modField.substring(0, modField.length - 1);
+
+ for (let i = 0; i < modField.length; ++i){
+
+ }
+
+ if (modField.endsWith(';')) modField = modField.substring(0, modField.length - 1);
+
+ const inQuotes = (field: string) => {return ((field.startsWith('`') && field.endsWith('`')) || (field.startsWith("'") && field.endsWith("'")) || (field.startsWith('"') && field.endsWith('"')))}
+ if (!inQuotes(this._submittedValue) && inQuotes(modField)) modField = modField.substring(1, modField.length - 1);
const selfRefPattern = `d${this.docIndex}.${this._props.fieldKey}`
const selfRefRegX = RegExp(selfRefPattern, 'g');
if (selfRefRegX.exec(modField) !== null) { return 'Invalid'}
- return modField;
+ return eqSymbol + modField;
}
@computed get defaultCellContent() {
@@ -196,7 +210,8 @@ export class SchemaTableCell extends ObservableReactComponent this.cleanupField(Field.toKeyValueString(fieldProps.Document, this._props.fieldKey, SnappingManager.MetaKey))}
+ ////const script = ScriptCast(fieldProps.Document[this._props.fieldKey]).rawscript;
+ GetValue={() => ScriptCast(fieldProps.Document[this._props.fieldKey])?.rawscript ?? ''}
SetValue={undoable((value: string, shiftDown?: boolean, enterKey?: boolean) => {
if (shiftDown && enterKey) {
this._props.setColumnValues(this._props.fieldKey.replace(/^_/, ''), value);
@@ -205,6 +220,7 @@ export class SchemaTableCell extends ObservableReactComponent