Skip to content

Commit bacb5f5

Browse files
committed
Merge branch 'newDoc' of https://github.com/terminusdb/terminusdb-dashboard into newDoc
2 parents fd6a809 + 84079a5 commit bacb5f5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/tdb-documents-ui/src/widgets/subDocumentWidget.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,17 @@ export const SubDocumentProperties = ({ subDocumentPropertyName, props, order_by
105105
{update && getSubDocumentFields(subDocumentData)}
106106
</Card.Body>
107107
}
108+
109+
// function returns expanded for subdocuments
110+
// if a location is deascribed & geometry_location return true always
111+
// we do this as a temporary fix so that maps in geo locations are loaded correctly
112+
function getExpanded(expanded, linked_to, frame) {
113+
if(frame.hasOwnProperty(linked_to) && frame[linked_to].hasOwnProperty("geometry_location")) return true
114+
return expanded
115+
}
108116

109117
export const TDBSubDocument = ({ extracted, expanded, order_by, comment, props, index, hideFieldLabel, linked_to, propertyDocumentation, id, reference, subDocumentData, setSubDocumentData, args }) => {
110-
const [open, setOpen] = useState(expanded);
118+
const [open, setOpen] = useState(args.mode === CONST.VIEW ? getExpanded(expanded, linked_to, args.fullFrame) : expanded);
111119
//const [open, setOpen] = useState(true);
112120
let uiFrame = args.uiFrame, mode = args.mode
113121

0 commit comments

Comments
 (0)