4d992adcf301980f27ae88528073e1f9570a60d2
[sdc/sdc-workflow-designer.git] /
1 /*
2 * Copyright © 2018 European Support Limited
3 *
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
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17 import React from 'react';
18 import { I18n } from 'react-redux-i18n';
19 import { Button } from 'onap-ui-react';
20 import PropTypes from 'prop-types';
21 import SvgButton from 'features/version/versionController/views/SvgButton';
22
23 const OperationModeButtons = props => {
24     const {
25         onSaveClick,
26         saveDisabled,
27         sendMsgToCatalog,
28         onCertifyClick
29     } = props;
30     return (
31         <div className="save-submit-cancel-container">
32             <div className="action-buttons">
33                 <div className="select-action-buttons">
34                     <SvgButton
35                         dataTestId="vc-save-btn"
36                         name="version-controller-save"
37                         tooltipText={I18n.t('buttons.saveBtn')}
38                         disabled={saveDisabled}
39                         onClick={onSaveClick}
40                     />
41
42                     <Button
43                         disabled={saveDisabled}
44                         className="certifyBtn"
45                         btnType="primary"
46                         onClick={onCertifyClick}>
47                         {I18n.t('buttons.completeBtn')}
48                     </Button>
49
50                     <SvgButton
51                         tooltipText={I18n.t('buttons.backToCatalog')}
52                         className="vs-back-btn"
53                         dataTestId="vc-back-btn"
54                         name="upload"
55                         onClick={sendMsgToCatalog}
56                     />
57                 </div>
58             </div>
59         </div>
60     );
61 };
62
63 OperationModeButtons.propTypes = {
64     onSaveClick: PropTypes.func,
65     saveDisabled: PropTypes.bool,
66     sendMsgToCatalog: PropTypes.func,
67     onCertifyClick: PropTypes.func
68 };
69
70 export default OperationModeButtons;