mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
fixed dropzone issues
This commit is contained in:
@@ -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) => {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<div class="container-fluid">
|
||||
<div *ngIf="!(isLoading() | async)">
|
||||
<div *ngIf="!(isLoading() | async) && (uploadEnabled$ | async)">
|
||||
<ds-submission-upload-files [submissionId]="submissionId"
|
||||
[collectionId]="collectionId"
|
||||
[sectionId]="'upload'"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
||||
|
||||
import { Observable, of as observableOf, Subscription } from 'rxjs';
|
||||
import { distinctUntilChanged, filter, map, switchMap } from 'rxjs/operators';
|
||||
import { distinctUntilChanged, filter, map, switchMap, tap } from 'rxjs/operators';
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
import { SubmissionDefinitionsModel } from '../../core/config/models/config-submission-definitions.model';
|
||||
import { Collection } from '../../core/shared/collection.model';
|
||||
@@ -15,6 +15,8 @@ import { SubmissionObjectEntry } from '../objects/submission-objects.reducer';
|
||||
import { SectionDataObject } from '../sections/models/section-data.model';
|
||||
import { SubmissionService } from '../submission.service';
|
||||
import { Item } from '../../core/shared/item.model';
|
||||
import { SectionsType } from '../sections/sections-type';
|
||||
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
||||
|
||||
/**
|
||||
* This component represents the submission form.
|
||||
@@ -69,6 +71,11 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy {
|
||||
*/
|
||||
public loading: Observable<boolean> = observableOf(true);
|
||||
|
||||
/**
|
||||
* Emits true when the submission config has bitstream uploading enabled in submission
|
||||
*/
|
||||
public uploadEnabled$ = new BehaviorSubject<boolean>(false);
|
||||
|
||||
/**
|
||||
* Observable of the list of submission's sections
|
||||
* @type {Observable<WorkspaceitemSectionsObject>}
|
||||
@@ -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(
|
||||
|
Reference in New Issue
Block a user