From 7d774d43e8b9fdf3b8d4d8c8098f755cf68c0c5d Mon Sep 17 00:00:00 2001 From: lotte Date: Thu, 11 Mar 2021 15:41:27 +0100 Subject: [PATCH] fixed dropzone issues --- src/app/shared/uploader/uploader.component.ts | 6 ------ .../form/submission-form.component.html | 2 +- .../submission/form/submission-form.component.ts | 15 +++++++++++++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/app/shared/uploader/uploader.component.ts b/src/app/shared/uploader/uploader.component.ts index 0e19c38b55..4e5b002b51 100644 --- a/src/app/shared/uploader/uploader.component.ts +++ b/src/app/shared/uploader/uploader.component.ts @@ -146,12 +146,6 @@ export class UploaderComponent { this.uploader.options.headers = [{ name: XSRF_REQUEST_HEADER, value: this.tokenExtractor.getToken() }]; this.onBeforeUpload(); this.isOverDocumentDropZone = observableOf(false); - - // Move page target to the uploader - const config: ScrollToConfigOptions = { - target: this.uploaderId - }; - this.scrollToService.scrollTo(config); }; if (hasValue(this.uploadProperties)) { this.uploader.onBuildItemForm = (item, form) => { diff --git a/src/app/submission/form/submission-form.component.html b/src/app/submission/form/submission-form.component.html index 7376b1e10b..a8e963d8ea 100644 --- a/src/app/submission/form/submission-form.component.html +++ b/src/app/submission/form/submission-form.component.html @@ -1,5 +1,5 @@
-
+
= observableOf(true); + /** + * Emits true when the submission config has bitstream uploading enabled in submission + */ + public uploadEnabled$ = new BehaviorSubject(false); + /** * Observable of the list of submission's sections * @type {Observable} @@ -128,7 +135,11 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy { } else { return observableOf([]); } - })); + }), + tap((sectionList) => { + this.uploadEnabled$.next(isNotEmpty(sectionList) && sectionList.some(config => config.sectionType === SectionsType.Upload)); + }) + ); // check if is submission loading this.loading = this.submissionService.getSubmissionObject(this.submissionId).pipe(