summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/nfvo-components/modal
diff options
context:
space:
mode:
authortalig <talig@amdocs.com>2017-12-20 14:30:43 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2017-12-21 11:12:33 +0000
commit8e9c0653dd6c6862123c9609ae34e1206d86456e (patch)
tree5eeef00ec0677133baa439ca8d7ffd7aca4804b6 /openecomp-ui/src/nfvo-components/modal
parent785ebcc95de3e064e843bec04ba7a209d854fc7c (diff)
Add collaboration feature
Issue-ID: SDC-767 Change-Id: I14fb4c1f54086ed03a56a7ff7fab9ecd40381795 Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/nfvo-components/modal')
-rw-r--r--openecomp-ui/src/nfvo-components/modal/GlobalModal.js27
1 files changed, 14 insertions, 13 deletions
diff --git a/openecomp-ui/src/nfvo-components/modal/GlobalModal.js b/openecomp-ui/src/nfvo-components/modal/GlobalModal.js
index 4e7a1a16a4..a47c42a1fb 100644
--- a/openecomp-ui/src/nfvo-components/modal/GlobalModal.js
+++ b/openecomp-ui/src/nfvo-components/modal/GlobalModal.js
@@ -15,6 +15,7 @@
*/
import React from 'react';
+import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import Modal from 'nfvo-components/modal/Modal.jsx';
@@ -25,7 +26,7 @@ import {actionTypes, typeEnum} from './GlobalModalConstants.js';
const typeClass = {
- 'default': 'default',
+ 'default': 'primary',
error: 'negative',
warning: 'warning',
success: 'positive'
@@ -47,11 +48,11 @@ const ModalFooter = ({type, onConfirmed, onDeclined, onClose, confirmationButton
return (
<Modal.Footer>
<div className='sdc-modal-footer'>
- {onConfirmed && <Button color={typeClass[type]} onClick={() => {
+ {onConfirmed && <Button data-test-id='sdc-modal-confirm-button' color={typeClass[type]} onClick={() => {
onConfirmed();
onClose();
}}>{confirmationButtonText}</Button>}
- <Button {...myPropsForNoConfirmed} color={typeClass[type]} onClick={onDeclined ? () => {
+ <Button {...myPropsForNoConfirmed} data-test-id='sdc-modal-cancel-button' btnType='outline' color={typeClass[type]} onClick={onDeclined ? () => {
onDeclined();
onClose();} : () => onClose()}>
{cancelButtonText}
@@ -85,15 +86,15 @@ export const mapActionToProps = (dispatch) => {
export class GlobalModalView extends React.Component {
static propTypes = {
- show: React.PropTypes.bool,
- type: React.PropTypes.oneOf(['default', 'error', 'warning', 'success']),
- title: React.PropTypes.string,
- modalComponentProps: React.PropTypes.object,
- modalComponentName: React.PropTypes.string,
- onConfirmed: React.PropTypes.func,
- onDeclined: React.PropTypes.func,
- confirmationButtonText: React.PropTypes.string,
- cancelButtonText: React.PropTypes.string
+ show: PropTypes.bool,
+ type: PropTypes.oneOf(['default', 'error', 'warning', 'success']),
+ title: PropTypes.string,
+ modalComponentProps: PropTypes.object,
+ modalComponentName: PropTypes.string,
+ onConfirmed: PropTypes.func,
+ onDeclined: PropTypes.func,
+ confirmationButtonText: PropTypes.string,
+ cancelButtonText: PropTypes.string
};
static defaultProps = {
@@ -115,7 +116,7 @@ export class GlobalModalView extends React.Component {
{ComponentToRender ?
<ComponentToRender {...modalComponentProps}/> :
msg && typeof msg === 'string' ?
- <div> {msg.split('\n').map(txt => <span> {txt} <br/> </span>)} </div> :
+ <div> {msg.split('\n').map((txt, i) => <span key={i}> {txt} <br/> </span>)} </div> :
msg
}
</Modal.Body>