Skip to content

Commit 68fc07b

Browse files
Merged dspace-cris-2024_02_x into task/dspace-cris-2024_02_x/DSC-2386
2 parents df5aaa7 + c3fcbfe commit 68fc07b

367 files changed

Lines changed: 146791 additions & 37280 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)

bitbucket-pipelines.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ options:
22
runs-on: self.hosted
33

44
definitions:
5+
caches:
6+
node-cris8: ./node_modules
7+
58
steps:
69
- step: &unittest-code-checks
710
name: test-code-checks
@@ -10,7 +13,7 @@ definitions:
1013
run-as-user: 1000
1114
size: 4x
1215
caches:
13-
- node
16+
- node-cris8
1417
script:
1518
- yarn install --frozen-lockfile
1619
- yarn run lint --quiet
@@ -20,7 +23,7 @@ definitions:
2023

2124
pipelines:
2225
branches:
23-
'main-cris':
26+
'dspace-cris-2024_02_x':
2427
- step: *unittest-code-checks
2528
'prod/**':
2629
- step: *unittest-code-checks

config/config.example.yml

Lines changed: 33 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.
@@ -135,6 +149,8 @@ auth:
135149
# If the rest token expires in less than this amount of time, it will be refreshed automatically.
136150
# This is independent from the idle warning.
137151
timeLeftBeforeTokenRefresh: 120000 # 2 minutes
152+
# Standard login enabled
153+
disableStandardLogin: false
138154

139155
# Form settings
140156
form:
@@ -372,12 +388,20 @@ item:
372388

373389
# Community Page Config
374390
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
375395
# Search tab config
376396
searchSection:
377397
showSidebar: true
378398

379399
# Collection Page Config
380400
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
381405
# Search tab config
382406
searchSection:
383407
showSidebar: true
@@ -568,6 +592,11 @@ liveRegion:
568592
# The visibility of the live region. Setting this to true is only useful for debugging purposes.
569593
isVisible: false
570594

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+
571600
# CRIS Layout
572601
# Configuration for CRIS Layout
573602
crisLayout:

cypress.config.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ export default defineConfig({
1818
// (This is the data set used in our CI environment)
1919

2020
// Admin account used for administrative tests
21-
DSPACE_TEST_ADMIN_USER: 'dspacedemo+admin@gmail.com',
21+
DSPACE_TEST_ADMIN_USER: 'admin@admin.com',
2222
DSPACE_TEST_ADMIN_USER_UUID: '335647b6-8a52-4ecb-a8c1-7ebabb199bda',
23-
DSPACE_TEST_ADMIN_PASSWORD: 'dspace',
23+
DSPACE_TEST_ADMIN_PASSWORD: 'admin',
2424
// Community/collection/publication used for view/edit tests
25-
DSPACE_TEST_COMMUNITY: '0958c910-2037-42a9-81c7-dca80e3892b4',
26-
DSPACE_TEST_COLLECTION: '282164f5-d325-4740-8dd1-fa4d6d3e7200',
27-
DSPACE_TEST_ENTITY_PUBLICATION: '6160810f-1e53-40db-81ef-f6621a727398',
25+
DSPACE_TEST_COMMUNITY: 'a30b75e4-1682-4b4d-85fd-a47fc78dbcf6',
26+
DSPACE_TEST_COLLECTION: 'caf04bfa-b2f6-40d3-90d2-aa0b86d92f8d',
27+
DSPACE_TEST_ENTITY_PUBLICATION: '9d1efbce-4d55-446c-ac70-0ba8998d04d2',
2828
// Search term (should return results) used in search tests
2929
DSPACE_TEST_SEARCH_TERM: 'test',
3030
// Main Collection used for submission tests. Should be able to accept normal Item objects
31-
DSPACE_TEST_SUBMIT_COLLECTION_NAME: 'Sample Collection',
32-
DSPACE_TEST_SUBMIT_COLLECTION_UUID: '9d8334e9-25d3-4a67-9cea-3dffdef80144',
31+
DSPACE_TEST_SUBMIT_COLLECTION_NAME: 'Equipments',
32+
DSPACE_TEST_SUBMIT_COLLECTION_UUID: 'c1da6a21-451f-430d-ad28-0f16e5b38fa0',
3333
// Collection used for Person entity submission tests. MUST be configured with EntityType=Person.
34-
DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME: 'People',
34+
DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME: 'Persons',
3535
// Account used to test basic submission process
36-
DSPACE_TEST_SUBMIT_USER: 'dspacedemo+submit@gmail.com',
37-
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'dspace',
36+
DSPACE_TEST_SUBMIT_USER: 'admin@admin.com',
37+
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'admin',
3838
// Administrator users group
39-
DSPACE_ADMINISTRATOR_GROUP: 'e59f5659-bff9-451e-b28f-439e7bd467e4'
39+
DSPACE_ADMINISTRATOR_GROUP: 'f8c90336-34c1-4ad6-ab63-ba4b9357f087'
4040
},
4141
e2e: {
4242
// Setup our plugins for e2e tests

cypress/e2e/admin-export-modals.cy.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ describe('Admin Export Modals', () => {
1616
cy.get('#admin-menu-section-export-title').should('be.visible');
1717
cy.get('#admin-menu-section-export-title').click();
1818

19-
cy.get('a[data-test="menu.section.export_metadata"]').click();
19+
cy.get('a[data-test="menu.section.export_metadata_csv"]').click();
2020

21-
// Analyze <ds-export-metadata-selector> for accessibility
22-
testA11y('ds-export-metadata-selector');
21+
// Analyze <ds-export-batch-csv-selector> for accessibility
22+
testA11y('ds-export-metadata-csv-selector');
2323
});
2424

2525
it('Export batch modal should pass accessibility tests', () => {
@@ -34,6 +34,6 @@ describe('Admin Export Modals', () => {
3434
cy.get('a[data-test="menu.section.export_batch"]').click();
3535

3636
// Analyze <ds-export-batch-selector> for accessibility
37-
testA11y('ds-export-batch-selector');
37+
testA11y('ds-export-batch-csv-selector');
3838
});
3939
});

cypress/e2e/breadcrumbs.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { testA11y } from 'cypress/support/utils';
22

3-
xdescribe('Breadcrumbs', () => {
3+
describe('Breadcrumbs', () => {
44
it('should pass accessibility tests', () => {
55
// Visit an Item, as those have more breadcrumbs
66
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));

cypress/e2e/collection-statistics.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
22
import { testA11y } from 'cypress/support/utils';
33

4-
xdescribe('Collection Statistics Page', () => {
4+
describe('Collection Statistics Page', () => {
55
const COLLECTIONSTATISTICSPAGE = '/statistics/collections/'.concat(TEST_COLLECTION);
66

77
it('should load if you click on "Statistics" from a Collection page', () => {

cypress/e2e/community-statistics.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
22
import { testA11y } from 'cypress/support/utils';
33

4-
xdescribe('Community Statistics Page', () => {
4+
describe('Community Statistics Page', () => {
55
const COMMUNITYSTATISTICSPAGE = '/statistics/communities/'.concat(TEST_COMMUNITY);
66

77
it('should load if you click on "Statistics" from a Community page', () => {

cypress/e2e/footer.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { testA11y } from 'cypress/support/utils';
22
import { Options } from 'cypress-axe';
33

4-
xdescribe('Footer', () => {
4+
describe('Footer', () => {
55
it('should pass accessibility tests', () => {
66
cy.visit('/');
77

0 commit comments

Comments
 (0)