20de95d89c93f1ac7465725f8a6bf8d7b2fd3d45
[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 'sdc-ui/lib/react';
20 import PropTypes from 'prop-types';
21 import SvgButton from 'features/version/versionController/views/SvgButton';
22
23 const OperationModeButtons = props => {
24     const { onSaveClick, saveDisabled, sendMsgToCatalog } = props;
25     const handleCompleteMsgToCatalog = () => sendMsgToCatalog(true);
26     const handleGoBackMsgToCatalog = () => sendMsgToCatalog();
27     return (
28         <div className="save-submit-cancel-container">
29             <div className="action-buttons">
30                 <div className="select-action-buttons">
31                     <SvgButton
32                         dataTestId="vc-save-btn"
33                         name="version-controller-save"
34                         tooltipText={I18n.t('buttons.saveBtn')}
35                         disabled={saveDisabled}
36                         onClick={onSaveClick}
37                     />
38
39                     <Button
40                         className="certifyBtn"
41                         btnType="primary"
42                         onClick={handleCompleteMsgToCatalog}>
43                         {I18n.t('buttons.completeBtn')}
44                     </Button>
45
46                     <SvgButton
47                         tooltipText={I18n.t('buttons.backToCatalog')}
48                         className="vs-back-btn"
49                         dataTestId="vc-back-btn"
50                         name="upload"
51                         onClick={handleGoBackMsgToCatalog}
52                     />
53                 </div>
54             </div>
55         </div>
56     );
57 };
58
59 OperationModeButtons.propTypes = {
60     onSaveClick: PropTypes.func,
61     saveDisabled: PropTypes.bool,
62     sendMsgToCatalog: PropTypes.func
63 };
64
65 export default OperationModeButtons;