diff --git a/libs/shared/lib/querybuilder/query-utils/query2backend.ts b/libs/shared/lib/querybuilder/query-utils/query2backend.ts index f25f6a5337ef7d2e94911ab3b193e5bd791a19bf..09df80be83bea94866d5cdd590ec834c69037522 100644 --- a/libs/shared/lib/querybuilder/query-utils/query2backend.ts +++ b/libs/shared/lib/querybuilder/query-utils/query2backend.ts @@ -191,24 +191,11 @@ export function Query2BackendQuery( const newOrigin = graphologyQuery.addNode(origin + 'cycle', graphologyQuery.getNodeAttributes(origin)); const edgeAttributes = graphologyQuery.getEdgeAttributes(target, origin); graphologyQuery.dropEdge(target, origin); - // edgeAttributes.target = newOrigin; graphologyQuery.addEdge(target, newOrigin, edgeAttributes); }); }); - // console.log('graph', graph); return Query2BackendQuery(databaseName, graphologyQuery.export()); - - // if ( - // relations.some((entity, i) => { - // return allSimplePaths(graphologyQuery, entity.id, entity.id); - // }) - // ) - // throw Error('Cycles in query are not supported yet'); - // console.log('cycles', cycles); - // return null; - // } - // return null; } // Chunk extraction: traverse graph to find all paths of logic between relations and entities let graphSequenceChunks: QueryGraphNodes[][] = []; @@ -264,7 +251,7 @@ export function Query2BackendQuery( ID: currNode?.id, label: currNode?.name || undefined, // depth: QuerySearchDepthStruct; - direction: 'TO', + direction: 'FROM', node: chunk.length === position + 1 ? undefined : (processConnection(chunk, position + 1) as NodeStruct), }; return ret; diff --git a/libs/shared/lib/schema/pills/nodes/entity/entity-node.tsx b/libs/shared/lib/schema/pills/nodes/entity/entity-node.tsx index 50156cb6df9ecfd9a1f275ffaf4d3eeb16303d76..81cfe7a4bafc3971e0e0b3c579d61c2a6e125596 100644 --- a/libs/shared/lib/schema/pills/nodes/entity/entity-node.tsx +++ b/libs/shared/lib/schema/pills/nodes/entity/entity-node.tsx @@ -97,14 +97,14 @@ export const EntityNode = React.memo(({ id, data }: NodeProps<SchemaReactflowNod </span> <span className={styles.nodeSpan}>{data.nodeCount}</span> </div> */} - <Handle + {/* <Handle style={{ pointerEvents: 'none' }} id="entitySourceLeft" position={Position.Left} className={styles.handleTriangleLeft} type="source" // hidden={Array.from(data.handles).includes('entitySourceLeft') ? false : true} - ></Handle> + ></Handle> */} <Handle style={{ pointerEvents: 'none' }} id="entityTargetLeft" @@ -117,17 +117,18 @@ export const EntityNode = React.memo(({ id, data }: NodeProps<SchemaReactflowNod style={{ pointerEvents: 'none' }} id="entitySourceRight" position={Position.Right} + className={styles.handleTriangleRight} type="source" // hidden={Array.from(data.handles).includes('entitySourceRight') ? false : true} ></Handle> - <Handle + {/* <Handle style={{ pointerEvents: 'none' }} id="entityTargetRight" position={Position.Right} type="target" // hidden={Array.from(data.handles).includes('entityTargetRight') ? false : true} - ></Handle> - <Handle + ></Handle> */} + {/* <Handle style={{ pointerEvents: 'none' }} id="entitySourceTop" position={Position.Top} @@ -140,8 +141,8 @@ export const EntityNode = React.memo(({ id, data }: NodeProps<SchemaReactflowNod position={Position.Top} type="target" // hidden={Array.from(data.handles).includes('entityTargetTop') ? false : true} - ></Handle> - <Handle + ></Handle> */} + {/* <Handle style={{ pointerEvents: 'none' }} id="entitySourceBottom" position={Position.Bottom} @@ -154,7 +155,7 @@ export const EntityNode = React.memo(({ id, data }: NodeProps<SchemaReactflowNod position={Position.Bottom} type="target" // hidden={Array.from(data.handles).includes('entityTargetBottom') ? false : true} - ></Handle> + ></Handle> */} <div className={styles.nodeWrapper}> <span className={styles.nodeData}>{id}</span> </div> diff --git a/libs/shared/lib/schema/pills/nodes/entity/entity.module.scss b/libs/shared/lib/schema/pills/nodes/entity/entity.module.scss index d2ed00c095e08bbea985e985a635528fc9005d07..6c88a9becfd34a52a0972ba5554bd06910607741 100644 --- a/libs/shared/lib/schema/pills/nodes/entity/entity.module.scss +++ b/libs/shared/lib/schema/pills/nodes/entity/entity.module.scss @@ -35,6 +35,12 @@ transform: rotate(-90deg) translate(50%, -55%) scale(0.65) !important; } +.handleTriangleRight { + @extend .handleTriangle; + transform: rotate(90deg) translate(-50%, -45%) scale(0.65) !important; + @apply border-b-entity-300 #{!important}; +} + // nodeWrapper: { // display: 'inherit', // color: SchemaThemeHolder.entity.textColor, diff --git a/libs/shared/lib/schema/pills/nodes/entity/entity.module.scss.d.ts b/libs/shared/lib/schema/pills/nodes/entity/entity.module.scss.d.ts index ff6009ccf4e73e5a675f11df112805df3ac329d3..ad5150215e515f585e2005bf915fd7282b631f43 100644 --- a/libs/shared/lib/schema/pills/nodes/entity/entity.module.scss.d.ts +++ b/libs/shared/lib/schema/pills/nodes/entity/entity.module.scss.d.ts @@ -6,6 +6,7 @@ declare const classNames: { readonly entityNode: 'entityNode'; readonly entityNodeAttributesBox: 'entityNodeAttributesBox'; readonly handleTriangle: 'handleTriangle'; + readonly handleTriangleRight: 'handleTriangleRight'; readonly handleTriangleLeft: 'handleTriangleLeft'; }; export = classNames; diff --git a/libs/shared/lib/schema/pills/nodes/relation/relation-node.tsx b/libs/shared/lib/schema/pills/nodes/relation/relation-node.tsx index 87729a11e9c467c0bdda3735e706561d1aa0a1dc..760231dd8ae21feb7a3566a5f0b7b80fc0048b67 100644 --- a/libs/shared/lib/schema/pills/nodes/relation/relation-node.tsx +++ b/libs/shared/lib/schema/pills/nodes/relation/relation-node.tsx @@ -64,13 +64,11 @@ export const RelationNode = React.memo(({ id, data }: NodeProps<SchemaReactflowR > <div className={styles.relationNode}> <Handle - style={{ - pointerEvents: 'none', - }} + style={{ pointerEvents: 'none' }} className={styles.handleTriangleTop} id="entitySourceLeft" position={Position.Top} - type="source" + type="target" ></Handle> {/* <div className={styles.relationNodeAttributesBox} @@ -119,14 +117,7 @@ export const RelationNode = React.memo(({ id, data }: NodeProps<SchemaReactflowR <span className={styles.nodeData}>{data.collection}</span> </div> - <Handle - className={styles.handleTriangleBottom} - style={{ - pointerEvents: 'none', - }} - position={Position.Bottom} - type="target" - ></Handle> + <Handle className={styles.handleTriangleBottom} style={{ pointerEvents: 'none' }} position={Position.Bottom} type="source"></Handle> </div> </div> );