aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/SoftwareProductDeployment.js
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/SoftwareProductDeployment.js')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/SoftwareProductDeployment.js85
1 files changed, 59 insertions, 26 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/SoftwareProductDeployment.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/SoftwareProductDeployment.js
index a5c70068b0..4e03926ac5 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/SoftwareProductDeployment.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/SoftwareProductDeployment.js
@@ -13,37 +13,70 @@
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
-import {connect} from 'react-redux';
+import { connect } from 'react-redux';
import SoftwareProductDeploymentView from './SoftwareProductDeploymentView.jsx';
import SoftwareProductDeploymentActionHelper from './SoftwareProductDeploymentActionHelper.js';
import i18n from 'nfvo-utils/i18n/i18n.js';
-import {actionTypes as modalActionTypes} from 'nfvo-components/modal/GlobalModalConstants.js';
+import { actionTypes as modalActionTypes } from 'nfvo-components/modal/GlobalModalConstants.js';
-export function mapStateToProps({softwareProduct}) {
- let {softwareProductComponents: {componentsList}, softwareProductDeployment: {deploymentFlavors}} = softwareProduct;
- return {
- deploymentFlavors,
- componentsList
- };
+export function mapStateToProps({ softwareProduct }) {
+ let {
+ softwareProductComponents: { componentsList },
+ softwareProductDeployment: { deploymentFlavors }
+ } = softwareProduct;
+ return {
+ deploymentFlavors,
+ componentsList
+ };
}
-function mapActionToProps(dispatch, {softwareProductId, version}) {
- let modalClassName = 'deployment-flavor-editor';
- return {
- onAddDeployment: componentsList => SoftwareProductDeploymentActionHelper.openDeploymentFlavorEditor(dispatch, {softwareProductId, modalClassName, componentsList, version}),
- onDeleteDeployment: ({id, model}) => dispatch({
- type: modalActionTypes.GLOBAL_MODAL_WARNING,
- data:{
- msg: i18n('Are you sure you want to delete "{model}"?', {model: model}),
- onConfirmed: () => SoftwareProductDeploymentActionHelper.deleteDeploymentFlavor(dispatch, {softwareProductId, deploymentFlavorId: id, version})
- }
- }),
- onEditDeployment: (deploymentFlavor, componentsList) =>
- SoftwareProductDeploymentActionHelper.fetchDeploymentFlavor({softwareProductId, deploymentFlavorId: deploymentFlavor.id, version}).then(response =>
- SoftwareProductDeploymentActionHelper
- .openDeploymentFlavorEditor(dispatch, {softwareProductId, componentsList, modalClassName, deploymentFlavor: {...response.data, id: response.id}, isEdit: true, version}),
- )
- };
+function mapActionToProps(dispatch, { softwareProductId, version }) {
+ let modalClassName = 'deployment-flavor-editor';
+ return {
+ onAddDeployment: componentsList =>
+ SoftwareProductDeploymentActionHelper.openDeploymentFlavorEditor(
+ dispatch,
+ { softwareProductId, modalClassName, componentsList, version }
+ ),
+ onDeleteDeployment: ({ id, model }) =>
+ dispatch({
+ type: modalActionTypes.GLOBAL_MODAL_WARNING,
+ data: {
+ msg: i18n('Are you sure you want to delete "{model}"?', {
+ model: model
+ }),
+ onConfirmed: () =>
+ SoftwareProductDeploymentActionHelper.deleteDeploymentFlavor(
+ dispatch,
+ {
+ softwareProductId,
+ deploymentFlavorId: id,
+ version
+ }
+ )
+ }
+ }),
+ onEditDeployment: (deploymentFlavor, componentsList) =>
+ SoftwareProductDeploymentActionHelper.fetchDeploymentFlavor({
+ softwareProductId,
+ deploymentFlavorId: deploymentFlavor.id,
+ version
+ }).then(response =>
+ SoftwareProductDeploymentActionHelper.openDeploymentFlavorEditor(
+ dispatch,
+ {
+ softwareProductId,
+ componentsList,
+ modalClassName,
+ deploymentFlavor: { ...response.data, id: response.id },
+ isEdit: true,
+ version
+ }
+ )
+ )
+ };
}
-export default connect(mapStateToProps, mapActionToProps, null, {withRef: true})(SoftwareProductDeploymentView);
+export default connect(mapStateToProps, mapActionToProps, null, {
+ withRef: true
+})(SoftwareProductDeploymentView);