Skip to content

Commit

Permalink
Merge pull request #2434 from ProgrammeVitam/bug_14235
Browse files Browse the repository at this point in the history
Bug #14235: [BUG/Regression] [Collection] Missing ZIP name when creating a project on Collect.
  • Loading branch information
Salimdev authored Feb 4, 2025
2 parents 95a12bc + 56a8b56 commit 3d3c8db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,10 @@ export class CreateProjectComponent implements OnInit, AfterViewChecked {
}) as Transaction,
),
switchMap((transaction) => this.transactionsService.create(transaction)),
tap((createdTransactionResponse) => (transactionId = createdTransactionResponse.id)),
tap((createdTransactionResponse) => {
transactionId = createdTransactionResponse.id;
zipFile.setZipName(transactionId + '.zip');
}),
switchMap(() => zipFile.addFiles(this.filesToUpload).generateZip()),
switchMap((content) => this.archiveCollectService.uploadZip(content, transactionId)),
tap((httpEvent) => zipFile.updateUploadingZipFileStatus(httpEvent)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/

export interface ZipFileStatus {
transactionId: string;
name: string;
size: number;
uploadedSize: number;
currentFile?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ export class ZipFile {
zipFileStatus: ZipFileStatus = null;
zipFileStatus$: BehaviorSubject<ZipFileStatus> = new BehaviorSubject<ZipFileStatus>(null);

constructor(transactionId?: string) {
constructor(zipName?: string) {
this.zipFile = new JSZip();
this.zipFileStatus = {
transactionId: transactionId,
name: zipName,
size: 0,
uploadedSize: 0,
};
}

setTransactionId(transactionId: string): ZipFile {
this.zipFileStatus.transactionId = transactionId;
setZipName(zipName: string): ZipFile {
this.zipFileStatus.name = zipName;
return this;
}

Expand Down

0 comments on commit 3d3c8db

Please sign in to comment.