Skip to content

Commit 9270862

Browse files
committed
Merged dspace-cris-2023_02_x into task/dspace-cris-2023_02_x/DSC-1742
2 parents b0a9a0b + 117c0f0 commit 9270862

727 files changed

Lines changed: 17624 additions & 6536 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.

.github/workflows/build.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ name: Build
77
on: [push, pull_request]
88

99
permissions:
10-
contents: read # to fetch code (actions/checkout)
10+
contents: read # to fetch code (actions/checkout)
11+
packages: read # to fetch private images from GitHub Container Registry (GHCR)
1112

1213
jobs:
1314
tests:
@@ -30,15 +31,18 @@ jobs:
3031
CYPRESS_BASE_URL: http://127.0.0.1:4000
3132
# When Chrome version is specified, we pin to a specific version of Chrome
3233
# Comment this out to use the latest release
33-
CHROME_VERSION: "116.0.5845.187-1"
34+
#CHROME_VERSION: "116.0.5845.187-1"
3435
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
3536
NODE_OPTIONS: '--max-old-space-size=4096'
3637
# Project name to use when running "docker compose" prior to e2e tests
3738
COMPOSE_PROJECT_NAME: 'ci'
39+
# Docker Registry to use for Docker compose scripts below.
40+
# We use GitHub's Container Registry to avoid aggressive rate limits at DockerHub.
41+
DOCKER_REGISTRY: ghcr.io
3842
strategy:
3943
# Create a matrix of Node versions to test against (in parallel)
4044
matrix:
41-
node-version: [16.x, 18.x]
45+
node-version: [18.x, 20.x]
4246
# Do NOT exit immediately if one matrix job fails
4347
fail-fast: false
4448
# These are the actual CI steps to perform per job
@@ -108,6 +112,14 @@ jobs:
108112
path: 'coverage/dspace-angular/lcov.info'
109113
retention-days: 14
110114

115+
# Login to our Docker registry, so that we can access private Docker images using "docker compose" below.
116+
- name: Login to ${{ env.DOCKER_REGISTRY }}
117+
uses: docker/login-action@v3
118+
with:
119+
registry: ${{ env.DOCKER_REGISTRY }}
120+
username: ${{ github.repository_owner }}
121+
password: ${{ secrets.GITHUB_TOKEN }}
122+
111123
# Using "docker compose" start backend using CI configuration
112124
# and load assetstore from a cached copy
113125
- name: Start DSpace REST Backend via Docker (for e2e tests)
@@ -172,11 +184,12 @@ jobs:
172184
# Get homepage and verify that the <meta name="title"> tag includes "DSpace".
173185
# If it does, then SSR is working, as this tag is created by our MetadataService.
174186
# This step also prints entire HTML of homepage for easier debugging if grep fails.
175-
- name: Verify SSR (server-side rendering)
176-
run: |
177-
result=$(wget -O- -q http://127.0.0.1:4000/home)
178-
echo "$result"
179-
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DSpace
187+
# TODO: enable this step once we have a CRIS back end to test against
188+
# - name: Verify SSR (server-side rendering)
189+
# run: |
190+
# result=$(wget -O- -q http://127.0.0.1:4000/home)
191+
# echo "$result"
192+
# echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DSpace
180193

181194
- name: Stop running app
182195
run: kill -9 $(lsof -t -i:4000)

.github/workflows/docker.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ on:
1616
pull_request:
1717

1818
permissions:
19-
contents: read # to fetch code (actions/checkout)
19+
contents: read # to fetch code (actions/checkout)
20+
packages: write # to write images to GitHub Container Registry (GHCR)
2021

2122
jobs:
2223
#############################################################

Dockerfile

Lines changed: 2 additions & 2 deletions
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 node:18-alpine
4+
FROM docker.io/node:18-alpine
55

66
# Ensure Python and other build tools are available
77
# These are needed to install some node modules, especially on linux/arm64
@@ -24,5 +24,5 @@ ENV NODE_OPTIONS="--max_old_space_size=4096"
2424
# Listen / accept connections from all IP addresses.
2525
# NOTE: At this time it is only possible to run Docker container in Production mode
2626
# if you have a public URL. See https://github.com/DSpace/dspace-angular/issues/1485
27-
ENV NODE_ENV development
27+
ENV NODE_ENV=development
2828
CMD yarn serve --host 0.0.0.0

Dockerfile.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Test build:
55
# docker build -f Dockerfile.dist -t dspace/dspace-angular:dspace-7_x-dist .
66

7-
FROM node:18-alpine as build
7+
FROM docker.io/node:18-alpine AS build
88

99
# Ensure Python and other build tools are available
1010
# These are needed to install some node modules, especially on linux/arm64
@@ -26,6 +26,6 @@ COPY --chown=node:node docker/dspace-ui.json /app/dspace-ui.json
2626

2727
WORKDIR /app
2828
USER node
29-
ENV NODE_ENV production
29+
ENV NODE_ENV=production
3030
EXPOSE 4000
3131
CMD pm2-runtime start dspace-ui.json --json

angular.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"ngx-export-as",
3535
"url-parse",
3636
"uuid",
37-
"webfontloader",
3837
"xlsx",
3938
"zone.js"
4039
],

