Skip to content

Commit a6c14e5

Browse files
author
Jens Vannerum
committed
Merge remote-tracking branch 'origin/main' into w2p-119612_export-item-limit
2 parents 8eaff78 + 28f865e commit a6c14e5

1,452 files changed

Lines changed: 203729 additions & 47735 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.

.eslintrc.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"eslint-plugin-rxjs",
1313
"eslint-plugin-simple-import-sort",
1414
"eslint-plugin-import-newlines",
15-
"eslint-plugin-jsonc",
1615
"dspace-angular-ts",
1716
"dspace-angular-html"
1817
],
@@ -294,18 +293,22 @@
294293
"rules": {
295294
// Custom DSpace Angular rules
296295
"dspace-angular-html/themed-component-usages": "error",
297-
"dspace-angular-html/no-disabled-attribute-on-button": "error"
296+
"dspace-angular-html/no-disabled-attribute-on-button": "error",
297+
"@angular-eslint/template/prefer-control-flow": "error"
298298
}
299299
},
300300
{
301301
"files": [
302302
"*.json5"
303303
],
304304
"extends": [
305-
"plugin:jsonc/recommended-with-jsonc"
305+
"plugin:jsonc/recommended-with-json5"
306306
],
307307
"rules": {
308-
"no-irregular-whitespace": "error",
308+
// The ESLint core no-irregular-whitespace rule doesn't work well in JSON
309+
// See: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html
310+
"no-irregular-whitespace": "off",
311+
"jsonc/no-irregular-whitespace": "error",
309312
"no-trailing-spaces": "error",
310313
"jsonc/comma-dangle": [
311314
"error",

.github/workflows/build.yml

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,84 @@ jobs:
190190
# Get homepage and verify that the <meta name="title"> tag includes "DSpace".
191191
# If it does, then SSR is working, as this tag is created by our MetadataService.
192192
# This step also prints entire HTML of homepage for easier debugging if grep fails.
193-
- name: Verify SSR (server-side rendering)
193+
- name: Verify SSR (server-side rendering) on Homepage
194194
run: |
195195
result=$(wget -O- -q http://127.0.0.1:4000/home)
196196
echo "$result"
197197
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DSpace
198198
199+
# Get a specific community in our test data and verify that the "<h1>" tag includes "Publications" (the community name).
200+
# If it does, then SSR is working.
201+
- name: Verify SSR on a Community page
202+
run: |
203+
result=$(wget -O- -q http://127.0.0.1:4000/communities/0958c910-2037-42a9-81c7-dca80e3892b4)
204+
echo "$result"
205+
echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Publications
206+
207+
# Get a specific collection in our test data and verify that the "<h1>" tag includes "Articles" (the collection name).
208+
# If it does, then SSR is working.
209+
- name: Verify SSR on a Collection page
210+
run: |
211+
result=$(wget -O- -q http://127.0.0.1:4000/collections/282164f5-d325-4740-8dd1-fa4d6d3e7200)
212+
echo "$result"
213+
echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Articles
214+
215+
# Get a specific publication in our test data and verify that the <meta name="title"> tag includes
216+
# the title of this publication. If it does, then SSR is working.
217+
- name: Verify SSR on a Publication page
218+
run: |
219+
result=$(wget -O- -q http://127.0.0.1:4000/entities/publication/6160810f-1e53-40db-81ef-f6621a727398)
220+
echo "$result"
221+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "An Economic Model of Mortality Salience"
222+
223+
# Get a specific person in our test data and verify that the <meta name="title"> tag includes
224+
# the name of the person. If it does, then SSR is working.
225+
- name: Verify SSR on a Person page
226+
run: |
227+
result=$(wget -O- -q http://127.0.0.1:4000/entities/person/b1b2c768-bda1-448a-a073-fc541e8b24d9)
228+
echo "$result"
229+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Simmons, Cameron"
230+
231+
# Get a specific project in our test data and verify that the <meta name="title"> tag includes
232+
# the name of the project. If it does, then SSR is working.
233+
- name: Verify SSR on a Project page
234+
run: |
235+
result=$(wget -O- -q http://127.0.0.1:4000/entities/project/46ccb608-a74c-4bf6-bc7a-e29cc7defea9)
236+
echo "$result"
237+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "University Research Fellowship"
238+
239+
# Get a specific orgunit in our test data and verify that the <meta name="title"> tag includes
240+
# the name of the orgunit. If it does, then SSR is working.
241+
- name: Verify SSR on an OrgUnit page
242+
run: |
243+
result=$(wget -O- -q http://127.0.0.1:4000/entities/orgunit/9851674d-bd9a-467b-8d84-068deb568ccf)
244+
echo "$result"
245+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Law and Development"
246+
247+
# Get a specific journal in our test data and verify that the <meta name="title"> tag includes
248+
# the name of the journal. If it does, then SSR is working.
249+
- name: Verify SSR on a Journal page
250+
run: |
251+
result=$(wget -O- -q http://127.0.0.1:4000/entities/journal/d4af6c3e-53d0-4757-81eb-566f3b45d63a)
252+
echo "$result"
253+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology"
254+
255+
# Get a specific journal volume in our test data and verify that the <meta name="title"> tag includes
256+
# the name of the volume. If it does, then SSR is working.
257+
- name: Verify SSR on a Journal Volume page
258+
run: |
259+
result=$(wget -O- -q http://127.0.0.1:4000/entities/journalvolume/07c6249f-4bf7-494d-9ce3-6ffdb2aed538)
260+
echo "$result"
261+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology Volume 28 (2017)"
262+
263+
# Get a specific journal issue in our test data and verify that the <meta name="title"> tag includes
264+
# the name of the issue. If it does, then SSR is working.
265+
- name: Verify SSR on a Journal Issue page
266+
run: |
267+
result=$(wget -O- -q http://127.0.0.1:4000/entities/journalissue/44c29473-5de2-48fa-b005-e5029aa1a50b)
268+
echo "$result"
269+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology Vol. 28, No. 1"
270+
199271
- name: Stop running app
200272
run: kill -9 $(lsof -t -i:4000)
201273

angular.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@
5858
"input": "src/themes/dspace/styles/theme.scss",
5959
"inject": false,
6060
"bundleName": "dspace-theme"
61-
}
61+
},
62+
"node_modules/leaflet/dist/leaflet.css",
63+
"node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css",
64+
"node_modules/leaflet.markercluster/dist/MarkerCluster.css"
6265
],
6366
"scripts": [],
6467
"baseHref": "/"

config/config.example.yml

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ ssr:
2424
# disabled (false) by default to boost server performance at the expense of loading smoothness.
2525
inlineCriticalCss: false
2626
# Path prefixes to enable SSR for. By default these are limited to paths of primary DSpace objects.
27-
paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/' ]
27+
# NOTE: The "/handle/" path ensures Handle redirects work via SSR. The "/reload/" path ensures
28+
# hard refreshes (e.g. after login) trigger SSR while fully reloading the page.
29+
paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/', '/reload/' ]
2830
# Whether to enable rendering of Search component on SSR.
2931
# If set to true the component will be included in the HTML returned from the server side rendering.
3032
# If set to false the component will not be included in the HTML returned from the server side rendering.
@@ -33,6 +35,19 @@ ssr:
3335
# If set to true the component will be included in the HTML returned from the server side rendering.
3436
# If set to false the component will not be included in the HTML returned from the server side rendering.
3537
enableBrowseComponent: false
38+
# Enable state transfer from the server-side application to the client-side application.
39+
# Defaults to true.
40+
# Note: When using an external application cache layer, it's recommended not to transfer the state to avoid caching it.
41+
# Disabling it ensures that dynamic state information is not inadvertently cached, which can improve security and
42+
# ensure that users always use the most up-to-date state.
43+
transferState: true
44+
# When a different REST base URL is used for the server-side application, the generated state contains references to
45+
# REST resources with the internal URL configured. By default, these internal URLs are replaced with public URLs.
46+
# Disable this setting to avoid URL replacement during SSR. In this the state is not transferred to avoid security issues.
47+
replaceRestUrl: true
48+
# Enable request performance profiling data collection and printing the results in the server console.
49+
# Defaults to false. Enabling in production is NOT recommended
50+
#enablePerformanceProfiler: false
3651

3752
# The REST API server settings
3853
# NOTE: these settings define which (publicly available) REST API to use. They are usually
@@ -43,6 +58,9 @@ rest:
4358
port: 443
4459
# NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
4560
nameSpace: /server
61+
# Provide a different REST url to be used during SSR execution. It must contain the whole url including protocol, server port and
62+
# server namespace (uncomment to use it).
63+
#ssrBaseUrl: http://localhost:8080/server
4664

4765
# Caching settings
4866
cache:
@@ -332,15 +350,25 @@ item:
332350
# Rounded to the nearest size in the list of selectable sizes on the
333351
# settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
334352
pageSize: 5
353+
# Show the bitstream access status label on the item page
354+
showAccessStatuses: false
335355

336356
# Community Page Config
337357
community:
358+
# Default tab to be shown when browsing a Community. Valid values are: comcols, search, or browse_<field>
359+
# <field> must be any of the configured "browse by" fields, e.g., dateissued, author, title, or subject
360+
# When the default tab is not the 'search' tab, the search tab is moved to the last position
361+
defaultBrowseTab: search
338362
# Search tab config
339363
searchSection:
340364
showSidebar: true
341365

342366
# Collection Page Config
343367
collection:
368+
# Default tab to be shown when browsing a Collection. Valid values are: search, or browse_<field>
369+
# <field> must be any of the configured "browse by" fields, e.g., dateissued, author, title, or subject
370+
# When the default tab is not the 'search' tab, the search tab is moved to the last position
371+
defaultBrowseTab: search
344372
# Search tab config
345373
searchSection:
346374
showSidebar: true
@@ -518,7 +546,6 @@ notifyMetrics:
518546
config: 'NOTIFY.outgoing.delivered'
519547
description: 'admin-notify-dashboard.NOTIFY.outgoing.delivered.description'
520548

521-
522549
# Live Region configuration
523550
# Live Region as defined by w3c, https://www.w3.org/TR/wai-aria-1.1/#terms:
524551
# Live regions are perceivable regions of a web page that are typically updated as a
@@ -532,3 +559,37 @@ liveRegion:
532559
messageTimeOutDurationMs: 30000
533560
# The visibility of the live region. Setting this to true is only useful for debugging purposes.
534561
isVisible: false
562+
563+
# Geospatial Map display options
564+
geospatialMapViewer:
565+
# Which fields to use for parsing as geospatial points in search maps
566+
# (note, the item page field component allows any field(s) to be used
567+
# and is set as an input when declaring the component)
568+
spatialMetadataFields:
569+
- 'dcterms.spatial'
570+
# Which discovery configuration to use for 'geospatial search', used
571+
# in the browse map
572+
spatialFacetDiscoveryConfiguration: 'geospatial'
573+
# Which filter / facet name to use for faceted geospatial search
574+
# used in the browse map
575+
spatialPointFilterName: 'point'
576+
# Whether item page geospatial metadata should be displayed
577+
# (assumes they are wrapped in a test for this config in the template as
578+
# per the default templates supplied with DSpace for untyped-item and publication)
579+
enableItemPageFields: false
580+
# Whether the browse map should be enabled and included in the browse menu
581+
enableBrowseMap: false
582+
# Whether a 'map view' mode should be included alongside list and grid views
583+
# in search result pages
584+
enableSearchViewMode: false
585+
# The tile provider(s) to use for the map tiles drawn in the leaflet maps.
586+
# (see https://leaflet-extras.github.io/leaflet-providers/preview/) for a full list
587+
tileProviders:
588+
- 'OpenStreetMap.Mapnik'
589+
# Starting centre point for the map, as lat and lng coordinates. This is useful
590+
# to set the centre of the map when the map is first loaded and if there are no
591+
# points, shapes or markers to display.
592+
# Defaults to the centre of Istanbul
593+
defaultCentrePoint:
594+
lat: 41.015137
595+
lng: 28.979530

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/e2e/community-list.cy.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ describe('Community List Page', () => {
1212
cy.get('[data-test="expand-button"]').click({ multiple: true });
1313

1414
// Analyze <ds-community-list-page> for accessibility issues
15-
testA11y('ds-community-list-page');
15+
testA11y('ds-community-list-page', {
16+
rules: {
17+
// When expanding a cdk node on the community-list page, the 'aria-posinset' property becomes 0.
18+
// 0 is not a valid value for 'aria-posinset' so the test fails.
19+
// see https://github.com/DSpace/dspace-angular/issues/4068
20+
'aria-valid-attr-value': { enabled: false },
21+
},
22+
});
1623
});
1724
});

cypress/e2e/item-statistics.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('Item Statistics Page', () => {
77
it('should load if you click on "Statistics" from an Item/Entity page', () => {
88
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
99
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
10-
cy.location('pathname').should('eq', ITEMSTATISTICSPAGE);
10+
cy.location('pathname').should('eq', '/statistics/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
1111
});
1212

1313
it('should contain element ds-item-statistics-page when navigating to an item statistics page', () => {

cypress/e2e/submission.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ describe('New Submission page', () => {
217217
});
218218

219219
// Close popup window
220-
cy.get('ds-dynamic-lookup-relation-modal button.close').click();
220+
cy.get('ds-dynamic-lookup-relation-modal button.btn-close').click();
221221

222222
// Back on the form, click the discard button to remove new submission
223223
// Clicking it will display a confirmation, which we will confirm with another click

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

docker/docker-compose-ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ services:
9393
volumes:
9494
# Keep Solr data directory between reboots
9595
- solr_data:/var/solr/data
96-
# Initialize all DSpace Solr cores using the mounted configsets (see above), then start Solr
96+
# NOTE: We are not running Solr as "root", but we need root permissions to copy our cores to the mounted
97+
# /var/solr/data directory. Then we start Solr as the "solr" user.
98+
user: root
99+
# Initialize all DSpace Solr cores, then start Solr
97100
entrypoint:
98101
- /bin/bash
99102
- '-c'
@@ -111,7 +114,8 @@ services:
111114
cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
112115
precreate-core suggestion /opt/solr/server/solr/configsets/suggestion
113116
cp -r /opt/solr/server/solr/configsets/suggestion/* suggestion
114-
exec solr -f
117+
chown -R solr:solr /var/solr
118+
runuser -u solr -- solr-foreground
115119
volumes:
116120
assetstore:
117121
pgdata:

0 commit comments

Comments
 (0)