[ADF-5378] ADF Previewer: Image Rotate + Save (#6958)

* updates including cropperJS

* update on rotation + unit tests

* small fix

* hide toolbar on save

* remove unused & duplicate method

* added readonly & prettier code

* include readOnly mode to hide/show media management actions

* updated dependencies

* fix emit spy

* ADF-5378: Fix failing e2es

* Fix comments for unit tests

* ADF-5378: Removed obsolete buttons from e2e

Co-authored-by: kristian <kristian.dimitrov@alfresco.com>
Co-authored-by: adomi <ardit.domi@alfresco.com>
This commit is contained in:
Urse Daniel
2021-05-01 17:54:37 +03:00
committed by GitHub
parent 8b5e45f4eb
commit e8ffe8e35e
15 changed files with 358 additions and 374 deletions

View File

@@ -97,6 +97,10 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
@Input()
showToolbar = true;
/** Hide or show media management actions for image-viewer component */
@Input()
readOnly = true;
/** Specifies the name of the file when it is not available from the URL. */
@Input()
displayName: string;
@@ -206,6 +210,10 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
@Output()
invalidSharedLink = new EventEmitter();
/** Emitted when user updates a node via rotate, crop, etc. */
@Output()
fileSubmit = new EventEmitter<Blob>();
TRY_TIMEOUT: number = 10000;
viewerType = 'unknown';
@@ -685,6 +693,10 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
}
onSubmitFile(newImageBlob: Blob) {
this.fileSubmit.emit(newImageBlob);
}
onUnsupportedFile() {
this.viewerType = 'unknown';
}