Skip to content

Commit fa92395

Browse files
author
abhinav
committed
Merge branch 'dspace-9_x' into cache-bust-dynamic-configuration-9.0
2 parents 2b8a223 + f0d422e commit fa92395

File tree

2,134 files changed

+258518
-53453
lines changed

Some content is hidden

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

2,134 files changed

+258518
-53453
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: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
"@angular-eslint/eslint-plugin",
66
"eslint-plugin-import",
77
"eslint-plugin-jsdoc",
8-
"eslint-plugin-deprecation",
98
"unused-imports",
109
"eslint-plugin-lodash",
1110
"eslint-plugin-jsonc",
12-
"eslint-plugin-rxjs",
11+
"@smarttools/rxjs",
1312
"eslint-plugin-simple-import-sort",
1413
"eslint-plugin-import-newlines",
15-
"eslint-plugin-jsonc",
14+
"@stylistic",
1615
"dspace-angular-ts",
1716
"dspace-angular-html"
1817
],
@@ -38,7 +37,7 @@
3837
"plugin:@typescript-eslint/recommended-requiring-type-checking",
3938
"plugin:@angular-eslint/recommended",
4039
"plugin:@angular-eslint/template/process-inline-templates",
41-
"plugin:rxjs/recommended"
40+
"plugin:@smarttools/rxjs/recommended-legacy"
4241
],
4342
"rules": {
4443
"indent": [
@@ -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",
@@ -173,15 +175,16 @@
173175
"ignoreParameters": true
174176
}
175177
],
176-
"@typescript-eslint/quotes": [
178+
"@angular-eslint/prefer-inject": "off",
179+
"@stylistic/quotes": [
177180
"error",
178181
"single",
179182
{
180183
"avoidEscape": true,
181184
"allowTemplateLiterals": true
182185
}
183186
],
184-
"@typescript-eslint/semi": "error",
187+
"@stylistic/semi": "error",
185188
"@typescript-eslint/no-shadow": "error",
186189
"@typescript-eslint/dot-notation": "error",
187190
"@typescript-eslint/consistent-type-definitions": "error",
@@ -204,9 +207,9 @@
204207
]
205208
}
206209
],
207-
"@typescript-eslint/type-annotation-spacing": "error",
210+
"@stylistic/type-annotation-spacing": "error",
208211
"@typescript-eslint/unified-signatures": "error",
209-
"@typescript-eslint/ban-types": "error",
212+
"@typescript-eslint/no-restricted-types": "error",
210213
"@typescript-eslint/no-floating-promises": "warn",
211214
"@typescript-eslint/no-misused-promises": "warn",
212215
"@typescript-eslint/restrict-plus-operands": "warn",
@@ -221,6 +224,7 @@
221224
"@typescript-eslint/no-unsafe-call": "off",
222225
"@typescript-eslint/no-unsafe-argument": "off",
223226
"@typescript-eslint/no-unsafe-return": "off",
227+
"@typescript-eslint/no-redundant-type-constituents": "off",
224228
"@typescript-eslint/restrict-template-expressions": "off",
225229
"@typescript-eslint/require-await": "off",
226230
"@typescript-eslint/no-base-to-string": [
@@ -233,7 +237,7 @@
233237
}
234238
],
235239

236-
"deprecation/deprecation": "warn",
240+
"@typescript-eslint/no-deprecated": "warn",
237241

238242
"simple-import-sort/imports": "error",
239243
"simple-import-sort/exports": "error",
@@ -251,19 +255,62 @@
251255
"forceSingleLine": true
252256
}
253257
],
258+
"import/enforce-node-protocol-usage": [
259+
"error",
260+
"always"
261+
],
254262

255263
"unused-imports/no-unused-imports": "error",
256264
"lodash/import-scope": [
257265
"error",
258266
"method"
259267
],
260268

261-
"rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases
269+
"@smarttools/rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases
262270

