alfresco-ng2-components/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.ts
Denys Vuika 3dd43ce9b5
[ADF-4997] no-duplicate-imports rule (#5256)
* no-duplicate-imports rule

* no-duplicate-imports rule
2019-11-15 13:38:01 +00:00

51 lines
1.8 KiB
TypeScript

/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, Inject, ViewEncapsulation } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
import { MatSnackBar } from '@angular/material/snack-bar';
@Component({
templateUrl: './version-manager-dialog-adapter.component.html',
encapsulation: ViewEncapsulation.None
})
export class VersionManagerDialogAdapterComponent {
public contentEntry: MinimalNodeEntryEntity;
showComments = true;
allowDownload = true;
readOnly = false;
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;
this.allowDownload = data.hasOwnProperty('allowDownload') ? data.allowDownload : this.allowDownload;
}
uploadError(errorMessage: string) {
this.snackBar.open(errorMessage, '', { duration: 4000 });
}
close() {
this.containingDialog.close();
}
}