mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2561] add showComments toggle on demo-shell (#3143)
This commit is contained in:
committed by
Denys Vuika
parent
9b3e153b83
commit
c7507c0c31
@@ -62,6 +62,7 @@
|
||||
"DESCRIPTION_UPLOAD" : "Enable upload",
|
||||
"ENABLE_INFINITE_SCROLL":"Enable Infinite Scrolling",
|
||||
"MULTISELECT_DESCRIPTION" : "Use Cmd (Mac) or Ctrl (Windows) to toggle selection of multiple items",
|
||||
"SHOW_VERSION_COMMENTS" : "Show comments on versions",
|
||||
"RECENT" : {
|
||||
"EMPTY_STATE": {
|
||||
"TITLE": "Recent is empty"
|
||||
|
@@ -352,7 +352,8 @@
|
||||
<ng-container *ngIf="hasOneFileSelected();else choose_document_template">
|
||||
<ng-container *ngIf="userHasPermissionToManageVersions(); else no_permission_to_versions">
|
||||
<adf-version-manager
|
||||
[node]="documentList.selection[0].entry">
|
||||
[node]="documentList.selection[0].entry"
|
||||
[showComments]="showVersionComments">
|
||||
</adf-version-manager>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
@@ -438,6 +439,12 @@
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle [color]="'primary'" [(ngModel)]="showVersionComments">{{'DOCUMENT_LIST.SHOW_VERSION_COMMENTS' |
|
||||
translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<h5>Upload</h5>
|
||||
<section *ngIf="acceptedFilesTypeShow">
|
||||
<mat-form-field floatPlaceholder="float">
|
||||
|
@@ -96,6 +96,9 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
@Input()
|
||||
maxSizeShow = false;
|
||||
|
||||
@Input()
|
||||
showVersionComments = true;
|
||||
|
||||
@Input()
|
||||
versioning = false;
|
||||
|
||||
@@ -358,10 +361,11 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
onManageVersions(event) {
|
||||
const contentEntry = event.value.entry;
|
||||
const showComments = this.showVersionComments;
|
||||
|
||||
if (this.contentService.hasPermission(contentEntry, 'update')) {
|
||||
this.dialog.open(VersionManagerDialogAdapterComponent, {
|
||||
data: { contentEntry },
|
||||
data: { contentEntry, showComments },
|
||||
panelClass: 'adf-version-manager-dialog',
|
||||
width: '630px'
|
||||
});
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<header mat-dialog-title>{{'VERSION.DIALOG.TITLE' | translate}}</header>
|
||||
<section mat-dialog-content>
|
||||
<adf-version-manager [node]="contentEntry" (uploadError)="uploadError($event)"></adf-version-manager>
|
||||
<adf-version-manager [node]="contentEntry" [showComments]="showComments" (uploadError)="uploadError($event)"></adf-version-manager>
|
||||
</section>
|
||||
<footer mat-dialog-actions fxLayout="row" fxLayoutAlign="end center">
|
||||
<button mat-button (click)="close()">{{'VERSION.DIALOG.CLOSE' | translate}}</button>
|
||||
|
@@ -27,11 +27,13 @@ import { MatSnackBar } from '@angular/material';
|
||||
export class VersionManagerDialogAdapterComponent {
|
||||
|
||||
public contentEntry: MinimalNodeEntryEntity;
|
||||
showComments = true;
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) data: any,
|
||||
private snackBar: MatSnackBar,
|
||||
private containingDialog?: MatDialogRef<VersionManagerDialogAdapterComponent>) {
|
||||
this.contentEntry = data.contentEntry;
|
||||
this.showComments = data.hasOwnProperty('showComments') ? data.showComments : this.showComments;
|
||||
}
|
||||
|
||||
uploadError(errorMessage: string) {
|
||||
|
Reference in New Issue
Block a user