From 3d838602fd56055b878eae9bdb9f4b3517e6eeb7 Mon Sep 17 00:00:00 2001 From: Martin Vahlensieck Date: Thu, 27 Jun 2024 11:19:38 +0200 Subject: [PATCH 1/4] Fix deployment of query interfaces --- .../query-interfaces.component.ts | 15 +++++---------- .../query-interfaces/query-interfaces.model.ts | 5 ++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/app/views/query-interfaces/query-interfaces.component.ts b/src/app/views/query-interfaces/query-interfaces.component.ts index f4ea058f..2776f2b2 100644 --- a/src/app/views/query-interfaces/query-interfaces.component.ts +++ b/src/app/views/query-interfaces/query-interfaces.component.ts @@ -190,22 +190,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 = 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); diff --git a/src/app/views/query-interfaces/query-interfaces.model.ts b/src/app/views/query-interfaces/query-interfaces.model.ts index eb6ef4eb..b009c122 100644 --- a/src/app/views/query-interfaces/query-interfaces.model.ts +++ b/src/app/views/query-interfaces/query-interfaces.model.ts @@ -10,7 +10,6 @@ export interface QueryInterface { export interface QueryInterfaceInformation { interfaceName: string; description: string; - clazz: string; availableSettings: QueryInterfaceSetting[]; } @@ -24,7 +23,7 @@ export interface QueryInterfaceSetting { } export interface QueryInterfaceInformationRequest { - clazzName: string; + interfaceName: string; uniqueName: string; - currentSettings: any;//Map + currentSettings: Map; } From 34dd45f0c1805fa1114f77238d66209c0623e888 Mon Sep 17 00:00:00 2001 From: Martin Vahlensieck Date: Fri, 28 Jun 2024 11:13:26 +0200 Subject: [PATCH 2/4] Rename QueryInterfaceInformationRequest to QueryInterfaceCreateRequest --- .../views/query-interfaces/query-interfaces.component.ts | 8 ++++---- src/app/views/query-interfaces/query-interfaces.model.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/views/query-interfaces/query-interfaces.component.ts b/src/app/views/query-interfaces/query-interfaces.component.ts index 2776f2b2..ca8d1618 100644 --- a/src/app/views/query-interfaces/query-interfaces.component.ts +++ b/src/app/views/query-interfaces/query-interfaces.component.ts @@ -9,7 +9,7 @@ import {RelationalResult} from '../../components/data-view/models/result-set.mod import { QueryInterface, QueryInterfaceInformation, - QueryInterfaceInformationRequest, + QueryInterfaceCreateRequest, QueryInterfaceSetting } from './query-interfaces.model'; import {LeftSidebarService} from '../../components/left-sidebar/left-sidebar.service'; @@ -189,13 +189,13 @@ export class QueryInterfacesComponent implements OnInit, OnDestroy { if (!this.availableQIUniqueNameForm.valid) { return; } - const deploy: QueryInterfaceInformationRequest = { + const deploy: QueryInterfaceCreateRequest = { interfaceName: this.editingAvailableQI.interfaceName, uniqueName: this.availableQIUniqueNameForm.controls['uniqueName'].value, - currentSettings: new Map() + settings: new Map() }; for (const [k, v] of Object.entries(this.editingAvailableQIForm.controls)) { - deploy.currentSettings[k] = v.value; + deploy.settings[k] = v.value; } this._crud.createQueryInterface(deploy).subscribe({ next: _ => { diff --git a/src/app/views/query-interfaces/query-interfaces.model.ts b/src/app/views/query-interfaces/query-interfaces.model.ts index b009c122..ff0b9096 100644 --- a/src/app/views/query-interfaces/query-interfaces.model.ts +++ b/src/app/views/query-interfaces/query-interfaces.model.ts @@ -22,8 +22,8 @@ export interface QueryInterfaceSetting { options: string[]; } -export interface QueryInterfaceInformationRequest { +export interface QueryInterfaceCreateRequest { interfaceName: string; uniqueName: string; - currentSettings: Map; + settings: Map; } From baaeb5e4ab50cc6eebb3faeaf5be1069a066ea56 Mon Sep 17 00:00:00 2001 From: Martin Vahlensieck Date: Fri, 28 Jun 2024 12:15:54 +0200 Subject: [PATCH 3/4] Rename interfaceName to interfaceType --- .../views/query-interfaces/query-interfaces.component.html | 2 +- .../views/query-interfaces/query-interfaces.component.ts | 6 +++--- src/app/views/query-interfaces/query-interfaces.model.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/views/query-interfaces/query-interfaces.component.html b/src/app/views/query-interfaces/query-interfaces.component.html index 6a2237c4..a73ba957 100644 --- a/src/app/views/query-interfaces/query-interfaces.component.html +++ b/src/app/views/query-interfaces/query-interfaces.component.html @@ -22,7 +22,7 @@

Available Query Interfaces

- {{ aQI.interfaceName }} + {{ aQI.interfaceType }} {{aQI.description}} diff --git a/src/app/views/query-interfaces/query-interfaces.component.ts b/src/app/views/query-interfaces/query-interfaces.component.ts index ca8d1618..c1504a14 100644 --- a/src/app/views/query-interfaces/query-interfaces.component.ts +++ b/src/app/views/query-interfaces/query-interfaces.component.ts @@ -85,8 +85,8 @@ export class QueryInterfacesComponent implements OnInit, OnDestroy { getAvailableQueryInterfaces() { this._crud.getAvailableQueryInterfaces().subscribe({ next: availableQIs => { - availableQIs.sort((a, b) => (a.interfaceName > b.interfaceName) ? 1 : -1); - this.availableQueryInterfaces = availableQIs; + availableQIs.sort((a, b) => (a.interfaceType > b.interfaceType) ? 1 : -1); + this.availableQueryInterfaces = availableQIs; }, error: err => { console.log(err); } @@ -190,7 +190,7 @@ export class QueryInterfacesComponent implements OnInit, OnDestroy { return; } const deploy: QueryInterfaceCreateRequest = { - interfaceName: this.editingAvailableQI.interfaceName, + interfaceType: this.editingAvailableQI.interfaceType, uniqueName: this.availableQIUniqueNameForm.controls['uniqueName'].value, settings: new Map() }; diff --git a/src/app/views/query-interfaces/query-interfaces.model.ts b/src/app/views/query-interfaces/query-interfaces.model.ts index ff0b9096..ff43d580 100644 --- a/src/app/views/query-interfaces/query-interfaces.model.ts +++ b/src/app/views/query-interfaces/query-interfaces.model.ts @@ -8,7 +8,7 @@ export interface QueryInterface { } export interface QueryInterfaceInformation { - interfaceName: string; + interfaceType: string; description: string; availableSettings: QueryInterfaceSetting[]; } @@ -23,7 +23,7 @@ export interface QueryInterfaceSetting { } export interface QueryInterfaceCreateRequest { - interfaceName: string; + interfaceType: string; uniqueName: string; settings: Map; } From 66bbc78b6a05a33eba3cad2fcfb40f6cca0ceb1d Mon Sep 17 00:00:00 2001 From: Martin Vahlensieck Date: Mon, 29 Jul 2024 08:37:54 +0200 Subject: [PATCH 4/4] Rename QueryInterfaceInformation to QueryInterfaceTemplate --- src/app/services/crud.service.ts | 4 ++-- .../views/query-interfaces/query-interfaces.component.ts | 8 ++++---- src/app/views/query-interfaces/query-interfaces.model.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/services/crud.service.ts b/src/app/services/crud.service.ts index e3b6af80..42011388 100644 --- a/src/app/services/crud.service.ts +++ b/src/app/services/crud.service.ts @@ -41,7 +41,7 @@ import { import {ForeignKey, Uml} from '../views/uml/uml.model'; import {Validators} from '@angular/forms'; import {AdapterModel} from '../views/adapters/adapter.model'; -import {QueryInterface, QueryInterfaceInformation} from '../views/query-interfaces/query-interfaces.model'; +import {QueryInterface, QueryInterfaceTemplate} from '../views/query-interfaces/query-interfaces.model'; import {AlgNodeModel, Node} from '../views/querying/algebra/algebra.model'; import {WebSocket} from './webSocket'; import {Observable} from 'rxjs'; @@ -559,7 +559,7 @@ export class CrudService { } getAvailableQueryInterfaces() { - return this._http.get(`${this.httpUrl}/getAvailableQueryInterfaces`); + return this._http.get(`${this.httpUrl}/getAvailableQueryInterfaces`); } createQueryInterface(request: any) { diff --git a/src/app/views/query-interfaces/query-interfaces.component.ts b/src/app/views/query-interfaces/query-interfaces.component.ts index c1504a14..016618b7 100644 --- a/src/app/views/query-interfaces/query-interfaces.component.ts +++ b/src/app/views/query-interfaces/query-interfaces.component.ts @@ -8,7 +8,7 @@ import {ToasterService} from '../../components/toast-exposer/toaster.service'; import {RelationalResult} from '../../components/data-view/models/result-set.model'; import { QueryInterface, - QueryInterfaceInformation, + QueryInterfaceTemplate, QueryInterfaceCreateRequest, QueryInterfaceSetting } from './query-interfaces.model'; @@ -28,7 +28,7 @@ export class QueryInterfacesComponent implements OnInit, OnDestroy { private readonly _sidebar = inject(LeftSidebarService); queryInterfaces: QueryInterface[]; - availableQueryInterfaces: QueryInterfaceInformation[]; + availableQueryInterfaces: QueryInterfaceTemplate[]; route: String; routeListener; private subscriptions = new Subscription(); @@ -37,7 +37,7 @@ export class QueryInterfacesComponent implements OnInit, OnDestroy { editingQIForm: UntypedFormGroup; deletingQI; - editingAvailableQI: QueryInterfaceInformation; + editingAvailableQI: QueryInterfaceTemplate; editingAvailableQIForm: UntypedFormGroup; availableQIUniqueNameForm: UntypedFormGroup; @@ -143,7 +143,7 @@ export class QueryInterfacesComponent implements OnInit, OnDestroy { }); } - initAvailableQISettings(availableQI: QueryInterfaceInformation) { + initAvailableQISettings(availableQI: QueryInterfaceTemplate) { this.editingAvailableQI = availableQI; const fc = {}; for (const [k, v] of Object.entries(this.editingAvailableQI.availableSettings)) { diff --git a/src/app/views/query-interfaces/query-interfaces.model.ts b/src/app/views/query-interfaces/query-interfaces.model.ts index ff43d580..5888b4b5 100644 --- a/src/app/views/query-interfaces/query-interfaces.model.ts +++ b/src/app/views/query-interfaces/query-interfaces.model.ts @@ -7,7 +7,7 @@ export interface QueryInterface { currentSettings: Map; } -export interface QueryInterfaceInformation { +export interface QueryInterfaceTemplate { interfaceType: string; description: string; availableSettings: QueryInterfaceSetting[];