diff --git a/lib/content-services/src/lib/new-version-uploader/models/new-version-uploader.model.ts b/lib/content-services/src/lib/new-version-uploader/models/new-version-uploader.model.ts index ab89500a6ba..5bf5f9e53d6 100644 --- a/lib/content-services/src/lib/new-version-uploader/models/new-version-uploader.model.ts +++ b/lib/content-services/src/lib/new-version-uploader/models/new-version-uploader.model.ts @@ -24,6 +24,8 @@ export interface NewVersionUploaderDialogData { file?: File; currentVersion?: Version; showVersionsOnly?: boolean; + showComments?: boolean; + allowDownload?: true; } export type NewVersionUploaderData = VersionManagerUploadData | ViewVersion | RefreshData; diff --git a/lib/content-services/src/lib/new-version-uploader/new-version-uploader.dialog.html b/lib/content-services/src/lib/new-version-uploader/new-version-uploader.dialog.html index 87665c20029..b8d774c4e7f 100644 --- a/lib/content-services/src/lib/new-version-uploader/new-version-uploader.dialog.html +++ b/lib/content-services/src/lib/new-version-uploader/new-version-uploader.dialog.html @@ -18,8 +18,8 @@

{ const { file, node, showVersionsOnly } = data; - const showComments = true; - const allowDownload = true; return new Observable((observer) => { - this.versionsApi.listVersionHistory(node.id).then((versionPaging: VersionPaging) => { - const dialogRef = this.dialog.open(NewVersionUploaderDialogComponent, { - data: { file, node, currentVersion: versionPaging.list.entries[0].entry, showComments, allowDownload, showVersionsOnly }, - panelClass: this.composePanelClass(showVersionsOnly), - width: '630px', - ...(config && Object.keys(config).length > 0 && config) - }); + this.versionsApi.listVersionHistory(node.id).then((versionPaging) => { + const dialogRef = this.dialog.open( + NewVersionUploaderDialogComponent, + { + data: { file, node, currentVersion: versionPaging.list.entries[0].entry, showComments, allowDownload, showVersionsOnly }, + panelClass: this.composePanelClass(showVersionsOnly), + width: '630px', + ...(config && Object.keys(config).length > 0 && config) + } + ); dialogRef.componentInstance.dialogAction.asObservable().subscribe((newVersionUploaderData) => { observer.next(newVersionUploaderData); }); diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts index c27fe34a413..66cff0c117f 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts @@ -227,8 +227,8 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent i this.processCloudContentService.downloadFile(file.id); } - onUploadNewFileVersion(node: NewVersionUploaderDialogData): void { - this.newVersionUploaderService.openUploadNewVersionDialog(node).subscribe( + onUploadNewFileVersion(config: NewVersionUploaderDialogData): void { + this.newVersionUploaderService.openUploadNewVersionDialog(config).subscribe( (newVersionUploaderData) => { if (newVersionUploaderData.action === NewVersionUploaderDataAction.upload) { this.replaceOldFileVersionWithNew(newVersionUploaderData as VersionManagerUploadData);