react 16 upgrade
Issue-ID: SDC-1762
Change-Id: I7701f12fc63bb09f8c985c7c893b984701dcbfab
Signed-off-by: Einav Keidar <einavw@amdocs.com>
diff --git a/openecomp-ui/src/sdc-app/flows/FlowsActions.js b/openecomp-ui/src/sdc-app/flows/FlowsActions.js
index 9fb65f3..4ad7dcf 100644
--- a/openecomp-ui/src/sdc-app/flows/FlowsActions.js
+++ b/openecomp-ui/src/sdc-app/flows/FlowsActions.js
@@ -1,22 +1,25 @@
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js';
import Configuration from 'sdc-app/config/Configuration.js';
import { actionTypes, enums } from './FlowsConstants.js';
import SequenceDiagramModelHelper from './SequenceDiagramModelHelper.js';
+import { actionTypes as modalActionTypes } from 'nfvo-components/modal/GlobalModalConstants.js';
+import { modalContentMapper } from 'sdc-app/common/modal/ModalContentMapper.js';
+import i18n from 'nfvo-utils/i18n/i18n.js';
function baseUrl(serviceId, artifactId = '') {
const restCatalogPrefix = Configuration.get('restCatalogPrefix');
@@ -97,7 +100,7 @@
readonly
});
if (!readonly) {
- FlowsActions.openFlowDetailsEditor(dispatch);
+ FlowsActions.openEditCreateWFModal(dispatch);
}
} else {
Object.keys(artifacts).forEach(artifact =>
@@ -194,14 +197,6 @@
);
},
- openFlowDetailsEditor(dispatch, flow) {
- dispatch({ type: actionTypes.OPEN_FLOW_DETAILS_EDITOR, flow });
- },
-
- closeFlowDetailsEditor(dispatch) {
- dispatch({ type: actionTypes.CLOSE_FLOW_DETAILS_EDITOR });
- },
-
openFlowDiagramEditor(dispatch, { flow }) {
dispatch({ type: actionTypes.OPEN_FLOW_DIAGRAM_EDITOR, flow });
},
@@ -212,6 +207,27 @@
reset(dispatch) {
dispatch({ type: actionTypes.RESET });
+ },
+ openEditCreateWFModal(dispatch, flow) {
+ dispatch({ type: actionTypes.OPEN_FLOW_DETAILS_EDITOR, flow });
+ dispatch({
+ type: modalActionTypes.GLOBAL_MODAL_SHOW,
+ data: {
+ modalComponentName: modalContentMapper.FLOWS_EDITOR,
+ modalComponentProps: {
+ isNewArtifact: Boolean(flow && flow.uniqueId)
+ },
+ title: flow
+ ? i18n('Edit Workflow')
+ : i18n('Create New Workflow')
+ }
+ });
+ },
+ closeEditCreateWFModal(dispatch) {
+ dispatch({
+ type: modalActionTypes.GLOBAL_MODAL_CLOSE
+ });
+ dispatch({ type: actionTypes.CLOSE_FLOW_DETAILS_EDITOR });
}
});
diff --git a/openecomp-ui/src/sdc-app/flows/FlowsEditorModal.js b/openecomp-ui/src/sdc-app/flows/FlowsEditorModal.js
index b45a9fc..4ef12fa 100644
--- a/openecomp-ui/src/sdc-app/flows/FlowsEditorModal.js
+++ b/openecomp-ui/src/sdc-app/flows/FlowsEditorModal.js
@@ -1,17 +1,17 @@
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import { connect } from 'react-redux';
import FlowsEditorModalView from './FlowsEditorModalView.jsx';
@@ -50,10 +50,10 @@
const mapActionsToProps = (dispatch, { isNewArtifact }) => {
return {
onSubmit: flow => {
- FlowsActions.closeFlowDetailsEditor(dispatch);
+ FlowsActions.closeEditCreateWFModal(dispatch);
FlowsActions.createOrUpdateFlow(dispatch, { flow }, isNewArtifact);
},
- onCancel: () => FlowsActions.closeFlowDetailsEditor(dispatch),
+ onCancel: () => FlowsActions.closeEditCreateWFModal(dispatch),
onDataChanged: deltaData =>
ValidationHelper.dataChanged(dispatch, {
deltaData,
diff --git a/openecomp-ui/src/sdc-app/flows/FlowsEditorModalView.jsx b/openecomp-ui/src/sdc-app/flows/FlowsEditorModalView.jsx
index 8c805cc..6ac316e 100644
--- a/openecomp-ui/src/sdc-app/flows/FlowsEditorModalView.jsx
+++ b/openecomp-ui/src/sdc-app/flows/FlowsEditorModalView.jsx
@@ -1,17 +1,17 @@
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import React, { Component } from 'react';
import i18n from 'nfvo-utils/i18n/i18n.js';
@@ -38,7 +38,8 @@
onReset={onCancel}
formReady={formReady}
isValid={isFormValid}
- onValidateForm={() => onValidateForm()}>
+ onValidateForm={() => onValidateForm()}
+ btnClassName="sdc-modal__footer">
<Input
type="text"
name="name"
diff --git a/openecomp-ui/src/sdc-app/flows/FlowsListEditor.js b/openecomp-ui/src/sdc-app/flows/FlowsListEditor.js
index 2718c19..c96415c 100644
--- a/openecomp-ui/src/sdc-app/flows/FlowsListEditor.js
+++ b/openecomp-ui/src/sdc-app/flows/FlowsListEditor.js
@@ -1,17 +1,17 @@
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import { connect } from 'react-redux';
import FlowsActions from './FlowsActions.js';
@@ -20,8 +20,6 @@
export const mapStateToProps = ({ flows }) => {
let {
flowList = [],
- isDisplayModal,
- isModalInEditMode,
shouldShowWorkflowsEditor = true,
data = undefined,
readonly
@@ -33,9 +31,7 @@
return {
flowList,
- isDisplayModal,
isCheckedOut,
- isModalInEditMode,
shouldShowWorkflowsEditor,
currentFlow: data,
readonly
@@ -44,9 +40,9 @@
const mapActionsToProps = dispatch => {
return {
- onAddWorkflowClick: () => FlowsActions.openFlowDetailsEditor(dispatch),
+ onAddWorkflowClick: () => FlowsActions.openEditCreateWFModal(dispatch),
onEditFlowDetailsClick: flow =>
- FlowsActions.openFlowDetailsEditor(dispatch, flow),
+ FlowsActions.openEditCreateWFModal(dispatch, flow),
onEditFlowDiagramClick: flow =>
FlowsActions.fetchArtifact(dispatch, { flow }),
onDeleteFlowClick: flow => FlowsActions.deleteFlow(dispatch, { flow }),
diff --git a/openecomp-ui/src/sdc-app/flows/FlowsListEditorView.jsx b/openecomp-ui/src/sdc-app/flows/FlowsListEditorView.jsx
index d1c0c9a..f0a4635 100644
--- a/openecomp-ui/src/sdc-app/flows/FlowsListEditorView.jsx
+++ b/openecomp-ui/src/sdc-app/flows/FlowsListEditorView.jsx
@@ -1,34 +1,30 @@
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import i18n from 'nfvo-utils/i18n/i18n.js';
-import Modal from 'nfvo-components/modal/Modal.jsx';
import ListEditorView from 'nfvo-components/listEditor/ListEditorView.jsx';
import ListEditorItemView from 'nfvo-components/listEditor/ListEditorItemView.jsx';
-import FlowsEditorModal from './FlowsEditorModal.js';
import SequenceDiagram from './SequenceDiagram.jsx';
class FlowsListEditorView extends Component {
static propTypes = {
flowList: PropTypes.array,
currentFlow: PropTypes.object,
- isDisplayModal: PropTypes.bool,
- isModalInEditMode: PropTypes.bool,
isCheckedOut: PropTypes.bool,
shouldShowWorkflowsEditor: PropTypes.bool,
readonly: PropTypes.bool,
@@ -57,7 +53,7 @@
}
renderWorkflowsEditor() {
- let { isDisplayModal, onAddWorkflowClick, isCheckedOut } = this.props;
+ let { onAddWorkflowClick, isCheckedOut } = this.props;
const { localFilter } = this.state;
return (
@@ -72,35 +68,10 @@
this.renderWorkflowListItem(flow, isCheckedOut)
)}
</ListEditorView>
-
- {isDisplayModal && this.renderWorkflowEditorModal()}
</div>
);
}
- renderWorkflowEditorModal() {
- let { isDisplayModal, isModalInEditMode } = this.props;
- return (
- <Modal
- show={isDisplayModal}
- animation={true}
- className="onborading-modal workflows-editor-modal">
- <Modal.Header>
- <Modal.Title>
- {`${
- isModalInEditMode
- ? i18n('Edit Workflow')
- : i18n('Create New Workflow')
- }`}
- </Modal.Title>
- </Modal.Header>
- <Modal.Body>
- <FlowsEditorModal isNewArtifact={!isModalInEditMode} />
- </Modal.Body>
- </Modal>
- );
- }
-
renderSequenceDiagramTool() {
let {
onSequenceDiagramSaveClick,
diff --git a/openecomp-ui/src/sdc-app/flows/FlowsListReducer.js b/openecomp-ui/src/sdc-app/flows/FlowsListReducer.js
index 0279824..56d389b 100644
--- a/openecomp-ui/src/sdc-app/flows/FlowsListReducer.js
+++ b/openecomp-ui/src/sdc-app/flows/FlowsListReducer.js
@@ -1,17 +1,17 @@
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import { actionTypes, FLOWS_EDITOR_FORM } from './FlowsConstants.js';
@@ -71,17 +71,13 @@
validations: [{ type: 'required', data: true }]
}
},
- data: action.flow,
- isDisplayModal: true,
- isModalInEditMode: Boolean(action.flow && action.flow.uniqueId)
+ data: action.flow
};
case actionTypes.CLOSE_FLOW_DETAILS_EDITOR:
return {
...state,
- data: undefined,
- isDisplayModal: false,
- isModalInEditMode: false
+ data: undefined
};
case actionTypes.OPEN_FLOW_DIAGRAM_EDITOR:
return {