aboutsummaryrefslogtreecommitdiffstats
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.js81
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx9
2 files changed, 66 insertions, 24 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 4b4c2fa86b..07a59eded3 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js
@@ -22,6 +22,7 @@ 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';
+import VspUploadStatus from 'sdc-app/onboarding/softwareProduct/landingPage/VspUploadStatus';
export const mapStateToProps = ({
features,
@@ -120,16 +121,34 @@ const mapActionsToProps = (dispatch, { version }) => {
// do nothing by default
}
) => {
- SoftwareProductActionHelper.uploadFile(dispatch, {
+ SoftwareProductActionHelper.createUploadStatus(
softwareProductId,
- formData,
- failedNotificationTitle: i18n('Upload validation failed'),
- version,
- onUploadProgress
- }).finally(() => {
- onUploadFinished();
- });
- onUploadStart();
+ version.id
+ )
+ .then(response => {
+ const vspUploadStatus = new VspUploadStatus(response);
+ onUploadStart(vspUploadStatus);
+ SoftwareProductActionHelper.uploadFile(dispatch, {
+ softwareProductId,
+ formData,
+ failedNotificationTitle: i18n(
+ 'Upload validation failed'
+ ),
+ version,
+ onUploadProgress
+ }).finally(() => {
+ onUploadFinished();
+ });
+ })
+ .catch(error => {
+ dispatch({
+ type: modalActionTypes.GLOBAL_MODAL_ERROR,
+ data: {
+ title: i18n('upload.failed'),
+ msg: error.message
+ }
+ });
+ });
},
onUploadConfirmation: (
@@ -152,19 +171,39 @@ const mapActionsToProps = (dispatch, { version }) => {
confirmationButtonText: i18n('Continue'),
title: i18n('Warning'),
onConfirmed: () => {
- SoftwareProductActionHelper.uploadFile(dispatch, {
+ SoftwareProductActionHelper.createUploadStatus(
softwareProductId,
- formData,
- failedNotificationTitle: i18n(
- 'Upload validation failed'
- ),
- version,
- onUploadProgress
- }).finally(value => {
- console.log('upload finished', value);
- onUploadFinished();
- });
- onUploadStart();
+ version.id
+ )
+ .then(response => {
+ const vspUploadStatus = new VspUploadStatus(
+ response
+ );
+ onUploadStart(vspUploadStatus);
+ SoftwareProductActionHelper.uploadFile(
+ dispatch,
+ {
+ softwareProductId,
+ formData,
+ failedNotificationTitle: i18n(
+ 'Upload validation failed'
+ ),
+ version,
+ onUploadProgress
+ }
+ ).finally(() => {
+ onUploadFinished();
+ });
+ })
+ .catch(error => {
+ dispatch({
+ type: modalActionTypes.GLOBAL_MODAL_ERROR,
+ data: {
+ title: i18n('upload.failed'),
+ msg: error.message
+ }
+ });
+ });
},
onDeclined: () =>
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 c560a73db3..64032863c7 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx
@@ -261,7 +261,10 @@ class SoftwareProductLandingPageView extends React.Component {
}
}
- onUploadStart = () => {
+ onUploadStart = vspUploadStatus => {
+ this.setState({
+ uploadStatus: vspUploadStatus
+ });
this.stopUploadStatusChecking();
this.showProgressBar();
};
@@ -324,7 +327,7 @@ class SoftwareProductLandingPageView extends React.Component {
onUploadConfirmation(
currentSoftwareProduct.id,
formData,
- () => this.onUploadStart(),
+ vspUploadStatus => this.onUploadStart(vspUploadStatus),
this.onUploadProgress,
this.onUploadFinished
);
@@ -332,7 +335,7 @@ class SoftwareProductLandingPageView extends React.Component {
onUpload(
currentSoftwareProduct.id,
formData,
- () => this.onUploadStart(),
+ vspUploadStatus => this.onUploadStart(vspUploadStatus),
this.onUploadProgress,
this.onUploadFinished
);