fix issue where combining entities and authority control in the same field wouldn't work

This commit is contained in:
Art Lowel
2020-09-01 14:25:50 +02:00
parent 92207cf66d
commit f167d5a629
8 changed files with 76 additions and 58 deletions

View File

@@ -9,6 +9,7 @@ import { hasValue, isNotEmpty, isNotNull } from '../../shared/empty.util';
import { SubmissionSectionError, SubmissionSectionObject } from '../objects/submission-objects.reducer';
import parseSectionErrorPaths, { SectionErrorPath } from '../utils/parseSectionErrorPaths';
import { SubmissionService } from '../submission.service';
import { SectionsType } from './sections-type';
/**
* Directive for handling generic section functionality
@@ -31,6 +32,12 @@ export class SectionsDirective implements OnDestroy, OnInit {
*/
@Input() sectionId: string;
/**
* The section type
* @type {SectionsType}
*/
@Input() sectionType: SectionsType;
/**
* The submission id
* @type {string}
@@ -104,7 +111,7 @@ export class SectionsDirective implements OnDestroy, OnInit {
}));
this.subs.push(
this.sectionService.getSectionState(this.submissionId, this.sectionId).pipe(
this.sectionService.getSectionState(this.submissionId, this.sectionId, this.sectionType).pipe(
map((state: SubmissionSectionObject) => state.errors))
.subscribe((errors: SubmissionSectionError[]) => {
if (isNotEmpty(errors)) {