From 7845fff8d3d9914f2c9b7c1dafdf305312686b03 Mon Sep 17 00:00:00 2001
From: Leonardo Christino <leomilho@gmail.com>
Date: Wed, 9 Aug 2023 14:35:25 +0200
Subject: [PATCH] feat(css): fix tsconfig build

---
 .eslintignore                                 |   2 +
 .gitignore                                    |   5 +-
 apps/web/.eslintignore                        |   4 +-
 apps/web/.gitignore                           |   3 +
 apps/web/node.d.ts                            |  18 ----
 apps/web/src/app/panels/Visualization.tsx     |   4 +-
 .../AddDatabaseForm/newdatabaseform.tsx       |  12 +--
 apps/web/tsconfig.json                        |  34 +++++-
 apps/web/tsconfig.node.json                   |  10 ++
 libs/config/.eslintignore                     |   4 +-
 libs/config/tsconfig.json                     |  24 ++---
 libs/config/tsconfig.lib.json                 |  13 +++
 libs/config/tsconfig.node.json                |  10 ++
 libs/shared/.eslintignore                     |   2 +
 libs/shared/.gitignore                        |   3 +
 .../lib/querybuilder/model/logic/utils.ts     |   0
 .../lib/querybuilder/panel/nodeUtils.ts       |   0
 .../customFlowPills/logicpill/logicpill.tsx   | 100 ++++++++++--------
 .../querybuilder/query-utils/query2backend.ts |   4 +-
 .../popup/attribute-analytics-popup-menu.tsx  |   1 +
 .../popup/node-quality-relation-popup.tsx     |  17 +--
 ...attribute-analytics-popup-menu.stories.tsx |   2 +-
 .../attribute-analytics-popup-menu.tsx        |   1 +
 .../nodes/popup/popupmenus/filterbar.tsx      |   1 +
 .../schema-utils/schema-backend-models.ts     |   0
 .../lib/vis/geovis/GeoNodeLinkMap.stories.tsx |   1 -
 .../NodeLinkConfigPanelViewModelImpl.tsx      |   2 +
 .../lib/vis/paohvis/paohvis.stories.tsx       |   1 -
 .../lib/vis/paohvis/paohvisViewModel.tsx      |   0
 libs/shared/lib/vis/rawjsonvis/rawjsonvis.tsx |   2 +-
 .../CalcConnectionLinePositionsUseCase.tsx    |   8 +-
 .../CalcEntityAttrNamesFromResultUseCase.tsx  |   1 -
 libs/shared/node.d.ts                         |  18 ----
 libs/shared/tsconfig.json                     |  32 +++++-
 libs/shared/tsconfig.node.json                |  10 ++
 libs/shared/vite.config.ts                    |  11 +-
 libs/storybook/.eslintignore                  |   2 +
 libs/storybook/.gitignore                     |   3 +
 38 files changed, 218 insertions(+), 147 deletions(-)
 delete mode 100644 apps/web/node.d.ts
 create mode 100644 apps/web/tsconfig.node.json
 create mode 100644 libs/config/tsconfig.lib.json
 create mode 100644 libs/config/tsconfig.node.json
 delete mode 100644 libs/shared/lib/querybuilder/model/logic/utils.ts
 delete mode 100644 libs/shared/lib/querybuilder/panel/nodeUtils.ts
 delete mode 100644 libs/shared/lib/schema/schema-utils/schema-backend-models.ts
 delete mode 100644 libs/shared/lib/vis/paohvis/paohvisViewModel.tsx
 delete mode 100644 libs/shared/node.d.ts
 create mode 100644 libs/shared/tsconfig.node.json

diff --git a/.eslintignore b/.eslintignore
index abd9e2b17..325d9788d 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -2,3 +2,5 @@ node_modules/*
 node_modules/
 node_modules
 *.d.ts
+*.mjs
+*.tsbuildinfo
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 3d9346567..6f9727aa4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -75,4 +75,7 @@ Thumbs.db
 
 # Certs
 certs/*.pem
-node_modules
\ No newline at end of file
+node_modules
+
+tsconfig.tsbuildinfo
+vite.config.ts.*
\ No newline at end of file
diff --git a/apps/web/.eslintignore b/apps/web/.eslintignore
index ebd538ec9..ed9d65c51 100644
--- a/apps/web/.eslintignore
+++ b/apps/web/.eslintignore
@@ -1,4 +1,6 @@
 node_modules/*
 node_modules/
 node_modules
-*.d.ts
\ No newline at end of file
+*.d.ts
+*.mjs
+*.tsbuildinfo
\ No newline at end of file
diff --git a/apps/web/.gitignore b/apps/web/.gitignore
index a547bf36d..dd4d473b2 100644
--- a/apps/web/.gitignore
+++ b/apps/web/.gitignore
@@ -22,3 +22,6 @@ dist-ssr
 *.njsproj
 *.sln
 *.sw?
+
+tsconfig.tsbuildinfo
+vite.config.ts.*
\ No newline at end of file
diff --git a/apps/web/node.d.ts b/apps/web/node.d.ts
deleted file mode 100644
index 544d25be2..000000000
--- a/apps/web/node.d.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-interface ImportMeta {
-  env: {
-    VITE_BACKEND_URL: string;
-    VITE_BACKEND_WSS_URL: string;
-    VITE_BACKEND_USER: string;
-    VITE_BACKEND_SCHEMA: string;
-    VITE_BACKEND_QUERY: string;
-    VITE_STAGING: string;
-    VITE_KEYCLOAK_URL: string;
-    VITE_KEYCLOAK_REALM: string;
-    VITE_KEYCLOAK_CLIENT: string;
-  };
-}
-
-declare module "*.png";
-declare module "*.svg";
-declare module "*.jpeg";
-declare module "*.jpg";
\ No newline at end of file
diff --git a/apps/web/src/app/panels/Visualization.tsx b/apps/web/src/app/panels/Visualization.tsx
index c7833a6d2..4aa79b6b3 100644
--- a/apps/web/src/app/panels/Visualization.tsx
+++ b/apps/web/src/app/panels/Visualization.tsx
@@ -37,8 +37,8 @@ export const VisualizationPanel = () => {
           height: '95vh', */}
       <div className="w-full h-[calc(100%-2rem)]">
         {/* <RawJSONVis /> */}