bitbucket-pipelines.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ definitions:
66
- step: &unittest-code-checks
77
name: test-code-checks
88
image:
9-
name: cypress/browsers:node18.12.0-chrome107
9+
name: cypress/browsers:node-18.20.3-chrome-125.0.6422.141-1-ff-126.0.1-edge-125.0.2535.85-1
1010
run-as-user: 1000
11-
size: 2x
11+
size: 4x
1212
caches:
1313
- node
1414
script:
@@ -22,6 +22,8 @@ pipelines:
2222
branches:
2323
'dspace-cris-2023_02_x':
2424
- step: *unittest-code-checks
25+
'prod/**':
26+
- step: *unittest-code-checks
2527
pull-requests:
2628
'**':
2729
- step: *unittest-code-checks

config/config.example.yml

Lines changed: 73 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NOTE: will log all redux actions and transfers in console
22
debug: false
33

4-
# Angular Universal server settings
4+
# Angular User Inteface settings
55
# NOTE: these settings define where Node.js will start your UI application. Therefore, these
66
# "ui" settings usually specify a localhost port/URL which is later proxied to a public URL (using Apache or similar)
77
ui:
@@ -17,12 +17,34 @@ ui:
1717
# Trust X-FORWARDED-* headers from proxies (default = true)
1818
useProxies: true
1919

20+
# Angular Universal / Server Side Rendering (SSR) settings
2021
universal:
21-
# Whether to inline "critical" styles into the server-side rendered HTML.
22-
# Determining which styles are critical is a relatively expensive operation;
23-
# this option can be disabled to boost server performance at the expense of
24-
# loading smoothness. For improved SSR performance, DSpace defaults this to false (disabled).
22+
# Whether to tell Angular to inline "critical" styles into the server-side rendered HTML.
23+
# Determining which styles are critical is a relatively expensive operation; this option is
24+
# 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/' ]
30+
# Whether to enable rendering of Search component on SSR.
31+
# If set to true the component will be included in the HTML returned from the server side rendering.
32+
# If set to false the component will not be included in the HTML returned from the server side rendering.
33+
enableSearchComponent: false
34+
# Whether to enable rendering of Browse component on SSR.
35+
# If set to true the component will be included in the HTML returned from the server side rendering.
36+
# If set to false the component will not be included in the HTML returned from the server side rendering.
37+
enableBrowseComponent: false
38+
# Enable state transfer from the server-side application to the client-side application.
39+
# Defaults to true.
40+
# Note: When using an external application cache layer, it's recommended not to transfer the state to avoid caching it.
41+
# Disabling it ensures that dynamic state information is not inadvertently cached, which can improve security and
42+
# ensure that users always use the most up-to-date state.
43+
transferState: true
44+
# When a different REST base URL is used for the server-side application, the generated state contains references to
45+
# REST resources with the internal URL configured. By default, these internal URLs are replaced with public URLs.
46+
# Disable this setting to avoid URL replacement during SSR. In this the state is not transferred to avoid security issues.
47+
replaceRestUrl: true
2648

