Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version 0.4.6-0 #206

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@samply/lens",
"description": "A web component library for clinical data search and visualisation",
"version": "0.4.5",
"version": "0.4.6-0",
"type": "module",
"module": "dist/lens.js",
"main": "dist/lens.umd.js",
Expand Down
7 changes: 0 additions & 7 deletions packages/lib/src/classes/spot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ export class Spot {
updateResponse(parsedResponse);
});

// read error events from beam
eventSource.addEventListener("error", (message) => {
console.error(`Beam returned error ${message}`);
errorChannel.set("Fehler von Beam erhalten"); // show user-facing error
eventSource.close();
});

// event source in javascript throws an error then the event source is closed by backend
eventSource.onerror = () => {
console.info(
Expand Down
23 changes: 22 additions & 1 deletion packages/lib/src/helpers/ast-transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,28 @@ import { get } from "svelte/store";
* @returns Ast: the AST will later be converted to a query language of choice
*/
export const buildAstFromQuery = (queryStore: QueryItem[][]): AstTopLayer => {
return returnNestedValues(queryStore) as AstTopLayer;
const ast = returnNestedValues(queryStore) as AstTopLayer;

// The empty query is currently a special case because focus and potentially other consumers want it like this
// Instead of:
// {"nodeType":"branch","operand":"OR","children":[{"nodeType":"branch","operand":"AND","children":[]}]}
// We return:
// {"nodeType":"branch","operand":"OR","children":[]}
if (ast.children.length === 1) {
const onlyChild = ast.children[0];
if (
onlyChild.nodeType === "branch" &&
onlyChild.children.length === 0
) {
return {
nodeType: "branch",
operand: "OR",
children: [],
};
}
}

return ast;
};

/**
Expand Down