Skip to content

Commit

Permalink
Merge remote-tracking branch 'dspace/main' into accessibility-setting…
Browse files Browse the repository at this point in the history
…s-main

# Conflicts:
#	src/app/profile-page/profile-page.component.html
#	src/app/profile-page/profile-page.component.ts
#	src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts
#	src/app/shared/notifications/notifications-board/notifications-board.component.ts
#	src/themes/custom/app/profile-page/profile-page.component.ts
  • Loading branch information
AAwouters committed Jan 23, 2025
2 parents f0ff625 + c7ae1d6 commit 888459c
Show file tree
Hide file tree
Showing 259 changed files with 10,471 additions and 4,151 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ name: Build
on: [push, pull_request]

permissions:
contents: read # to fetch code (actions/checkout)
contents: read # to fetch code (actions/checkout)
packages: read # to fetch private images from GitHub Container Registry (GHCR)

jobs:
tests:
Expand Down Expand Up @@ -35,6 +36,9 @@ jobs:
NODE_OPTIONS: '--max-old-space-size=4096'
# Project name to use when running "docker compose" prior to e2e tests
COMPOSE_PROJECT_NAME: 'ci'
# Docker Registry to use for Docker compose scripts below.
# We use GitHub's Container Registry to avoid aggressive rate limits at DockerHub.
DOCKER_REGISTRY: ghcr.io
strategy:
# Create a matrix of Node versions to test against (in parallel)
matrix:
Expand Down Expand Up @@ -114,6 +118,14 @@ jobs:
path: 'coverage/dspace-angular/lcov.info'
retention-days: 14

