diff --git a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/dataset/service/DatasetServiceImpl.java b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/dataset/service/DatasetServiceImpl.java index 7586f512f4..89724aee8e 100644 --- a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/dataset/service/DatasetServiceImpl.java +++ b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/dataset/service/DatasetServiceImpl.java @@ -93,9 +93,9 @@ public void deleteById(final Long id) throws ShanoirException, SolrServerExcepti if (datasetDb == null) { throw new EntityNotFoundException(Dataset.class, id); } - repository.deleteById(id); solrService.deleteFromIndex(id); this.deleteDatasetFromPacs(datasetDb); + repository.deleteById(id); shanoirEventService.publishEvent(new ShanoirEvent(ShanoirEventType.DELETE_DATASET_EVENT, id.toString(), KeycloakUtil.getTokenUserId(), "", ShanoirEvent.SUCCESS, datasetDb.getStudyId())); } diff --git a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/dicom/web/service/DICOMWebService.java b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/dicom/web/service/DICOMWebService.java index 3a9f5484ad..76d9d6bb9a 100644 --- a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/dicom/web/service/DICOMWebService.java +++ b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/dicom/web/service/DICOMWebService.java @@ -295,7 +295,7 @@ public void deleteDicomFilesFromPacs(String url) throws ShanoirException { HttpPost post = new HttpPost(rejectURL); post.setHeader(HttpHeaders.CONTENT_TYPE, CONTENT_TYPE_JSON); try (CloseableHttpResponse response = httpClient.execute(post)) { - if (response.getCode() == HttpStatus.NO_CONTENT.value()) { + if (HttpStatus.OK.value() == response.getCode()) { LOG.info("Rejected from PACS: " + url); } else { LOG.error(response.getCode() + ": Could not reject instance from PACS: " + response.getReasonPhrase() @@ -304,8 +304,8 @@ public void deleteDicomFilesFromPacs(String url) throws ShanoirException { + "for rejectURL: " + rejectURL); } } catch (IOException e) { - LOG.error(e.getMessage(), e); - throw new ShanoirException(e.getMessage()); + LOG.error("Could not reject instance from PACS: for rejectURL: " + rejectURL, e); + throw new ShanoirException("Could not reject instance from PACS: for rejectURL: " + url, e); } // STEP 2: Delete from the PACS HttpDelete delete = new HttpDelete(deleteUrl); diff --git a/shanoir-ng-front/src/app/shared/notifications/notifications.service.ts b/shanoir-ng-front/src/app/shared/notifications/notifications.service.ts index edd0bb2a5c..d034a1cd4f 100644 --- a/shanoir-ng-front/src/app/shared/notifications/notifications.service.ts +++ b/shanoir-ng-front/src/app/shared/notifications/notifications.service.ts @@ -42,7 +42,7 @@ export class NotificationsService { readonly readInterval: number = 1000; readonly persistenceTime: number = 1800000; private freshTimeouts: SuperTimeout[] = []; - private readonly TIMEOUT: number = 30000; + private readonly TIMEOUT: number = 300000; constructor(private taskService: TaskService, private keycloakService: KeycloakService) { @@ -229,4 +229,4 @@ export class NotificationsService { this.tasksInProgress.forEach(task => total += task.progress); return total/this.tasksInProgress.length; } -} \ No newline at end of file +} diff --git a/shanoir-ng-front/src/app/studies/study/study.component.ts b/shanoir-ng-front/src/app/studies/study/study.component.ts index 9ceba3f82f..0430cf0cc0 100644 --- a/shanoir-ng-front/src/app/studies/study/study.component.ts +++ b/shanoir-ng-front/src/app/studies/study/study.component.ts @@ -127,7 +127,7 @@ export class StudyComponent extends EntityComponent { this.studyRightsService.getMyRightsForStudy(this.id).then(rights => { this.hasDownloadRight = this.keycloakService.isUserAdmin() || rights.includes(StudyUserRight.CAN_DOWNLOAD); }) - let studyPromise: Promise = this.studyService.get(this.id, null, true).then(study => { + let studyPromise: Promise = this.studyService.get(this.id, null).then(study => { this.study = study; this.setLabeledSizes(this.study); @@ -166,7 +166,7 @@ export class StudyComponent extends EntityComponent { } initEdit(): Promise { - let studyPromise: Promise = this.studyService.get(this.id, null, true).then(study => { + let studyPromise: Promise = this.studyService.get(this.id, null).then(study => { this.study = study; if (this.study.profile == null) { @@ -273,7 +273,6 @@ export class StudyComponent extends EntityComponent { if (datasetSizes.extraDataSize > 0){ sizesByLabel.set("Other files (DUA, protocol...)", datasetSizes.extraDataSize); } - let total = datasetSizes.total; study.detailedSizes = sizesByLabel; }); }).finally(() => { @@ -659,7 +658,7 @@ export class StudyComponent extends EntityComponent { downloadSelected() { this.downloadService.downloadByIds(this.selectedDatasetIds); } - + storageVolumePrettyPrint(size: number) { return this.studyService.storageVolumePrettyPrint(size); }