Skip to content

Commit f2d6f77

Browse files
committed
#10053: Add support for PCI Endorsement workflow
1 parent 3ca56c3 commit f2d6f77

10 files changed

Lines changed: 76 additions & 7 deletions

File tree

src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,22 @@ <h1 class="flex-grow-1">{{ isNewService ? ('ldn-create-service.title' | translat
112112
</div>
113113
</div>
114114

115+
<!-- In the usesActorEmailId section -->
116+
<div class="mb-5 mt-5">
117+
<label class="status-label font-weight-bold" for="usesActorEmailId">{{ 'ldn-service-usesActorEmailId' | translate }}</label>
118+
<div>
119+
<input formControlName="usesActorEmailId" hidden id="usesActorEmailId"
120+
name="usesActorEmailId" type="checkbox">
121+
<div (click)="toggleUsesActorEmailId()"
122+
[class.checked]="formModel.get('usesActorEmailId').value" class="toggle-switch">
123+
<div class="slider"></div>
124+
</div>
125+
<div class="text-muted">
126+
{{ 'ldn-service-usesActorEmailId-description' | translate }}
127+
</div>
128+
</div>
129+
</div>
130+
115131

116132
<!-- In the Inbound Patterns Labels section -->
117133
<div class="row mb-1 mt-5" *ngIf="areControlsInitialized">

src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
131131
score: ['', [Validators.required, Validators.pattern('^0*(\.[0-9]+)?$|^1(\.0+)?$')]], inboundPattern: [''],
132132
constraintPattern: [''],
133133
enabled: [''],
134+
usesActorEmailId: [''],
134135
type: LDN_SERVICE.value,
135136
});
136137
}
@@ -184,7 +185,8 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
184185
return rest;
185186
});
186187

187-
const values = { ...this.formModel.value, enabled: true };
188+
const values = { ...this.formModel.value, enabled: true,
189+
usesActorEmailId: this.formModel.get('usesActorEmailId').value };
188190

189191
const ldnServiceData = this.ldnServicesService.create(values);
190192

@@ -243,6 +245,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
243245
ldnUrl: this.ldnService.ldnUrl,
244246
type: this.ldnService.type,
245247
enabled: this.ldnService.enabled,
248+
usesActorEmailId: this.ldnService.usesActorEmailId,
246249
lowerIp: this.ldnService.lowerIp,
247250
upperIp: this.ldnService.upperIp,
248251
});
@@ -390,6 +393,32 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
390393
);
391394
}
392395

396+
/**
397+
* Toggles the usesActorEmailId field of the LDN service by sending a patch request
398+
*/
399+
toggleUsesActorEmailId() {
400+
const newStatus = !this.formModel.get('usesActorEmailId').value;
401+
if (!this.isNewService) {
402+
const patchOperation: Operation = {
403+
op: 'replace',
404+
path: '/usesActorEmailId',
405+
value: newStatus,
406+
};
407+
408+
this.ldnServicesService.patch(this.ldnService, [patchOperation]).pipe(
409+
getFirstCompletedRemoteData(),
410+
).subscribe(
411+
() => {
412+
this.formModel.get('usesActorEmailId').setValue(newStatus);
413+
this.cdRef.detectChanges();
414+
},
415+
);
416+
} else {
417+
this.formModel.get('usesActorEmailId').setValue(newStatus);
418+
this.cdRef.detectChanges();
419+
}
420+
}
421+
393422
/**
394423
* Closes the modal
395424
*/

