Unreverted changes from #1053

This commit is contained in:
lotte
2021-04-06 13:27:20 +02:00
parent b16a565f7c
commit 3482db0686
7 changed files with 186 additions and 69 deletions

View File

@@ -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 { SectionsService } from '../sections/sections.service';
/**
* 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$: Observable<boolean>;
/**
* Observable of the list of submission's sections
* @type {Observable<WorkspaceitemSectionsObject>}
@@ -100,12 +107,14 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy {
* @param {ChangeDetectorRef} changeDetectorRef
* @param {HALEndpointService} halService
* @param {SubmissionService} submissionService
* @param {SectionsService} sectionsService
*/
constructor(
private authService: AuthService,
private changeDetectorRef: ChangeDetectorRef,
private halService: HALEndpointService,
private submissionService: SubmissionService) {
private submissionService: SubmissionService,
private sectionsService: SectionsService) {
this.isActive = true;
}
@@ -129,6 +138,7 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy {
return observableOf([]);
}
}));
this.uploadEnabled$ = this.sectionsService.isSectionTypeAvailable(this.submissionId, SectionsType.Upload);
// check if is submission loading
this.loading = this.submissionService.getSubmissionObject(this.submissionId).pipe(