# Login to our Docker registry, so that we can access private Docker images using "docker compose" below.
- name: Login to ${{ env.DOCKER_REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# Using "docker compose" start backend using CI configuration
# and load assetstore from a cached copy
- name: Start DSpace REST Backend via Docker (for e2e tests)
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ on:
pull_request:

permissions:
contents: read # to fetch code (actions/checkout)
contents: read # to fetch code (actions/checkout)
packages: write # to write images to GitHub Container Registry (GHCR)

jobs:
#############################################################
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This image will be published as dspace/dspace-angular
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details

FROM node:18-alpine
FROM docker.io/node:18-alpine

# Ensure Python and other build tools are available
# These are needed to install some node modules, especially on linux/arm64
Expand All @@ -22,5 +22,5 @@ ENV NODE_OPTIONS="--max_old_space_size=4096"
# Listen / accept connections from all IP addresses.
# NOTE: At this time it is only possible to run Docker container in Production mode
# if you have a public URL. See https://github.com/DSpace/dspace-angular/issues/1485
ENV NODE_ENV development
ENV NODE_ENV=development
CMD npm run serve -- --host 0.0.0.0
4 changes: 2 additions & 2 deletions Dockerfile.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Test build:
# docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist .

FROM node:18-alpine AS build
FROM docker.io/node:18-alpine AS build

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

WORKDIR /app
USER node
ENV NODE_ENV production
ENV NODE_ENV=production
EXPOSE 4000
CMD pm2-runtime start dspace-ui.json --json
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace
Quick start
-----------

**Ensure you're running [Node](https://nodejs.org) `v16.x` or `v18.x`, [npm](https://www.npmjs.com/) >= `v5.x`**
**Ensure you're running [Node](https://nodejs.org) `v18.x` or `v20.x`, [npm](https://www.npmjs.com/) >= `v10.x`**

```bash
# clone the repo
Expand Down Expand Up @@ -90,7 +90,7 @@ Requirements
------------

- [Node.js](https://nodejs.org)
- Ensure you're running node `v16.x` or `v18.x`
- Ensure you're running node `v18.x` or `v20.x`

If you have [`nvm`](https://github.com/creationix/nvm#install-script) or [`nvm-windows`](https://github.com/coreybutler/nvm-windows) installed, which is highly recommended, you can run `nvm install --lts && nvm use` to install and start using the latest Node LTS.

Expand Down
16 changes: 9 additions & 7 deletions config/config.example.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NOTE: will log all redux actions and transfers in console
debug: false

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

universal:
# Whether to inline "critical" styles into the server-side rendered HTML.
# Determining which styles are critical is a relatively expensive operation;
# this option can be disabled to boost server performance at the expense of
# loading smoothness.
inlineCriticalCss: true
# Angular Server Side Rendering (SSR) settings
ssr:
# Whether to tell Angular to inline "critical" styles into the server-side rendered HTML.
# Determining which styles are critical is a relatively expensive operation; this option is
# disabled (false) by default to boost server performance at the expense of loading smoothness.
inlineCriticalCss: false
# Path prefixes to enable SSR for. By default these are limited to paths of primary DSpace objects.
paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/' ]

# The REST API server settings
# NOTE: these settings define which (publicly available) REST API to use. They are usually
Expand Down
18 changes: 12 additions & 6 deletions cypress/e2e/admin-add-new-modals.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ describe('Admin Add New Modals', () => {

it('Add new Community modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-new-title').click();
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-new-title"]').click();

cy.get('a[data-test="menu.section.new_community"]').click();

Expand All @@ -22,10 +24,12 @@ describe('Admin Add New Modals', () => {

it('Add new Collection modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-new-title').click();
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-new-title"]').click();

cy.get('a[data-test="menu.section.new_collection"]').click();

Expand All @@ -35,10 +39,12 @@ describe('Admin Add New Modals', () => {

it('Add new Item modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-new-title').click();
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-new-title"]').click();

cy.get('a[data-test="menu.section.new_item"]').click();

Expand Down
18 changes: 12 additions & 6 deletions cypress/e2e/admin-edit-modals.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ describe('Admin Edit Modals', () => {

it('Edit Community modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-edit-title').click();
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-edit-title"]').click();

cy.get('a[data-test="menu.section.edit_community"]').click();

Expand All @@ -22,10 +24,12 @@ describe('Admin Edit Modals', () => {

it('Edit Collection modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-edit-title').click();
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-edit-title"]').click();

cy.get('a[data-test="menu.section.edit_collection"]').click();

Expand All @@ -35,10 +39,12 @@ describe('Admin Edit Modals', () => {

it('Edit Item modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-edit-title').click();
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-edit-title"]').click();

cy.get('a[data-test="menu.section.edit_item"]').click();

Expand Down
12 changes: 8 additions & 4 deletions cypress/e2e/admin-export-modals.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ describe('Admin Export Modals', () => {

it('Export metadata modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-export-title').click();
cy.get('[data-test="admin-menu-section-export-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-export-title"]').click();

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

Expand All @@ -22,10 +24,12 @@ describe('Admin Export Modals', () => {

it('Export batch modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-export-title').click();
cy.get('[data-test="admin-menu-section-export-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-export-title"]').click();

cy.get('a[data-test="menu.section.export_batch"]').click();

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/admin-sidebar.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Admin Sidebar', () => {

it('should be pinnable and pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on every expandable section to open all menus
cy.get('ds-expandable-admin-sidebar-section').click({ multiple: true });
Expand Down
37 changes: 24 additions & 13 deletions cypress/e2e/item-edit.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@ beforeEach(() => {

// This page is restricted, so we will be shown the login form. Fill it out & submit.
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));

// We need to wait for the correction types allowed for the item to be loaded to be sure that each tab is fully loaded.
// This because the edit item page causes often tests to fails due to timeout.
cy.intercept('GET', 'server/api/config/correctiontypes/search/findByItem*').as('correctionTypes');
cy.wait('@correctionTypes');
});

describe('Edit Item > Edit Metadata tab', () => {
it('should pass accessibility tests', () => {
cy.get('a[data-test="metadata"]').should('be.visible');
cy.get('a[data-test="metadata"]').click();

// Our selected tab should be active
// Our selected tab should be both visible & active
cy.get('a[data-test="metadata"]').should('be.visible');
cy.get('a[data-test="metadata"]').should('have.class', 'active');

// <ds-edit-item-page> tag must be loaded
Expand All @@ -39,9 +36,11 @@ describe('Edit Item > Edit Metadata tab', () => {
describe('Edit Item > Status tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="status"]').should('be.visible');
cy.get('a[data-test="status"]').click();

// Our selected tab should be active
// Our selected tab should be both visible & active
cy.get('a[data-test="status"]').should('be.visible');
cy.get('a[data-test="status"]').should('have.class', 'active');

// <ds-item-status> tag must be loaded
Expand All @@ -55,9 +54,11 @@ describe('Edit Item > Status tab', () => {
describe('Edit Item > Bitstreams tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="bitstreams"]').should('be.visible');
cy.get('a[data-test="bitstreams"]').click();

// Our selected tab should be active
// Our selected tab should be both visible & active
cy.get('a[data-test="bitstreams"]').should('be.visible');
cy.get('a[data-test="bitstreams"]').should('have.class', 'active');

// <ds-item-bitstreams> tag must be loaded
Expand All @@ -82,9 +83,11 @@ describe('Edit Item > Bitstreams tab', () => {
describe('Edit Item > Curate tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="curate"]').should('be.visible');
cy.get('a[data-test="curate"]').click();

// Our selected tab should be active
// Our selected tab should be both visible & active
cy.get('a[data-test="curate"]').should('be.visible');
cy.get('a[data-test="curate"]').should('have.class', 'active');

// <ds-item-curate> tag must be loaded
Expand All @@ -98,9 +101,11 @@ describe('Edit Item > Curate tab', () => {
describe('Edit Item > Relationships tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="relationships"]').should('be.visible');
cy.get('a[data-test="relationships"]').click();

// Our selected tab should be active
// Our selected tab should be both visible & active
cy.get('a[data-test="relationships"]').should('be.visible');
cy.get('a[data-test="relationships"]').should('have.class', 'active');

// <ds-item-relationships> tag must be loaded
Expand All @@ -114,9 +119,11 @@ describe('Edit Item > Relationships tab', () => {
describe('Edit Item > Version History tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="versionhistory"]').should('be.visible');
cy.get('a[data-test="versionhistory"]').click();

// Our selected tab should be active
// Our selected tab should be both visible & active
cy.get('a[data-test="versionhistory"]').should('be.visible');
cy.get('a[data-test="versionhistory"]').should('have.class', 'active');

// <ds-item-version-history> tag must be loaded
Expand All @@ -130,9 +137,11 @@ describe('Edit Item > Version History tab', () => {
describe('Edit Item > Access Control tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="access-control"]').should('be.visible');
cy.get('a[data-test="access-control"]').click();

// Our selected tab should be active
// Our selected tab should be both visible & active
cy.get('a[data-test="access-control"]').should('be.visible');
cy.get('a[data-test="access-control"]').should('have.class', 'active');

// <ds-item-access-control> tag must be loaded
Expand All @@ -146,9 +155,11 @@ describe('Edit Item > Access Control tab', () => {
describe('Edit Item > Collection Mapper tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="mapper"]').should('be.visible');
cy.get('a[data-test="mapper"]').click();

// Our selected tab should be active
// Our selected tab should be both visible & active
cy.get('a[data-test="mapper"]').should('be.visible');
cy.get('a[data-test="mapper"]').should('have.class', 'active');

// <ds-item-collection-mapper> tag must be loaded
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ before(() => {

// Runs once before the first test in each "block"
beforeEach(() => {
// Pre-agree to all Klaro cookies by setting the klaro-anonymous cookie
// Pre-agree to all Orejime cookies by setting the orejime-anonymous cookie
// This just ensures it doesn't get in the way of matching other objects in the page.
cy.setCookie('klaro-anonymous', '{%22authentication%22:true%2C%22preferences%22:true%2C%22acknowledgement%22:true%2C%22google-analytics%22:true%2C%22google-recaptcha%22:true}');
cy.setCookie('orejime-anonymous', '{"authentication":true,"preferences":true,"acknowledgement":true,"google-analytics":true}');

// Remove any CSRF cookies saved from prior tests
cy.clearCookie(DSPACE_XSRF_COOKIE);
Expand Down
2 changes: 1 addition & 1 deletion docker/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ networks:
external: true
services:
dspace-cli:
image: "${DOCKER_OWNER:-dspace}/dspace-cli:${DSPACE_VER:-latest}"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-cli:${DSPACE_VER:-latest}"
container_name: dspace-cli
environment:
# Below syntax may look odd, but it is how to override dspace.cfg settings via env variables.
Expand Down
2 changes: 1 addition & 1 deletion docker/db.entities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# # Therefore, it should be kept in sync with that file
services:
dspacedb:
image: "${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}-loadsql"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}-loadsql"
environment:
# This LOADSQL should be kept in sync with the URL in DSpace/DSpace
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
Expand Down
Loading

0 comments on commit 888459c

Please sign in to comment.