aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-05-14 15:58:23 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-05-14 15:58:23 -0400
commitb27056fc67c654dea72338f928cd69026a501c0f (patch)
tree721306e275a36332a7a1fe17200fb86a23308503 /src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
parent4770a958a7b1003d636a4f9ea2cfdb76558e61b9 (diff)
editable columnheader progress; still not updating properly on adding new col
Diffstat (limited to 'src/client/views/collections/collectionSchema/CollectionSchemaView.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx39
1 files changed, 3 insertions, 36 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index d74cb56cf..2d181a772 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -277,6 +277,7 @@ export class CollectionSchemaView extends CollectionSubView() {
this.addNewKey(newKey, defaultVal);
console.log("added")
}
+ console.log("changed " + index)
const currKeys = this.columnKeys.slice(); // copy the column key array first, then change it.
currKeys[index] = newKey;
@@ -321,39 +322,6 @@ export class CollectionSchemaView extends CollectionSubView() {
return modField;
}
- // @action
- // setupAutoUpdate = (equation: string, doc: Doc) => {
- // return autorun(() => {
- // const result = this.parsedEquationResult(equation, doc);
- // doc[DocData][equation] = result;
- // });
- // }
-
- // parseEquation = (eq: string): [string, Map<string, Doc>] => {
- // const variablePattern = /[a-z]+/gi;
- // const tagRefPattern = /{([^}]*)}/g;
- // const docTagRefPairs = new Map<string, Doc>();
- // let modifiedEq = eq;
- // let match;
-
- // while (match = tagRefPattern.exec(eq)) {
- // const ref = match[1];
- // const [doc, key] = this.getCellInfoFromTag(ref);
- // docTagRefPairs.set(ref, doc);
- // const replacement = `docTagRefPairs.get('${ref}').${key}`;
- // modifiedEq = modifiedEq.replace(new RegExp(`{${ref}}`, 'g'), replacement);
- // }
-
- // modifiedEq = modifiedEq.replace(variablePattern, (match) => `doc.${match}`);
-
- // return [modifiedEq, docTagRefPairs];
- // }
-
- // parsedEquationResult = (eq: [string, Map<string, Doc>], doc: any): number => {
- // const func = new Function('doc', 'docTagRefPairs', 'return ' + eq[0]);
- // return func(doc, eq[1]);
- // }
-
@undoBatch
removeColumn = (index: number) => {
if (this.columnKeys.length === 1) return;
@@ -745,14 +713,13 @@ export class CollectionSchemaView extends CollectionSubView() {
};
@action
- setKey = (key: string, defaultVal?: any) => {
+ setKey = (key: string, defaultVal?: any, index?: number) => {
console.log("setKey called with" + key)
if (this._makeNewColumn) {
this.addColumn(key, defaultVal);
this._makeNewColumn = false;
} else {
- this.changeColumnKey(this._columnMenuIndex!, key, defaultVal);
- console.log("changed")
+ this.changeColumnKey(this._columnMenuIndex! | index!, key, defaultVal);
}
this.closeColumnMenu();
};