X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Flaunchpad%2Fsrc%2FrecordViewer%2FrecordCard.jsx;h=7b3cb2188f246b60d50b159967e718fcc647177c;hp=f69c2ba61a5cf7d155abb58de875089c7a1886c6;hb=8a3927012ae0fc7e136612682a5641b7ba0af567;hpb=a75ac3eb67ef3730e787d766224800c81f82a9fa diff --git a/skyquake/plugins/launchpad/src/recordViewer/recordCard.jsx b/skyquake/plugins/launchpad/src/recordViewer/recordCard.jsx index f69c2ba61..7b3cb2188 100644 --- a/skyquake/plugins/launchpad/src/recordViewer/recordCard.jsx +++ b/skyquake/plugins/launchpad/src/recordViewer/recordCard.jsx @@ -36,6 +36,10 @@ import LaunchpadFleetStore from '../launchpadFleetStore.js'; import Prism from 'prismjs'; import 'prismjs/themes/prism.css'; +import {SkyquakeRBAC, isRBACValid} from 'widgets/skyquake_rbac/skyquakeRBAC.jsx'; +import ROLES from 'utils/roleConstants.js'; + +const PROJECT_ROLES = ROLES.PROJECT; export default class RecordCard extends React.Component { constructor(props) { @@ -77,6 +81,8 @@ export default class RecordCard extends React.Component { let notice = null; + let hasAccess = isRBACValid(this.context.userProfile, [PROJECT_ROLES.LCM_ADMIN]); + switch(this.props.type) { case 'vnfr' : cardData = this.props.data[0]; @@ -86,7 +92,7 @@ export default class RecordCard extends React.Component { if (displayConfigPrimitives) { configPrimitiveComponent = (
- + {/* */}
@@ -106,7 +112,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 + return }) } }) @@ -146,7 +152,7 @@ export default class RecordCard extends React.Component { p.push(
{k}
+ fontWeight: 'bold', textTransform: 'uppercase', color: '#5b5b5b'}}>{k}
{v.constructor.name != 'Object' ? v : buildProperties(v)}
) @@ -208,7 +214,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 + return }) } }) @@ -419,3 +425,7 @@ RecordCard.defaultProps = { isLoading: true, jobData: [] } +RecordCard.contextTypes = { + router: React.PropTypes.object, + userProfile: React.PropTypes.object +};