2749
# The REST API server settings
2850
# NOTE: these settings define which (publicly available) REST API to use. They are usually
@@ -33,6 +55,9 @@ rest:
3355
port: 443
3456
# NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
3557
nameSpace: /server
58+
# Provide a different REST url to be used during SSR execution. It must contain the whole url including protocol, server port and
59+
# server namespace (uncomment to use it).
60+
#ssrBaseUrl: http://localhost:8080/server
3661

3762
# Caching settings
3863
cache:
@@ -107,6 +132,8 @@ auth:
107132
# If the rest token expires in less than this amount of time, it will be refreshed automatically.
108133
# This is independent from the idle warning.
109134
timeLeftBeforeTokenRefresh: 120000 # 2 minutes
135+
# Standard login enabled
136+
isPasswordLoginEnabledForAdminsOnly: false
110137

111138
# Form settings
112139
form:
@@ -187,6 +214,8 @@ submission:
187214
metadataDetailsList:
188215
- label: 'Document type'
189216
name: dc.type
217+
# Minimum number of characters required before performing a lookup.
218+
minChars: 3
190219

191220
# Default Language in which the UI will be rendered if the user's browser language is not an active language
192221
defaultLanguage: en
@@ -327,15 +356,6 @@ item:
327356
# The maximum number of values for repeatable metadata to show in the full item
328357
metadataLimit: 20
329358

330-
# When the search results are retrieved, for each item type the metadata with a valid authority value are inspected.
331-
# Referenced items will be fetched with a find all by id strategy to avoid individual rest requests
332-
# to efficiently display the search results.
333-
followAuthorityMetadata:
334-
- type: Publication
335-
metadata: dc.contributor.author
336-
- type: Product
337-
metadata: dc.contributor.author
338-
339359
# Collection Page Config
340360
collection:
341361
edit:
@@ -400,10 +420,6 @@ themes:
400420
attributes:
401421
rel: manifest
402422
href: assets/dspace/images/favicons/manifest.webmanifest
403-
- tagName: link
404-
attributes:
405-
rel: stylesheet
406-
href: "https://fonts.googleapis.com/icon?family=Material+Icons"
407423

408424
# The default bundles that should always be displayed as suggestions when you upload a new bundle
409425
bundle:
@@ -442,6 +458,29 @@ comcolSelectionSort:
442458
sortField: 'dc.title'
443459
sortDirection: 'ASC'
444460

461+
# Live Region configuration
462+
# Live Region as defined by w3c, https://www.w3.org/TR/wai-aria-1.1/#terms:
463+
# Live regions are perceivable regions of a web page that are typically updated as a
464+
# result of an external event when user focus may be elsewhere.
465+
#
466+
# The DSpace live region is a component present at the bottom of all pages that is invisible by default, but is useful
467+
# for screen readers. Any message pushed to the live region will be announced by the screen reader. These messages
468+
# usually contain information about changes on the page that might not be in focus.
469+
liveRegion:
470+
# The duration after which messages disappear from the live region in milliseconds
471+
messageTimeOutDurationMs: 30000
472+
# The visibility of the live region. Setting this to true is only useful for debugging purposes.
473+
isVisible: false
474+
475+
476+
# Search settings
477+
search:
478+
# Number used to render n UI elements called loading skeletons that act as placeholders.
479+
# These elements indicate that some content will be loaded in their stead.
480+
# Since we don't know how many filters will be loaded before we receive a response from the server we use this parameter for the skeletons count.
481+
# e.g. If we set 5 then 5 loading skeletons will be visualized before the actual filters are retrieved.
482+
defaultFiltersCount: 5
483+
445484
crisLayout:
446485
urn:
447486
- name: doi
@@ -521,3 +560,19 @@ addToAnyPlugin:
521560
title: DSpace CRIS 7 demo
522561
# The link to be shown in the shared post, if different from document.location.origin (optional)
523562
# link: https://dspacecris7.4science.cloud/
563+
564+
# When the search results are retrieved, for each item type the metadata with a valid authority value are inspected.
565+
# Referenced items will be fetched with a find all by id strategy to avoid individual rest requests
566+
# to efficiently display the search results.
567+
followAuthorityMetadata:
568+
- type: Publication
569+
metadata: dc.contributor.author
570+
- type: Product
571+
metadata: dc.contributor.author
572+
573+
# The maximum number of item to process when following authority metadata values.
574+
followAuthorityMaxItemLimit: 100
575+
576+
# The maximum number of metadata values to process for each metadata key
577+
# when following authority metadata values.
578+
followAuthorityMetadataValuesLimit: 5

