summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js30
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx60
2 files changed, 46 insertions, 44 deletions
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 a13e742006..90ea182dfa 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js
@@ -15,14 +15,18 @@
*/
import {connect} from 'react-redux';
import i18n from 'nfvo-utils/i18n/i18n.js';
-import VersionControllerUtils from 'nfvo-components/panel/versionController/VersionControllerUtils.js';
-import OnboardingActionHelper from 'sdc-app/onboarding/OnboardingActionHelper.js';
import SoftwareProductActionHelper from 'sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js';
import LandingPageView from './SoftwareProductLandingPageView.jsx';
import {actionTypes as modalActionTypes} from 'nfvo-components/modal/GlobalModalConstants.js';
import {onboardingMethod} from '../SoftwareProductConstants.js';
+import ScreensHelper from 'sdc-app/common/helpers/ScreensHelper.js';
+import {enums, screenTypes} from 'sdc-app/onboarding/OnboardingConstants.js';
-export const mapStateToProps = ({softwareProduct, licenseModel: {licenseAgreement}}) => {
+
+export const mapStateToProps = ({
+ softwareProduct,
+ licenseModel: {licenseAgreement},
+}) => {
let {softwareProductEditor: {data:currentSoftwareProduct = {}}, softwareProductComponents, softwareProductCategories = []} = softwareProduct;
let {licensingData = {}} = currentSoftwareProduct;
let {licenseAgreementList} = licenseAgreement;
@@ -44,7 +48,6 @@ export const mapStateToProps = ({softwareProduct, licenseModel: {licenseAgreemen
}
fullCategoryDisplayName = `${subCategoryName} (${categoryName})`;
- const isReadOnlyMode = VersionControllerUtils.isReadOnly(currentSoftwareProduct);
return {
currentSoftwareProduct: {
@@ -52,7 +55,6 @@ export const mapStateToProps = ({softwareProduct, licenseModel: {licenseAgreemen
licenseAgreementName,
fullCategoryDisplayName
},
- isReadOnlyMode,
componentsList,
isManual: currentSoftwareProduct.onboardingMethod === onboardingMethod.MANUAL
};
@@ -60,11 +62,12 @@ export const mapStateToProps = ({softwareProduct, licenseModel: {licenseAgreemen
const mapActionsToProps = (dispatch, {version}) => {
return {
- onDetailsSelect: ({id: softwareProductId, vendorId: licenseModelId, version}) => OnboardingActionHelper.navigateToSoftwareProductDetails(dispatch, {
- softwareProductId,
- licenseModelId,
- version
- }),
+ onDetailsSelect: ({id: softwareProductId}) =>
+ ScreensHelper.loadScreen(dispatch, {
+ screen: enums.SCREEN.SOFTWARE_PRODUCT_DETAILS, screenType: screenTypes.SOFTWARE_PRODUCT,
+ props: {softwareProductId, version}
+ }),
+
onUpload: (softwareProductId, formData) =>
SoftwareProductActionHelper.uploadFile(dispatch, {
softwareProductId,
@@ -100,9 +103,10 @@ const mapActionsToProps = (dispatch, {version}) => {
msg: i18n('no zip or csar file was uploaded or expected file doesn\'t exist')
}
}),
- onComponentSelect: ({id: softwareProductId, componentId}) => {
- OnboardingActionHelper.navigateToSoftwareProductComponentGeneralAndUpdateLeftPanel(dispatch, {softwareProductId, componentId, version });
- },
+ onComponentSelect: ({id: softwareProductId, componentId}) => ScreensHelper.loadScreen(dispatch, {
+ screen: screenTypes.SOFTWARE_PRODUCT_COMPONENT_DEFAULT_GENERAL, screenType: screenTypes.SOFTWARE_PRODUCT,
+ props: {softwareProductId, version, componentId}
+ }),
/** for the next version */
onAddComponent: () => SoftwareProductActionHelper.addComponent(dispatch)
};
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 72a416473c..56402b4417 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx
@@ -14,6 +14,7 @@
* permissions and limitations under the License.
*/
import React from 'react';
+import PropTypes from 'prop-types';
import classnames from 'classnames';
import Dropzone from 'react-dropzone';
@@ -22,25 +23,25 @@ import i18n from 'nfvo-utils/i18n/i18n.js';
import DraggableUploadFileBox from 'nfvo-components/fileupload/DraggableUploadFileBox.jsx';
import SVGIcon from 'sdc-ui/lib/react/SVGIcon.js';
-import SoftwareProductComponentsList from '../components/SoftwareProductComponentsList.js';
-
-const SoftwareProductPropType = React.PropTypes.shape({
- name: React.PropTypes.string,
- description: React.PropTypes.string,
- version: React.PropTypes.object,
- id: React.PropTypes.string,
- categoryId: React.PropTypes.string,
- vendorId: React.PropTypes.string,
- status: React.PropTypes.string,
- licensingData: React.PropTypes.object,
- validationData: React.PropTypes.object
+import SoftwareProductComponentsList from 'sdc-app/onboarding/softwareProduct/components/SoftwareProductComponents.js';
+
+const SoftwareProductPropType = PropTypes.shape({
+ name: PropTypes.string,
+ description: PropTypes.string,
+ version: PropTypes.object,
+ id: PropTypes.string,
+ categoryId: PropTypes.string,
+ vendorId: PropTypes.string,
+ status: PropTypes.string,
+ licensingData: PropTypes.object,
+ validationData: PropTypes.object
});
-const ComponentPropType = React.PropTypes.shape({
- id: React.PropTypes.string,
- name: React.PropTypes.string,
- displayName: React.PropTypes.string,
- description: React.PropTypes.string
+const ComponentPropType = PropTypes.shape({
+ id: PropTypes.string,
+ name: PropTypes.string,
+ displayName: PropTypes.string,
+ description: PropTypes.string
});
class SoftwareProductLandingPageView extends React.Component {
@@ -54,18 +55,19 @@ class SoftwareProductLandingPageView extends React.Component {
static propTypes = {
currentSoftwareProduct: SoftwareProductPropType,
- isReadOnlyMode: React.PropTypes.bool,
- componentsList: React.PropTypes.arrayOf(ComponentPropType),
- onDetailsSelect: React.PropTypes.func,
- onUpload: React.PropTypes.func,
- onUploadConfirmation: React.PropTypes.func,
- onInvalidFileSizeUpload: React.PropTypes.func,
- onComponentSelect: React.PropTypes.func,
- onAddComponent: React.PropTypes.func
+ isReadOnlyMode: PropTypes.bool,
+ componentsList: PropTypes.arrayOf(ComponentPropType),
+ version: PropTypes.object,
+ onDetailsSelect: PropTypes.func,
+ onUpload: PropTypes.func,
+ onUploadConfirmation: PropTypes.func,
+ onInvalidFileSizeUpload: PropTypes.func,
+ onComponentSelect: PropTypes.func,
+ onAddComponent: PropTypes.func
};
render() {
- let {currentSoftwareProduct, isReadOnlyMode, isManual, onDetailsSelect, componentsList} = this.props;
+ let {currentSoftwareProduct, isReadOnlyMode, isManual, onDetailsSelect} = this.props;
return (
<div className='software-product-landing-wrapper'>
<Dropzone
@@ -88,11 +90,7 @@ class SoftwareProductLandingPageView extends React.Component {
</div>
</div>
</Dropzone>
- <SoftwareProductComponentsList
- isReadOnlyMode={isReadOnlyMode}
- componentsList={componentsList}
- isManual={isManual}
- currentSoftwareProduct={currentSoftwareProduct}/>
+ <SoftwareProductComponentsList/>
</div>
);
}