From 268ee04d1e17532f1d79b7f4d95f207c61e270eb Mon Sep 17 00:00:00 2001 From: Rezart Vata Date: Mon, 23 May 2022 19:05:03 +0200 Subject: [PATCH] [CST-5270] Fixes requested as improvements --- .../publisher-policy/publisher-policy.component.html | 4 +++- .../publisher-policy/publisher-policy.component.ts | 8 ++++++++ .../section-sherpa-policies.component.html | 7 ++++++- .../section-sherpa-policies.component.ts | 10 +++++++++- src/assets/i18n/en.json5 | 2 ++ 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.html b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.html index 24e3b09762..dc3cf8b737 100644 --- a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.html +++ b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.html @@ -2,7 +2,9 @@

- {{'submission.sections.sherpa.publisher.policy.openaccess' | translate}} + +

diff --git a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts index 42d755d5b1..65d044f30c 100644 --- a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts +++ b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts @@ -1,6 +1,7 @@ import { Component, Input } from '@angular/core'; import { Policy } from '../../../../core/submission/models/sherpa-policies-details.model'; +import { AlertType } from './../../../../shared/alert/aletr-type'; /** * This component represents a section that contains the publisher policy informations. @@ -17,4 +18,11 @@ export class PublisherPolicyComponent { */ @Input() policy: Policy; + + /** + * The AlertType enumeration + * @type {AlertType} + */ + public AlertTypeEnum = AlertType; + } diff --git a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.html b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.html index 1ebcfc26c8..c135e0941a 100644 --- a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.html +++ b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.html @@ -8,7 +8,7 @@ - +
@@ -59,4 +59,9 @@
+ + + + \ No newline at end of file diff --git a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts index 3861bd1217..e4bbebc617 100644 --- a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts +++ b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts @@ -1,3 +1,4 @@ +import { AlertType } from './../../../shared/alert/aletr-type'; import { Component, Inject, QueryList, ViewChildren } from '@angular/core'; import { BehaviorSubject, interval, Observable, of, Subscription } from 'rxjs'; @@ -49,6 +50,13 @@ export class SubmissionSectionSherpaPoliciesComponent extends SectionModelCompon */ public isCollapsed = false; + + /** + * The AlertType enumeration + * @type {AlertType} + */ + public AlertTypeEnum = AlertType; + /** * Initialize instance variables * @@ -71,6 +79,7 @@ export class SubmissionSectionSherpaPoliciesComponent extends SectionModelCompon * Unsubscribe from all subscriptions */ onSectionDestroy() { + this.subs .filter((subscription) => hasValue(subscription)) .forEach((subscription) => subscription.unsubscribe()); @@ -81,7 +90,6 @@ export class SubmissionSectionSherpaPoliciesComponent extends SectionModelCompon * Initialize all instance variables and retrieve collection default access conditions */ protected onSectionInit(): void { - this.pathCombiner = new JsonPatchOperationPathCombiner('sections', this.sectionData.id); this.subs.push( this.sectionService.getSectionData(this.submissionId, this.sectionData.id, this.sectionData.sectionType) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 9f5ba5c8b1..447af4dcf5 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -4046,6 +4046,8 @@ "submission.sections.sherpa.record.information.uri": "URI", + "submission.sections.sherpa.error.message": "There was an error retrieving sherpa informations", + "submission.submit.breadcrumbs": "New submission",