Skip to content

#10053: Add support for PCI Endorsement workflow #3735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,22 @@ <h1 class="flex-grow-1">{{ isNewService ? ('ldn-create-service.title' | translat
}
</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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
score: ['', [Validators.required, Validators.pattern('^0*(\.[0-9]+)?$|^1(\.0+)?$')]], inboundPattern: [''],
constraintPattern: [''],
enabled: [''],
usesActorEmailId: [''],
type: LDN_SERVICE.value,
});
}
Expand Down Expand Up @@ -178,7 +179,8 @@
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);

Expand Down Expand Up @@ -237,6 +239,7 @@
ldnUrl: this.ldnService.ldnUrl,
type: this.ldnService.type,
enabled: this.ldnService.enabled,
usesActorEmailId: this.ldnService.usesActorEmailId,
lowerIp: this.ldnService.lowerIp,
upperIp: this.ldnService.upperIp,
});
Expand Down Expand Up @@ -384,6 +387,32 @@
);
}

/**
* Toggles the usesActorEmailId field of the LDN service by sending a patch request
*/
toggleUsesActorEmailId() {
const newStatus = !this.formModel.get('usesActorEmailId').value;

Check warning on line 394 in src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L394 was not covered by tests
if (!this.isNewService) {
const patchOperation: Operation = {

Check warning on line 396 in src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L396 was not covered by tests
op: 'replace',
path: '/usesActorEmailId',
value: newStatus,
};

this.ldnServicesService.patch(this.ldnService, [patchOperation]).pipe(

Check warning on line 402 in src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L402 was not covered by tests
getFirstCompletedRemoteData(),
).subscribe(
() => {
this.formModel.get('usesActorEmailId').setValue(newStatus);
this.cdRef.detectChanges();

Check warning on line 407 in src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts

View check run for this annotation

Codecov / codecov/patch

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

Added lines #L406 - L407 were not covered by tests
},
);
} else {
this.formModel.get('usesActorEmailId').setValue(newStatus);
this.cdRef.detectChanges();

Check warning on line 412 in src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts

View check run for this annotation

Codecov / codecov/patch

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

Added lines #L411 - L412 were not covered by tests
}
}

/**
* Closes the modal
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -81,6 +83,7 @@ export const mockLdnServices: LdnService[] = [{
}, {
uuid: '2',
enabled: false,
usesActorEmailId: false,
score: 0,
id: 2,
lowerIp: '192.0.2.146',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export class LdnService extends CacheableObject {
@autoserialize
enabled: boolean;

@autoserialize
usesActorEmailId: boolean;

@autoserialize
ldnUrl: string;

Expand Down
3 changes: 2 additions & 1 deletion src/app/core/data/signposting-links.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
export interface SignpostingLink {
href?: string,
rel?: string,
type?: string
type?: string,
profile?: string
}
8 changes: 7 additions & 1 deletion src/app/item-page/simple/item-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@
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,
Expand All @@ -176,6 +177,11 @@
type: link.type,
});
}
if (isNotEmpty(link.profile)) {
tag = Object.assign(tag, {

Check warning on line 181 in src/app/item-page/simple/item-page.component.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L181 was not covered by tests
profile: link.profile,
});
}
this.linkHeadService.addTag(tag);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export enum RequestStatusEnum {
ACCEPTED = 'ACCEPTED',
REJECTED = 'REJECTED',
REQUESTED = 'REQUESTED',
TENTATIVE_REJECT = 'TENTATIVE_REJECT',
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@
};
break;

case RequestStatusEnum.TENTATIVE_REJECT:
this.displayOptions = {

Check warning on line 72 in src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L72 was not covered by tests
alertType: 'alert-warning',
text: 'request-status-alert-box.tentative_rejected',
};
break;

Check warning on line 76 in src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L76 was not covered by tests

case RequestStatusEnum.REQUESTED:
this.displayOptions = {
alertType: 'alert-warning',
Expand Down
8 changes: 7 additions & 1 deletion src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -6320,7 +6320,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:",

Expand Down Expand Up @@ -6384,6 +6384,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",
Expand All @@ -6400,6 +6402,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",
Expand Down
Loading