src/app/admin/admin-ldn-services/ldn-service-serviceMock/ldnServicesRD$-mock.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { LdnService } from '../ldn-services-model/ldn-services.model';
1212
export const mockLdnService: LdnService = {
1313
uuid: '1',
1414
enabled: false,
15+
usesActorEmailId: false,
1516
score: 0,
1617
id: 1,
1718
lowerIp: '192.0.2.146',
@@ -49,6 +50,7 @@ export const mockLdnServiceRD$ = createSuccessfulRemoteDataObject$(mockLdnServic
4950
export const mockLdnServices: LdnService[] = [{
5051
uuid: '1',
5152
enabled: false,
53+
usesActorEmailId: false,
5254
score: 0,
5355
id: 1,
5456
lowerIp: '192.0.2.146',
@@ -81,6 +83,7 @@ export const mockLdnServices: LdnService[] = [{
8183
}, {
8284
uuid: '2',
8385
enabled: false,
86+
usesActorEmailId: false,
8487
score: 0,
8588
id: 2,
8689
lowerIp: '192.0.2.146',

src/app/admin/admin-ldn-services/ldn-services-model/ldn-services.model.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ export class LdnService extends CacheableObject {
5252
@autoserialize
5353
enabled: boolean;
5454

55+
@autoserialize
56+
usesActorEmailId: boolean;
57+
5558
@autoserialize
5659
ldnUrl: string;
5760

src/app/core/data/signposting-links.model.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
export interface SignpostingLink {
55
href?: string,
66
rel?: string,
7-
type?: string
7+
type?: string,
8+
profile?: string
89
}

src/app/item-page/simple/item-page.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ export class ItemPageComponent implements OnInit, OnDestroy {
168168
this.signpostingLinks = signpostingLinks;
169169

170170
signpostingLinks.forEach((link: SignpostingLink) => {
171-
links = links + (isNotEmpty(links) ? ', ' : '') + `<${link.href}> ; rel="${link.rel}"` + (isNotEmpty(link.type) ? ` ; type="${link.type}" ` : ' ');
171+
links = links + (isNotEmpty(links) ? ', ' : '') + `<${link.href}> ; rel="${link.rel}"` + (isNotEmpty(link.type) ? ` ; type="${link.type}" ` : ' ')
172+
+ (isNotEmpty(link.profile) ? ` ; profile="${link.profile}" ` : '');
172173
let tag: LinkDefinition = {
173174
href: link.href,
174175
rel: link.rel,
@@ -178,6 +179,11 @@ export class ItemPageComponent implements OnInit, OnDestroy {
178179
type: link.type,
179180
});
180181
}
182+
if (isNotEmpty(link.profile)) {
183+
tag = Object.assign(tag, {
184+
profile: link.profile,
185+
});
186+
}
181187
this.linkHeadService.addTag(tag);
182188
});
183189

src/app/item-page/simple/notify-requests-status/notify-status.enum.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export enum RequestStatusEnum {
22
ACCEPTED = 'ACCEPTED',
33
REJECTED = 'REJECTED',
44
REQUESTED = 'REQUESTED',
5+
TENTATIVE_REJECT = 'TENTATIVE_REJECT',
56
}

src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ export class RequestStatusAlertBoxComponent implements OnInit {
7474
};
7575
break;
7676

77+
case RequestStatusEnum.TENTATIVE_REJECT:
78+
this.displayOptions = {
79+
alertType: 'alert-warning',
80+
text: 'request-status-alert-box.tentative_rejected',
81+
};
82+
break;
83+
7784
case RequestStatusEnum.REQUESTED:
7885
this.displayOptions = {
7986
alertType: 'alert-warning',

src/app/submission/sections/section-coar-notify/section-coar-notify.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
<div *ngIf="(filterServices(ldnPattern.pattern ) | async)?.length > 0">
55
<label class="row col-form-label">
66
{{'submission.section.section-coar-notify.control.' + ldnPattern.pattern + '.label' | translate }}
7-
</label
8-
>
7+
</label>
98
<div *ngIf="ldnServiceByPattern[ldnPattern.pattern]?.services.length">
109
<div
1110
*ngFor="

src/assets/i18n/en.json5

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5630,8 +5630,6 @@
56305630

56315631
"supervision.search.results.head": "Workflow and Workspace tasks",
56325632

5633-
"orgunit.search.results.head": "Organizational Unit Search Results",
5634-
56355633
"workflow-item.edit.breadcrumbs": "Edit workflowitem",
56365634

56375635
"workflow-item.edit.title": "Edit workflowitem",
@@ -6348,6 +6346,8 @@
63486346

63496347
"request-status-alert-box.rejected": "The requested {{ offerType }} for <a href='{{serviceUrl}}' target='_blank'> {{ serviceName }} </a> has been rejected.",
63506348

6349+
"request-status-alert-box.tentative_rejected": "The requested {{ offerType }} for <a href='{{serviceUrl}}' target='_blank'> {{ serviceName }} </a> has been tentatively rejected. Revisions are required",
6350+
63516351
"request-status-alert-box.requested": "The requested {{ offerType }} for <a href='{{serviceUrl}}' target='_blank'> {{ serviceName }} </a> is pending.",
63526352

63536353
"ldn-service-button-mark-inbound-deletion": "Mark supported pattern for deletion",
@@ -6364,6 +6364,10 @@
63646364

63656365
"ldn-service-overview-close-modal": "Close modal",
63666366

6367+
"ldn-service-usesActorEmailId": "Requires actor email in notifications",
6368+
6369+
"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.",
6370+
63676371
"a-common-or_statement.label": "Item type is Journal Article or Dataset",
63686372

63696373
"always_true_filter.label": "Always true",

0 commit comments

Comments
 (0)