Skip to content

Commit 03d13e3

Browse files
Merge branch 'w2p-113996_Improvements-submission-sections-7.6' into w2p-113996_Improvements-submission-sections-main
2 parents 39d2a75 + 713564b commit 03d13e3

18 files changed

+46
-7
lines changed

src/app/core/config/models/config-submission-section.model.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ export class SubmissionSectionModel extends ConfigObject {
4141
@autoserialize
4242
sectionType: SectionsType;
4343

44+
/**
45+
* A string representing the type this section extends
46+
*/
47+
@autoserialize
48+
extendsSectionType: SectionsType;
49+
4450
/**
4551
* The [SubmissionSectionVisibility] object for this section
4652
*/

src/app/core/submission/submission-response-parsing.service.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,7 @@ export class SubmissionResponseParsingService extends BaseResponseParsingService
141141
// Iterate over all workspaceitem's sections
142142
Object.keys(item.sections)
143143
.forEach((sectionId) => {
144-
if (typeof item.sections[sectionId] === 'object' && (isNotEmpty(item.sections[sectionId]) &&
145-
// When Upload section is disabled, add to submission only if there are files
146-
(!item.sections[sectionId].hasOwnProperty('files') || isNotEmpty((item.sections[sectionId] as any).files)))) {
147-
144+
if (typeof item.sections[sectionId] === 'object' && (isNotEmpty(item.sections[sectionId]))) {
148145
const sectiondata = Object.create({});
149146
// Iterate over all sections property
150147
Object.keys(item.sections[sectionId])

src/app/submission/objects/submission-objects.actions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export class InitSectionAction implements Action {
121121
config: string;
122122
mandatory: boolean;
123123
sectionType: SectionsType;
124+
extendsSectionType: SectionsType;
124125
visibility: SectionVisibility;
125126
enabled: boolean;
126127
data: WorkspaceitemSectionDataType;
@@ -142,6 +143,8 @@ export class InitSectionAction implements Action {
142143
* the section's mandatory
143144
* @param sectionType
144145
* the section's type
146+
* @param extendsSectionType
147+
* the type of the section it extends
145148
* @param visibility
146149
* the section's visibility
147150
* @param enabled
@@ -157,11 +160,12 @@ export class InitSectionAction implements Action {
157160
config: string,
158161
mandatory: boolean,
159162
sectionType: SectionsType,
163+
extendsSectionType: SectionsType,
160164
visibility: SectionVisibility,
161165
enabled: boolean,
162166
data: WorkspaceitemSectionDataType,
163167
errors: SubmissionSectionError[]) {
164-
this.payload = { submissionId, sectionId, header, config, mandatory, sectionType, visibility, enabled, data, errors };
168+
this.payload = { submissionId, sectionId, header, config, mandatory, sectionType, extendsSectionType, visibility, enabled, data, errors };
165169
}
166170
}
167171

src/app/submission/objects/submission-objects.effects.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ describe('SubmissionObjectEffects test suite', () => {
161161
config,
162162
sectionDefinition.mandatory,
163163
sectionDefinition.sectionType,
164+
sectionDefinition.extendsSectionType,
164165
sectionDefinition.visibility,
165166
enabled,
166167
sectionData,

src/app/submission/objects/submission-objects.effects.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export class SubmissionObjectEffects {
116116
config,
117117
sectionDefinition.mandatory,
118118
sectionDefinition.sectionType,
119+
sectionDefinition.extendsSectionType,
119120
sectionDefinition.visibility,
120121
enabled,
121122
sectionData,

src/app/submission/objects/submission-objects.reducer.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ describe('submissionReducer test suite', () => {
238238
config: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone',
239239
mandatory: true,
240240
sectionType: 'submission-form',
241+
extendsSectionType: undefined,
241242
visibility: undefined,
242243
collapsed: false,
243244
enabled: true,
@@ -259,6 +260,7 @@ describe('submissionReducer test suite', () => {
259260
true,
260261
SectionsType.SubmissionForm,
261262
undefined,
263+
undefined,
262264
true,
263265
{},
264266
null);

src/app/submission/objects/submission-objects.reducer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ function initSection(state: SubmissionObjectState, action: InitSectionAction): S
566566
config: action.payload.config,
567567
mandatory: action.payload.mandatory,
568568
sectionType: action.payload.sectionType,
569+
extendsSectionType: action.payload.extendsSectionType,
569570
visibility: action.payload.visibility,
570571
collapsed: false,
571572
enabled: action.payload.enabled,

src/app/submission/objects/submission-section-object.model.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ export interface SubmissionSectionObject {
2727
*/
2828
sectionType: SectionsType;
2929

30+
/**
31+
* The type this section extends
32+
*/
33+
extendsSectionType: SectionsType;
34+
3035
/**
3136
* The section visibility
3237
*/

src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe('SubmissionSectionCcLicensesComponent', () => {
4040
header: 'test header',
4141
id: 'test section id',
4242
sectionType: SectionsType.SubmissionForm,
43+
extendsSectionType: undefined,
4344
};
4445

4546
const submissionCcLicenses: SubmissionCcLicence[] = [

src/app/submission/sections/container/section-container.component.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const sectionObject: SectionDataObject = {
5151
header: 'submit.progressbar.describe.stepone',
5252
id: 'traditionalpageone',
5353
sectionType: SectionsType.SubmissionForm,
54+
extendsSectionType: undefined,
5455
};
5556

5657
describe('SubmissionSectionContainerComponent test suite', () => {

0 commit comments

Comments
 (0)