X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Flaunchpad%2Fsrc%2Finstantiate%2FinstantiateDashboard.jsx;h=b1d2163698d713de3c9d27f4166b3bcf1faebcd5;hb=8a3927012ae0fc7e136612682a5641b7ba0af567;hp=607576b5eb9b927ec7e358a18da6c9b522f5c4e4;hpb=e29efc315df33d546237e270470916e26df391d6;p=osm%2FUI.git diff --git a/skyquake/plugins/launchpad/src/instantiate/instantiateDashboard.jsx b/skyquake/plugins/launchpad/src/instantiate/instantiateDashboard.jsx index 607576b5e..b1d216369 100644 --- a/skyquake/plugins/launchpad/src/instantiate/instantiateDashboard.jsx +++ b/skyquake/plugins/launchpad/src/instantiate/instantiateDashboard.jsx @@ -1,5 +1,5 @@ /* - * + * * Copyright 2016 RIFT.IO Inc * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,10 +24,15 @@ import InstantiateSelectDescriptorPanel from './instantiateSelectDescriptorPanel import CatalogDescriptorRaw from './catalogDescriptorRaw.jsx' import SkyquakeComponent from 'widgets/skyquake_container/skyquakeComponent.jsx'; import {Panel, PanelWrapper} from 'widgets/panel/panel'; -import Button from 'widgets/button/rw.button.js' +import Button from 'widgets/button/rw.button.js'; +import {SkyquakeRBAC, isRBACValid} from 'widgets/skyquake_rbac/skyquakeRBAC.jsx'; +import ROLES from 'utils/roleConstants.js'; import 'style/layout.scss'; import './instantiateDashboard.scss'; +const PROJECT_ROLES = ROLES.PROJECT; +const PLATFORM = ROLES.PLATFORM; + class InstantiateDashboard extends React.Component { constructor(props) { super(props); @@ -40,8 +45,10 @@ class InstantiateDashboard extends React.Component { asyncOperations.push(this.Store.getCatalog()); asyncOperations.push(this.Store.getCloudAccount(function() { asyncOperations.push(self.Store.getDataCenters()); + asyncOperations.push(self.Store.getResourceOrchestrator()); asyncOperations.push(self.Store.getSshKey()); asyncOperations.push(self.Store.getConfigAgent()); + asyncOperations.push(self.Store.getResourceOrchestrator()); })); Promise.all(asyncOperations).then(function(resolve, reject) { if(self.props.params.nsd) { @@ -75,7 +82,7 @@ class InstantiateDashboard extends React.Component { self.props.actions.showNotification('Spaces and special characters except underscores are not supported in the network service name at this time'); return; } - if (this.isOpenMano() && (this.state.dataCenterID == "" || !this.state.dataCenterID)) { + if (this.state.isOpenMano && (this.state.dataCenterID == "" || !this.state.dataCenterID)) { self.props.actions.showNotification("Please enter the Data Center ID"); return; } @@ -87,7 +94,7 @@ class InstantiateDashboard extends React.Component { return !this.props.location.pathname.split('/')[2]; } isOpenMano = () => { - return this.state.selectedCloudAccount['account-type'] == 'openmano'; + return this.state.ro['account-type'] == 'openmano'; } openDescriptor = (descriptor) => { let NSD = descriptor; @@ -105,6 +112,7 @@ class InstantiateDashboard extends React.Component { let html; let selectedNSDid = self.state.selectedNSDid; let isPreviewing = self.state.isPreviewing; + const hasAccess = isRBACValid(this.context.userProfile, [PROJECT_ROLES.LCM_ADMIN]); let descriptorPreview = ( @@ -134,10 +142,11 @@ class InstantiateDashboard extends React.Component {