Skip to content

Commit 2df7c86

Browse files
author
Andrea Barbasso
committed
Merge branch 'dspace-cris-2023_02_x' into task/dspace-cris-2023_02_x/DSC-1661
# Conflicts: # src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.html # src/app/search-page/configuration-search-page.component.ts # src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts # src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.html # src/app/shared/search/search-results/themed-search-results.component.ts # src/app/shared/search/search.component.spec.ts # src/app/shared/search/search.component.ts
2 parents 315f8d5 + 8fd026a commit 2df7c86

294 files changed

Lines changed: 101391 additions & 30202 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.

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.

package.json

Lines changed: 2 additions & 1 deletion
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",
@@ -113,6 +113,7 @@
113113
"date-fns": "^2.29.3",
114114
"date-fns-tz": "^1.3.7",
115115
"deepmerge": "^4.3.1",
116+
"domino": "^2.1.6",
116117
"ejs": "^3.1.9",
117118
"express": "^4.18.2",
118119
"express-rate-limit": "^5.1.3",

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/epeople-registry/epeople-registry.component.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ import { RequestService } from '../../core/data/request.service';
2727
import { PaginationService } from '../../core/pagination/pagination.service';
2828
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
2929
import { FindListOptions } from '../../core/data/find-list-options.model';
30-
import { UUIDService } from '../../core/shared/uuid.service';
31-
import { getMockUUIDService } from '../../shared/mocks/uuid.service.mock';
3230

