Associate database column data by UUID, not header name (#31)
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Garrett Mills 2020-11-10 07:45:56 -06:00
parent 69cfef0193
commit e3402f7501
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246
2 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,6 @@
import {Component, Input, OnInit} from '@angular/core';
import {ModalController} from '@ionic/angular';
import {uuid_v4} from '../../../../utility';
@Component({
selector: 'editor-database-columns',
@ -16,7 +17,7 @@ export class ColumnsComponent implements OnInit {
ngOnInit() {}
onAddColumnClick() {
this.columnSets.push({headerName: '', field: '', Type: '', additionalData: {}});
this.columnSets.push({headerName: '', field: uuid_v4(), Type: '', additionalData: {}});
}
onAddOption(i) {
@ -36,7 +37,9 @@ export class ColumnsComponent implements OnInit {
dismissModal(doSave = true) {
if ( doSave ) {
this.columnSets = this.columnSets.map(x => {
x.field = x.headerName;
if ( !x.field ) {
x.field = uuid_v4();
}
return x;
});

View File

@ -33,6 +33,10 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
public notAvailableOffline = false;
protected dbId!: string;
title = 'app';
columnDefs = [];
rowData = [];
public isDark() {
return document.body.classList.contains('dark');
}
@ -49,10 +53,6 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
public editorService: EditorService,
) { super(); }
title = 'app';
columnDefs = [];
rowData = [];
public isDirty(): boolean | Promise<boolean> {
return this.dirty;
}