2 * Copyright © 2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http: //www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 import { connect } from 'react-redux';
21 } from 'shared/modal/modalWrapperActions';
29 } from 'features/version/inputOutput/inputOutputSelectors';
30 import { getIsCertified } from 'features/version/general/generalSelectors';
41 } from 'features/version/inputOutput/inputOutputActions';
42 import { isWorkflowArchive } from 'features/workflow/workflowSelectors';
43 import InputOutputView from 'features/version/inputOutput/InputOutputView';
45 const mapStateToProps = state => ({
46 isShowInputs: getIsShowInputs(state),
47 search: getSearch(state),
48 dataRows: getDataRows(state),
49 types: getTypes(state),
50 error: getError(state),
51 isReadOnly: getIsCertified(state) || isWorkflowArchive(state)
54 const mapDispatchToProps = dispatch => ({
55 handleChangeError: payload => dispatch(changeError(payload)),
56 handleShowInputs: () => dispatch(showInputs()),
57 handleShowOutputs: () => dispatch(showOutputs()),
58 handleSearch: value => dispatch(search(value)),
59 handleAdd: () => dispatch(add()),
60 handleNameChange: (name, key) => dispatch(changeName(name, key)),
61 handleTypeChange: (type, key) => dispatch(changeType(type, key)),
62 handleMandatoryChange: (mandatory, key) =>
63 dispatch(changeMandatory(mandatory, key)),
64 handleRemove: (alertProps, key) => {
67 showAlertModalAction({
70 actionButtonClick: () =>
71 dispatch(hideModalAction()) && dispatch(remove(key))
76 return dispatch(remove(key));
80 export default connect(