parse multilple error messages in separate lines 93/19993/1
authormiriame <miriam.eini@amdocs.com>
Sun, 22 Oct 2017 12:14:44 +0000 (15:14 +0300)
committermiriame <miriam.eini@amdocs.com>
Sun, 22 Oct 2017 12:14:44 +0000 (15:14 +0300)
Change-Id: I7e17ea7b4fdd31fe3b9607f9896b077bb8d9f451
Issue-ID: SDC-488
Signed-off-by: miriame <miriam.eini@amdocs.com>
openecomp-ui/src/nfvo-components/modal/GlobalModal.js
openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js

index e05c2ac..f282046 100644 (file)
@@ -112,7 +112,10 @@ export class  GlobalModalView extends React.Component {
                                        <Modal.Title>{title}</Modal.Title>
                                </Modal.Header>
                                <Modal.Body>
-                                       {ComponentToRender ? <ComponentToRender {...modalComponentProps}/> :  msg}
+                                       {ComponentToRender ?
+                                               <ComponentToRender {...modalComponentProps}/> :
+                                               <div> {msg && msg.split('\n').map(txt => <span> {txt} <br/> </span>)} </div>
+                                       }
                                </Modal.Body>
                                {(onConfirmed || onDeclined || type !== typeEnum.DEFAULT) &&
                                                <ModalFooter
index 41306a1..db7afd2 100644 (file)
@@ -114,7 +114,7 @@ function objToString(obj) {
                        }
                }
        }
-       return str;
+       return str.replace(/\n$/, '');
 }
 
 function parseUploadErrorMsg(error) {
@@ -124,7 +124,7 @@ function parseUploadErrorMsg(error) {
                        message += objToString(error[key]) + '\n';
                }
        }
-       return message;
+       return message.replace(/\n$/, '');
 }
 
 function fetchSoftwareProductCategories(dispatch) {