mongo changeset WIP

This commit is contained in:
Jan Prochazka
2021-04-05 13:21:52 +02:00
parent c160fdb628
commit 29e6dad713
5 changed files with 38 additions and 11 deletions

View File

@@ -39,7 +39,7 @@ export default class ChangeSetGrider extends Grider {
) {
super();
this.changeSet = changeSetState && changeSetState.value;
this.insertedRows = getChangeSetInsertedRows(this.changeSet, display?.baseTable);
this.insertedRows = getChangeSetInsertedRows(this.changeSet, display?.baseTableOrCollection);
this.setChangeSet = value => dispatchChangeSet({ type: 'set', value });
this.rowCacheIndexes = new Set();
this.rowDataCache = {};
@@ -47,6 +47,8 @@ export default class ChangeSetGrider extends Grider {
this.rowDefinitionsCache = {};
this.batchChangeSet = null;
this.compiledMacroFunc = compileMacroFunction(macro, this._errors);
console.log('changeSet', this.changeSet);
}
get errors() {
@@ -110,7 +112,7 @@ export default class ChangeSetGrider extends Grider {
}
get canInsert() {
return !!this.display.baseTable;
return !!this.display.baseTableOrCollection;
}
getRowData(index: number) {
@@ -157,7 +159,7 @@ export default class ChangeSetGrider extends Grider {
insertRow(): number {
const res = this.rowCountInUpdate;
this.applyModification(chs => changeSetInsertNewRow(chs, this.display.baseTable));
this.applyModification(chs => changeSetInsertNewRow(chs, this.display.baseTableOrCollection));
return res;
}

View File

@@ -98,9 +98,10 @@
<style>
.toolbar {
background: var(--theme-bg-3);
background: var(--theme-bg-1);
display: flex;
border-bottom: 1px solid var(--theme-border);
border-top: 2px solid var(--theme-border);
margin-bottom: 3px;
}