diff options
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/modals/report-modal')
2 files changed, 10 insertions, 9 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/report-modal/report-modal-request.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/report-modal/report-modal-request.controller.js index 6b69a08fe..48179dd02 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/report-modal/report-modal-request.controller.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/report-modal/report-modal-request.controller.js @@ -42,10 +42,11 @@ }; vm.saveReportData = function(response) { - vm.report = - "Selected test API: \n" + DataService.getMsoRequestParametersTestApi() - + "\n\n Data from GUI:\n" + errorMsg - + "\n\n Collected data from API:\n" + JSON.stringify(response.data, null, "\t") ; + vm.report = "Selected test API: \n" + DataService.getMsoRequestParametersTestApi(); + if(errorMsg !== undefined && errorMsg !== null) { + vm.report += "\n\n Data from GUI:\n" + errorMsg; + } + vm.report +="\n\n Collected data from API:\n" + JSON.stringify(response.data, null, "\t") ; const blob = new Blob([ vm.report ], { type : 'text/plain' }); vm.download = ($window.URL || $window.webkitURL).createObjectURL( blob ); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/report-modal/report-modal.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/report-modal/report-modal.controller.js index eff029175..215439634 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/report-modal/report-modal.controller.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/report-modal/report-modal.controller.js @@ -42,11 +42,11 @@ }; vm.saveReportData = function(response) { - vm.report = - "Selected test API: \n" + DataService.getMsoRequestParametersTestApi() - + "\n\n Data from GUI:\n" + errorMsg - + "\n\n Collected data from API:\n" + JSON.stringify(response.data, null, "\t") ; - + vm.report = "Selected test API: \n" + DataService.getMsoRequestParametersTestApi(); + if(errorMsg !== undefined && errorMsg !== null) { + vm.report += "\n\n Data from GUI:\n" + errorMsg; + } + vm.report +="\n\n Collected data from API:\n" + JSON.stringify(response.data, null, "\t") ; const blob = new Blob([ vm.report ], { type : 'text/plain' }); vm.download = ($window.URL || $window.webkitURL).createObjectURL( blob ); |