Skip to content

Commit 65fa77e

Browse files
committed
Merge branch 'dspace-cris-2024_02_x' into task/dspace-cris-2024_02_x/DWS-111
2 parents e22f1c7 + c6a0d45 commit 65fa77e

310 files changed

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

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.
@@ -374,12 +388,20 @@ item:
374388

375389
# Community Page Config
376390
community:
391+
# Default tab to be shown when browsing a Community. Valid values are: comcols, search, or browse_<field>
392+
# <field> must be any of the configured "browse by" fields, e.g., dateissued, author, title, or subject
393+
# When the default tab is not the 'search' tab, the search tab is moved to the last position
394+
defaultBrowseTab: search
377395
# Search tab config
378396
searchSection:
379397
showSidebar: true
380398

381399
# Collection Page Config
382400
collection:
401+
# Default tab to be shown when browsing a Collection. Valid values are: search, or browse_<field>
402+
# <field> must be any of the configured "browse by" fields, e.g., dateissued, author, title, or subject
403+
# When the default tab is not the 'search' tab, the search tab is moved to the last position
404+
defaultBrowseTab: search
383405
# Search tab config
384406
searchSection:
385407
showSidebar: true
@@ -570,6 +592,11 @@ liveRegion:
570592
# The visibility of the live region. Setting this to true is only useful for debugging purposes.
571593
isVisible: false
572594

