Skip to content

Commit a18e03d

Browse files
authored
Merge pull request DSpace#3735 from amgciadev/fix-10053-b
#10053: Add support for PCI Endorsement workflow
2 parents d9c68d4 + 6467b60 commit a18e03d

File tree

9 files changed

+76
-4
lines changed

9 files changed

+76
-4
lines changed

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
@@ -128,6 +128,22 @@ <h1 class="flex-grow-1">{{ isNewService ? ('ldn-create-service.title' | translat
128128
}
129129
</div>
130130

131+
<!-- In the usesActorEmailId section -->
132+
<div class="mb-5 mt-5">
133+
<label class="status-label font-weight-bold" for="usesActorEmailId">{{ 'ldn-service-usesActorEmailId' | translate }}</label>
134+
<div>
135+
<input formControlName="usesActorEmailId" hidden id="usesActorEmailId"
136+
name="usesActorEmailId" type="checkbox">
137+
<div (click)="toggleUsesActorEmailId()"
138+
[class.checked]="formModel.get('usesActorEmailId').value" class="toggle-switch">
139+
<div class="slider"></div>
140+
</div>
141+
<div class="text-muted">
142+
{{ 'ldn-service-usesActorEmailId-description' | translate }}
143+
</div>
144+
</div>
145+
</div>
146+
131147

132148
<!-- In the Inbound Patterns Labels section -->
133149
@if (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
@@ -125,6 +125,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
125125
score: ['', [Validators.required, Validators.pattern('^0*(\.[0-9]+)?$|^1(\.0+)?$')]], inboundPattern: [''],
126126
constraintPattern: [''],
127127
enabled: [''],
128+
usesActorEmailId: [''],
128129
type: LDN_SERVICE.value,
129130
});
130131
}
@@ -178,7 +179,8 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
178179
return rest;
179180
});
180181

181-
const values = { ...this.formModel.value, enabled: true };
182+
const values = { ...this.formModel.value, enabled: true,
183+
usesActorEmailId: this.formModel.get('usesActorEmailId').value };
182184

183185
const ldnServiceData = this.ldnServicesService.create(values);
184186

@@ -237,6 +239,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
237239
ldnUrl: this.ldnService.ldnUrl,
238240
type: this.ldnService.type,
239241
enabled: this.ldnService.enabled,
242+
usesActorEmailId: this.ldnService.usesActorEmailId,
240243
lowerIp: this.ldnService.lowerIp,
241244
upperIp: this.ldnService.upperIp,
242245
});
@@ -384,6 +387,32 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
384387
);
385388
}
386389

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

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
@@ -166,7 +166,8 @@ export class ItemPageComponent implements OnInit, OnDestroy {
166166
this.signpostingLinks = signpostingLinks;
167167

168168
signpostingLinks.forEach((link: SignpostingLink) => {
169-
links = links + (isNotEmpty(links) ? ', ' : '') + `<${link.href}> ; rel="${link.rel}"` + (isNotEmpty(link.type) ? ` ; type="${link.type}" ` : ' ');
169+
links = links + (isNotEmpty(links) ? ', ' : '') + `<${link.href}> ; rel="${link.rel}"` + (isNotEmpty(link.type) ? ` ; type="${link.type}" ` : ' ')
170+
+ (isNotEmpty(link.profile) ? ` ; profile="${link.profile}" ` : '');
170171
let tag: LinkDefinition = {
171172
href: link.href,
172173
rel: link.rel,
@@ -176,6 +177,11 @@ export class ItemPageComponent implements OnInit, OnDestroy {
176177
type: link.type,
177178
});
178179
}
180+
if (isNotEmpty(link.profile)) {
181+
tag = Object.assign(tag, {
182+
profile: link.profile,
183+
});
184+
}
179185
this.linkHeadService.addTag(tag);
180186
});
181187

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
@@ -68,6 +68,13 @@ export class RequestStatusAlertBoxComponent implements OnInit {
6868
};
6969
break;
7070

71+
case RequestStatusEnum.TENTATIVE_REJECT:
72+
this.displayOptions = {
73+
alertType: 'alert-warning',
74+
text: 'request-status-alert-box.tentative_rejected',
75+
};
76+
break;
77+
7178
case RequestStatusEnum.REQUESTED:
7279
this.displayOptions = {
7380
alertType: 'alert-warning',

src/assets/i18n/en.json5

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6326,7 +6326,7 @@
63266326

63276327
"quality-assurance.events.description-with-topic-and-target": "Below the list of all the suggestions for the selected topic <b>{{topic}}</b>, related to <b>{{source}}</b> and ",
63286328

6329-
"quality-assurance.event.table.event.message.serviceUrl": "Service URL:",
6329+
"quality-assurance.event.table.event.message.serviceUrl": "Actor:",
63306330

63316331
"quality-assurance.event.table.event.message.link": "Link:",
63326332

@@ -6390,6 +6390,8 @@
63906390

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

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

63956397
"ldn-service-button-mark-inbound-deletion": "Mark supported pattern for deletion",
@@ -6406,6 +6408,10 @@
64066408

64076409
"ldn-service-overview-close-modal": "Close modal",
64086410

6411+
"ldn-service-usesActorEmailId": "Requires actor email in notifications",
6412+
6413+
"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.",
6414+
64096415
"a-common-or_statement.label": "Item type is Journal Article or Dataset",
64106416

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

0 commit comments

Comments
 (0)