From 8c80d3bb221baf44a1ce674326731e8d17218b2f Mon Sep 17 00:00:00 2001 From: Alisa Ismailati Date: Wed, 2 Aug 2023 18:11:40 +0200 Subject: [PATCH 1/2] [DSC-1180] Fixed license not granted error displayed twice --- .../detect-duplicate.service.ts | 30 ++++++++++--------- .../sections/license/section-license.model.ts | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/app/submission/sections/detect-duplicate/detect-duplicate.service.ts b/src/app/submission/sections/detect-duplicate/detect-duplicate.service.ts index a252a72c769..3ce67fdaba6 100644 --- a/src/app/submission/sections/detect-duplicate/detect-duplicate.service.ts +++ b/src/app/submission/sections/detect-duplicate/detect-duplicate.service.ts @@ -7,7 +7,7 @@ import { SubmissionState } from '../../submission.reducers'; import { SetDuplicateDecisionAction } from '../../objects/submission-objects.actions'; import { submissionSectionDataFromIdSelector } from '../../selectors'; import { WorkspaceitemSectionDetectDuplicateObject } from '../../../core/submission/models/workspaceitem-section-deduplication.model'; -import { isEmpty, isNotEmpty } from '../../../shared/empty.util'; +import { hasValue, isEmpty, isNotEmpty } from '../../../shared/empty.util'; import { Observable } from 'rxjs'; /** @@ -62,19 +62,21 @@ export class DetectDuplicateService { map((item: WorkspaceitemSectionDetectDuplicateObject) => { const outputObject: WorkspaceitemSectionDetectDuplicateObject = {} as WorkspaceitemSectionDetectDuplicateObject; outputObject.matches = {}; - Object.keys(item.matches) - .filter((key) => { - let output = false; - if (isWorkFlow) { - output = isEmpty(item.matches[key].workflowDecision); - } else { - output = isEmpty(item.matches[key].submitterDecision); - } - return output; - }) - .forEach((key) => { - outputObject.matches[key] = item.matches[key]; - }); + if (hasValue(item)) { + Object.keys(item.matches) + .filter((key) => { + let output = false; + if (isWorkFlow) { + output = isEmpty(item.matches[key].workflowDecision); + } else { + output = isEmpty(item.matches[key].submitterDecision); + } + return output; + }) + .forEach((key) => { + outputObject.matches[key] = item.matches[key]; + }); + } return outputObject; }) ); diff --git a/src/app/submission/sections/license/section-license.model.ts b/src/app/submission/sections/license/section-license.model.ts index 0f21ef98a43..a083dd74dad 100644 --- a/src/app/submission/sections/license/section-license.model.ts +++ b/src/app/submission/sections/license/section-license.model.ts @@ -20,7 +20,7 @@ export const SECTION_LICENSE_FORM_MODEL = [ required: null }, errorMessages: { - required: 'submission.sections.license.required', + // required: 'submission.sections.license.required', notgranted: 'submission.sections.license.notgranted' }, type: 'CHECKBOX', From d4dfad3cce730d55165a49043d98ed4cad194830 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Thu, 12 Oct 2023 15:18:57 +0200 Subject: [PATCH 2/2] [DSC-1180] Remove unused code --- src/app/submission/sections/license/section-license.model.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/submission/sections/license/section-license.model.ts b/src/app/submission/sections/license/section-license.model.ts index a083dd74dad..3745af780b9 100644 --- a/src/app/submission/sections/license/section-license.model.ts +++ b/src/app/submission/sections/license/section-license.model.ts @@ -20,7 +20,6 @@ export const SECTION_LICENSE_FORM_MODEL = [ required: null }, errorMessages: { - // required: 'submission.sections.license.required', notgranted: 'submission.sections.license.notgranted' }, type: 'CHECKBOX',