Skip to content

Commit

Permalink
Fix deployment of query interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
gartens committed Jun 27, 2024
1 parent dbf2147 commit 8ba7b7c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Available Query Interfaces</h2>
</thead>
<tbody>
<tr *ngFor="let aQI of availableQueryInterfaces">
<td><strong>{{aQI.name}}</strong></td>
<td><strong>{{aQI.interfaceName}}</strong></td>
<td>{{aQI.description}}</td>
<td class="center">
<button cButton color="primary" size="sm" (click)="initAvailableQISettings(aQI)">Add</button>
Expand Down
19 changes: 7 additions & 12 deletions src/app/views/query-interfaces/query-interfaces.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export class QueryInterfacesComponent implements OnInit, OnDestroy {
this._crud.getAvailableQueryInterfaces().subscribe({
next: res => {
const availableQIs = <QueryInterfaceInformation[]>res;
availableQIs.sort((a, b) => (a.name > b.name) ? 1 : -1);
this.availableQueryInterfaces = <QueryInterfaceInformation[]>res;
availableQIs.sort((a, b) => (a.interfaceName > b.interfaceName) ? 1 : -1);
this.availableQueryInterfaces = availableQIs;
}, error: err => {
console.log(err);
}
Expand Down Expand Up @@ -191,22 +191,17 @@ export class QueryInterfacesComponent implements OnInit, OnDestroy {
return;
}
const deploy: QueryInterfaceInformationRequest = {
interfaceName: this.editingAvailableQI.interfaceName,
uniqueName: this.availableQIUniqueNameForm.controls['uniqueName'].value,
clazzName: this.editingAvailableQI.clazz,
currentSettings: {}
currentSettings: new Map()
};
for (const [k, v] of Object.entries(this.editingAvailableQIForm.controls)) {
deploy.currentSettings[k] = v.value;
}
this._crud.createQueryInterface(deploy).subscribe({
next: res => {
const result = <RelationalResult>res;
if (!result.error) {
this._toast.success('Added query interface: ' + deploy.uniqueName, result.query);
this._router.navigate(['./../'], {relativeTo: this._route});
} else {
this._toast.exception(result);
}
next: _ => {
this._toast.success('Added query interface: ' + deploy.uniqueName);
this._router.navigate(['./../'], {relativeTo: this._route});
this.QISettingsModal.hide();
}, error: err => {
this._toast.error('Could not add query interface: ' + deploy.uniqueName);
Expand Down
7 changes: 3 additions & 4 deletions src/app/views/query-interfaces/query-interfaces.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ export interface QueryInterface {
}

export interface QueryInterfaceInformation {
name: string;
interfaceName: string;
description: string;
clazz: string;
availableSettings: QueryInterfaceSetting[];
}

Expand All @@ -24,7 +23,7 @@ export interface QueryInterfaceSetting {
}

export interface QueryInterfaceInformationRequest {
clazzName: string;
interfaceName: string;
uniqueName: string;
currentSettings: any;//Map<string, string>
currentSettings: Map<string, string>;
}

0 comments on commit 8ba7b7c

Please sign in to comment.