From 7b7e39d989e0ff3dbcbeb258b0da9c36db3858e9 Mon Sep 17 00:00:00 2001 From: Suzana Dirla Date: Thu, 5 Apr 2018 23:24:05 +0300 Subject: [PATCH] [ADF-2562] Download a previous version (#3141) * [ADF-2562] Download a previous version * [ADF-2562] add input property to enable/disable version downloads * [ADF-2562] add example in demo-shell * [ADF-2562] unit tests * [ADF-2561] View comments on previous versions (#3137) * [ADF-2561] View comments on previous versions add input property to enable/disable viewing version comments * [ADF-2561] add more tests * remove name property * test fixes --- demo-shell/resources/i18n/en.json | 1 + .../app/components/files/files.component.html | 10 ++-- .../app/components/files/files.component.ts | 6 ++- ...sion-manager-dialog-adapter.component.html | 2 +- ...ersion-manager-dialog-adapter.component.ts | 2 + .../version-list.component.md | 1 + .../version-manager.component.md | 1 + .../search-filter/search-filter.component.ts | 2 +- .../version-list.component.html | 1 + .../version-list.component.spec.ts | 50 ++++++++++++++----- .../version-manager/version-list.component.ts | 29 +++++++++++ .../version-manager.component.html | 6 ++- .../version-manager.component.ts | 3 ++ 13 files changed, 95 insertions(+), 19 deletions(-) diff --git a/demo-shell/resources/i18n/en.json b/demo-shell/resources/i18n/en.json index 92f267e7fa..986ce84307 100644 --- a/demo-shell/resources/i18n/en.json +++ b/demo-shell/resources/i18n/en.json @@ -59,6 +59,7 @@ "CUSTOM_FILTER" :"Custom extensions filter", "MAX_SIZE" : "Max size filter", "ENABLE_VERSIONING" :"Enable versioning", + "ENABLE_VERSION_DOWNLOAD" :"Enable version download", "DESCRIPTION_UPLOAD" : "Enable upload", "ENABLE_INFINITE_SCROLL":"Enable Infinite Scrolling", "MULTISELECT_DESCRIPTION" : "Use Cmd (Mac) or Ctrl (Windows) to toggle selection of multiple items", diff --git a/demo-shell/src/app/components/files/files.component.html b/demo-shell/src/app/components/files/files.component.html index 28c5d72b54..2c37d927d7 100644 --- a/demo-shell/src/app/components/files/files.component.html +++ b/demo-shell/src/app/components/files/files.component.html @@ -353,7 +353,8 @@ + [showComments]="showVersionComments" + [enableDownload]="enableVersionDownload"> @@ -440,8 +441,11 @@
- {{'DOCUMENT_LIST.SHOW_VERSION_COMMENTS' | - translate}} + + {{'DOCUMENT_LIST.SHOW_VERSION_COMMENTS' | translate}} + + + {{'DOCUMENT_LIST.ENABLE_VERSION_DOWNLOAD' | translate}}
diff --git a/demo-shell/src/app/components/files/files.component.ts b/demo-shell/src/app/components/files/files.component.ts index 06648bf4b6..6124d90346 100644 --- a/demo-shell/src/app/components/files/files.component.ts +++ b/demo-shell/src/app/components/files/files.component.ts @@ -102,6 +102,9 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { @Input() versioning = false; + @Input() + enableVersionDownload = true; + @Input() acceptedFilesType = '.jpg,.pdf,.js'; @@ -362,10 +365,11 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { onManageVersions(event) { const contentEntry = event.value.entry; const showComments = this.showVersionComments; + const enableDownload = this.enableVersionDownload; if (this.contentService.hasPermission(contentEntry, 'update')) { this.dialog.open(VersionManagerDialogAdapterComponent, { - data: { contentEntry, showComments }, + data: { contentEntry, showComments, enableDownload }, panelClass: 'adf-version-manager-dialog', width: '630px' }); diff --git a/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.html b/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.html index 6a2dc154c8..509c3bb54a 100644 --- a/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.html +++ b/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.html @@ -1,6 +1,6 @@
{{'VERSION.DIALOG.TITLE' | translate}}
- +