diff --git a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.html b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.html index a9801828820..cff2757d0d2 100644 --- a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.html +++ b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.html @@ -112,6 +112,22 @@

{{ isNewService ? ('ldn-create-service.title' | translat + +
+ +
+ +
+
+
+
+ {{ 'ldn-service-usesActorEmailId-description' | translate }} +
+
+
+
diff --git a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts index 667669646c9..b5c493da6ba 100644 --- a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts +++ b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts @@ -131,6 +131,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy { score: ['', [Validators.required, Validators.pattern('^0*(\.[0-9]+)?$|^1(\.0+)?$')]], inboundPattern: [''], constraintPattern: [''], enabled: [''], + usesActorEmailId: [''], type: LDN_SERVICE.value, }); } @@ -184,7 +185,8 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy { return rest; }); - const values = { ...this.formModel.value, enabled: true }; + const values = { ...this.formModel.value, enabled: true, + usesActorEmailId: this.formModel.get('usesActorEmailId').value }; const ldnServiceData = this.ldnServicesService.create(values); @@ -243,6 +245,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy { ldnUrl: this.ldnService.ldnUrl, type: this.ldnService.type, enabled: this.ldnService.enabled, + usesActorEmailId: this.ldnService.usesActorEmailId, lowerIp: this.ldnService.lowerIp, upperIp: this.ldnService.upperIp, }); @@ -390,6 +393,32 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy { ); } + /** + * Toggles the usesActorEmailId field of the LDN service by sending a patch request + */ + toggleUsesActorEmailId() { + const newStatus = !this.formModel.get('usesActorEmailId').value; + if (!this.isNewService) { + const patchOperation: Operation = { + op: 'replace', + path: '/usesActorEmailId', + value: newStatus, + }; + + this.ldnServicesService.patch(this.ldnService, [patchOperation]).pipe( + getFirstCompletedRemoteData(), + ).subscribe( + () => { + this.formModel.get('usesActorEmailId').setValue(newStatus); + this.cdRef.detectChanges(); + }, + ); + } else { + this.formModel.get('usesActorEmailId').setValue(newStatus); + this.cdRef.detectChanges(); + } + } + /** * Closes the modal */ diff --git a/src/app/admin/admin-ldn-services/ldn-service-serviceMock/ldnServicesRD$-mock.ts b/src/app/admin/admin-ldn-services/ldn-service-serviceMock/ldnServicesRD$-mock.ts index 8494b67dab6..bd732ea37ec 100644 --- a/src/app/admin/admin-ldn-services/ldn-service-serviceMock/ldnServicesRD$-mock.ts +++ b/src/app/admin/admin-ldn-services/ldn-service-serviceMock/ldnServicesRD$-mock.ts @@ -12,6 +12,7 @@ import { LdnService } from '../ldn-services-model/ldn-services.model'; export const mockLdnService: LdnService = { uuid: '1', enabled: false, + usesActorEmailId: false, score: 0, id: 1, lowerIp: '192.0.2.146', @@ -49,6 +50,7 @@ export const mockLdnServiceRD$ = createSuccessfulRemoteDataObject$(mockLdnServic export const mockLdnServices: LdnService[] = [{ uuid: '1', enabled: false, + usesActorEmailId: false, score: 0, id: 1, lowerIp: '192.0.2.146', @@ -81,6 +83,7 @@ export const mockLdnServices: LdnService[] = [{ }, { uuid: '2', enabled: false, + usesActorEmailId: false, score: 0, id: 2, lowerIp: '192.0.2.146', diff --git a/src/app/admin/admin-ldn-services/ldn-services-model/ldn-services.model.ts b/src/app/admin/admin-ldn-services/ldn-services-model/ldn-services.model.ts index 1497b618f0e..5aed22ffb96 100644 --- a/src/app/admin/admin-ldn-services/ldn-services-model/ldn-services.model.ts +++ b/src/app/admin/admin-ldn-services/ldn-services-model/ldn-services.model.ts @@ -52,6 +52,9 @@ export class LdnService extends CacheableObject { @autoserialize enabled: boolean; + @autoserialize + usesActorEmailId: boolean; + @autoserialize ldnUrl: string; diff --git a/src/app/core/data/signposting-links.model.ts b/src/app/core/data/signposting-links.model.ts index 11d2cafe006..dcc35e91e86 100644 --- a/src/app/core/data/signposting-links.model.ts +++ b/src/app/core/data/signposting-links.model.ts @@ -4,5 +4,6 @@ export interface SignpostingLink { href?: string, rel?: string, - type?: string + type?: string, + profile?: string } diff --git a/src/app/item-page/simple/item-page.component.ts b/src/app/item-page/simple/item-page.component.ts index fb2db4ad059..edce420af5d 100644 --- a/src/app/item-page/simple/item-page.component.ts +++ b/src/app/item-page/simple/item-page.component.ts @@ -168,7 +168,8 @@ export class ItemPageComponent implements OnInit, OnDestroy { this.signpostingLinks = signpostingLinks; signpostingLinks.forEach((link: SignpostingLink) => { - links = links + (isNotEmpty(links) ? ', ' : '') + `<${link.href}> ; rel="${link.rel}"` + (isNotEmpty(link.type) ? ` ; type="${link.type}" ` : ' '); + links = links + (isNotEmpty(links) ? ', ' : '') + `<${link.href}> ; rel="${link.rel}"` + (isNotEmpty(link.type) ? ` ; type="${link.type}" ` : ' ') + + (isNotEmpty(link.profile) ? ` ; profile="${link.profile}" ` : ''); let tag: LinkDefinition = { href: link.href, rel: link.rel, @@ -178,6 +179,11 @@ export class ItemPageComponent implements OnInit, OnDestroy { type: link.type, }); } + if (isNotEmpty(link.profile)) { + tag = Object.assign(tag, { + profile: link.profile, + }); + } this.linkHeadService.addTag(tag); }); diff --git a/src/app/item-page/simple/notify-requests-status/notify-status.enum.ts b/src/app/item-page/simple/notify-requests-status/notify-status.enum.ts index e44c6141302..19ba320d498 100644 --- a/src/app/item-page/simple/notify-requests-status/notify-status.enum.ts +++ b/src/app/item-page/simple/notify-requests-status/notify-status.enum.ts @@ -2,4 +2,5 @@ export enum RequestStatusEnum { ACCEPTED = 'ACCEPTED', REJECTED = 'REJECTED', REQUESTED = 'REQUESTED', + TENTATIVE_REJECT = 'TENTATIVE_REJECT', } diff --git a/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts b/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts index e6059688fb4..9ab8f90c18e 100644 --- a/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts +++ b/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts @@ -74,6 +74,13 @@ export class RequestStatusAlertBoxComponent implements OnInit { }; break; + case RequestStatusEnum.TENTATIVE_REJECT: + this.displayOptions = { + alertType: 'alert-warning', + text: 'request-status-alert-box.tentative_rejected', + }; + break; + case RequestStatusEnum.REQUESTED: this.displayOptions = { alertType: 'alert-warning', diff --git a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.html b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.html index 49742892caa..c6dfa700d80 100644 --- a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.html +++ b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.html @@ -4,8 +4,7 @@
+
{{ serviceName }} has been rejected.", + "request-status-alert-box.tentative_rejected": "The requested {{ offerType }} for {{ serviceName }} has been tentatively rejected. Revisions are required", + "request-status-alert-box.requested": "The requested {{ offerType }} for {{ serviceName }} is pending.", "ldn-service-button-mark-inbound-deletion": "Mark supported pattern for deletion", @@ -6364,6 +6364,10 @@ "ldn-service-overview-close-modal": "Close modal", + "ldn-service-usesActorEmailId": "Requires actor email in notifications", + + "ldn-service-usesActorEmailId-description": "If enabled, initial notifications sent will include the submitter email rather than the repository URL. This is usually the case for endorsement or review services.", + "a-common-or_statement.label": "Item type is Journal Article or Dataset", "always_true_filter.label": "Always true",