RIFT-14850: more volume styling 75/775/1
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Wed, 19 Oct 2016 19:08:00 +0000 (15:08 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Fri, 9 Dec 2016 20:19:19 +0000 (15:19 -0500)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/plugins/launchpad/src/recordViewer/recordCard.jsx

index 737ef70..f69c2ba 100644 (file)
@@ -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',
+                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'}}>{k}</div>
-                        <div>{v}</div>
+                        <div style={{margin: '0 0.5rem'}}>{v.constructor.name != 'Object' ? 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>
                 )
               })