Skip to content

Commit 61cdf5f

Browse files
authored
Merge pull request #89 from dsteelma-umd/feature/LIBDRUM-957
LIBDRUM-957. Incorporate dspace-8.1 changes into DRUM https://umd-dit.atlassian.net/browse/LIBDRUM-957
2 parents 1ad001d + 773f452 commit 61cdf5f

590 files changed

Lines changed: 35957 additions & 13632 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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
"@angular-eslint/no-output-native": "warn",
166166
"@angular-eslint/no-output-on-prefix": "warn",
167167
"@angular-eslint/no-conflicting-lifecycle": "warn",
168+
"@angular-eslint/use-lifecycle-interface": "error",
168169

169170
"@typescript-eslint/no-inferrable-types":[
170171
"error",
@@ -292,7 +293,8 @@
292293
],
293294
"rules": {
294295
// Custom DSpace Angular rules
295-
"dspace-angular-html/themed-component-usages": "error"
296+
"dspace-angular-html/themed-component-usages": "error",
297+
"dspace-angular-html/no-disabled-attribute-on-button": "error"
296298
}
297299
},
298300
{

.github/workflows/build.yml

Lines changed: 17 additions & 1 deletion
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:
@@ -35,6 +36,11 @@ jobs:
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+
# UMD Customization
42+
#DOCKER_REGISTRY: ghcr.io
43+
# End UMD Customization
3844
strategy:
3945
# Create a matrix of Node versions to test against (in parallel)
4046
matrix:
@@ -114,6 +120,16 @@ jobs:
114120
path: 'coverage/dspace-angular/lcov.info'
115121
retention-days: 14
116122

123+
# Login to our Docker registry, so that we can access private Docker images using "docker compose" below.
124+
# UMD Customization
125+
# - name: Login to ${{ env.DOCKER_REGISTRY }}
126+
# uses: docker/login-action@v3
127+
# with:
128+
# registry: ${{ env.DOCKER_REGISTRY }}
129+
# username: ${{ github.repository_owner }}
130+
# password: ${{ secrets.GITHUB_TOKEN }}
131+
# End UMD Customization
132+
117133
# Using "docker compose" start backend using CI configuration
118134
# and load assetstore from a cached copy
119135
- name: Start DSpace REST Backend via Docker (for e2e tests)

.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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
33

44
# Test build:
5-
# docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist .
5+
# docker build -f Dockerfile.dist -t dspace/dspace-angular:dspace-8_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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace
3535
Quick start
3636
-----------
3737

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

4040
```bash
4141
# clone the repo
@@ -90,7 +90,7 @@ Requirements
9090
------------
9191

9292
- [Node.js](https://nodejs.org) and [yarn](https://yarnpkg.com)
93-
- Ensure you're running node `v16.x` or `v18.x` and yarn == `v1.x`
93+
- Ensure you're running node `v18.x` or `v20.x` and yarn == `v1.x`
9494

9595
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.
9696

angular.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"lodash",
3131
"jwt-decode",
3232
"uuid",
33-
"webfontloader",
3433
"zone.js"
3534
],
3635
"outputPath": "dist/browser",

config/config.example.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ ui:
1919

2020
# Angular Server Side Rendering (SSR) settings
2121
ssr:
22-
# Enable request performance profiling data collection and printing the results in the server console.
23-
# Defaults to false. Enabling in production is NOT recommended
24-
enablePerformanceProfiler: false
2522
# Whether to tell Angular to inline "critical" styles into the server-side rendered HTML.
2623
# Determining which styles are critical is a relatively expensive operation; this option is
2724
# disabled (false) by default to boost server performance at the expense of loading smoothness.
@@ -48,6 +45,9 @@ ssr:
4845
# REST resources with the internal URL configured. By default, these internal URLs are replaced with public URLs.
4946
# Disable this setting to avoid URL replacement during SSR. In this the state is not transferred to avoid security issues.
5047
replaceRestUrl: true
48+
# Enable request performance profiling data collection and printing the results in the server console.
49+
# Defaults to false. Enabling in production is NOT recommended
50+
#enablePerformanceProfiler: false
5151

5252
# The REST API server settings
5353
# NOTE: these settings define which (publicly available) REST API to use. They are usually
@@ -476,6 +476,12 @@ search:
476476
enabled: false
477477
# List of filters to enable in "Advanced Search" dropdown
478478
filter: [ 'title', 'author', 'subject', 'entityType' ]
479+
#
480+
# Number used to render n UI elements called loading skeletons that act as placeholders.
481+
# These elements indicate that some content will be loaded in their stead.
482+
# 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.
483+
# e.g. If we set 5 then 5 loading skeletons will be visualized before the actual filters are retrieved.
484+
defaultFiltersCount: 5
479485

480486

481487
# Notify metrics
@@ -531,6 +537,16 @@ notifyMetrics:
531537
description: 'admin-notify-dashboard.NOTIFY.outgoing.delivered.description'
532538

533539

534-
535-
536-
540+
# Live Region configuration
541+
# Live Region as defined by w3c, https://www.w3.org/TR/wai-aria-1.1/#terms:
542+
# Live regions are perceivable regions of a web page that are typically updated as a
543+
# result of an external event when user focus may be elsewhere.
544+
#
545+
# The DSpace live region is a component present at the bottom of all pages that is invisible by default, but is useful
546+
# for screen readers. Any message pushed to the live region will be announced by the screen reader. These messages
547+
# usually contain information about changes on the page that might not be in focus.
548+
liveRegion:
549+
# The duration after which messages disappear from the live region in milliseconds
550+
messageTimeOutDurationMs: 30000
551+
# The visibility of the live region. Setting this to true is only useful for debugging purposes.
552+
isVisible: false

cypress.config.ts

Lines changed: 4 additions & 0 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',
@@ -18,6 +19,7 @@ export default defineConfig({
1819

1920
// Admin account used for administrative tests
2021
DSPACE_TEST_ADMIN_USER: 'dspacedemo+admin@gmail.com',
22+
DSPACE_TEST_ADMIN_USER_UUID: '335647b6-8a52-4ecb-a8c1-7ebabb199bda',
2123
DSPACE_TEST_ADMIN_PASSWORD: 'dspace',
2224
// Community/collection/publication used for view/edit tests
2325
DSPACE_TEST_COMMUNITY: '0958c910-2037-42a9-81c7-dca80e3892b4',
@@ -33,6 +35,8 @@ export default defineConfig({
3335
// Account used to test basic submission process
3436
DSPACE_TEST_SUBMIT_USER: 'dspacedemo+submit@gmail.com',
3537
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'dspace',
38+
// Administrator users group
39+
DSPACE_ADMINISTRATOR_GROUP: 'e59f5659-bff9-451e-b28f-439e7bd467e4'
3640
},
3741
e2e: {
3842
// Setup our plugins for e2e tests
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { testA11y } from 'cypress/support/utils';
2+
3+
describe('Admin Add New Modals', () => {
4+
beforeEach(() => {
5+
// Must login as an Admin for sidebar to appear
6+
cy.visit('/login');
7+
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
8+
});
9+
10+
it('Add new Community modal should pass accessibility tests', () => {
11+
// Pin the sidebar open
12+
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
13+
cy.get('#sidebar-collapse-toggle').click();
14+
15+
// Click on entry of menu
16+
cy.get('#admin-menu-section-new-title').should('be.visible');
17+
cy.get('#admin-menu-section-new-title').click();
18+
19+
cy.get('a[data-test="menu.section.new_community"]').click();
20+
21+
// Analyze <ds-create-community-parent-selector> for accessibility
22+
testA11y('ds-create-community-parent-selector');
23+
});
24+
25+
it('Add new Collection modal should pass accessibility tests', () => {
26+
// Pin the sidebar open
27+
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
28+
cy.get('#sidebar-collapse-toggle').click();
29+
30+
// Click on entry of menu
31+
cy.get('#admin-menu-section-new-title').should('be.visible');
32+
cy.get('#admin-menu-section-new-title').click();
33+
34+
cy.get('a[data-test="menu.section.new_collection"]').click();
35+
36+
// Analyze <ds-create-collection-parent-selector> for accessibility
37+
testA11y('ds-create-collection-parent-selector');
38+
});
39+
40+
it('Add new Item modal should pass accessibility tests', () => {
41+
// Pin the sidebar open
42+
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
43+
cy.get('#sidebar-collapse-toggle').click();
44+
45+
// Click on entry of menu
46+
cy.get('#admin-menu-section-new-title').should('be.visible');
47+
cy.get('#admin-menu-section-new-title').click();
48+
49+
cy.get('a[data-test="menu.section.new_item"]').click();
50+
51+
// Analyze <ds-create-item-parent-selector> for accessibility
52+
testA11y('ds-create-item-parent-selector');
53+
});
54+
});

0 commit comments

Comments
 (0)