Skip to content

Commit 8593c4c

Browse files
committed
Merge branch 'starWars' of https://github.com/terminusdb/terminusdb-dashboard into starWars
2 parents fdd62c9 + fd322b6 commit 8593c4c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/tdb-documents-ui/src/documentTypeFrames/documentTypeFrames.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ function checkIfCycleExists(property, linked_to_frames, linked_to, docType) {
8787
// checks if linked to is same as the parent document class
8888
if(linked_to === docType) return true
8989
}
90+
for(let props in linked_to_frames) {
91+
if(typeof linked_to_frames[props] === CONST.OBJECT_TYPE &&
92+
linked_to_frames[props].hasOwnProperty("@class")) {
93+
// cycle exists with linked_to document class
94+
if(linked_to_frames[props]["@class"] === linked_to) return true
95+
// cycle exists with docType class
96+
if(linked_to_frames[props]["@class"] === docType) return true
97+
}
98+
}
9099
return false
91100
}
92101

0 commit comments

Comments
 (0)