Merge pull request #3735 from amgciadev/fix-10053-b

#10053: Add support for PCI Endorsement workflow
This commit is contained in:
Tim Donohue
2025-03-17 10:44:54 -05:00
committed by GitHub
9 changed files with 76 additions and 4 deletions

View File

@@ -128,6 +128,22 @@
}
</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 -->
@if (areControlsInitialized) {

View File

@@ -125,6 +125,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,
});
}
@@ -178,7 +179,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);
@@ -237,6 +239,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,
});
@@ -384,6 +387,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
*/

View File

@@ -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',

View File

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

View File

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

View File

@@ -166,7 +166,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,
@@ -176,6 +177,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);
});

View File

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

View File

@@ -68,6 +68,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',

View File

@@ -6326,7 +6326,7 @@
"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 ",
"quality-assurance.event.table.event.message.serviceUrl": "Service URL:",
"quality-assurance.event.table.event.message.serviceUrl": "Actor:",
"quality-assurance.event.table.event.message.link": "Link:",
@@ -6390,6 +6390,8 @@
"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.",
"ldn-service-button-mark-inbound-deletion": "Mark supported pattern for deletion",
@@ -6406,6 +6408,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",