diff --git a/src/app/submission/sections/form/section-form.component.spec.ts b/src/app/submission/sections/form/section-form.component.spec.ts index 9dd3984ea3..09fd6fa991 100644 --- a/src/app/submission/sections/form/section-form.component.spec.ts +++ b/src/app/submission/sections/form/section-form.component.spec.ts @@ -357,7 +357,7 @@ describe('SubmissionSectionFormComponent test suite', () => { describe('in workspace scope', () => { beforeEach(() => { // @ts-ignore - comp.workspaceItem = { type: WorkspaceItem.type }; + comp.submissionObject = { type: WorkspaceItem.type }; }); it('should return true for unscoped fields', () => { @@ -376,7 +376,7 @@ describe('SubmissionSectionFormComponent test suite', () => { describe('in workflow scope', () => { beforeEach(() => { // @ts-ignore - comp.workspaceItem = { type: WorkflowItem.type }; + comp.submissionObject = { type: WorkflowItem.type }; }); it('should return true when field is unscoped', () => { diff --git a/src/app/submission/sections/form/section-form.component.ts b/src/app/submission/sections/form/section-form.component.ts index ccb1867fee..ea5c27821c 100644 --- a/src/app/submission/sections/form/section-form.component.ts +++ b/src/app/submission/sections/form/section-form.component.ts @@ -36,6 +36,7 @@ import { ConfigObject } from '../../../core/config/models/config.model'; import { RemoteData } from '../../../core/data/remote-data'; import { SubmissionScopeType } from '../../../core/submission/submission-scope-type'; import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; +import { SubmissionObject } from '../../../core/submission/models/submission-object.model'; /** * This component represents a section that contains a Form. @@ -114,7 +115,7 @@ export class SubmissionSectionFormComponent extends SectionModelComponent { */ protected subs: Subscription[] = []; - protected workspaceItem: WorkspaceItem; + protected submissionObject: SubmissionObject; /** * The FormComponent reference */ @@ -175,10 +176,10 @@ export class SubmissionSectionFormComponent extends SectionModelComponent { getRemoteDataPayload()) ])), take(1)) - .subscribe(([sectionData, workspaceItem]: [WorkspaceitemSectionFormObject, WorkspaceItem]) => { + .subscribe(([sectionData, submissionObject]: [WorkspaceitemSectionFormObject, SubmissionObject]) => { if (isUndefined(this.formModel)) { // this.sectionData.errorsToShow = []; - this.workspaceItem = workspaceItem; + this.submissionObject = submissionObject; // Is the first loading so init form this.initForm(sectionData); this.sectionData.data = sectionData; @@ -259,10 +260,10 @@ export class SubmissionSectionFormComponent extends SectionModelComponent { switch (scope) { case SubmissionScopeType.WorkspaceItem: { - return this.workspaceItem.type === WorkspaceItem.type; + return this.submissionObject.type === WorkspaceItem.type; } case SubmissionScopeType.WorkflowItem: { - return this.workspaceItem.type === WorkflowItem.type; + return this.submissionObject.type === WorkflowItem.type; } default: { return true;