diff --git a/dcm4chee-arc-ui2/src/app/app.service.ts b/dcm4chee-arc-ui2/src/app/app.service.ts
index cf0a5ed1d2..1f6c0a38ef 100644
--- a/dcm4chee-arc-ui2/src/app/app.service.ts
+++ b/dcm4chee-arc-ui2/src/app/app.service.ts
@@ -179,6 +179,24 @@ export class AppService implements OnInit, OnDestroy{
})
}
+ showMsgCopyMoveLink(res, action:string) {
+ let msg;
+ const errorCount = res.filter(result=>result.isError).length;
+ let errorDetail = _.hasIn(res, "0.error.error.errorMessage") ? _.get(res, "0.error.error.errorMessage") : '';
+ if(errorCount === res.length){
+ msg = $localize `:@@study.process_executed_all_failed_detail:${action}:@@action: process executed - all failed:
\nErrors: ${errorCount}:@@error:`;
+ errorDetail = msg + `
\n` + errorDetail;
+ this.showError(errorDetail);
+ } else {
+ msg = $localize `:@@study.process_executed_successfully_detailed:${action}:@@action: process executed successfully:
\nErrors: ${errorCount}:@@error:
\nSuccessful: ${res.length - errorCount}:@@successfull:`;
+ if(errorCount > 0){
+ this.showWarning(msg);
+ }else{
+ this.showMsg(msg);
+ }
+ }
+ }
+
showMsgUpdateCharsets(res) {
let detail = '';
let successful = _.hasIn(res, "updated") ? _.get(res, "updated") : '';
diff --git a/dcm4chee-arc-ui2/src/app/study/study/study.component.ts b/dcm4chee-arc-ui2/src/app/study/study/study.component.ts
index 403612455d..65d4351d78 100644
--- a/dcm4chee-arc-ui2/src/app/study/study/study.component.ts
+++ b/dcm4chee-arc-ui2/src/app/study/study/study.component.ts
@@ -659,19 +659,7 @@ export class StudyComponent implements OnInit, OnDestroy, AfterContentChecked{
this.service.linkStudyToMwl(this.selectedElements, this.studyWebService.selectedWebService, result.reject).subscribe(res=>{
console.log("res",res);
this.cfpLoadingBar.complete();
- const errorCount = res.filter(result=>result.isError).length;
- let msg;
- if(errorCount === res.length){
- msg = $localize `:@@study.process_executed_all_failed_detail:${this.service.getTextFromAction(this.selectedElements.action)}:@@action: process executed - all failed:
\nErrors: ${errorCount}:@@error:`;
- this.appService.showError(msg);
- }else{
- msg = $localize `:@@study.process_executed_successfully_detailed:${this.service.getTextFromAction(this.selectedElements.action)}:@@action: process executed successfully:
\nErrors: ${errorCount}:@@error:
\nSuccessful: ${res.length - errorCount}:@@successfull:`;
- if(errorCount > 0){
- this.appService.showWarning(msg);
- }else{
- this.appService.showMsg(msg);
- }
- }
+ this.appService.showMsgCopyMoveLink(res, this.service.getTextFromAction(this.selectedElements.action));
this.clearClipboard();
},err=>{
this.cfpLoadingBar.complete();
@@ -682,19 +670,7 @@ export class StudyComponent implements OnInit, OnDestroy, AfterContentChecked{
this.service.copyMove(this.selectedElements, this.studyWebService.selectedWebService,result.reject).subscribe(res=>{
try{
console.log("res",res);
- const errorCount = res.filter(result=>result.isError).length;
- let msg;
- if(errorCount === res.length){
- msg = $localize `:@@study.process_executed_all_failed_detail:${this.service.getTextFromAction(this.selectedElements.action)}:@@action: process executed - all failed:
\nErrors: ${errorCount}:@@error:`;
- this.appService.showError(msg);
- }else{
- msg = $localize `:@@study.process_executed_successfully_detailed:${this.service.getTextFromAction(this.selectedElements.action)}:@@action: process executed successfully:
\nErrors: ${errorCount}:@@error:
\nSuccessful: ${res.length - errorCount}:@@successfull:`;
- if(errorCount > 0){
- this.appService.showWarning(msg);
- }else{
- this.appService.showMsg(msg);
- }
- }
+ this.appService.showMsgCopyMoveLink(res, this.service.getTextFromAction(this.selectedElements.action));
}catch (e) {
this.httpErrorHandler.handleError(res);
}