71f414068422dbad17841b3101cc05f6d1b633fb
[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 ActionButtons = props => {
24     const {
25         onSaveClick,
26         certifyDisabled,
27         onCertifyClick,
28         onUndoClick,
29         saveDisabled
30     } = props;
31     return (
32         <div className="save-submit-cancel-container">
33             <div className="action-buttons">
34                 <div className="select-action-buttons">
35                     <div className={'separator vc-separator'} />
36                     <SvgButton
37                         dataTestId="vc-save-btn"
38                         name="version-controller-save"
39                         tooltipText={I18n.t('buttons.saveBtn')}
40                         disabled={saveDisabled}
41                         onClick={onSaveClick}
42                     />
43                     <div className={'separator vc-separator'} />
44                     <SvgButton
45                         dataTestId="vc-undo-btn"
46                         name="version-controller-undo"
47                         tooltipText={I18n.t('buttons.undoBtn')}
48                         disabled={certifyDisabled}
49                         onClick={onUndoClick}
50                     />
51                     <div className={'separator vc-separator'} />
52                     <Button
53                         className="certifyBtn"
54                         btnType="primary"
55                         disabled={certifyDisabled}
56                         onClick={onCertifyClick}>
57                         {I18n.t('buttons.certifyBtn')}
58                     </Button>
59                 </div>
60             </div>
61         </div>
62     );
63 };
64
65 ActionButtons.propTypes = {
66     onSaveClick: PropTypes.func,
67     certifyDisabled: PropTypes.bool,
68     onCertifyClick: PropTypes.func,
69     onUndoClick: PropTypes.func,
70     saveDisabled: PropTypes.bool
71 };
72
73 export default ActionButtons;