263271
// Custom DSpace Angular rules
264-
"dspace-angular-ts/themed-component-classes": "error",
272+
"dspace-angular-ts/alias-imports": [
273+
"error",
274+
{
275+
"aliases": [
276+
{
277+
"package": "rxjs",
278+
"imported": "of",
279+
"local": "of"
280+
}
281+
]
282+
}
283+
],
284+
"dspace-angular-ts/no-default-standalone-value": "error",
265285
"dspace-angular-ts/themed-component-selectors": "error",
266-
"dspace-angular-ts/themed-component-usages": "error"
286+
"dspace-angular-ts/themed-component-usages": "error",
287+
"dspace-angular-ts/themed-decorators": [
288+
"off",
289+
{
290+
"decorators": {
291+
"listableObjectComponent": 3,
292+
"rendersSectionForMenu": 2
293+
}
294+
}
295+
],
296+
"dspace-angular-ts/themed-wrapper-no-input-defaults": "error",
297+
"dspace-angular-ts/unique-decorators": [
298+
"off",
299+
{
300+
"decorators": [
301+
"listableObjectComponent"
302+
]
303+
}
304+
],
305+
"dspace-angular-ts/sort-standalone-imports": [
306+
"error",
307+
{
308+
"locale": "en-US",
309+
"maxItems": 0,
310+
"indent": 2,
311+
"trailingComma": true
312+
}
313+
]
267314
}
268315
},
269316
{
@@ -303,10 +350,13 @@
303350
"*.json5"
304351
],
305352
"extends": [
306-
"plugin:jsonc/recommended-with-jsonc"
353+
"plugin:jsonc/recommended-with-json5"
307354
],
308355
"rules": {
309-
"no-irregular-whitespace": "error",
356+
// The ESLint core no-irregular-whitespace rule doesn't work well in JSON
357+
// See: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html
358+
"no-irregular-whitespace": "off",
359+
"jsonc/no-irregular-whitespace": "error",
310360
"no-trailing-spaces": "error",
311361
"jsonc/comma-dangle": [
312362
"error",

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ However, reviewers may request that you complete any actions in this list if you
2525
- [ ] My PR **doesn't introduce circular dependencies** (verified via `npm run check-circ-deps`)
2626
- [ ] My PR **includes [TypeDoc](https://typedoc.org/) comments** for _all new (or modified) public methods and classes_. It also includes TypeDoc for large or complex private methods.
2727
- [ ] My PR **passes all specs/tests and includes new/updated specs or tests** based on the [Code Testing Guide](https://wiki.lyrasis.org/display/DSPACE/Code+Testing+Guide).
28-
- [ ] My PR **aligns with [Accessibility guidelines](https://wiki.lyrasis.org/display/DSDOC8x/Accessibility)** if it makes changes to the user interface.
28+
- [ ] My PR **aligns with [Accessibility guidelines](https://wiki.lyrasis.org/display/DSDOC9x/Accessibility)** if it makes changes to the user interface.
2929
- [ ] My PR **uses i18n (internationalization) keys** instead of hardcoded English text, to allow for translations.
3030
- [ ] My PR **includes details on how to test it**. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
3131
- [ ] If my PR includes new libraries/dependencies (in `package.json`), I've made sure their licenses align with the [DSpace BSD License](https://github.com/DSpace/DSpace/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation.

.github/workflows/build.yml

Lines changed: 109 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ jobs:
2121
DSPACE_REST_PORT: 8080
2222
DSPACE_REST_NAMESPACE: '/server'
2323
DSPACE_REST_SSL: false
24-
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 18+
24+
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 20+
2525
DSPACE_UI_HOST: 127.0.0.1
2626
DSPACE_UI_PORT: 4000
2727
# Ensure all SSR caching is disabled in test environment
2828
DSPACE_CACHE_SERVERSIDE_BOTCACHE_MAX: 0
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"
@@ -42,7 +44,7 @@ jobs:
4244
strategy:
4345
# Create a matrix of Node versions to test against (in parallel)
4446
matrix:
45-
node-version: [18.x, 20.x]
47+
node-version: [20.x, 22.x]
4648
# Do NOT exit immediately if one matrix job fails
4749
fail-fast: false
4850
# These are the actual CI steps to perform per job
@@ -112,7 +114,7 @@ jobs:
112114
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
113115
- name: Upload code coverage report to Artifact
114116
uses: actions/upload-artifact@v4
115-
if: matrix.node-version == '18.x'
117+
if: matrix.node-version == '20.x'
116118
with:
117119
name: coverage-report-${{ matrix.node-version }}
118120
path: 'coverage/dspace-angular/lcov.info'
@@ -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

.github/workflows/codescan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040
# Initializes the CodeQL tools for scanning.
4141
# https://github.com/github/codeql-action
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v2
43+
uses: github/codeql-action/init@v3
4444
with:
4545
languages: javascript
4646

4747
# Autobuild attempts to build any compiled languages
4848
- name: Autobuild
49-
uses: github/codeql-action/autobuild@v2
49+
uses: github/codeql-action/autobuild@v3
5050

5151
# Perform GitHub Code Scanning.
5252
- name: Perform CodeQL Analysis
53-
uses: github/codeql-action/analyze@v2
53+
uses: github/codeql-action/analyze@v3

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ DSpace is a community built and supported project. We do not have a centralized
1010
## Contribute new code via a Pull Request
1111

1212
We accept [GitHub Pull Requests (PRs)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) at any time from anyone.
13-
Contributors to each release are recognized in our [Release Notes](https://wiki.lyrasis.org/display/DSDOC8x/Release+Notes).
13+
Contributors to each release are recognized in our [Release Notes](https://wiki.lyrasis.org/display/DSDOC9x/Release+Notes).
1414

1515
Code Contribution Checklist
1616
- [ ] PRs _should_ be smaller in size (ideally less than 1,000 lines of code, not including comments & tests)
1717
- [ ] PRs **must** pass [ESLint](https://eslint.org/) validation using `yarn lint`
1818
- [ ] PRs **must** not introduce circular dependencies (verified via `yarn check-circ-deps`)
1919
- [ ] PRs **must** include [TypeDoc](https://typedoc.org/) comments for _all new (or modified) public methods and classes_. Large or complex private methods should also have TypeDoc.
2020
- [ ] PRs **must** pass all automated pecs/tests and includes new/updated specs or tests based on the [Code Testing Guide](https://wiki.lyrasis.org/display/DSPACE/Code+Testing+Guide).
21-
- [ ] User interface changes **must** align with [Accessibility guidelines](https://wiki.lyrasis.org/display/DSDOC8x/Accessibility)
21+
- [ ] User interface changes **must** align with [Accessibility guidelines](https://wiki.lyrasis.org/display/DSDOC9x/Accessibility)
2222
- [ ] PRs **must** use i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
2323
- [ ] Details on how to test the PR **must** be provided. Reviewers must be aware of any steps they need to take to successfully test your fix or feature.
2424
- [ ] If a PR includes new libraries/dependencies (in `package.json`), then their software licenses **must** align with the [DSpace BSD License](https://github.com/DSpace/dspace-angular/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This image will be published as dspace/dspace-angular
22
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
33

4-
FROM docker.io/node:18-alpine
4+
FROM docker.io/node:20-alpine
55

66
# Ensure Python and other build tools are available
77
# These are needed to install some node modules, especially on linux/arm64

0 commit comments

Comments
 (0)