Skip to content

Commit dbb57ab

Browse files
authored
Merge pull request #93 from umd-lib/feature/LIBDRUM-994
LIBDRUM-994. Upgrade to DSpace 8.2. https://umd-dit.atlassian.net/browse/LIBDRUM-994
2 parents bc06a7d + 504560f commit dbb57ab

300 files changed

Lines changed: 154233 additions & 23874 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: 5 additions & 3 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
],
@@ -302,10 +301,13 @@
302301
"*.json5"
303302
],
304303
"extends": [
305-
"plugin:jsonc/recommended-with-jsonc"
304+
"plugin:jsonc/recommended-with-json5"
306305
],
307306
"rules": {
308-
"no-irregular-whitespace": "error",
307+
// The ESLint core no-irregular-whitespace rule doesn't work well in JSON
308+
// See: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html
309+
"no-irregular-whitespace": "off",
310+
"jsonc/no-irregular-whitespace": "error",
309311
"no-trailing-spaces": "error",
310312
"jsonc/comma-dangle": [
311313
"error",

.github/workflows/build.yml

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
DSPACE_CACHE_SERVERSIDE_ANONYMOUSCACHE_MAX: 0
3030
# Tell Cypress to run e2e tests using the same UI URL
3131
CYPRESS_BASE_URL: http://127.0.0.1:4000
32+
# Disable the cookie consent banner in e2e tests to avoid errors because of elements hidden by it
33+
DSPACE_INFO_ENABLECOOKIECONSENTPOPUP: false
3234
# When Chrome version is specified, we pin to a specific version of Chrome
3335
# Comment this out to use the latest release
3436
#CHROME_VERSION: "90.0.4430.212-1"
@@ -195,13 +197,116 @@ jobs:
195197
# Get homepage and verify that the <meta name="title"> tag includes "DSpace".
196198
# If it does, then SSR is working, as this tag is created by our MetadataService.
197199
# This step also prints entire HTML of homepage for easier debugging if grep fails.
198-
- name: Verify SSR (server-side rendering)
200+
- name: Verify SSR (server-side rendering) on Homepage
199201
run: |
200202
result=$(wget -O- -q http://127.0.0.1:4000/home)
201203
echo "$result"
202204
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DRUM
203205
# End UMD Customization
204206

207+
# Get a specific community in our test data and verify that the "<h1>" tag includes "Publications" (the community name).
208+
# If it does, then SSR is working.
209+
- name: Verify SSR on a Community page
210+
run: |
211+
result=$(wget -O- -q http://127.0.0.1:4000/communities/0958c910-2037-42a9-81c7-dca80e3892b4)
212+
echo "$result"
213+
echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Publications
214+
215+
# Get a specific collection in our test data and verify that the "<h1>" tag includes "Articles" (the collection name).
216+
# If it does, then SSR is working.
217+
- name: Verify SSR on a Collection page
218+
run: |
219+
result=$(wget -O- -q http://127.0.0.1:4000/collections/282164f5-d325-4740-8dd1-fa4d6d3e7200)
220+
echo "$result"
221+
echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Articles
222+
223+
# Get a specific publication in our test data and verify that the <meta name="title"> tag includes
224+
# the title of this publication. If it does, then SSR is working.
225+
- name: Verify SSR on a Publication page
226+
run: |
227+
result=$(wget -O- -q http://127.0.0.1:4000/entities/publication/6160810f-1e53-40db-81ef-f6621a727398)
228+
echo "$result"
229+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "An Economic Model of Mortality Salience"
230+
231+
# Get a specific person in our test data and verify that the <meta name="title"> tag includes
232+
# the name of the person. If it does, then SSR is working.
233+
- name: Verify SSR on a Person page
234+
run: |
235+
result=$(wget -O- -q http://127.0.0.1:4000/entities/person/b1b2c768-bda1-448a-a073-fc541e8b24d9)
236+
echo "$result"
237+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Simmons, Cameron"
238+
239+
# Get a specific project in our test data and verify that the <meta name="title"> tag includes
240+
# the name of the project. If it does, then SSR is working.
241+
- name: Verify SSR on a Project page
242+
run: |
243+
result=$(wget -O- -q http://127.0.0.1:4000/entities/project/46ccb608-a74c-4bf6-bc7a-e29cc7defea9)
244+
echo "$result"
245+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "University Research Fellowship"
246+
247+
# Get a specific orgunit in our test data and verify that the <meta name="title"> tag includes
248+
# the name of the orgunit. If it does, then SSR is working.
249+
- name: Verify SSR on an OrgUnit page
250+
run: |
251+
result=$(wget -O- -q http://127.0.0.1:4000/entities/orgunit/9851674d-bd9a-467b-8d84-068deb568ccf)
252+
echo "$result"
253+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Law and Development"
254+
255+
# Get a specific journal in our test data and verify that the <meta name="title"> tag includes
256+
# the name of the journal. If it does, then SSR is working.
257+
- name: Verify SSR on a Journal page
258+
run: |
259+
result=$(wget -O- -q http://127.0.0.1:4000/entities/journal/d4af6c3e-53d0-4757-81eb-566f3b45d63a)
260+
echo "$result"
261+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology"
262+
263+
# Get a specific journal volume in our test data and verify that the <meta name="title"> tag includes
264+
# the name of the volume. If it does, then SSR is working.
265+
- name: Verify SSR on a Journal Volume page
266+
run: |
267+
result=$(wget -O- -q http://127.0.0.1:4000/entities/journalvolume/07c6249f-4bf7-494d-9ce3-6ffdb2aed538)
268+
echo "$result"
269+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology Volume 28 (2017)"
270+
271+
# Get a specific journal issue in our test data and verify that the <meta name="title"> tag includes
272+
# the name of the issue. If it does, then SSR is working.
273+
- name: Verify SSR on a Journal Issue page
274+
run: |
275+
result=$(wget -O- -q http://127.0.0.1:4000/entities/journalissue/44c29473-5de2-48fa-b005-e5029aa1a50b)
276+
echo "$result"
277+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology Vol. 28, No. 1"
278+
279+
# Verify 301 Handle redirect behavior
280+
# Note: /handle/123456789/260 is the same test Publication used by our e2e tests
281+
- name: Verify 301 redirect from '/handle' URLs
282+
run: |
283+
result=$(wget --server-response --quiet http://127.0.0.1:4000/handle/123456789/260 2>&1 | head -1 | awk '{print $2}')
284+
echo "$result"
285+
[[ "$result" -eq "301" ]]
286+
287+
# Verify 403 error code behavior
288+
- name: Verify 403 error code from '/403'
289+
run: |
290+
result=$(wget --server-response --quiet http://127.0.0.1:4000/403 2>&1 | head -1 | awk '{print $2}')
291+
echo "$result"
292+
[[ "$result" -eq "403" ]]
293+
294+
# Verify 404 error code behavior
295+
- name: Verify 404 error code from '/404' and on invalid pages
296+
run: |
297+
result=$(wget --server-response --quiet http://127.0.0.1:4000/404 2>&1 | head -1 | awk '{print $2}')
298+
echo "$result"
299+
result2=$(wget --server-response --quiet http://127.0.0.1:4000/invalidurl 2>&1 | head -1 | awk '{print $2}')
300+
echo "$result2"
301+
[[ "$result" -eq "404" && "$result2" -eq "404" ]]
302+
303+
# Verify 500 error code behavior
304+
- name: Verify 500 error code from '/500'
305+
run: |
306+
result=$(wget --server-response --quiet http://127.0.0.1:4000/500 2>&1 | head -1 | awk '{print $2}')
307+
echo "$result"
308+
[[ "$result" -eq "500" ]]
309+
205310
- name: Stop running app
206311
run: kill -9 $(lsof -t -i:4000)
207312

config/config.example.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,24 @@ ssr:
2323
# Determining which styles are critical is a relatively expensive operation; this option is
2424
# disabled (false) by default to boost server performance at the expense of loading smoothness.
2525
inlineCriticalCss: false
26-
# Path prefixes to enable SSR for. By default these are limited to paths of primary DSpace objects.
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/' ]
26+
# Patterns to be run as regexes against the path of the page to check if SSR is allowed.
27+
# If the path match any of the regexes it will be served directly in CSR.
28+
# By default, excludes community and collection browse, global browse, global search, community list, statistics and various administrative tools.
29+
excludePathPatterns:
30+
- pattern: "^/communities/[a-f0-9-]{36}/browse(/.*)?$"
31+
flag: "i"
32+
- pattern: "^/collections/[a-f0-9-]{36}/browse(/.*)?$"
33+
flag: "i"
34+
- pattern: "^/browse/"
35+
- pattern: "^/search$"
36+
- pattern: "^/community-list$"
37+
- pattern: "^/admin/"
38+
- pattern: "^/processes/?"
39+
- pattern: "^/notifications/"
40+
- pattern: "^/statistics/?"
41+
- pattern: "^/access-control/"
42+
- pattern: "^/health$"
43+
3044
# Whether to enable rendering of Search component on SSR.
3145
# If set to true the component will be included in the HTML returned from the server side rendering.
3246
# If set to false the component will not be included in the HTML returned from the server side rendering.
@@ -353,12 +367,20 @@ item:
353367

354368
# Community Page Config
355369
community:
370+
# Default tab to be shown when browsing a Community. Valid values are: comcols, search, or browse_<field>
371+
# <field> must be any of the configured "browse by" fields, e.g., dateissued, author, title, or subject
372+
# When the default tab is not the 'search' tab, the search tab is moved to the last position
373+
defaultBrowseTab: search
356374
# Search tab config
357375
searchSection:
358376
showSidebar: true
359377

360378
# Collection Page Config
361379
collection:
380+
# Default tab to be shown when browsing a Collection. Valid values are: search, or browse_<field>
381+
# <field> must be any of the configured "browse by" fields, e.g., dateissued, author, title, or subject
382+
# When the default tab is not the 'search' tab, the search tab is moved to the last position
383+
defaultBrowseTab: search
362384
# Search tab config
363385
searchSection:
364386
showSidebar: true
@@ -550,3 +572,8 @@ liveRegion:
550572
messageTimeOutDurationMs: 30000
551573
# The visibility of the live region. Setting this to true is only useful for debugging purposes.
552574
isVisible: false
575+
576+
# Configuration for storing accessibility settings, used by the AccessibilitySettingsService
577+
accessibility:
578+
# The duration in days after which the accessibility settings cookie expires
579+
cookieExpirationDuration: 7

cypress/e2e/header.cy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ describe('Header', () => {
1515
cy.visit('/');
1616

1717
// Click the language switcher (globe) in header
18-
cy.get('a[data-test="lang-switch"]').click();
18+
cy.get('button[data-test="lang-switch"]').click();
1919
// Click on the "Deusch" language in dropdown
20-
cy.get('#language-menu-list li').contains('Deutsch').click();
20+
cy.get('#language-menu-list div[role="option"]').contains('Deutsch').click();
2121

2222
// HTML "lang" attribute should switch to "de"
2323
cy.get('html').invoke('attr', 'lang').should('eq', 'de');
2424

2525
// Login menu should now be in German
26-
cy.get('a[data-test="login-menu"]').contains('Anmelden');
26+
cy.get('[data-test="login-menu"]').contains('Anmelden');
2727

2828
// Change back to English from language switcher
29-
cy.get('a[data-test="lang-switch"]').click();
30-
cy.get('#language-menu-list li').contains('English').click();
29+
cy.get('button[data-test="lang-switch"]').click();
30+
cy.get('#language-menu-list div[role="option"]').contains('English').click();
3131

3232
// HTML "lang" attribute should switch to "en"
3333
cy.get('html').invoke('attr', 'lang').should('eq', 'en');
3434

3535
// Login menu should now be in English
36-
cy.get('a[data-test="login-menu"]').contains('Log In');
36+
cy.get('[data-test="login-menu"]').contains('Log In');
3737
});
3838
});

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dspace-angular",
3-
"version": "8.1.0",
3+
"version": "8.2.0",
44
"scripts": {
55
"ng": "ng",
66
"config:watch": "nodemon",
@@ -66,8 +66,8 @@
6666
"@angular/platform-browser-dynamic": "^17.3.11",
6767
"@angular/platform-server": "^17.3.11",
6868
"@angular/router": "^17.3.11",
69-
"@angular/ssr": "^17.3.11",
70-
"@babel/runtime": "7.26.0",
69+
"@angular/ssr": "^17.3.17",
70+
"@babel/runtime": "7.27.6",
7171
"@kolkov/ngx-gallery": "^2.0.1",
7272
"@ng-bootstrap/ng-bootstrap": "^11.0.0",
7373
"@ng-dynamic-forms/core": "^16.0.0",
@@ -78,14 +78,14 @@
7878
"@ngx-translate/core": "^14.0.0",
7979
"@nicky-lenaers/ngx-scroll-to": "^14.0.0",
8080
"angulartics2": "^12.2.0",
81-
"axios": "^1.7.9",
81+
"axios": "^1.10.0",
8282
"bootstrap": "^4.6.1",
8383
"cerialize": "0.1.18",
8484
"cli-progress": "^3.12.0",
8585
"colors": "^1.4.0",
86-
"compression": "^1.7.5",
86+
"compression": "^1.8.0",
8787
"cookie-parser": "1.4.7",
88-
"core-js": "^3.40.0",
88+
"core-js": "^3.42.0",
8989
"date-fns": "^2.29.3",
9090
"date-fns-tz": "^1.3.7",
9191
"deepmerge": "^4.3.1",
@@ -94,9 +94,9 @@
9494
"express-rate-limit": "^5.1.3",
9595
"fast-json-patch": "^3.1.1",
9696
"filesize": "^6.1.0",
97-
"http-proxy-middleware": "^2.0.7",
97+
"http-proxy-middleware": "^2.0.9",
9898
"http-terminator": "^3.2.0",
99-
"isbot": "^5.1.21",
99+
"isbot": "^5.1.28",
100100
"js-cookie": "2.2.1",
101101
"js-yaml": "^4.1.0",
102102
"json5": "^2.2.3",
@@ -120,20 +120,20 @@
120120
"nouislider": "^15.7.1",
121121
"pem": "1.14.8",
122122
"reflect-metadata": "^0.2.2",
123-
"rxjs": "^7.8.0",
123+
"rxjs": "^7.8.2",
124124
"uuid": "^8.3.2",
125-
"zone.js": "~0.15.0"
125+
"zone.js": "~0.14.0"
126126
},
127127
"devDependencies": {
128128
"@angular-builders/custom-webpack": "~17.0.2",
129-
"@angular-devkit/build-angular": "^17.3.11",
129+
"@angular-devkit/build-angular": "^17.3.17",
130130
"@angular-eslint/builder": "17.5.3",
131131
"@angular-eslint/bundled-angular-compiler": "17.5.3",
132132
"@angular-eslint/eslint-plugin": "17.5.3",
133133
"@angular-eslint/eslint-plugin-template": "17.5.3",
134134
"@angular-eslint/schematics": "17.5.3",
135135
"@angular-eslint/template-parser": "17.5.3",
136-
"@angular/cli": "^17.3.11",
136+
"@angular/cli": "^17.3.17",
137137
"@angular/compiler-cli": "^17.3.11",
138138
"@angular/language-service": "^17.3.11",
139139
"@cypress/schematic": "^1.5.0",
@@ -148,19 +148,19 @@
148148
"@types/grecaptcha": "^3.0.9",
149149
"@types/jasmine": "~3.6.0",
150150
"@types/js-cookie": "2.2.6",
151-
"@types/lodash": "^4.17.14",
151+
"@types/lodash": "^4.17.17",
152152
"@types/node": "^14.14.9",
153153
"@typescript-eslint/eslint-plugin": "^7.2.0",
154154
"@typescript-eslint/parser": "^7.2.0",
155155
"@typescript-eslint/rule-tester": "^7.2.0",
156156
"@typescript-eslint/utils": "^7.2.0",
157-
"axe-core": "^4.10.2",
157+
"axe-core": "^4.10.3",
158158
"compression-webpack-plugin": "^9.2.0",
159159
"copy-webpack-plugin": "^6.4.1",
160160
"cross-env": "^7.0.3",
161161
"csstype": "^3.1.3",
162162
"cypress": "^13.17.0",
163-
"cypress-axe": "^1.5.0",
163+
"cypress-axe": "^1.6.0",
164164
"deep-freeze": "0.0.1",
165165
"eslint": "^8.39.0",
166166
"eslint-plugin-deprecation": "^1.4.1",
@@ -169,7 +169,7 @@
169169
"eslint-plugin-import": "^2.31.0",
170170
"eslint-plugin-import-newlines": "^1.3.1",
171171
"eslint-plugin-jsdoc": "^45.0.0",
172-
"eslint-plugin-jsonc": "^2.18.2",
172+
"eslint-plugin-jsonc": "^2.20.1",
173173
"eslint-plugin-lodash": "^7.4.0",
174174
"eslint-plugin-rxjs": "^5.0.3",
175175
"eslint-plugin-simple-import-sort": "^10.0.0",
@@ -184,7 +184,7 @@
184184
"karma-jasmine": "~4.0.0",
185185
"karma-jasmine-html-reporter": "^1.5.0",
186186
"karma-mocha-reporter": "2.2.5",
187-
"ng-mocks": "^14.13.2",
187+
"ng-mocks": "^14.13.5",
188188
"ngx-mask": "14.2.4",
189189
"nodemon": "^2.0.22",
190190
"postcss": "^8.5",
@@ -196,12 +196,12 @@
196196
"react-copy-to-clipboard": "^5.1.0",
197197
"react-dom": "^16.14.0",
198198
"rimraf": "^3.0.2",
199-
"sass": "~1.83.4",
199+
"sass": "~1.89.2",
200200
"sass-loader": "^12.6.0",
201201
"sass-resources-loader": "^2.2.5",
202202
"ts-node": "^8.10.2",
203203
"typescript": "~5.4.5",
204-
"webpack": "5.97.1",
204+
"webpack": "5.99.9",
205205
"webpack-cli": "^5.1.4",
206206
"webpack-dev-server": "^4.15.1"
207207
}

0 commit comments

Comments
 (0)