Skip to content

Commit 3a80009

Browse files
Merge branch 'DSpace:main' into main
2 parents e737adb + 417f835 commit 3a80009

File tree

1,703 files changed

+209334
-40637
lines changed

Some content is hidden

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

1,703 files changed

+209334
-40637
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ trim_trailing_whitespace = false
1515

1616
[*.ts]
1717
quote_type = single
18+
ij_typescript_enforce_trailing_comma = whenmultiline
19+
20+
[*.js]
21+
ij_javascript_enforce_trailing_comma = whenmultiline
1822

1923
[*.json5]
2024
ij_json_keep_blank_lines_in_code = 3

.eslintrc.json

Lines changed: 48 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
],
@@ -161,6 +160,9 @@
161160
]
162161
}
163162
],
163+
"@angular-eslint/prefer-standalone": [
164+
"error"
165+
],
164166
"@angular-eslint/no-attribute-decorator": "error",
165167
"@angular-eslint/no-output-native": "warn",
166168
"@angular-eslint/no-output-on-prefix": "warn",
@@ -261,9 +263,48 @@
261263
"rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases
262264

263265
// Custom DSpace Angular rules
266+
"dspace-angular-ts/alias-imports": [
267+
"error",
268+
{
269+
"aliases": [
270+
{
271+
"package": "rxjs",
272+
"imported": "of",
273+
"local": "of"
274+
}
275+
]
276+
}
277+
],
264278
"dspace-angular-ts/themed-component-classes": "error",
265279
"dspace-angular-ts/themed-component-selectors": "error",
266-
"dspace-angular-ts/themed-component-usages": "error"
280+
"dspace-angular-ts/themed-component-usages": "error",
281+
"dspace-angular-ts/themed-decorators": [
282+
"off",
283+
{
284+
"decorators": {
285+
"listableObjectComponent": 3,
286+
"rendersSectionForMenu": 2
287+
}
288+
}
289+
],
290+
"dspace-angular-ts/themed-wrapper-no-input-defaults": "error",
291+
"dspace-angular-ts/unique-decorators": [
292+
"off",
293+
{
294+
"decorators": [
295+
"listableObjectComponent"
296+
]
297+
}
298+
],
299+
"dspace-angular-ts/sort-standalone-imports": [
300+
"error",
301+
{
302+
"locale": "en-US",
303+
"maxItems": 0,
304+
"indent": 2,
305+
"trailingComma": true
306+
}
307+
]
267308
}
268309
},
269310
{
@@ -303,10 +344,13 @@
303344
"*.json5"
304345
],
305346
"extends": [
306-
"plugin:jsonc/recommended-with-jsonc"
347+
"plugin:jsonc/recommended-with-json5"
307348
],
308349
"rules": {
309-
"no-irregular-whitespace": "error",
350+
// The ESLint core no-irregular-whitespace rule doesn't work well in JSON
351+
// See: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html
352+
"no-irregular-whitespace": "off",
353+
"jsonc/no-irregular-whitespace": "error",
310354
"no-trailing-spaces": "error",
311355
"jsonc/comma-dangle": [
312356
"error",

.github/dependabot.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ updates:
1313
directory: "/"
1414
schedule:
1515
interval: "weekly"
16+
time: "05:00"
1617
# Allow up to 10 open PRs for dependencies
1718
open-pull-requests-limit: 10
1819
# Group together Angular package upgrades
@@ -141,6 +142,99 @@ updates:
141142
update-types:
142143
- "minor"
143144
- "patch"
145+
# Restrict zone.js updates to patch level to avoid dependency conflicts with @angular/core
146+
zonejs:
147+
applies-to: version-updates
148+
patterns:
149+
- "zone.js"
150+
update-types:
151+
- "patch"
152+
ignore:
153+
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
154+
- dependency-name: "*"
155+
update-types: ["version-update:semver-major"]
156+
#####################
157+
## dspace-9_x branch
158+
#####################
159+
- package-ecosystem: "npm"
160+
directory: "/"
161+
target-branch: dspace-9_x
162+
schedule:
163+
interval: "weekly"
164+
time: "05:00"
165+
# Allow up to 10 open PRs for dependencies
166+
open-pull-requests-limit: 10
167+
# Group together Angular package upgrades
168+
groups:
169+
# Group together all patch version updates for Angular in a single PR
170+
angular:
171+
applies-to: version-updates
172+
patterns:
173+
- "@angular*"
174+
update-types:
175+
- "minor"
176+
- "patch"
177+
# Group together all minor/patch version updates for NgRx in a single PR
178+
ngrx:
179+
applies-to: version-updates
180+
patterns:
181+
- "@ngrx*"
182+
update-types:
183+
- "minor"
184+
- "patch"
185+
# Group together all patch version updates for eslint in a single PR
186+
eslint:
187+
applies-to: version-updates
188+
patterns:
189+
- "@typescript-eslint*"
190+
- "eslint*"
191+
update-types:
192+
- "minor"
193+
- "patch"
194+
# Group together any testing related version updates
195+
testing:
196+
applies-to: version-updates
197+
patterns:
198+
- "@cypress*"
199+
- "axe-*"
200+
- "cypress*"
201+
- "jasmine*"
202+
- "karma*"
203+
- "ng-mocks"
204+
update-types:
205+
- "minor"
206+
- "patch"
207+
# Group together any postcss related version updates
208+
postcss:
209+
applies-to: version-updates
210+
patterns:
211+
- "postcss*"
212+
update-types:
213+
- "minor"
214+
- "patch"
215+
# Group together any sass related version updates
216+
sass:
217+
applies-to: version-updates
218+
patterns:
219+
- "sass*"
220+
update-types:
221+
- "minor"
222+
- "patch"
223+
# Group together any webpack related version updates
224+
webpack:
225+
applies-to: version-updates
226+
patterns:
227+
- "webpack*"
228+
update-types:
229+
- "minor"
230+
- "patch"
231+
# Restrict zone.js updates to patch level to avoid dependency conflicts with @angular/core
232+
zonejs:
233+
applies-to: version-updates
234+
patterns:
235+
- "zone.js"
236+
update-types:
237+
- "patch"
144238
ignore:
145239
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
146240
- dependency-name: "*"
@@ -153,6 +247,7 @@ updates:
153247
target-branch: dspace-8_x
154248
schedule:
155249
interval: "weekly"
250+
time: "05:00"
156251
# Allow up to 10 open PRs for dependencies
157252
open-pull-requests-limit: 10
158253
# Group together Angular package upgrades
@@ -219,6 +314,13 @@ updates:
219314
update-types:
220315
- "minor"
221316
- "patch"
317+
# Restrict zone.js updates to patch level to avoid dependency conflicts with @angular/core
318+
zonejs:
319+
applies-to: version-updates
320+
patterns:
321+
- "zone.js"
322+
update-types:
323+
- "patch"
222324
ignore:
223325
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
224326
- dependency-name: "*"
@@ -231,6 +333,7 @@ updates:
231333
target-branch: dspace-7_x
232334
schedule:
233335
interval: "weekly"
336+
time: "05:00"
234337
# Allow up to 10 open PRs for dependencies
235338
open-pull-requests-limit: 10
236339
# Group together Angular package upgrades
@@ -289,6 +392,13 @@ updates:
289392
update-types:
290393
- "minor"
291394
- "patch"
395+
# Restrict zone.js updates to patch level to avoid dependency conflicts with @angular/core
396+
zonejs:
397+
applies-to: version-updates
398+
patterns:
399+
- "zone.js"
400+
update-types:
401+
- "patch"
292402
ignore:
293403
# 7.x Cannot update Webpack past v5.76.1 as later versions not supported by Angular 15
294404
# See also https://github.com/DSpace/dspace-angular/pull/3283#issuecomment-2372488489

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

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": "/"

0 commit comments

Comments
 (0)