From c8b6b4d4adff3c8db142ad5a8dda34cdb52f111a Mon Sep 17 00:00:00 2001 From: pogi7 Date: Mon, 6 May 2024 09:25:02 -0700 Subject: [PATCH 1/2] open property panel immediately when showProperties command is called Signed-off-by: pogi7 --- controller/src/extension.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controller/src/extension.ts b/controller/src/extension.ts index f27a10f..8c80c08 100644 --- a/controller/src/extension.ts +++ b/controller/src/extension.ts @@ -230,6 +230,9 @@ export function activate(context: vscode.ExtensionContext) { vscode.commands.registerCommand( "oml-vision.showProperties", async (iri: string = "", webviewType: IWebviewType) => { + // Open the property panel immediately when showProperties command is called + provider.showPropertyPanel(); + let types: string[] = []; if (iri !== "") { const rawTypesQuery = getIriTypes(iri); @@ -252,7 +255,6 @@ export function activate(context: vscode.ExtensionContext) { command: Commands.SHOW_PROPERTIES, payload: propertyData, }); - provider.showPropertyPanel(); } ) ); From c12dd84ca17f483a476c85f4866774c8a148b704 Mon Sep 17 00:00:00 2001 From: pogi7 Date: Wed, 8 May 2024 16:16:22 -0700 Subject: [PATCH 2/2] fix bug with undefined sparql query when clicking some nodes in the DiagramView Signed-off-by: pogi7 --- controller/src/sparql/SparqlClient.ts | 10 +++++----- view/src/components/Diagram/diagramUtils.ts | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/controller/src/sparql/SparqlClient.ts b/controller/src/sparql/SparqlClient.ts index e8ac6d7..5709a8e 100644 --- a/controller/src/sparql/SparqlClient.ts +++ b/controller/src/sparql/SparqlClient.ts @@ -21,11 +21,6 @@ export async function SparqlClient(query: string, service: SparqlServiceType, ir throw new Error(`No SPARQL queries found in current model.`); } - if (!QUERY && !query) { - vscode.window.showErrorMessage(`Unknown SPARQL query: ${query}`); - throw new Error(`Unknown SPARQL query: ${query}`); - } - if (!QUERY) { QUERY = query // Uncomment to have VSCode notify users about SPARQL query not being defined in src/vision/sparql directory @@ -38,6 +33,11 @@ export async function SparqlClient(query: string, service: SparqlServiceType, ir QUERY = QUERY.replace(/\$\{iri\}/g, iri); } + if (!QUERY && !query) { + vscode.window.showErrorMessage(`Unknown SPARQL query: ${query}`); + throw new Error(`Unknown SPARQL query: ${query}`); + } + if (service === "query") { console.log(`EXECUTE QUERY SERVICE: ${QUERY}`) return await queryEngine(QUERY); diff --git a/view/src/components/Diagram/diagramUtils.ts b/view/src/components/Diagram/diagramUtils.ts index 4caaffe..ae4d4d9 100644 --- a/view/src/components/Diagram/diagramUtils.ts +++ b/view/src/components/Diagram/diagramUtils.ts @@ -593,6 +593,10 @@ const processNodes = ( } } + if (node.type === "NA") { + node.type = "default"; + } + const processedNode: any = { id: node.id, data: node.data,