#10053: Add support for PCI Endorsement workflow

This commit is contained in:
Agustina Martinez
2024-12-09 14:37:01 +00:00
parent 3ca56c3c28
commit f2d6f774d3
10 changed files with 76 additions and 7 deletions

View File

@@ -112,6 +112,22 @@
</div> </div>
</div> </div>
<!-- In the usesActorEmailId section -->
<div class="mb-5 mt-5">
<label class="status-label font-weight-bold" for="usesActorEmailId">{{ 'ldn-service-usesActorEmailId' | translate }}</label>
<div>
<input formControlName="usesActorEmailId" hidden id="usesActorEmailId"
name="usesActorEmailId" type="checkbox">
<div (click)="toggleUsesActorEmailId()"
[class.checked]="formModel.get('usesActorEmailId').value" class="toggle-switch">
<div class="slider"></div>
</div>
<div class="text-muted">
{{ 'ldn-service-usesActorEmailId-description' | translate }}
</div>
</div>
</div>
<!-- In the Inbound Patterns Labels section --> <!-- In the Inbound Patterns Labels section -->
<div class="row mb-1 mt-5" *ngIf="areControlsInitialized"> <div class="row mb-1 mt-5" *ngIf="areControlsInitialized">

View File

@@ -131,6 +131,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
score: ['', [Validators.required, Validators.pattern('^0*(\.[0-9]+)?$|^1(\.0+)?$')]], inboundPattern: [''], score: ['', [Validators.required, Validators.pattern('^0*(\.[0-9]+)?$|^1(\.0+)?$')]], inboundPattern: [''],
constraintPattern: [''], constraintPattern: [''],
enabled: [''], enabled: [''],
usesActorEmailId: [''],
type: LDN_SERVICE.value, type: LDN_SERVICE.value,
}); });
} }
@@ -184,7 +185,8 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
return rest; 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); const ldnServiceData = this.ldnServicesService.create(values);
@@ -243,6 +245,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
ldnUrl: this.ldnService.ldnUrl, ldnUrl: this.ldnService.ldnUrl,
type: this.ldnService.type, type: this.ldnService.type,
enabled: this.ldnService.enabled, enabled: this.ldnService.enabled,
usesActorEmailId: this.ldnService.usesActorEmailId,
lowerIp: this.ldnService.lowerIp, lowerIp: this.ldnService.lowerIp,
upperIp: this.ldnService.upperIp, 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 * Closes the modal
*/ */

View File

