Associate database column data by UUID, not header name (#31)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
69cfef0193
commit
e3402f7501
@ -1,5 +1,6 @@
|
|||||||
import {Component, Input, OnInit} from '@angular/core';
|
import {Component, Input, OnInit} from '@angular/core';
|
||||||
import {ModalController} from '@ionic/angular';
|
import {ModalController} from '@ionic/angular';
|
||||||
|
import {uuid_v4} from '../../../../utility';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'editor-database-columns',
|
selector: 'editor-database-columns',
|
||||||
@ -16,7 +17,7 @@ export class ColumnsComponent implements OnInit {
|
|||||||
ngOnInit() {}
|
ngOnInit() {}
|
||||||
|
|
||||||
onAddColumnClick() {
|
onAddColumnClick() {
|
||||||
this.columnSets.push({headerName: '', field: '', Type: '', additionalData: {}});
|
this.columnSets.push({headerName: '', field: uuid_v4(), Type: '', additionalData: {}});
|
||||||
}
|
}
|
||||||
|
|
||||||
onAddOption(i) {
|
onAddOption(i) {
|
||||||
@ -36,7 +37,9 @@ export class ColumnsComponent implements OnInit {
|
|||||||
dismissModal(doSave = true) {
|
dismissModal(doSave = true) {
|
||||||
if ( doSave ) {
|
if ( doSave ) {
|
||||||
this.columnSets = this.columnSets.map(x => {
|
this.columnSets = this.columnSets.map(x => {
|
||||||
x.field = x.headerName;
|
if ( !x.field ) {
|
||||||
|
x.field = uuid_v4();
|
||||||
|
}
|
||||||
return x;
|
return x;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -33,6 +33,10 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
|
|||||||
public notAvailableOffline = false;
|
public notAvailableOffline = false;
|
||||||
protected dbId!: string;
|
protected dbId!: string;
|
||||||
|
|
||||||
|
title = 'app';
|
||||||
|
columnDefs = [];
|
||||||
|
rowData = [];
|
||||||
|
|
||||||
public isDark() {
|
public isDark() {
|
||||||
return document.body.classList.contains('dark');
|
return document.body.classList.contains('dark');
|
||||||
}
|
}
|
||||||
@ -49,10 +53,6 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
|
|||||||
public editorService: EditorService,
|
public editorService: EditorService,
|
||||||
) { super(); }
|
) { super(); }
|
||||||
|
|
||||||
title = 'app';
|
|
||||||
columnDefs = [];
|
|
||||||
rowData = [];
|
|
||||||
|
|
||||||
public isDirty(): boolean | Promise<boolean> {
|
public isDirty(): boolean | Promise<boolean> {
|
||||||
return this.dirty;
|
return this.dirty;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user