Skip to content

Commit

Permalink
fix(ANG-833): fixed downloaded filename and download all button from …
Browse files Browse the repository at this point in the history
…attachments
  • Loading branch information
christophhagelkruys committed Nov 20, 2020
1 parent f992bc9 commit 1568349
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import javax.ws.rs.PathParam;

/**
* Providing Document Service Methods for refObehcts, projects and processes
* Providing Document Service Methods for refObjects, projects and processes
*
* @author jlo
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@ public FolderRestResource getFolder(Long folderId, String mappings) {
query = query.withTargetFolderId(folderId);
query.fileCount = false;
DirectoryInfoDto di = documentService.getTree(query);
//refObjectType and refObjectIdName used to set name of download zip File
if(query.paramMap.get("refObjectIdName") == null) {
query.paramMap.put("refObjectIdName", project.getProjectId());
}
if ( query.paramMap.get("refObjectType") == null) {
if (di.getSubFolder() == null || "/".equals(di.getSubFolder())) {
query.paramMap.put("refObjectType", di.getConfig().getDisplayName());
} else if (di.getConfig().getDisplayName() != null) {
query.paramMap.put("refObjectType", di.getSubFolder().replaceAll("/", ""));
}
}
documentAuthorizationService.checkPermissionForFolder(perm, null, project, di.getSubFolder());
} else {
query = DocuQueryDto.forPmcProject(project, false).withMappingName(project.getPmcProjectType().getIdName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@
</div>
<div class="p-grid p-formgrid">
<div class="p-col-12 p-field p-text-right">
<form [action]="downloadAllUrl" class="p-d-inline">
<p-button
type="submit"
icon="pi pi-download"
label="Download all"
[disabled]="fileCount === 0"
></p-button>
</form>
<p-button
icon="pi pi-download"
label="Download all"
[disabled]="fileCount === 0"
(click)="downloadAll()"
></p-button>

</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export class AlandaAttachmentsComponent implements OnInit {
}
return fileCount;
}

downloadAll(): void {
location.href = this.downloadAllUrl;
}
loadFolderContent(): void {
this.documentService
.loadFolderContent(
Expand Down

0 comments on commit 1568349

Please sign in to comment.