diff --git a/cra-client/src/components/RepositoryExplorer/components/details-panel/InstancePropertiesDisplay.js b/cra-client/src/components/RepositoryExplorer/components/details-panel/InstancePropertiesDisplay.js
index 841aec67..138d781d 100644
--- a/cra-client/src/components/RepositoryExplorer/components/details-panel/InstancePropertiesDisplay.js
+++ b/cra-client/src/components/RepositoryExplorer/components/details-panel/InstancePropertiesDisplay.js
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
-import React from "react";
+import React from "react";
import PropTypes from "prop-types";
@@ -10,7 +10,7 @@ import "./details-panel.scss";
export default function InstancePropertiesDisplay(props) {
- const instProps = props.properties;
+ const instProps = props.properties;
let properties;
@@ -18,48 +18,51 @@ export default function InstancePropertiesDisplay(props) {
const switchValue = (prop) => {
let value;
switch (prop.instancePropertyCategory) {
- case "PRIMITIVE" :
+ case "PRIMITIVE":
value = prop.primitiveValue;
break;
- case "ENUM" :
+ case "ENUM":
value = prop.symbolicName;
break;
- case "MAP" :
- value = (
{expandProperties(prop.mapValues)}
)
+ case "MAP":
+ if (prop.mapValues !== null && prop.mapValues !== undefined) {
+ value = ( {expandProperties(prop.mapValues.instanceProperties)}
)
+ } else {
+ value = "No map values."
+ }
+ break;
+ case "ARRAY":
+ if (prop.arrayValues !== null && prop.arrayValues !== undefined) {
+ value = ( {expandProperties(prop.arrayValues.instanceProperties)}
)
+ } else {
+ value = "No Array values."
+ }
break;
- case "ARRAY" :
- console.log("DEBUG ARRAY");
- if (prop.arrayValues !== null && prop.arrayValues !== undefined) {
- value = ( {expandProperties(prop.arrayValues.instanceProperties)}
)
- } else {
- value = "No Array values."
- }
- break;
// it seems like this method can be driven with an unknown prop.instancePropertyCategory. I assume a render occurs before the prop value has been populated
// removing this alert.
// default:
// alert("Unknown instance property category: "+prop.instancePropertyCategory);
// break;
- }
+ }
return value;
};
-
+
const expandProperties = (instanceProperties) => {
let propertyNamesUnsorted = [];
- for (const [key] of Object.entries(instanceProperties))
+ for (const [key] of Object.entries(instanceProperties))
propertyNamesUnsorted.push(`${key}`);
- let propertyNamesSorted = propertyNamesUnsorted.sort();
- let propertyList = propertyNamesSorted.map( (propName) =>
- {propName} :
- {
- switchValue(instanceProperties[propName])
- }
-
-
+ let propertyNamesSorted = propertyNamesUnsorted.sort();
+ let propertyList = propertyNamesSorted.map((propName) =>
+ {propName} :
+ {
+ switchValue(instanceProperties[propName])
+ }
+
+
);
return propertyList;
@@ -73,12 +76,12 @@ export default function InstancePropertiesDisplay(props) {
)
}
else {
-
- properties = (
-
- {expandProperties(instProps.instanceProperties)}
+
+ properties = (
+
+ {expandProperties(instProps.instanceProperties)}
-
+
);
}
@@ -86,5 +89,5 @@ export default function InstancePropertiesDisplay(props) {
}
InstancePropertiesDisplay.propTypes = {
- properties: PropTypes.object
+ properties: PropTypes.object
};