Skip to content

Commit 940f2aa

Browse files
committed
Merge branch 'main' into w2p-130443_combined-themed-components
2 parents 6349cd1 + c158311 commit 940f2aa

File tree

1,574 files changed

+25223
-12520
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,574 files changed

+25223
-12520
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: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@
160160
]
161161
}
162162
],
163+
"@angular-eslint/prefer-standalone": [
164+
"error"
165+
],
163166
"@angular-eslint/no-attribute-decorator": "error",
164167
"@angular-eslint/no-output-native": "warn",
165168
"@angular-eslint/no-output-on-prefix": "warn",
@@ -260,9 +263,48 @@
260263
"rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases
261264

262265
// 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+
],
263278
"dspace-angular-ts/themed-component-classes": "error",
264279
"dspace-angular-ts/themed-component-selectors": "error",
265-
"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+
]
266308
}
267309
},
268310
{

.github/workflows/build.yml

Lines changed: 33 additions & 0 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: "90.0.4430.212-1"
@@ -268,6 +270,37 @@ jobs:
268270
echo "$result"
269271
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology Vol. 28, No. 1"
270272
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+
271304
- name: Stop running app
272305
run: kill -9 $(lsof -t -i:4000)
273306

config/config.example.yml

Lines changed: 25 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.
@@ -453,6 +467,8 @@ info:
453467
enableEndUserAgreement: true
454468
enablePrivacyStatement: true
455469
enableCOARNotifySupport: true
470+
# Whether to show the cookie consent popup and the cookie settings footer link or not.
471+
enableCookieConsentPopup: true
456472

457473
# Whether to enable Markdown (https://commonmark.org/) and MathJax (https://www.mathjax.org/)
458474
# display in supported metadata fields. By default, only dc.description.abstract is supported.
@@ -593,3 +609,8 @@ geospatialMapViewer:
593609
defaultCentrePoint:
594610
lat: 41.015137
595611
lng: 28.979530
612+
613+
# Configuration for storing accessibility settings, used by the AccessibilitySettingsService
614+
accessibility:
615+
# The duration in days after which the accessibility settings cookie expires
616+
cookieExpirationDuration: 7

cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default defineConfig({
3434
DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME: 'People',
3535
// Account used to test basic submission process
3636
DSPACE_TEST_SUBMIT_USER: '[email protected]',
37+
DSPACE_TEST_SUBMIT_USER_UUID: '914955b1-cf2e-4884-8af7-a166aa24cf73',
3738
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'dspace',
3839
// Administrator users group
3940
DSPACE_ADMINISTRATOR_GROUP: 'e59f5659-bff9-451e-b28f-439e7bd467e4'

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
});

cypress/e2e/health-page.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import { Options } from 'cypress-axe';
44

55
beforeEach(() => {
66
// Must login as an Admin to see the page
7+
cy.intercept('GET', '/server/actuator/health').as('status');
8+
cy.intercept('GET', '/server/actuator/info').as('info');
79
cy.visit('/health');
810
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
911
});
1012

1113
describe('Health Page > Status Tab', () => {
1214
it('should pass accessibility tests', () => {
13-
cy.intercept('GET', '/server/actuator/health').as('status');
1415
cy.wait('@status');
1516

1617
cy.get('a[data-test="health-page.status-tab"]').click();
@@ -36,7 +37,6 @@ describe('Health Page > Status Tab', () => {
3637

3738
describe('Health Page > Info Tab', () => {
3839
it('should pass accessibility tests', () => {
39-
cy.intercept('GET', '/server/actuator/info').as('info');
4040
cy.wait('@info');
4141

4242
cy.get('a[data-test="health-page.info-tab"]').click();

cypress/e2e/homepage.cy.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ describe('Homepage', () => {
2626
// Wait for homepage tag to appear
2727
cy.get('ds-home-page').should('be.visible');
2828

29+
// Wait for at least one loading component to show up
30+
cy.get('ds-loading').should('exist');
31+
32+
// Wait until all loading components have disappeared
33+
cy.get('ds-loading').should('not.exist');
34+
2935
// Analyze <ds-home-page> for accessibility issues
3036
testA11y('ds-home-page');
3137
});

cypress/support/e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ before(() => {
5656
beforeEach(() => {
5757
// Pre-agree to all Orejime cookies by setting the orejime-anonymous cookie
5858
// This just ensures it doesn't get in the way of matching other objects in the page.
59-
cy.setCookie('orejime-anonymous', '{"authentication":true,"preferences":true,"acknowledgement":true,"google-analytics":true}');
59+
cy.setCookie('orejime-anonymous', '{"authentication":true,"preferences":true,"acknowledgement":true,"google-analytics":true,"correlation-id":true,"accessibility":true}');
6060

6161
// Remove any CSRF cookies saved from prior tests
6262
cy.clearCookie(DSPACE_XSRF_COOKIE);

docs/lint/html/rules/no-disabled-attribute-on-button.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ _______
99

1010
[Source code](../../../../lint/src/rules/html/no-disabled-attribute-on-button.ts)
1111

12+
13+
1214
### Examples
1315

1416

@@ -19,24 +21,28 @@ _______
1921
```html
2022
<button [dsBtnDisabled]="true">Submit</button>
2123
```
24+
2225

2326
##### disabled attribute is still valid on non-button elements
2427
2528
```html
2629
<input disabled>
2730
```
31+
2832

2933
##### [disabled] attribute is still valid on non-button elements
3034
3135
```html
3236
<input [disabled]="true">
3337
```
38+
3439

3540
##### angular dynamic attributes that use disabled are still valid
3641
3742
```html
3843
<button [class.disabled]="isDisabled">Submit</button>
3944
```
45+
4046

4147

4248

@@ -47,6 +53,9 @@ _______
4753
4854
```html
4955
<button disabled>Submit</button>
56+
57+
58+
5059
```
5160
Will produce the following error(s):
5261
```
@@ -63,6 +72,9 @@ Result of `yarn lint --fix`:
6372
6473
```html
6574
<button [disabled]="true">Submit</button>
75+
76+
77+
6678
```
6779
Will produce the following error(s):
6880
```

0 commit comments

Comments
 (0)