2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
24 * Holds the buttons for save/reset for forms.
25 * Used by the ValidationForm that changes the state of the buttons according
29 * labledButtons - whether or not to use labeled buttons or icons only
31 import React from 'react';
32 import i18n from 'utils/i18n/i18n.js';
33 import Button from 'react-bootstrap/lib/Button.js';
34 import FontAwesome from 'react-fontawesome';
36 class ValidationButtons extends React.Component {
39 labledButtons: React.PropTypes.bool.isRequired,
40 isReadOnlyMode: React.PropTypes.bool
44 isValid: this.props.formValid
48 var submitBtn = this.props.labledButtons ? i18n('Save') :
49 <FontAwesome className='check' name='check'/>;
50 var closeBtn = this.props.labledButtons ? i18n('Cancel') :
51 <FontAwesome className='close' name='close'/>;
53 <div className='validation-buttons'>
54 {!this.props.isReadOnlyMode ?
56 <Button bsStyle='primary' ref='submitbutton' type='submit'
57 disabled={!this.state.isValid}>{submitBtn}</Button>
58 <Button type='reset'>{closeBtn}</Button>
60 : <Button type='reset'>{i18n('Close')}</Button>
66 export default ValidationButtons;