Launchpad readonly components
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Thu, 20 Apr 2017 20:27:51 +0000 (16:27 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Thu, 20 Apr 2017 20:27:51 +0000 (16:27 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/plugins/launchpad/src/launchpad_card/launchpadCard.jsx
skyquake/plugins/launchpad/src/launchpad_card/launchpadHeader.jsx
skyquake/plugins/launchpad/src/launchpad_card/nsrConfigPrimitives.jsx
skyquake/plugins/launchpad/src/recordViewer/recordCard.jsx

index b4ebb81..f7b47d5 100644 (file)
@@ -98,12 +98,10 @@ class LaunchpadCard extends React.Component {
               <img src={circleXImage} title="Close card" />
               </a>
       );
-      if (this.props.hasAccess) {
-        closeButton = null;
-      }
+
       html = (
         <DashboardCard className={'launchpadCard'} closeCard={closeButton}>
-          <LaunchpadHeader nsr={this.props.nsr} name={this.props.name} isActive={this.props.isActive} id={this.props.id}/>
+          <LaunchpadHeader hasAccess={this.props.hasAccess} nsr={this.props.nsr} name={this.props.name} isActive={this.props.isActive} id={this.props.id}/>
           {
           deleting ?
           <div className={'deletingIndicator'}>
index 9ee7ec4..0c05497 100644 (file)
@@ -163,11 +163,15 @@ class LaunchpadHeader extends React.Component {
                 </a>
             </h3>
             {toggleStatus}
-            <h3 className="launchpadCard_header-link" style={{display: 'inherit'}}>
-              <a onClick={this.deleteLaunchpad} title="Delete">
-                <span className="oi" data-glyph="trash" aria-hidden="true"></span>
-              </a>
-            </h3>
+            {this.props.hasAccess ?
+                (
+                  <h3 className="launchpadCard_header-link" style={{display: 'inherit'}}>
+                    <a onClick={this.deleteLaunchpad} title="Delete">
+                      <span className="oi" data-glyph="trash" aria-hidden="true"></span>
+                    </a>
+                  </h3>
+                )
+              : null}
           </div>
         </div>
         <div className="launchpadCard_header-status">
index 9d0cdba..acafdd0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * 
+ *
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
@@ -162,6 +162,7 @@ class NsrConfigPrimitives extends React.Component {
     }
     constructConfigPrimitiveTabs = (tabList, tabPanels) => {
         let self = this;
+        const hasAccess = self.props.hasAccess;
         let defaultFromRpc = '';
         //coded here for dev purposes
         let mandatoryFieldValue = 'true';
@@ -307,7 +308,11 @@ class NsrConfigPrimitives extends React.Component {
                                     </div>
                                 )
                             })}
-                            <Button label="Submit" isLoading={this.state.isSaving} onClick={this.handleExecuteClick.bind(this, nsConfigPrimitiveIndex)} className="dark"/>
+                            {
+                                hasAccess ?
+                                    <Button label="Submit" isLoading={this.state.isSaving} onClick={this.handleExecuteClick.bind(this, nsConfigPrimitiveIndex)} className="dark"/>
+                                : null
+                            }
                         </TabPanel>
                     )
                 );
index 7fad6f4..69b4bbd 100644 (file)
@@ -197,7 +197,7 @@ export default class RecordCard extends React.Component {
         if (displayConfigPrimitives) {
           configPrimitiveComponent = (
             <div className="flex nsConfigPrimitiveContainer">
-              <NsrConfigPrimitives data={configPrimitivesProps} />
+              <NsrConfigPrimitives data={configPrimitivesProps} hasAccess={hasAccess}  />
               <div style={{display:'flex', flexDirection: 'column',     flex: '1 1 40%'}}>
                 <div className="launchpadCard_title">
                   JOB LIST