瀏覽代碼

Fix empty 'Properties' body in replica details

An empty 'Properties' body was shown if there were no properties from
the API except an empty `storage_mappings` field.
Sergiu Miclea 7 年之前
父節點
當前提交
4f78042883
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      src/components/organisms/MainDetails/MainDetails.jsx

+ 9 - 2
src/components/organisms/MainDetails/MainDetails.jsx

@@ -282,10 +282,17 @@ class MainDetails extends React.Component<Props> {
     }
     const sourceEndpoint = this.getSourceEndpoint()
     const destinationEndpoint = this.getDestinationEndpoint()
-
-    const propertyNames = this.props.item && this.props.item.destination_environment ? Object.keys(this.props.item.destination_environment).filter(k => k !== 'description' && k !== 'network_map') : []
     const lastUpdated = this.renderLastExecutionTime()
 
+    const destEnv = this.props.item && this.props.item.destination_environment
+    const propertyNames = destEnv ?
+      Object.keys(destEnv).filter(k =>
+        k !== 'network_map' && (
+          k !== 'storage_mappings' ||
+          (destEnv[k] != null && typeof destEnv[k] === 'object' && Object.keys(destEnv[k]).length > 0)
+        )
+      ) : []
+
     return (
       <ColumnsLayout>
         <Column width="42.5%">