@@ -12,6 +12,7 @@ import { LdnService } from '../ldn-services-model/ldn-services.model';
export const mockLdnService: LdnService = { export const mockLdnService: LdnService = {
uuid: '1', uuid: '1',
enabled: false, enabled: false,
usesActorEmailId: false,
score: 0, score: 0,
id: 1, id: 1,
lowerIp: '192.0.2.146', lowerIp: '192.0.2.146',
@@ -49,6 +50,7 @@ export const mockLdnServiceRD$ = createSuccessfulRemoteDataObject$(mockLdnServic
export const mockLdnServices: LdnService[] = [{ export const mockLdnServices: LdnService[] = [{
uuid: '1', uuid: '1',
enabled: false, enabled: false,
usesActorEmailId: false,
score: 0, score: 0,
id: 1, id: 1,
lowerIp: '192.0.2.146', lowerIp: '192.0.2.146',
@@ -81,6 +83,7 @@ export const mockLdnServices: LdnService[] = [{
}, { }, {
uuid: '2', uuid: '2',
enabled: false, enabled: false,
usesActorEmailId: false,
score: 0, score: 0,
id: 2, id: 2,
lowerIp: '192.0.2.146', lowerIp: '192.0.2.146',

View File

@@ -52,6 +52,9 @@ export class LdnService extends CacheableObject {
@autoserialize @autoserialize
enabled: boolean; enabled: boolean;
@autoserialize
usesActorEmailId: boolean;
@autoserialize @autoserialize
ldnUrl: string; ldnUrl: string;

View File

@@ -4,5 +4,6 @@
export interface SignpostingLink { export interface SignpostingLink {
href?: string, href?: string,
rel?: string, rel?: string,
type?: string type?: string,
profile?: string
} }

View File

@@ -168,7 +168,8 @@ export class ItemPageComponent implements OnInit, OnDestroy {
this.signpostingLinks = signpostingLinks; this.signpostingLinks = signpostingLinks;
signpostingLinks.forEach((link: SignpostingLink) => { 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 = { let tag: LinkDefinition = {
href: link.href, href: link.href,
rel: link.rel, rel: link.rel,
@@ -178,6 +179,11 @@ export class ItemPageComponent implements OnInit, OnDestroy {
type: link.type, type: link.type,
}); });
} }
if (isNotEmpty(link.profile)) {
tag = Object.assign(tag, {
profile: link.profile,
});
}
this.linkHeadService.addTag(tag); this.linkHeadService.addTag(tag);
}); });

View File

@@ -2,4 +2,5 @@ export enum RequestStatusEnum {
ACCEPTED = 'ACCEPTED', ACCEPTED = 'ACCEPTED',
REJECTED = 'REJECTED', REJECTED = 'REJECTED',
REQUESTED = 'REQUESTED', REQUESTED = 'REQUESTED',
TENTATIVE_REJECT = 'TENTATIVE_REJECT',
} }

View File

@@ -74,6 +74,13 @@ export class RequestStatusAlertBoxComponent implements OnInit {
}; };
break; break;
case RequestStatusEnum.TENTATIVE_REJECT:
this.displayOptions = {
alertType: 'alert-warning',
text: 'request-status-alert-box.tentative_rejected',
};
break;
case RequestStatusEnum.REQUESTED: case RequestStatusEnum.REQUESTED:
this.displayOptions = { this.displayOptions = {
alertType: 'alert-warning', alertType: 'alert-warning',

View File

@@ -4,8 +4,7 @@
<div *ngIf="(filterServices(ldnPattern.pattern ) | async)?.length > 0"> <div *ngIf="(filterServices(ldnPattern.pattern ) | async)?.length > 0">
<label class="row col-form-label"> <label class="row col-form-label">
{{'submission.section.section-coar-notify.control.' + ldnPattern.pattern + '.label' | translate }} {{'submission.section.section-coar-notify.control.' + ldnPattern.pattern + '.label' | translate }}
</label </label>
>
<div *ngIf="ldnServiceByPattern[ldnPattern.pattern]?.services.length"> <div *ngIf="ldnServiceByPattern[ldnPattern.pattern]?.services.length">
<div <div
*ngFor=" *ngFor="

View File

@@ -5630,8 +5630,6 @@
"supervision.search.results.head": "Workflow and Workspace tasks", "supervision.search.results.head": "Workflow and Workspace tasks",
"orgunit.search.results.head": "Organizational Unit Search Results",
"workflow-item.edit.breadcrumbs": "Edit workflowitem", "workflow-item.edit.breadcrumbs": "Edit workflowitem",
"workflow-item.edit.title": "Edit workflowitem", "workflow-item.edit.title": "Edit workflowitem",
@@ -6348,6 +6346,8 @@
"request-status-alert-box.rejected": "The requested {{ offerType }} for <a href='{{serviceUrl}}' target='_blank'> {{ serviceName }} </a> has been rejected.", "request-status-alert-box.rejected": "The requested {{ offerType }} for <a href='{{serviceUrl}}' target='_blank'> {{ serviceName }} </a> has been rejected.",
"request-status-alert-box.tentative_rejected": "The requested {{ offerType }} for <a href='{{serviceUrl}}' target='_blank'> {{ serviceName }} </a> has been tentatively rejected. Revisions are required",
"request-status-alert-box.requested": "The requested {{ offerType }} for <a href='{{serviceUrl}}' target='_blank'> {{ serviceName }} </a> is pending.", "request-status-alert-box.requested": "The requested {{ offerType }} for <a href='{{serviceUrl}}' target='_blank'> {{ serviceName }} </a> is pending.",
"ldn-service-button-mark-inbound-deletion": "Mark supported pattern for deletion", "ldn-service-button-mark-inbound-deletion": "Mark supported pattern for deletion",
@@ -6364,6 +6364,10 @@
"ldn-service-overview-close-modal": "Close modal", "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", "a-common-or_statement.label": "Item type is Journal Article or Dataset",
"always_true_filter.label": "Always true", "always_true_filter.label": "Always true",