3331
describe('EPeopleRegistryComponent', () => {
3432
let component: EPeopleRegistryComponent;
@@ -141,8 +139,7 @@ describe('EPeopleRegistryComponent', () => {
141139
{ provide: FormBuilderService, useValue: builderService },
142140
{ provide: Router, useValue: new RouterStub() },
143141
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
144-
{ provide: PaginationService, useValue: paginationService },
145-
{ provide: UUIDService, useValue: getMockUUIDService() }
142+
{ provide: PaginationService, useValue: paginationService }
146143
],
147144
schemas: [NO_ERRORS_SCHEMA]
148145
}).compileComponents();

src/app/access-control/epeople-registry/epeople-registry.component.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { NoContent } from '../../core/shared/NoContent.model';
2323
import { PaginationService } from '../../core/pagination/pagination.service';
2424
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
2525
import { getEPersonEditRoute, getEPersonsRoute } from '../access-control-routing-paths';
26-
import { UUIDService } from '../../core/shared/uuid.service';
2726

2827
@Component({
2928
selector: 'ds-epeople-registry',
@@ -61,7 +60,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
6160
* Pagination config used to display the list of epeople
6261
*/
6362
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
64-
id: this.uuidService.generate(),
63+
id: 'elp',
6564
pageSize: 5,
6665
currentPage: 1
6766
});
@@ -92,8 +91,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
9291
private modalService: NgbModal,
9392
private paginationService: PaginationService,
9493
public requestService: RequestService,
95-
public dsoNameService: DSONameService,
96-
private uuidService: UUIDService) {
94+
public dsoNameService: DSONameService) {
9795
this.currentSearchQuery = '';
9896
this.currentSearchScope = 'metadata';
9997
this.searchForm = this.formBuilder.group(({

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model
3535
import { ActivatedRoute, Router } from '@angular/router';
3636
import { RouterStub } from '../../../shared/testing/router.stub';
3737
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
38-
import { UUIDService } from '../../../core/shared/uuid.service';
39-
import { getMockUUIDService } from '../../../shared/mocks/uuid.service.mock';
4038

4139
describe('EPersonFormComponent', () => {
4240
let component: EPersonFormComponent;
@@ -222,7 +220,6 @@ describe('EPersonFormComponent', () => {
222220
{ provide: EpersonRegistrationService, useValue: epersonRegistrationService },
223221
{ provide: ActivatedRoute, useValue: route },
224222
{ provide: Router, useValue: router },
225-
{ provide: UUIDService, useValue: getMockUUIDService() },
226223
EPeopleRegistryComponent
227224
],
228225
schemas: [NO_ERRORS_SCHEMA]

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import { TYPE_REQUEST_FORGOT } from '../../../register-email-form/register-email
4040
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
4141
import { ActivatedRoute, Router } from '@angular/router';
4242
import { getEPersonsRoute } from '../../access-control-routing-paths';
43-
import { UUIDService } from '../../../core/shared/uuid.service';
4443

4544
@Component({
4645
selector: 'ds-eperson-form',
@@ -154,7 +153,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
154153
* Pagination config used to display the list of groups
155154
*/
156155
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
157-
id: this.uuidService.generate(),
156+
id: 'gem',
158157
pageSize: 5,
159158
currentPage: 1
160159
});
@@ -198,8 +197,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
198197
private epersonRegistrationService: EpersonRegistrationService,
199198
public dsoNameService: DSONameService,
200199
protected route: ActivatedRoute,
201-
protected router: Router,
202-
private uuidService: UUIDService
200+
protected router: Router
203201
) {
204202
this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => {
205203
this.epersonInitial = eperson;

src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ import { PaginationService } from '../../../../core/pagination/pagination.servic
3030
import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub';
3131
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
3232
import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock';
33-
import { UUIDService } from '../../../../core/shared/uuid.service';
34-
import { getMockUUIDService } from '../../../../shared/mocks/uuid.service.mock';
3533

3634
describe('MembersListComponent', () => {
3735
let component: MembersListComponent;
@@ -138,7 +136,6 @@ describe('MembersListComponent', () => {
138136
{ provide: Router, useValue: new RouterMock() },
139137
{ provide: PaginationService, useValue: paginationService },
140138
{ provide: DSONameService, useValue: new DSONameServiceMock() },
141-
{ provide: UUIDService, useValue: getMockUUIDService() }
142139
],
143140
schemas: [NO_ERRORS_SCHEMA]
144141
}).compileComponents();

src/app/access-control/group-registry/group-form/members-list/members-list.component.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { NotificationsService } from '../../../../shared/notifications/notificat
2323
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
2424
import { PaginationService } from '../../../../core/pagination/pagination.service';
2525
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
26-
import { UUIDService } from '../../../../core/shared/uuid.service';
2726

2827
/**
2928
* Keys to keep track of specific subscriptions
@@ -102,15 +101,15 @@ export class MembersListComponent implements OnInit, OnDestroy {
102101
* Pagination config used to display the list of EPeople that are result of EPeople search
103102
*/
104103
configSearch: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
105-
id: this.uuidService.generate(),
104+
id: 'sml',
106105
pageSize: 5,
107106
currentPage: 1
108107
});
109108
/**
110109
* Pagination config used to display the list of EPerson Membes of active group being edited
111110
*/
112111
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
113-
id: this.uuidService.generate(),
112+
id: 'ml',
114113
pageSize: 5,
115114
currentPage: 1
116115
});
@@ -140,8 +139,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
140139
protected formBuilder: UntypedFormBuilder,
141140
protected paginationService: PaginationService,
142141
protected router: Router,
143-
public dsoNameService: DSONameService,
144-
protected uuidService: UUIDService
142+
public dsoNameService: DSONameService
145143
) {
146144
this.currentSearchQuery = '';
147145
}

src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ import { PaginationServiceStub } from '../../../../shared/testing/pagination-ser
3030
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
3131
import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock';
3232
import { EPersonMock2 } from 'src/app/shared/testing/eperson.mock';
33-
import { UUIDService } from '../../../../core/shared/uuid.service';
34-
import { getMockUUIDService } from '../../../../shared/mocks/uuid.service.mock';
3533

3634
describe('SubgroupsListComponent', () => {
3735
let component: SubgroupsListComponent;
@@ -146,7 +144,6 @@ describe('SubgroupsListComponent', () => {
146144
{ provide: FormBuilderService, useValue: builderService },
147145
{ provide: Router, useValue: routerStub },
148146
{ provide: PaginationService, useValue: paginationService },
149-
{ provide: UUIDService, useValue: getMockUUIDService() }
150147
],
151148
schemas: [NO_ERRORS_SCHEMA]
152149
}).compileComponents();

0 commit comments

Comments
 (0)