Просмотр исходного кода

Merge pull request #315 from smiclea/empty-properties

Fix empty 'Properties' body in replica details
Dorin Paslaru 7 лет назад
Родитель
Сommit
3276cea6da
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%">