595+
# Configuration for storing accessibility settings, used by the AccessibilitySettingsService
596+
accessibility:
597+
# The duration in days after which the accessibility settings cookie expires
598+
cookieExpirationDuration: 7
599+
573600
# CRIS Layout
574601
# Configuration for CRIS Layout
575602
crisLayout:

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: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dspace-angular",
3-
"version": "2024.02.02-SNAPSHOT",
3+
"version": "2024.02.03-SNAPSHOT",
44
"scripts": {
55
"ng": "ng",
66
"config:watch": "nodemon",
@@ -88,8 +88,8 @@
8888
"@angular/platform-browser-dynamic": "^17.3.11",
8989
"@angular/platform-server": "^17.3.11",
9090
"@angular/router": "^17.3.11",
91-
"@angular/ssr": "^17.3.11",
92-
"@babel/runtime": "7.26.0",
91+
"@angular/ssr": "^17.3.17",
92+
"@babel/runtime": "7.27.6",
9393
"@datadog/browser-rum": "^5.7.0",
9494
"@kolkov/ngx-gallery": "^2.0.1",
9595
"@ng-bootstrap/ng-bootstrap": "^11.0.0",
@@ -103,16 +103,16 @@
103103
"@nicky-lenaers/ngx-scroll-to": "^14.0.0",
104104
"@swimlane/ngx-charts": "^20.4.1",
105105
"angular-idle-preload": "3.0.0",
106-
"angulartics2": "^12.2.1",
107-
"axios": "^1.7.9",
106+
"angulartics2": "^12.2.0",
107+
"axios": "^1.10.0",
108108
"bootstrap": "^4.6.1",
109109
"cerialize": "0.1.18",
110110
"cli-progress": "^3.12.0",
111111
"colors": "^1.4.0",
112-
"compression": "^1.7.5",
112+
"compression": "^1.8.0",
113113
"cookie-parser": "1.4.7",
114-
"core-js": "^3.40.0",
115-
"date-fns": "^2.30.0",
114+
"core-js": "^3.42.0",
115+
"date-fns": "^2.29.3",
116116
"date-fns-tz": "^1.3.7",
117117
"deepmerge": "^4.3.1",
118118
"domino-ext": "^2.1.4",
@@ -124,9 +124,9 @@
124124
"filesize": "^6.1.0",
125125
"font-awesome": "4.7.0",
126126
"html-to-image": "^1.10.8",
127-
"http-proxy-middleware": "^2.0.7",
127+
"http-proxy-middleware": "^2.0.9",
128128
"http-terminator": "^3.2.0",
129-
"isbot": "^5.1.21",
129+
"isbot": "^5.1.28",
130130
"js-cookie": "2.2.1",
131131
"js-yaml": "^4.1.0",
132132
"json5": "^2.2.3",
@@ -149,21 +149,21 @@
149149
"nouislider": "^15.8.1",
150150
"pem": "1.14.8",
151151
"reflect-metadata": "^0.2.2",
152-
"rxjs": "^7.8.0",
152+
"rxjs": "^7.8.2",
153153
"sanitize-html": "^2.14.0",
154154
"uuid": "^8.3.2",
155-
"zone.js": "~0.15.0"
155+
"zone.js": "~0.14.0"
156156
},
157157
"devDependencies": {
158158
"@angular-builders/custom-webpack": "~17.0.2",
159-
"@angular-devkit/build-angular": "^17.3.11",
159+
"@angular-devkit/build-angular": "^17.3.17",
160160
"@angular-eslint/builder": "17.5.3",
161161
"@angular-eslint/bundled-angular-compiler": "17.5.3",
162162
"@angular-eslint/eslint-plugin": "17.5.3",
163163
"@angular-eslint/eslint-plugin-template": "17.5.3",
164164
"@angular-eslint/schematics": "17.5.3",
165165
"@angular-eslint/template-parser": "17.5.3",
166-
"@angular/cli": "^17.3.11",
166+
"@angular/cli": "^17.3.17",
167167
"@angular/compiler-cli": "^17.3.11",
168168
"@angular/language-service": "^17.3.11",
169169
"@cypress/schematic": "^1.5.0",
@@ -179,21 +179,21 @@
179179
"@types/grecaptcha": "^3.0.9",
180180
"@types/jasmine": "~3.6.0",
181181
"@types/js-cookie": "2.2.6",
182-
"@types/lodash": "^4.17.14",
183-
"@types/node": "^14.18.63",
182+
"@types/lodash": "^4.17.17",
183+
"@types/node": "^14.14.9",
184184
"@types/sanitize-html": "^2.13.0",
185185
"@typescript-eslint/eslint-plugin": "^7.2.0",
186186
"@typescript-eslint/parser": "^7.2.0",
187187
"@typescript-eslint/rule-tester": "^7.2.0",
188188
"@typescript-eslint/utils": "^7.2.0",
189-
"axe-core": "^4.10.2",
189+
"axe-core": "^4.10.3",
190190
"browser-sync": "^3.0.0",
191191
"compression-webpack-plugin": "^9.2.0",
192192
"copy-webpack-plugin": "^6.4.1",
193193
"cross-env": "^7.0.3",
194194
"csstype": "^3.1.3",
195195
"cypress": "^13.17.0",
196-
"cypress-axe": "^1.5.0",
196+
"cypress-axe": "^1.6.0",
197197
"deep-freeze": "0.0.1",
198198
"eslint": "^8.39.0",
199199
"eslint-plugin-deprecation": "^1.5.0",
@@ -202,7 +202,7 @@
202202
"eslint-plugin-import": "^2.31.0",
203203
"eslint-plugin-import-newlines": "^1.3.1",
204204
"eslint-plugin-jsdoc": "^45.0.0",
205-
"eslint-plugin-jsonc": "^2.18.2",
205+
"eslint-plugin-jsonc": "^2.20.1",
206206
"eslint-plugin-lodash": "^7.4.0",
207207
"eslint-plugin-rxjs": "^5.0.3",
208208
"eslint-plugin-simple-import-sort": "^10.0.0",
@@ -217,7 +217,7 @@
217217
"karma-jasmine": "~4.0.0",
218218
"karma-jasmine-html-reporter": "^1.5.0",
219219
"karma-mocha-reporter": "2.2.5",
220-
"ng-mocks": "^14.13.2",
220+
"ng-mocks": "^14.13.5",
221221
"ngx-export-as": "~1.15.1",
222222
"ngx-mask": "14.2.4",
223223
"nodemon": "^2.0.22",
@@ -230,12 +230,12 @@
230230
"react-copy-to-clipboard": "^5.1.0",
231231
"react-dom": "^16.14.0",
232232
"rimraf": "^3.0.2",
233-
"sass": "~1.83.4",
233+
"sass": "~1.89.2",
234234
"sass-loader": "^12.6.0",
235235
"sass-resources-loader": "^2.2.5",
236236
"ts-node": "^8.10.2",
237237
"typescript": "~5.4.5",
238-
"webpack": "5.97.1",
238+
"webpack": "5.99.9",
239239
"webpack-cli": "^5.1.4",
240240
"webpack-dev-server": "^4.15.2"
241241
}

0 commit comments

Comments
 (0)