X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Flaunchpad%2Fsrc%2Finstantiate%2FinstantiateDashboard.jsx;h=ef93bb0a077ae75f0584a7f285af7cceb5f28cb6;hb=HEAD;hp=9c358e8c055ade589a985b82660ae3d36e0dab59;hpb=3130c3b976dc11f641bce038fcfa1c101d156f12;p=osm%2FUI.git diff --git a/skyquake/plugins/launchpad/src/instantiate/instantiateDashboard.jsx b/skyquake/plugins/launchpad/src/instantiate/instantiateDashboard.jsx index 9c358e8c0..ef93bb0a0 100644 --- a/skyquake/plugins/launchpad/src/instantiate/instantiateDashboard.jsx +++ b/skyquake/plugins/launchpad/src/instantiate/instantiateDashboard.jsx @@ -24,33 +24,34 @@ 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); - this.Store = this.props.flux.stores.hasOwnProperty('InstantiateStore') ? this.props.flux.stores.InstantiateStore : this.props.flux.createStore(InstantiateStore ); + this.Store = this.props.flux.stores.hasOwnProperty('InstantiateStore') ? this.props.flux.stores.InstantiateStore : this.props.flux.createStore(InstantiateStore, 'InstantiateStore'); this.state = this.Store.getState(); } componentDidMount() { let self = this; let asyncOperations = [] asyncOperations.push(this.Store.getCatalog()); - asyncOperations.push(this.Store.getCloudAccount(function() { - asyncOperations.push(self.Store.getDataCenters()); - asyncOperations.push(self.Store.getResourceOrchestrator()); + asyncOperations.push(this.Store.getResourceOrchestratorAccounts(function() { 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) { self.Store.descriptorSelected(self.state.nsdDict[self.props.params.nsd]); } }) - } componentWillMount() { this.Store.listen(this.updateState); @@ -107,6 +108,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, PROJECT_ROLES.PROJECT_ADMIN]); let descriptorPreview = ( @@ -136,10 +138,11 @@ class InstantiateDashboard extends React.Component {