Skip to content

Commit d735287

Browse files
author
Andrea Barbasso
committed
Merged ux-plus-2023_02_x into UXP-34-carousel-pagination
2 parents e5feacc + 34d0e93 commit d735287

449 files changed

Lines changed: 88916 additions & 30998 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
"input": "src/themes/dspace/styles/theme.scss",
7070
"inject": false,
7171
"bundleName": "dspace-theme"
72-
}
72+
},
73+
"./node_modules/leaflet/dist/leaflet.css"
7374
],
7475
"scripts": [],
7576
"baseHref": "/"

config/config.example.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,12 @@ browseBy:
275275
fiveYearLimit: 30
276276
# The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
277277
defaultLowerLimit: 1900
278+
# Whether to add item badges to BOTH browse and search result lists.
279+
showLabels: true
278280
# If true, thumbnail images for items will be added to BOTH search and browse result lists.
279281
showThumbnails: true
282+
# Whether to add item thumbnail images to BOTH browse and search result lists.
283+
showMetrics: false
280284
# The number of entries in a paginated browse results list.
281285
# Rounded to the nearest size in the list of selectable sizes on the
282286
# settings menu.

cypress/e2e/search-navbar.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const page = {
1515
}
1616
};
1717

18-
xdescribe('Search from Navigation Bar', () => {
18+
describe('Search from Navigation Bar', () => {
1919
// NOTE: these tests currently assume this query will return results!
2020
const query = TEST_SEARCH_TERM;
2121

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dspace-angular",
3-
"version": "2023.02.04-SNAPSHOT",
3+
"version": "2023.02.06-SNAPHOT",
44
"scripts": {
55
"ng": "ng",
66
"config:watch": "nodemon",
@@ -86,6 +86,8 @@
8686
"@angular/platform-server": "^15.2.8",
8787
"@angular/router": "^15.2.8",
8888
"@babel/runtime": "7.21.0",
89+
"@asymmetrik/ngx-leaflet": "^15.0.0",
90+
"@datadog/browser-rum": "^5.7.0",
8991
"@kolkov/ngx-gallery": "^2.0.1",
9092
"@material-ui/core": "^4.11.0",
9193
"@material-ui/icons": "^4.11.3",
@@ -102,6 +104,7 @@
102104
"@swimlane/ngx-charts": "^20.4.1",
103105
"@types/googlemaps": "^3.43.3",
104106
"@types/grecaptcha": "^3.0.4",
107+
"@types/leaflet": "^1.9.12",
105108
"angular-idle-preload": "3.0.0",
106109
"angulartics2": "^12.2.0",
107110
"axios": "^1.6.0",
@@ -115,6 +118,7 @@
115118
"date-fns": "^2.29.3",
116119
"date-fns-tz": "^1.3.7",
117120
"deepmerge": "^4.3.1",
121+
"domino": "^2.1.6",
118122
"ejs": "^3.1.9",
119123
"express": "^4.18.2",
120124
"express-rate-limit": "^5.1.3",
@@ -132,6 +136,7 @@
132136
"jsonschema": "1.4.1",
133137
"jwt-decode": "^3.1.2",
134138
"klaro": "^0.7.18",
139+
"leaflet": "^1.9.4",
135140
"lodash": "^4.17.21",
136141
"lru-cache": "^7.14.1",
137142
"markdown-it": "^13.0.1",
@@ -146,7 +151,6 @@
146151
"ng2-nouislider": "^2.0.0",
147152
"ng2-pdfjs-viewer": "^15.0.0",
148153
"ngx-infinite-scroll": "^15.0.0",
149-
"ngx-openlayers": "0.8.22",
150154
"ngx-pagination": "6.0.3",
151155
"ngx-ui-switch": "^14.0.3",
152156
"nouislider": "^15.7.1",
@@ -160,7 +164,7 @@
160164
"video.js": "^7.21.4",
161165
"videojs-contrib-quality-levels": "^2.0.9",
162166
"videojs-hls-quality-selector": "^1.1.1",
163-
"videojs-wavesurfer": "^3.9.0",
167+
"videojs-wavesurfer": "^3.10.0",
164168
"webfontloader": "1.6.28",
165169
"zone.js": "~0.11.5"
166170
},

server.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import * as express from 'express';
2525
import * as ejs from 'ejs';
2626
import * as compression from 'compression';
2727
import * as expressStaticGzip from 'express-static-gzip';
28+
import * as domino from 'domino';
2829
/* eslint-enable import/no-namespace */
2930
import axios from 'axios';
3031
import LRU from 'lru-cache';
@@ -79,6 +80,18 @@ let anonymousCache: LRU<string, any>;
7980
// extend environment with app config for server
8081
extendEnvironmentWithAppConfig(environment, appConfig);
8182

83+
// Create a DOM window object based on the template
84+
const _window = domino.createWindow(indexHtml);
85+
86+
// The REST server base URL
87+
const REST_BASE_URL = environment.rest.ssrBaseUrl || environment.rest.baseUrl;
88+
89+
// Assign the DOM window and document objects to the global object
90+
(_window as any).screen = {deviceXDPI: 0, logicalXDPI: 0};
91+
(global as any).window = _window;
92+
(global as any).document = _window.document;
93+
(global as any).navigator = _window.navigator;
94+
8295
// The Express app is exported so that it can be used by serverless Functions.
8396
export function app() {
8497

@@ -175,7 +188,7 @@ export function app() {
175188
* Proxy the sitemaps
176189
*/
177190
router.use('/sitemap**', createProxyMiddleware({
178-
target: `${environment.rest.baseUrl}/sitemaps`,
191+
target: `${REST_BASE_URL}/sitemaps`,
179192
pathRewrite: path => path.replace(environment.ui.nameSpace, '/'),
180193
changeOrigin: true
181194
}));
@@ -184,7 +197,7 @@ export function app() {
184197
* Proxy the linksets
185198
*/
186199
router.use('/signposting**', createProxyMiddleware({
187-
target: `${environment.rest.baseUrl}`,
200+
target: `${REST_BASE_URL}`,
188201
pathRewrite: path => path.replace(environment.ui.nameSpace, '/'),
189202
changeOrigin: true
190203
}));
@@ -635,7 +648,7 @@ function clientHealthCheck(req, res) {
635648
* The callback function to serve health check requests
636649
*/
637650
function healthCheck(req, res) {
638-
const baseUrl = `${environment.rest.baseUrl}${environment.actuators.endpointPath}`;
651+
const baseUrl = `${REST_BASE_URL}${environment.actuators.endpointPath}`;
639652
axios.get(baseUrl)
640653
.then((response) => {
641654
res.status(response.status).send(response.data);

src/app/access-control/bulk-access/bulk-access.component.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
<hr>
77

88
<div class="d-flex justify-content-end">
9-
<button class="btn btn-outline-primary mr-3" (click)="reset()">
10-
{{ 'access-control-cancel' | translate }}
11-
</button>
9+
<a routerLink="/home" class="btn btn-outline-primary mr-3">
10+
<i class="fas fa-arrow-left mr-1"></i>
11+
{{ 'access-control-back' | translate }}
12+
</a>
1213
<button class="btn btn-primary" [disabled]="!canExport()" (click)="submit()">
14+
<i class="fas fa-cogs mr-1"></i>
1315
{{ 'access-control-execute' | translate }}
1416
</button>
1517
</div>

src/app/access-control/bulk-access/bulk-access.component.spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { Process } from '../../process-page/processes/process.model';
1313
import { RouterTestingModule } from '@angular/router/testing';
1414
import { NotificationsService } from '../../shared/notifications/notifications.service';
1515
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
16+
import { By } from '@angular/platform-browser';
1617

1718
describe('BulkAccessComponent', () => {
1819
let component: BulkAccessComponent;
@@ -141,11 +142,6 @@ describe('BulkAccessComponent', () => {
141142
expect(component.canExport()).toBe(true);
142143
});
143144

144-
it('should call the settings reset method when reset is called', () => {
145-
component.reset();
146-
expect(component.settings.reset).toHaveBeenCalled();
147-
});
148-
149145
it('should call the bulkAccessControlService executeScript method when submit is called', () => {
150146
(component.settings as any).getValue.and.returnValue(mockFormState);
151147
bulkAccessControlService.createPayloadFile.and.returnValue(mockFile);
@@ -154,5 +150,11 @@ describe('BulkAccessComponent', () => {
154150
component.submit();
155151
expect(bulkAccessControlService.executeScript).toHaveBeenCalled();
156152
});
153+
154+
it('should have a link to /home', () => {
155+
const link = fixture.debugElement.query(By.css('a.btn-outline-primary'));
156+
expect(link).toBeTruthy();
157+
expect(link.properties.href).toContain('/home');
158+
});
157159
});
158160
});

src/app/access-control/bulk-access/bulk-access.component.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ export class BulkAccessComponent implements OnInit {
5454
return this.objectsSelected$.value?.length > 0;
5555
}
5656

57-
/**
58-
* Reset the form to its initial state
59-
* This will also reset the state of the child components (bitstream and item access)
60-
*/
61-
reset(): void {
62-
this.settings.reset();
63-
}
64-
6557
/**
6658
* Submit the form
6759
* This will create a payload file and execute the script

src/app/access-control/bulk-access/settings/bulk-access-settings.component.spec.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ describe('BulkAccessSettingsComponent', () => {
3636

3737
const mockControl: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
3838
getFormValue: jasmine.createSpy('getFormValue'),
39-
reset: jasmine.createSpy('reset')
4039
});
4140

4241
beforeEach(async () => {
@@ -62,20 +61,11 @@ describe('BulkAccessSettingsComponent', () => {
6261
expect(component.getValue).toBeDefined();
6362
});
6463

65-
it('should have a method to reset the form', () => {
66-
expect(component.reset).toBeDefined();
67-
});
68-
6964
it('should return the correct form value', () => {
7065
const expectedValue = mockFormState;
7166
(component.controlForm as any).getFormValue.and.returnValue(mockFormState);
7267
const actualValue = component.getValue();
7368
// @ts-ignore
7469
expect(actualValue).toEqual(expectedValue);
7570
});
76-
77-
it('should call reset on the control form', () => {
78-
component.reset();
79-
expect(component.controlForm.reset).toHaveBeenCalled();
80-
});
8171
});

src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,4 @@ export class BulkAccessSettingsComponent {
2222
getValue() {
2323
return this.controlForm.getFormValue();
2424
}
25-
26-
/**
27-
* Reset the form to its initial state
28-
* This will also reset the state of the child components (bitstream and item access)
29-
*/
30-
reset() {
31-
this.controlForm.reset();
32-
}
33-
3425
}

0 commit comments

Comments
 (0)