Skip to content

Commit

Permalink
Merge branch 'fli-iam:develop' into fix-download-root-folder
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-louis authored Nov 2, 2023
2 parents 8f1267c + 2692013 commit 23979d5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -229,4 +229,4 @@ export class NotificationsService {
this.tasksInProgress.forEach(task => total += task.progress);
return total/this.tasksInProgress.length;
}
}
}
7 changes: 3 additions & 4 deletions shanoir-ng-front/src/app/studies/study/study.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class StudyComponent extends EntityComponent<Study> {
this.studyRightsService.getMyRightsForStudy(this.id).then(rights => {
this.hasDownloadRight = this.keycloakService.isUserAdmin() || rights.includes(StudyUserRight.CAN_DOWNLOAD);
})
let studyPromise: Promise<Study> = this.studyService.get(this.id, null, true).then(study => {
let studyPromise: Promise<Study> = this.studyService.get(this.id, null).then(study => {

this.study = study;
this.setLabeledSizes(this.study);
Expand Down Expand Up @@ -166,7 +166,7 @@ export class StudyComponent extends EntityComponent<Study> {
}

initEdit(): Promise<void> {
let studyPromise: Promise<Study> = this.studyService.get(this.id, null, true).then(study => {
let studyPromise: Promise<Study> = this.studyService.get(this.id, null).then(study => {
this.study = study;

if (this.study.profile == null) {
Expand Down Expand Up @@ -273,7 +273,6 @@ export class StudyComponent extends EntityComponent<Study> {
if (datasetSizes.extraDataSize > 0){
sizesByLabel.set("Other files (DUA, protocol...)", datasetSizes.extraDataSize);
}
let total = datasetSizes.total;
study.detailedSizes = sizesByLabel;
});
}).finally(() => {
Expand Down Expand Up @@ -659,7 +658,7 @@ export class StudyComponent extends EntityComponent<Study> {
downloadSelected() {
this.downloadService.downloadByIds(this.selectedDatasetIds);
}

storageVolumePrettyPrint(size: number) {
return this.studyService.storageVolumePrettyPrint(size);
}
Expand Down

0 comments on commit 23979d5

Please sign in to comment.