summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/nfvo-components/confirmations/ConfirmationModalView.jsx
blob: cc971c608cdc3818f01f746d4a98338bf50e49ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from 'react';
import Button from 'react-bootstrap/lib/Button.js';

import i18n from 'nfvo-utils/i18n/i18n.js';
import Modal from 'nfvo-components/modal/Modal.jsx';

let typeClass = {
	'default': 'primary',
	error: 'danger',
	warning: 'warning',
	success: 'success'
};


class ConfirmationModalView extends React.Component {

	static propTypes = {
		show: React.PropTypes.bool,
		type: React.PropTypes.oneOf(['default', 'error', 'warning', 'success']),
		msg: React.PropTypes.node,
		title: React.PropTypes.string,
		confirmationDetails: React.PropTypes.object,
		confirmationButtonText: React.PropTypes.string,

	};

	static defaultProps = {
		show: false,
		type: 'warning',
		title: 'Warning',
		msg: '',
		confirmationButtonText: i18n('Delete')
	};

	render() {
		let {title, type, msg, show, confirmationButtonText} = this.props;

		return(
			<Modal show={show} className={`notification-modal ${typeClass[type]}`}>
				<Modal.Header>
					<Modal.Title>{title}</Modal.Title>
				</Modal.Header>
				<Modal.Body>{msg}</Modal.Body>
				<Modal.Footer>
					<Button bsStyle={typeClass[type]} onClick={() => this.props.onDeclined(this.props.confirmationDetails)}>{i18n('Cancel')}</Button>
					<Button bsStyle={typeClass[type]} onClick={() => this.props.onConfirmed(this.props.confirmationDetails)}>{confirmationButtonText}</Button>
				</Modal.Footer>
			</Modal>
		);
	};
}

export default ConfirmationModalView;
s="s">"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> <version>2.3.2</version> <relativePath/> </parent> <groupId>org.onap.ccsdk.features.sdnr.northbound</groupId> <artifactId>oofpcipoc-provider</artifactId> <version>1.3.0-SNAPSHOT</version> <packaging>bundle</packaging> <name>ccsdk-features :: sdnr-northbound :: ${project.artifactId}</name> <dependencies> <dependency> <groupId>org.onap.ccsdk.features.sdnr.northbound</groupId> <artifactId>oofpcipoc-model</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.opendaylight.mdsal</groupId> <artifactId>mdsal-binding-api</artifactId> </dependency> <dependency> <groupId>org.opendaylight.mdsal</groupId> <artifactId>mdsal-dom-api</artifactId> </dependency> <dependency> <groupId>org.onap.ccsdk.sli.core</groupId> <artifactId>sli-common</artifactId> <version>${ccsdk.sli.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.onap.ccsdk.sli.core</groupId> <artifactId>sli-provider</artifactId> <version>${ccsdk.sli.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.opendaylight.mdsal</groupId> <artifactId>mdsal-binding-test-model</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.opendaylight.yangtools</groupId> <artifactId>yang-data-impl</artifactId> </dependency> </dependencies> </project>