Merge branch 'master' of https://osm.etsi.org/gerrit/osm/UI
[osm/UI.git] / skyquake / plugins / launchpad / src / recordViewer / recordCard.jsx
index 737ef70..31b1ed6 100644 (file)
@@ -106,7 +106,7 @@ export default class RecordCard extends React.Component {
                         //That match the currently selected job id
                         if(v.id == cardData.id) {
                           return v.primitive.map(function(p, i) {
-                            return <JobListCard type="vnfr" job-id={job['job-id']} cardData={cardData} key={ob['job-id'] + '-' + i} {...p} />
+                            return <JobListCard type="vnfr" job-id={job['job-id']} cardData={cardData} key={job['job-id'] + '-' + i} {...p} />
                           })
                         }
                       })
@@ -134,31 +134,35 @@ export default class RecordCard extends React.Component {
             notice = <li className='notice'>* If a separate browser window does not open, please check if the popup was blocked and allow it.</li>
             if(vdur.hasOwnProperty('volumes') && (vdur.volumes.length > 0)) {
               displayVolumesTab = true;
-              vdur.volumer.map((volume, vi) => {
+              vdur.volumes.map((volume, vi) => {
                 // let html = Prism.highlight(JSON.stringify(volume), Prism.languages.javascript, 'javascript');
                 // volumesHTML.push(
                 //     <pre className="language-js" key={index + '-' + vi}>
                 //       <code dangerouslySetInnerHTML={{__html: html}} />
                 //     </pre>
-                let properties = [];
-                 _.forEach(volume, function(v, k) {
-                    properties.push(
-                      <div style={{display: 'flex', margin: '0.5rem 0'}} key={k + vi}>
-                        <div style={{margin: '0 1rem',
-    fontWeight: 'bold', textTransform: 'uppercase'}}>{k}</div>
-                        <div>{v}</div>
+                function buildProperties(obj) {
+                  let p = [];
+                    _.forEach(obj, function(v, k) {
+                    p.push(
+                      <div style={{margin: '0.5rem 0.5rem'}} key={k + '-' + vi}>
+                        <div style={{margin: '0 0.5rem',
+    fontWeight: 'bold', textTransform: 'uppercase', color: '#5b5b5b'}}>{k}</div>
+                        <div style={{margin: '0 0.5rem'}}>{v.constructor.name == 'String' ? v : buildProperties(v)}</div>
                       </div>
                     )
-                  })
+                  });
+                    return p;
+                 }
                 volumesHTML.push(
                     <div key={vi}>
                       <div className="launchpadCard_title">
                         VOLUME
                       </div>
-
+                      <div style={{display: 'flex', flexDirection: 'column'}}>
                       {
-                        properties
+                        buildProperties(volume)
                       }
+                      </div>
                     </div>
                 )
               })
@@ -204,7 +208,7 @@ export default class RecordCard extends React.Component {
                         //That match the currently selected job id
                         if(v.id == cardData.id) {
                           return v.primitive.map(function(p, i) {
-                            return <JobListCard type="vnfr" job-id={job['job-id']} cardData={cardData} key={ob['job-id'] + '-' + 'vnfr' + '-' + h} {...p} />
+                            return <JobListCard type="vnfr" job-id={job['job-id']} cardData={cardData} key={job['job-id'] + '-' + 'vnfr' + '-' + h} {...p} />
                           })
                         }
                       })
@@ -262,7 +266,7 @@ export default class RecordCard extends React.Component {
       if(this.props.isLoading) {
         html = <DashboardCard className="loading" showHeader={true} title={cardData["short-name"]}><LoadingIndicator size={10} show={true} /></DashboardCard>
       } else {
-        let glyphValue = (this.props.mmmrecordDetailsToggleValue) ? "chevron-left" : "chevron-right";
+        let glyphValue = (!this.props.recordDetailsToggleValue) ? "chevron-left" : "chevron-right";
 
         if (this.props.type == 'nsr') {
           tabList.push(
@@ -325,7 +329,7 @@ export default class RecordCard extends React.Component {
           if (this.props.type == 'nsr') {
             primitivesTabTitle = 'Service Primitive';
           } else if (this.props.type == 'vnfr') {
-            primitivesTabTitle = 'Service Primitive'
+            primitivesTabTitle = 'Config Primitive'
           }
 
           tabList.push(