cypress.config.ts

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'cypress';
22

33
export default defineConfig({
4+
video: true,
45
videosFolder: 'cypress/videos',
56
screenshotsFolder: 'cypress/screenshots',
67
fixturesFolder: 'cypress/fixtures',
@@ -17,22 +18,25 @@ export default defineConfig({
1718
// (This is the data set used in our CI environment)
1819

1920
// Admin account used for administrative tests
20-
DSPACE_TEST_ADMIN_USER: 'dspacedemo+admin@gmail.com',
21-
DSPACE_TEST_ADMIN_PASSWORD: 'dspace',
21+
DSPACE_TEST_ADMIN_USER: 'admin@admin.com',
22+
DSPACE_TEST_ADMIN_USER_UUID: '335647b6-8a52-4ecb-a8c1-7ebabb199bda',
23+
DSPACE_TEST_ADMIN_PASSWORD: 'admin',
2224
// Community/collection/publication used for view/edit tests
23-
DSPACE_TEST_COMMUNITY: '0958c910-2037-42a9-81c7-dca80e3892b4',
24-
DSPACE_TEST_COLLECTION: '282164f5-d325-4740-8dd1-fa4d6d3e7200',
25-
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',
2628
// Search term (should return results) used in search tests
2729
DSPACE_TEST_SEARCH_TERM: 'test',
2830
// Main Collection used for submission tests. Should be able to accept normal Item objects
29-
DSPACE_TEST_SUBMIT_COLLECTION_NAME: 'Sample Collection',
30-
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',
3133
// Collection used for Person entity submission tests. MUST be configured with EntityType=Person.
32-
DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME: 'People',
34+
DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME: 'Persons',
3335
// Account used to test basic submission process
34-
DSPACE_TEST_SUBMIT_USER: 'dspacedemo+submit@gmail.com',
35-
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'dspace',
36+
DSPACE_TEST_SUBMIT_USER: 'admin@admin.com',
37+
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'admin',
38+
// Administrator users group
39+
DSPACE_ADMINISTRATOR_GROUP: 'f8c90336-34c1-4ad6-ab63-ba4b9357f087'
3640
},
3741
e2e: {
3842
// Setup our plugins for e2e tests
@@ -43,5 +47,19 @@ export default defineConfig({
4347
// It can be overridden via the CYPRESS_BASE_URL environment variable
4448
// (By default we set this to a value which should work in most development environments)
4549
baseUrl: 'http://localhost:4000',
50+
excludeSpecPattern: [
51+
'cypress/e2e/collection-create.cy.ts',
52+
'cypress/e2e/collection-edit.cy.ts',
53+
'cypress/e2e/collection-statistics.cy.ts',
54+
'cypress/e2e/community-edit.cy.ts',
55+
'cypress/e2e/community-statistics.cy.ts',
56+
'cypress/e2e/homepage.cy.ts',
57+
'cypress/e2e/item-edit.cy.ts',
58+
'cypress/e2e/item-template.cy.ts',
59+
'cypress/e2e/login-modal.cy.ts',
60+
'cypress/e2e/search-navbar.cy.ts',
61+
'cypress/e2e/search-page.cy.ts',
62+
]
4663
},
64+
defaultCommandTimeout: 10000,
4765
});

0 commit comments

Comments
 (0)