RIFT-15872: NS Service Primitive Job details display in the UI needs improvement
authorKIRAN KASHALKAR <kiran.kashalkar@riftio.com>
Tue, 21 Mar 2017 20:33:00 +0000 (16:33 -0400)
committerKIRAN KASHALKAR <kiran.kashalkar@riftio.com>
Tue, 21 Mar 2017 20:33:00 +0000 (16:33 -0400)
Signed-off-by: KIRAN KASHALKAR <kiran.kashalkar@riftio.com>
skyquake/plugins/launchpad/src/launchpad_card/jobListCard.jsx

index 2a66540..0f345ea 100644 (file)
@@ -18,6 +18,7 @@
 
 import React from 'react';
 import './jobListCard.scss'
+import TreeView from 'react-treeview';
 import Uptime from 'widgets/uptime/uptime.jsx';
 import Modal from 'react-awesome-modal';
 
@@ -57,6 +58,12 @@ class JobListCard extends React.Component {
     getJobDetails(job) {
         let jobDetails = null;
         if (job['job-status-details']) {
+            let jobDetailsArray = job['job-status-details'].split(/\\n/);
+            let jobDetailsText = [];
+            jobDetailsArray && jobDetailsArray.map((jobDetail) => {
+                jobDetailsText.push(jobDetail);
+                jobDetailsText.push(<br/>);
+            });
             jobDetails = (
                 <section className='jobListCard--details'>
                     <h4 onClick={this.openModal.bind(this)}>Job Details</h4>
@@ -66,7 +73,9 @@ class JobListCard extends React.Component {
                         height="400"
                         effect="fadeInUp">
                         <div>
-                            <div className='jobListCard--details--content'>{job['job-status-details']}</div>
+                            <TreeView nodeLabel={<span>Job Details</span>} key={'job-details'} defaultCollapsed={false}>
+                                <p>{jobDetailsText}</p>
+                            </TreeView>
                             <h4 className='jobListCard--details--close' onClick={this.closeModal.bind(this)}>Close</h4>
                         </div>
                     </Modal>