Fix hardcoded submission section IDs

This commit is contained in:
Yura Bondarenko
2021-06-18 11:57:36 +02:00
parent 0ee451f3d3
commit 32003a72fd
4 changed files with 29 additions and 16 deletions

View File

@@ -28,6 +28,7 @@ import { CollectionDataService } from '../../../core/data/collection-data.servic
import { CollectionDropdownComponent } from '../../../shared/collection-dropdown/collection-dropdown.component';
import { SectionsService } from '../../sections/sections.service';
import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators';
import { SectionsType } from '../../sections/sections-type';
/**
* This component allows to show the current collection the submission belonging to and to change it.
@@ -142,7 +143,7 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit {
*/
ngOnInit() {
this.pathCombiner = new JsonPatchOperationPathCombiner('sections', 'collection');
this.available$ = this.sectionsService.isSectionAvailable(this.submissionId, 'collection');
this.available$ = this.sectionsService.isSectionTypeAvailable(this.submissionId, SectionsType.collection);
}
/**