From 72d62fb1aaaaeaed462083e232f3571b3bde6b08 Mon Sep 17 00:00:00 2001 From: Murali-P Date: Thu, 29 Mar 2018 17:46:39 +0530 Subject: Integrate VNF Repository in Beijing release Migrate the code Change-Id: Ifccacf83634af32b034fd9c413e68f894f06d2f7 Issue-ID: VNFSDK-155 Signed-off-by: Murali-P --- .../landingPage/SoftwareProductLandingPage.js | 8 ++- .../landingPage/SoftwareProductLandingPageView.jsx | 69 ++++++++++++++++------ 2 files changed, 57 insertions(+), 20 deletions(-) (limited to 'openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage') diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js index 34bfceec24..f5f3b7ebdb 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js @@ -21,6 +21,7 @@ import { actionTypes as modalActionTypes } from 'nfvo-components/modal/GlobalMod import { onboardingMethod } from '../SoftwareProductConstants.js'; import ScreensHelper from 'sdc-app/common/helpers/ScreensHelper.js'; import { enums, screenTypes } from 'sdc-app/onboarding/OnboardingConstants.js'; +import VNFImportActionHelper from '../vnfMarketPlace/VNFImportActionHelper.js'; export const mapStateToProps = ({ softwareProduct, @@ -137,7 +138,12 @@ const mapActionsToProps = (dispatch, { version }) => { props: { softwareProductId, version, componentId } }), /** for the next version */ - onAddComponent: () => SoftwareProductActionHelper.addComponent(dispatch) + onAddComponent: () => + SoftwareProductActionHelper.addComponent(dispatch), + + onBrowseVNF: currentSoftwareProduct => { + VNFImportActionHelper.open(dispatch, currentSoftwareProduct); + } }; }; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx index bc8a2be646..00f0c2a0cb 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx @@ -19,7 +19,9 @@ import classnames from 'classnames'; import Dropzone from 'react-dropzone'; import i18n from 'nfvo-utils/i18n/i18n.js'; +import Configuration from 'sdc-app/config/Configuration.js'; import DraggableUploadFileBox from 'nfvo-components/fileupload/DraggableUploadFileBox.jsx'; +import VnfRepositorySearchBox from 'nfvo-components/vnfMarketPlace/VnfRepositorySearchBox.jsx'; import SVGIcon from 'sdc-ui/lib/react/SVGIcon.js'; import SoftwareProductComponentsList from 'sdc-app/onboarding/softwareProduct/components/SoftwareProductComponents.js'; @@ -122,26 +124,55 @@ class SoftwareProductLandingPageView extends React.Component { } renderProductDetails(isManual, isReadOnlyMode) { - return ( -
- {!isManual && ( -
-
- {i18n('Software Product Attachments')} + let { onBrowseVNF, currentSoftwareProduct } = this.props; + + if (Configuration.get('showBrowseVNF')) { + return ( +
+ {!isManual && ( +
+
+ {i18n('Software Product Attachments')} +
+ this.refs.fileInput.open()} + onBrowseVNF={() => + onBrowseVNF(currentSoftwareProduct) + } + />
- this.refs.fileInput.open()} - /> -
- )} -
- ); + )} +
+ ); + } else { + return ( +
+ {!isManual && ( +
+
+ {i18n('Software Product Attachments')} +
+ this.refs.fileInput.open()} + onBrowseVNF={() => onBrowseVNF()} + /> +
+ )} +
+ ); + } } handleImportSubmit(files, isReadOnlyMode, isManual) { -- cgit 1.2.3-korg