Skip to content

Commit c1b951b

Browse files
Merge remote-tracking branch 'github/main' into task/main/CST-15074
# Conflicts: # src/assets/i18n/en.json5
2 parents d6776a8 + a18e03d commit c1b951b

14 files changed

Lines changed: 5224 additions & 822 deletions

File tree

cypress/e2e/admin-sidebar.cy.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { testA11y } from 'cypress/support/utils';
2-
import { Options } from 'cypress-axe';
32

43
describe('Admin Sidebar', () => {
54
beforeEach(() => {
@@ -16,13 +15,6 @@ describe('Admin Sidebar', () => {
1615
cy.get('ds-expandable-admin-sidebar-section').click({ multiple: true });
1716

1817
// Analyze <ds-admin-sidebar> for accessibility
19-
testA11y('ds-admin-sidebar',
20-
{
21-
rules: {
22-
// Currently all expandable sections have nested interactive elements
23-
// See https://github.com/DSpace/dspace-angular/issues/2178
24-
'nested-interactive': { enabled: false },
25-
},
26-
} as Options);
18+
testA11y('ds-admin-sidebar');
2719
});
2820
});

cypress/tsconfig.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
{
22
"extends": "../tsconfig.json",
33
"include": [
4-
"**/*.ts"
4+
"**/*.ts",
5+
"../cypress.config.ts"
56
],
67
"compilerOptions": {
78
"sourceMap": false,
9+
"typeRoots": [
10+
"../node_modules",
11+
"../node_modules/@types",
12+
"../src/typings.d.ts"
13+
],
814
"types": [
915
"cypress",
1016
"cypress-axe",

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

0 commit comments

Comments
 (0)