-        <PaohVis rowHeight={30} hyperedgeColumnWidth={30} gapBetweenRanges={3} />
-        {/* <NodeLinkVis /> */}
+        {/* <PaohVis rowHeight={30} hyperedgeColumnWidth={30} gapBetweenRanges={3} /> */}
+        <NodeLinkVis />
         {/* <SemanticSubstrates /> */}
       </div>
       {/* <div /> */}
diff --git a/apps/web/src/components/navbar/AddDatabaseForm/newdatabaseform.tsx b/apps/web/src/components/navbar/AddDatabaseForm/newdatabaseform.tsx
index 4ad2145c5..dbaedc458 100644
--- a/apps/web/src/components/navbar/AddDatabaseForm/newdatabaseform.tsx
+++ b/apps/web/src/components/navbar/AddDatabaseForm/newdatabaseform.tsx
@@ -90,7 +90,7 @@ export const NewDatabaseForm = (props: { onClose(): void; open: boolean }) => {
           placeHolder="neo4j"
           value={state.name}
           validate={(v) => {
-            hasError['name'] = v.length === 0;
+            setHasError({ ...hasError, name: v.length === 0 });
             return v.length > 0;
           }}
           onChange={(value) =>
@@ -108,7 +108,7 @@ export const NewDatabaseForm = (props: { onClose(): void; open: boolean }) => {
           placeHolder="internal_database_name"
           value={state.internal_database_name}
           validate={(v) => {
-            hasError['internal_database_name'] = v.length === 0;
+            setHasError({ ...hasError, internal_database_name: v.length === 0 });
             return v.length > 0;
           }}
           onChange={(value) =>
@@ -172,7 +172,7 @@ export const NewDatabaseForm = (props: { onClose(): void; open: boolean }) => {
             placeHolder="neo4j"
             value={state.url}
             validate={(v) => {
-              hasError['url'] = v.length === 0;
+              setHasError({ ...hasError, url: v.length === 0 });
               return v.length > 0;
             }}
             onChange={(value) =>
@@ -190,7 +190,7 @@ export const NewDatabaseForm = (props: { onClose(): void; open: boolean }) => {
             placeHolder="neo4j"
             value={state.port}
             validate={(v) => {
-              hasError['port'] = !(v <= 9999 && v > 0);
+              setHasError({ ...hasError, port: !(v <= 9999 && v > 0) });
               return v <= 9999 && v > 0;
             }}
             onChange={(value) => handlePortChanged(value)}
@@ -205,7 +205,7 @@ export const NewDatabaseForm = (props: { onClose(): void; open: boolean }) => {
             placeHolder="username"
             value={state.username}
             validate={(v) => {
-              hasError['username'] = v.length === 0;
+              setHasError({ ...hasError, username: v.length === 0 });
               return v.length > 0;
             }}
             onChange={(value) =>
@@ -222,7 +222,7 @@ export const NewDatabaseForm = (props: { onClose(): void; open: boolean }) => {
             placeHolder="password"
             value={state.password}
             validate={(v) => {
-              hasError['password'] = v.length === 0;
+              setHasError({ ...hasError, password: v.length === 0 });
               return v.length > 0;
             }}
             onChange={(value) =>
diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json
index 345e8b04c..43b6544f1 100644
--- a/apps/web/tsconfig.json
+++ b/apps/web/tsconfig.json
@@ -1,4 +1,34 @@
 {
-  "extends": "config/tsconfig.json",
-  "files": ["vite.config.ts"]
+  "$schema": "https://json.schemastore.org/tsconfig",
+  "display": "React Library",
+  "target": "ESNext",
+  "compilerOptions": {
+    "jsx": "react-jsx",
+    "allowJs": true,
+    "esModuleInterop": true,
+    "allowSyntheticDefaultImports": true,
+    "forceConsistentCasingInFileNames": true,
+    "strict": true,
+    "noImplicitOverride": false,
+    "noImplicitReturns": true,
+    "noFallthroughCasesInSwitch": true,
+    "target": "ESNext",
+    "useDefineForClassFields": true,
+    "lib": ["DOM", "DOM.Iterable", "ESNext"],
+    "skipLibCheck": true,
+    "module": "ESNext",
+    "moduleResolution": "node",
+    "resolveJsonModule": true,
+    "isolatedModules": true,
+    "noEmit": true,
+    "baseUrl": ".",
+    "types": ["vite/client"],
+    "paths": {
+      "@graphpolaris/shared/lib/*": ["../../libs/shared/lib/*"]
+    }
+  },
+  "exclude": ["node_modules", "public", "dist", "build"],
+  "include": ["vite.config.ts", "../../libs/shared/lib/**/*", "src/**/*"],
+  "files": ["vite.config.ts"],
+  "references": [{ "path": "./tsconfig.node.json" }]
 }
diff --git a/apps/web/tsconfig.node.json b/apps/web/tsconfig.node.json
new file mode 100644
index 000000000..a54ca1adb
--- /dev/null
+++ b/apps/web/tsconfig.node.json
@@ -0,0 +1,10 @@
+{
+  "compilerOptions": {
+    "composite": true,
+    "module": "ESNext",
+    "moduleResolution": "Node",
+    "allowSyntheticDefaultImports": true,
+    "types": ["node", "vite/client"]
+  },
+  "include": ["vite.config.ts"]
+}
diff --git a/libs/config/.eslintignore b/libs/config/.eslintignore
index ebd538ec9..ed9d65c51 100644
--- a/libs/config/.eslintignore
+++ b/libs/config/.eslintignore
@@ -1,4 +1,6 @@
 node_modules/*
 node_modules/
 node_modules
-*.d.ts
\ No newline at end of file
+*.d.ts
+*.mjs
+*.tsbuildinfo
\ No newline at end of file
diff --git a/libs/config/tsconfig.json b/libs/config/tsconfig.json
index d30b501fd..8f623bfdd 100644
--- a/libs/config/tsconfig.json
+++ b/libs/config/tsconfig.json
@@ -7,33 +7,25 @@
     "allowJs": true,
     "esModuleInterop": true,
     "allowSyntheticDefaultImports": true,
-    "forceConsistentCasingInFileNames": true,
+    "forceConsistentCasingInFileNames": false,
     "strict": true,
     "noImplicitOverride": false,
-    "noImplicitReturns": true,
-    "noFallthroughCasesInSwitch": true,
+    "noImplicitReturns": false,
+    "noFallthroughCasesInSwitch": false,
     "target": "ESNext",
     "useDefineForClassFields": true,
-    "lib": ["DOM", "DOM.Iterable", "ESNext"],
+    "lib": ["DOM", "DOM.Iterable", "ESNext", "ES6", "ES2017"],
     "skipLibCheck": true,
     "module": "ESNext",
     "moduleResolution": "node",
     "resolveJsonModule": true,
-    "isolatedModules": true,
+    "isolatedModules": false,
     "noEmit": true,
     "baseUrl": ".",
-    "paths": {
-      "@graphpolaris/shared/lib/*": ["../../libs/shared/lib/*"]
-    },
-    "composite": true,
     "inlineSources": false,
-    "types": [],
     "noUnusedLocals": false,
     "noUnusedParameters": false,
-    "preserveWatchOutput": true
-  },
-  "exclude": ["node_modules", "public", "dist", "build"],
-  "include": ["src", "lib", "src/**/*"],
-  "files": ["./node.d.ts"],
-  "references": []
+    "composite": true,
+    "types": ["vite/client"]
+  }
 }
diff --git a/libs/config/tsconfig.lib.json b/libs/config/tsconfig.lib.json
new file mode 100644
index 000000000..a1f1afa7a
--- /dev/null
+++ b/libs/config/tsconfig.lib.json
@@ -0,0 +1,13 @@
+{
+  "extends": "./tsconfig.json",
+  "compilerOptions": {
+    "composite": false,
+    "declaration": true,
+    "preserveWatchOutput": true,
+    "lib": ["ES2017", "DOM", "DOM.Iterable", "ESNext"]
+  },
+  "exclude": ["dist", "build", "node_modules"],
+  "include": ["src", "lib", "lib/**/*"],
+  "files": [],
+  "references": [{ "path": "./tsconfig.node.json" }]
+}
diff --git a/libs/config/tsconfig.node.json b/libs/config/tsconfig.node.json
new file mode 100644
index 000000000..a54ca1adb
--- /dev/null
+++ b/libs/config/tsconfig.node.json
@@ -0,0 +1,10 @@
+{
+  "compilerOptions": {
+    "composite": true,
+    "module": "ESNext",
+    "moduleResolution": "Node",
+    "allowSyntheticDefaultImports": true,
+    "types": ["node", "vite/client"]
+  },
+  "include": ["vite.config.ts"]
+}
diff --git a/libs/shared/.eslintignore b/libs/shared/.eslintignore
index 86439d7da..ed9d65c51 100644
--- a/libs/shared/.eslintignore
+++ b/libs/shared/.eslintignore
@@ -2,3 +2,5 @@ node_modules/*
 node_modules/
 node_modules
 *.d.ts
+*.mjs
+*.tsbuildinfo
\ No newline at end of file
diff --git a/libs/shared/.gitignore b/libs/shared/.gitignore
index a547bf36d..dd4d473b2 100644
--- a/libs/shared/.gitignore
+++ b/libs/shared/.gitignore
@@ -22,3 +22,6 @@ dist-ssr
 *.njsproj
 *.sln
 *.sw?
+
+tsconfig.tsbuildinfo
+vite.config.ts.*
\ No newline at end of file
diff --git a/libs/shared/lib/querybuilder/model/logic/utils.ts b/libs/shared/lib/querybuilder/model/logic/utils.ts
deleted file mode 100644
index e69de29bb..000000000
diff --git a/libs/shared/lib/querybuilder/panel/nodeUtils.ts b/libs/shared/lib/querybuilder/panel/nodeUtils.ts
deleted file mode 100644
index e69de29bb..000000000
diff --git a/libs/shared/lib/querybuilder/pills/customFlowPills/logicpill/logicpill.tsx b/libs/shared/lib/querybuilder/pills/customFlowPills/logicpill/logicpill.tsx
index 3df133bca..5e853e044 100644
--- a/libs/shared/lib/querybuilder/pills/customFlowPills/logicpill/logicpill.tsx
+++ b/libs/shared/lib/querybuilder/pills/customFlowPills/logicpill/logicpill.tsx
@@ -13,11 +13,12 @@ import {
   useAppDispatch,
   useQuerybuilderGraph,
   useQuerybuilderGraphology,
+  useQuerybuilderHash,
 } from '@graphpolaris/shared/lib/data-access';
-import { useCallback, useMemo } from 'react';
+import { useCallback, useEffect, useMemo, useState } from 'react';
 import { Handle, HandleType, Position } from 'reactflow';
 import { LogicNodeAttributes, SchemaReactflowLogicNode, toHandleId } from '../../../model';
-import { InputNode } from '../../../model/logic/general';
+import { InputNode, InputNodeTypeTypes } from '../../../model/logic/general';
 import { styleHandleMap } from '../../utils';
 import styles from './logicpill.module.scss';
 
@@ -33,8 +34,14 @@ export default function LogicPill(node: SchemaReactflowLogicNode) {
 
   const graph = useQuerybuilderGraph();
   const graphology = useQuerybuilderGraphology();
+  const graphologyHash = useQuerybuilderHash();
   const connectionsToLeft = useMemo(() => graph.edges.filter((edge) => edge.target === node.id), [graph]);
   const connectionsToRight = useMemo(() => graph.edges.filter((edge) => edge.source === node.id), [graph]);
+  const graphologyNodeAttributes = useMemo<LogicNodeAttributes | undefined>(
+    () => (graphology.hasNode(node.id) ? { ...(graphology.getNodeAttributes(node.id) as LogicNodeAttributes) } : undefined),
+    [node.id]
+  );
+  const [localInputCache, setLocalInputCache] = useState<Record<string, InputNodeTypeTypes>>({ ...graphologyNodeAttributes?.inputs });
 
   if (!data.id) throw new Error('LogicPill: data.id is undefined');
   const defaultHandleData = {
@@ -44,61 +51,30 @@ export default function LogicPill(node: SchemaReactflowLogicNode) {
   };
 
   const onInputUpdated = (value: string, input: InputNode, idx: number) => {
-    let logicNode = { ...(graphology.getNodeAttributes(node.id) as LogicNodeAttributes) };
+    let logicNode = { ...graphologyNodeAttributes };
     if (!logicNode) throw new Error('LogicPill: logicNode is undefined');
+
     let logicNodeInputs = { ...logicNode.inputs };
     if (logicNodeInputs[input.name] != value) {
       logicNodeInputs[input.name] = value;
       logicNode.inputs = logicNodeInputs;
       graphology.setNodeAttribute<any>(node.id, 'inputs', logicNodeInputs); // FIXME: I'm not sure why TS requires <any> to work here
       dispatch(setQuerybuilderNodes(graphology.export()));
+      console.log('updated input', input.name, 'to', value);
     }
   };
 
   const createLeftHandles = useCallback(
-    (sideInputs: InputNode[], positionSide: Position, handleType: HandleType) => {
-      let numOfInputs = 0;
-      let ret = sideInputs.map((input, i) => {
-        let inputTextBox = null;
-        if (
-          !connectionsToLeft.some(
-            (edge) =>
-              edge?.attributes?.targetHandleData.nodeId === data.id && edge?.attributes?.targetHandleData.attributeName === input.name
-          )
-        ) {
-          inputTextBox = (
-            <input
-              className={styles.logicInput}
-              // value={0}
-              style={{ top: -5, transform: `translateY(-${i * 20}%)` }}
-              // onChange={(e) => onInputUpdated(e.target.value, input)}
-              onKeyDown={(e) => {
-                if (e.key === 'Enter') onInputUpdated((e.target as HTMLInputElement).value, input, i);
-              }}
-              onBlur={(e) => onInputUpdated(e.target.value, input, i)}
-            />
-          );
-          numOfInputs++;
-        }
-        return (
-          <Handle
-            type={handleType}
-            position={positionSide}
-            id={toHandleId({ ...defaultHandleData, attributeName: input.name, attributeType: input.type })} // TODO
-            key={input.name + input.type}
-            // style={{ top: `${((i + 0.8) / (side.length + 0.6)) * 120}%` }}
-            style={{ top: `${((i + 0.8) / (sideInputs.length + 0.6)) * 100}%` }}
-            className={styleHandleMap[input.type]}
-          >
-            {inputTextBox}
-          </Handle>
+    (sideInputs: InputNode[]) => {
+      return sideInputs.filter((input, i) => {
+        return !connectionsToLeft.some(
+          (edge) => edge?.attributes?.targetHandleData.nodeId === data.id && edge?.attributes?.targetHandleData.attributeName === input.name
         );
-      });
-      return { handles: ret, number: numOfInputs };
+      }).length;
     },
     [node]
   );
-  const { handles: leftHandles, number: leftInputsNumber } = createLeftHandles(node.data.logic.inputs, Position.Left, 'target');
+  const leftInputsNumber = createLeftHandles(node.data.logic.inputs);
 
   return (
     <div className={styles.logic}>
@@ -108,13 +84,47 @@ export default function LogicPill(node: SchemaReactflowLogicNode) {
             {connectionsToLeft.map((e) => e?.attributes?.sourceHandleData.attributeName)}.{output.name}
           </span>
         }
-        {leftHandles}
+        {node.data.logic.inputs.map((input, i) => {
+          let inputTextBox = null;
+          if (
+            !connectionsToLeft.some(
+              (edge) =>
+                edge?.attributes?.targetHandleData.nodeId === data.id && edge?.attributes?.targetHandleData.attributeName === input.name
+            )
+          ) {
+            inputTextBox = (
+              <input
+                className={styles.logicInput}
+                value={localInputCache?.[input.name] as string}
+                style={{ top: -5, transform: `translateY(-${i * 20}%)` }}
+                onChange={(e) => {
+                  setLocalInputCache({ ...localInputCache, [input.name]: e.target.value });
+                }}
+                onKeyDown={(e) => {
+                  if (e.key === 'Enter') onInputUpdated((e.target as HTMLInputElement).value, input, i);
+                }}
+                onBlur={(e) => onInputUpdated(e.target.value, input, i)}
+              />
+            );
+          }
+          return (
+            <Handle
+              type={'target'}
+              position={Position.Left}
+              id={toHandleId({ ...defaultHandleData, attributeName: input.name, attributeType: input.type })}
+              key={input.name + input.type}
+              style={{ top: `${((i + 0.8) / (node.data.logic.inputs.length + 0.6)) * 100}%` }}
+              className={styleHandleMap[input.type]}
+            >
+              {inputTextBox}
+            </Handle>
+          );
+        })}
         {!!node.data.logic.output && (
           <Handle
             type={'source'}
             position={Position.Right}
-            id={toHandleId({ ...defaultHandleData, attributeName: output.name, attributeType: output.type })} // TODO
-            // style={{ top: `${((i + 0.8) / (side.length + 0.6)) * 100}%` }}
+            id={toHandleId({ ...defaultHandleData, attributeName: output.name, attributeType: output.type })}
             className={styleHandleMap?.[output.type]}
           ></Handle>
         )}
diff --git a/libs/shared/lib/querybuilder/query-utils/query2backend.ts b/libs/shared/lib/querybuilder/query-utils/query2backend.ts
index 84263c89b..f25f6a533 100644
--- a/libs/shared/lib/querybuilder/query-utils/query2backend.ts
+++ b/libs/shared/lib/querybuilder/query-utils/query2backend.ts
@@ -124,7 +124,9 @@ export function calculateQueryLogic(
       if (!connectionToInputRef) {
         // Not connected, search for set or default value
         let val = node.attributes.inputs?.[inputRef.name] || inputRef.default;
-        if (val && inputRef.type === 'string') val = `\"${val}\"`;
+        if (val && inputRef.type === 'string') {
+          val = `\"${val}\"`;
+        }
         console.log('val', val, inputRef, node);
         return val;
       } else if (connectionToInputRef.attributes?.sourceHandleData.nodeType === QueryElementTypes.Logic) {
diff --git a/libs/shared/lib/schema/pills/nodes/popup/attribute-analytics-popup-menu.tsx b/libs/shared/lib/schema/pills/nodes/popup/attribute-analytics-popup-menu.tsx
index 062f9f7ef..e8755e486 100644
--- a/libs/shared/lib/schema/pills/nodes/popup/attribute-analytics-popup-menu.tsx
+++ b/libs/shared/lib/schema/pills/nodes/popup/attribute-analytics-popup-menu.tsx
@@ -19,6 +19,7 @@ import './attribute-analytics-popup-menu.module.scss';
  * @param data Input data of type AttributeAnalyticsData, which is for the popup menu.
  */
 export const AttributeAnalyticsPopupMenu = ({ data }: NodeProps<AttributeAnalyticsData>) => {
+  return <div></div>;
   // const theme = useTheme();
   // if (data == undefined) throw new Error('No Attribute Analytics data is available for the node.');
   // let entityOrRelationBase: [string, string, string];
diff --git a/libs/shared/lib/schema/pills/nodes/popup/node-quality-relation-popup.tsx b/libs/shared/lib/schema/pills/nodes/popup/node-quality-relation-popup.tsx
index a7b05251c..ad5fe9931 100644
--- a/libs/shared/lib/schema/pills/nodes/popup/node-quality-relation-popup.tsx
+++ b/libs/shared/lib/schema/pills/nodes/popup/node-quality-relation-popup.tsx
@@ -19,7 +19,6 @@ import './node-quality-popup.module.scss';
  * @param data Input data of type NodeQualityDataForRelations, which is for the popup.
  */
 export const NodeQualityRelationPopupNode = React.memo(({ data }: NodeProps<NodeQualityDataForRelations>) => {
-  const theme = useTheme();
   if (data == undefined) throw new Error('No node quality data is available for this node.');
 
   if (data.isAttributeDataIn)
@@ -44,13 +43,7 @@ export const NodeQualityRelationPopupNode = React.memo(({ data }: NodeProps<Node
           </div>
         </div>
         <div className="closeButtonWrapper">
-          <button
-            onClick={() => data.onClickCloseButton()}
-            id="closeButton"
-            style={{
-              backgroundColor: theme.palette.custom.elements.relationBase[0],
-            }}
-          >
+          <button onClick={() => data.onClickCloseButton()} id="closeButton">
             Close
           </button>
         </div>
@@ -65,13 +58,7 @@ export const NodeQualityRelationPopupNode = React.memo(({ data }: NodeProps<Node
         </div>
         <div className="information"></div>
         <div className="closeButtonWrapper">
-          <button
-            onClick={() => data.onClickCloseButton()}
-            id="closeButton"
-            style={{
-              backgroundColor: theme.palette.custom.elements.relationBase[0],
-            }}
-          >
+          <button onClick={() => data.onClickCloseButton()} id="closeButton">
             Close
           </button>
         </div>
diff --git a/libs/shared/lib/schema/pills/nodes/popup/popupmenus/attribute-analytics-popup-menu.stories.tsx b/libs/shared/lib/schema/pills/nodes/popup/popupmenus/attribute-analytics-popup-menu.stories.tsx
index 70053abae..75f124ae7 100644
--- a/libs/shared/lib/schema/pills/nodes/popup/popupmenus/attribute-analytics-popup-menu.stories.tsx
+++ b/libs/shared/lib/schema/pills/nodes/popup/popupmenus/attribute-analytics-popup-menu.stories.tsx
@@ -53,7 +53,7 @@ export const Default: Story = {
       ],
       isAttributeDataIn: false,
       onClickCloseButton: () => {},
-      onClickPlaceInQueryBuilderButton: (name: string, type) => {},
+      onClickPlaceInQueryBuilderButton: (name: string, type: string) => {},
       searchForAttributes: (id: string, searchbarValue: string) => {},
       resetAttributeFilters: (id: string) => {},
       applyAttributeFilters: (id: string, category: AttributeCategory, predicate: string, percentage: number) => {},
diff --git a/libs/shared/lib/schema/pills/nodes/popup/popupmenus/attribute-analytics-popup-menu.tsx b/libs/shared/lib/schema/pills/nodes/popup/popupmenus/attribute-analytics-popup-menu.tsx
index 83cce0cc5..5ef056983 100644
--- a/libs/shared/lib/schema/pills/nodes/popup/popupmenus/attribute-analytics-popup-menu.tsx
+++ b/libs/shared/lib/schema/pills/nodes/popup/popupmenus/attribute-analytics-popup-menu.tsx
@@ -21,6 +21,7 @@ import { NodeProps } from 'reactflow';
  * @param data Input data of type AttributeAnalyticsData, which is for the popup menu.
  */
 export const AttributeAnalyticsPopupMenu = ({ data }: NodeProps<AttributeAnalyticsData>) => {
+  return <div></div>;
   // if (data == undefined) throw new Error('No Attribute Analytics data is available for the node.');
   // let entityOrRelationBase: [string, string, string];
   // if (data.nodeType == NodeType.entity) entityOrRelationBase = theme.palette.custom.elements.entityBase;
diff --git a/libs/shared/lib/schema/pills/nodes/popup/popupmenus/filterbar.tsx b/libs/shared/lib/schema/pills/nodes/popup/popupmenus/filterbar.tsx
index feea80147..6dcaec7b7 100644
--- a/libs/shared/lib/schema/pills/nodes/popup/popupmenus/filterbar.tsx
+++ b/libs/shared/lib/schema/pills/nodes/popup/popupmenus/filterbar.tsx
@@ -143,6 +143,7 @@ export const Filter = (props: FilterbarProps) => {
   // else resetButtonColor = 'inherit';
 
   return (
+    <div />
     // <div className="bar">
     //   <Accordion className={['attributesAccordion', 'filterbarAccordion'].join(' ')}>
     //     <AccordionSummary className="filterbarSummary" expandIcon={<ExpandMore className="expandIcon" />}>
diff --git a/libs/shared/lib/schema/schema-utils/schema-backend-models.ts b/libs/shared/lib/schema/schema-utils/schema-backend-models.ts
deleted file mode 100644
index e69de29bb..000000000
diff --git a/libs/shared/lib/vis/geovis/GeoNodeLinkMap.stories.tsx b/libs/shared/lib/vis/geovis/GeoNodeLinkMap.stories.tsx
index 12462dfec..332defe3e 100644
--- a/libs/shared/lib/vis/geovis/GeoNodeLinkMap.stories.tsx
+++ b/libs/shared/lib/vis/geovis/GeoNodeLinkMap.stories.tsx
@@ -2,7 +2,6 @@ import React from 'react';
 import GeoNodeLinkMap from './GeoNodeLinkMap';
 import { Provider } from 'react-redux';
 import { configureStore } from '@reduxjs/toolkit';
-import { GraphPolarisThemeProvider } from '../../data-access/theme';
 import { graphQueryResultSlice, assignNewGraphQueryResult } from '../../data-access/store';
 import { flights } from '../../mock-data/query-result/geo-mock-data';
 import { Meta } from '@storybook/react';
diff --git a/libs/shared/lib/vis/nodelink/NodeLinkConfigPanelViewModelImpl.tsx b/libs/shared/lib/vis/nodelink/NodeLinkConfigPanelViewModelImpl.tsx
index 989cc6760..65763358a 100644
--- a/libs/shared/lib/vis/nodelink/NodeLinkConfigPanelViewModelImpl.tsx
+++ b/libs/shared/lib/vis/nodelink/NodeLinkConfigPanelViewModelImpl.tsx
@@ -1,3 +1,5 @@
+export {};
+
 // /**
 //  * This program has been developed by students from the bachelor Computer Science at
 //  * Utrecht University within the Software Project course.
diff --git a/libs/shared/lib/vis/paohvis/paohvis.stories.tsx b/libs/shared/lib/vis/paohvis/paohvis.stories.tsx
index a3d774e93..f9935803d 100644
--- a/libs/shared/lib/vis/paohvis/paohvis.stories.tsx
+++ b/libs/shared/lib/vis/paohvis/paohvis.stories.tsx
@@ -1,5 +1,4 @@
 import { assignNewGraphQueryResult, graphQueryResultSlice, schemaSlice, setSchema } from '../../data-access/store';
-import { GraphPolarisThemeProvider } from '../../data-access/theme';
 import { configureStore } from '@reduxjs/toolkit';
 import { Meta, ComponentStory } from '@storybook/react';
 import { Provider } from 'react-redux';
diff --git a/libs/shared/lib/vis/paohvis/paohvisViewModel.tsx b/libs/shared/lib/vis/paohvis/paohvisViewModel.tsx
deleted file mode 100644
index e69de29bb..000000000
diff --git a/libs/shared/lib/vis/rawjsonvis/rawjsonvis.tsx b/libs/shared/lib/vis/rawjsonvis/rawjsonvis.tsx
index e55c8931d..a90933c95 100644
--- a/libs/shared/lib/vis/rawjsonvis/rawjsonvis.tsx
+++ b/libs/shared/lib/vis/rawjsonvis/rawjsonvis.tsx
@@ -1,4 +1,4 @@
-import { changePrimary, useAppDispatch, useGraphQueryResult } from '../../data-access/store';
+import { useAppDispatch, useGraphQueryResult } from '../../data-access/store';
 import React, { useEffect, useState } from 'react';
 import ReactJSONView from 'react-json-view';
 
diff --git a/libs/shared/lib/vis/semanticsubstrates/utils/CalcConnectionLinePositionsUseCase.tsx b/libs/shared/lib/vis/semanticsubstrates/utils/CalcConnectionLinePositionsUseCase.tsx
index 1961a6760..4dabbf3e0 100644
--- a/libs/shared/lib/vis/semanticsubstrates/utils/CalcConnectionLinePositionsUseCase.tsx
+++ b/libs/shared/lib/vis/semanticsubstrates/utils/CalcConnectionLinePositionsUseCase.tsx
@@ -8,7 +8,7 @@ import { RotateVectorByDeg } from '../utils/RotateVec';
 import { XYPosition } from 'reactflow';
 
 /** The return type for this usecase. controlPoint is used for the curvature of the line. */
-type ConnecionLinePositions = {
+type ConnectionLinePositions = {
   start: XYPosition;
   end: XYPosition;
   controlPoint: XYPosition;
@@ -25,9 +25,9 @@ export default class CalcConnectionLinePositionsUseCase {
    * @param {XYPosition} startNodePos The position of the start node.
    * @param {XYPosition} endNodePos The position of the end node.
    * @param {number} nodeRadius The node radius, used to calculate the start and end offset.
-   * @returns {ConnecionLinePositions} The positions for drawing the curved line.
+   * @returns {ConnectionLinePositions} The positions for drawing the curved line.
    */
-  public static calculatePositions(startNodePos: XYPosition, endNodePos: XYPosition, nodeRadius: number): ConnecionLinePositions {
+  public static calculatePositions(startNodePos: XYPosition, endNodePos: XYPosition, nodeRadius: number): ConnectionLinePositions {
     // Calculate the control point for the quadratic curve path, see https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths
     const distance = CalcDistance(startNodePos, endNodePos);
     if (distance == 0) return this.returnStartPosition(startNodePos);
@@ -62,7 +62,7 @@ export default class CalcConnectionLinePositionsUseCase {
    * @param {XYPosition} startNodePos The position of the start node.
    * @returns {ConnectionLinePosition} The positions for drawing the curved line.
    */
-  private static returnStartPosition(startNodePos: XYPosition): ConnecionLinePositions {
+  private static returnStartPosition(startNodePos: XYPosition): ConnectionLinePositions {
     return {
       start: startNodePos,
       end: startNodePos,
diff --git a/libs/shared/lib/vis/semanticsubstrates/utils/CalcEntityAttrNamesFromResultUseCase.tsx b/libs/shared/lib/vis/semanticsubstrates/utils/CalcEntityAttrNamesFromResultUseCase.tsx
index 05dc2909b..b903d7d81 100644
--- a/libs/shared/lib/vis/semanticsubstrates/utils/CalcEntityAttrNamesFromResultUseCase.tsx
+++ b/libs/shared/lib/vis/semanticsubstrates/utils/CalcEntityAttrNamesFromResultUseCase.tsx
@@ -4,7 +4,6 @@
  * © Copyright Utrecht University (Department of Information and Computing Sciences)
  */
 
-import { SchemaFromBackend } from '@graphpolaris/shared/lib/schema';
 import { EntitiesFromSchema } from '../Types';
 import { GraphQueryResult } from '@graphpolaris/shared/lib/data-access';
 
diff --git a/libs/shared/node.d.ts b/libs/shared/node.d.ts
deleted file mode 100644
index 81b18bc72..000000000
--- a/libs/shared/node.d.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-interface ImportMeta {
-  env: {
-    VITE_BACKEND_URL: string;
-    VITE_BACKEND_WSS_URL: string;
-    VITE_BACKEND_USER: string;
-    VITE_BACKEND_SCHEMA: string;
-    VITE_BACKEND_QUERY: string;
-    VITE_STAGING: string;
-    VITE_KEYCLOAK_URL: string;
-    VITE_KEYCLOAK_REALM: string;
-    VITE_KEYCLOAK_CLIENT: string;
-  };
-}
-
-declare module '*.png';
-declare module '*.svg';
-declare module '*.jpeg';
-declare module '*.jpg';
diff --git a/libs/shared/tsconfig.json b/libs/shared/tsconfig.json
index e99c7ebd1..a4e0c9802 100644
--- a/libs/shared/tsconfig.json
+++ b/libs/shared/tsconfig.json
@@ -1,7 +1,35 @@
 {
-  "extends": "config/tsconfig.json",
+  "$schema": "https://json.schemastore.org/tsconfig",
+  "display": "React Library",
+  "target": "ESNext",
   "compilerOptions": {
+    "composite": false,
+    "inlineSources": false,
+    "noUnusedLocals": false,
+    "noUnusedParameters": false,
+    "preserveWatchOutput": true,
+    "jsx": "react-jsx",
+    "target": "ESNext",
+    "useDefineForClassFields": true,
+    "lib": ["ES2017", "DOM", "DOM.Iterable", "ESNext"],
+    "allowJs": true,
+    "skipLibCheck": true,
+    "esModuleInterop": true,
+    "allowSyntheticDefaultImports": true,
+    "strict": true,
+    "forceConsistentCasingInFileNames": true,
+    "module": "ESNext",
+    "moduleResolution": "node",
+    "resolveJsonModule": true,
+    "noEmit": true,
+    "baseUrl": ".",
+    "noImplicitOverride": false,
+    "paths": {
+      "@graphpolaris/shared/lib/*": ["./lib/*"]
+    },
     "types": ["node", "vite/client"]
   },
-  "include": ["vite.config.ts", "lib"]
+  "exclude": ["dist", "build", "node_modules"],
+  "include": ["src", "lib"],
+  "references": [{ "path": "./tsconfig.node.json" }]
 }
diff --git a/libs/shared/tsconfig.node.json b/libs/shared/tsconfig.node.json
new file mode 100644
index 000000000..a54ca1adb
--- /dev/null
+++ b/libs/shared/tsconfig.node.json
@@ -0,0 +1,10 @@
+{
+  "compilerOptions": {
+    "composite": true,
+    "module": "ESNext",
+    "moduleResolution": "Node",
+    "allowSyntheticDefaultImports": true,
+    "types": ["node", "vite/client"]
+  },
+  "include": ["vite.config.ts"]
+}
diff --git a/libs/shared/vite.config.ts b/libs/shared/vite.config.ts
index 2f263c107..3e62b0fab 100644
--- a/libs/shared/vite.config.ts
+++ b/libs/shared/vite.config.ts
@@ -40,16 +40,7 @@ export default defineConfig({
   resolve: {
     alias: {
       '@graphpolaris/shared/lib': path.resolve(__dirname, './lib'),
-    },
-  },
-  test: {
-    environment: 'happy-dom',
-    deps: {},
-    threads: true,
-    environmentOptions: {
-      jsdom: {
-        resources: 'usable',
-      },
+      '@/': path.resolve(__dirname, './lib'),
     },
   },
 });
diff --git a/libs/storybook/.eslintignore b/libs/storybook/.eslintignore
index 86439d7da..ed9d65c51 100644
--- a/libs/storybook/.eslintignore
+++ b/libs/storybook/.eslintignore
@@ -2,3 +2,5 @@ node_modules/*
 node_modules/
 node_modules
 *.d.ts
+*.mjs
+*.tsbuildinfo
\ No newline at end of file
diff --git a/libs/storybook/.gitignore b/libs/storybook/.gitignore
index a547bf36d..dd4d473b2 100644
--- a/libs/storybook/.gitignore
+++ b/libs/storybook/.gitignore
@@ -22,3 +22,6 @@ dist-ssr
 *.njsproj
 *.sln
 *.sw?
+
+tsconfig.tsbuildinfo
+vite.config.ts.*
\ No newline at end of file
-- 
GitLab