Add ability to name databases (#16)
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
25085a9bad
commit
468f210d59
@ -1,4 +1,10 @@
|
|||||||
<div class="database-wrapper">
|
<div class="database-wrapper">
|
||||||
|
<ion-input
|
||||||
|
[readonly]="readonly"
|
||||||
|
[(ngModel)]="dbName"
|
||||||
|
(ionChange)="onCellValueChanged()"
|
||||||
|
style="font-size: 15pt;"
|
||||||
|
></ion-input>
|
||||||
<ion-toolbar *ngIf="!readonly">
|
<ion-toolbar *ngIf="!readonly">
|
||||||
<ion-buttons>
|
<ion-buttons>
|
||||||
<ion-button (click)="onManageColumns()"><ion-icon name="build" color="primary"></ion-icon> Manage Columns</ion-button>
|
<ion-button (click)="onManageColumns()"><ion-icon name="build" color="primary"></ion-icon> Manage Columns</ion-button>
|
||||||
|
@ -32,6 +32,7 @@ export class DatabaseComponent implements OnInit {
|
|||||||
public pendingSetup = true;
|
public pendingSetup = true;
|
||||||
public dirty = false;
|
public dirty = false;
|
||||||
public lastClickRow = -1;
|
public lastClickRow = -1;
|
||||||
|
public dbName = '';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected api: ApiService,
|
protected api: ApiService,
|
||||||
@ -182,11 +183,16 @@ export class DatabaseComponent implements OnInit {
|
|||||||
.subscribe(res => {
|
.subscribe(res => {
|
||||||
this.rowData = res.data.map(x => x.RowData);
|
this.rowData = res.data.map(x => x.RowData);
|
||||||
this.agGridElement.api.setRowData(this.rowData);
|
this.agGridElement.api.setRowData(this.rowData);
|
||||||
|
|
||||||
|
this.api.post(`/db/${this.hostRecord.PageId}/${this.hostRecord.UUID}/set/${this.hostRecord.Value.Value}/name`,
|
||||||
|
{ Name: this.dbName })
|
||||||
|
.subscribe(resp => {
|
||||||
this.dirty = false;
|
this.dirty = false;
|
||||||
loader.dismiss();
|
loader.dismiss();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getColumnLoadObservable(): Observable<any> {
|
getColumnLoadObservable(): Observable<any> {
|
||||||
@ -249,6 +255,7 @@ export class DatabaseComponent implements OnInit {
|
|||||||
if ( !this.hostRecord.Value.Value && !this.readonly ) {
|
if ( !this.hostRecord.Value.Value && !this.readonly ) {
|
||||||
this.api.post(`/db/${this.hostRecord.PageId}/${this.hostRecord.UUID}/create`).subscribe(res => {
|
this.api.post(`/db/${this.hostRecord.PageId}/${this.hostRecord.UUID}/create`).subscribe(res => {
|
||||||
this.dbRecord = res.data;
|
this.dbRecord = res.data;
|
||||||
|
this.dbName = res.data.Name;
|
||||||
this.hostRecord.Value.Mode = 'database';
|
this.hostRecord.Value.Mode = 'database';
|
||||||
this.hostRecord.Value.Value = res.data.UUID;
|
this.hostRecord.Value.Value = res.data.UUID;
|
||||||
this.hostRecord.value = res.data.UUID;
|
this.hostRecord.value = res.data.UUID;
|
||||||
@ -260,6 +267,7 @@ export class DatabaseComponent implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
this.api.get(`/db/${this.hostRecord.PageId}/${this.hostRecord.UUID}/get/${this.hostRecord.Value.Value}`).subscribe(res => {
|
this.api.get(`/db/${this.hostRecord.PageId}/${this.hostRecord.UUID}/get/${this.hostRecord.Value.Value}`).subscribe(res => {
|
||||||
this.dbRecord = res.data;
|
this.dbRecord = res.data;
|
||||||
|
this.dbName = res.data.Name;
|
||||||
this.pendingSetup = false;
|
this.pendingSetup = false;
|
||||||
sub.next(true);
|
sub.next(true);
|
||||||
sub.complete();
|
sub.complete();
|
||||||
|
Loading…
Reference in New Issue
Block a user