Skip to content

Commit 3007f6f

Browse files
Merge branch 'datashare-UoEMainLibrary-dspace-8_x' into uoe/add-bitstream-embargo-info
2 parents fcdb14c + c34360d commit 3007f6f

70 files changed

Lines changed: 441 additions & 217 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: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ jobs:
3838
NODE_OPTIONS: '--max-old-space-size=4096'
3939
# Project name to use when running "docker compose" prior to e2e tests
4040
COMPOSE_PROJECT_NAME: 'ci'
41-
# Docker Registry to use for Docker compose scripts below.
42-
# We use GitHub's Container Registry to avoid aggressive rate limits at DockerHub.
43-
DOCKER_REGISTRY: ghcr.io
41+
# Docker images: uses upstream DSpace images from DockerHub (docker.io/dspace/*).
42+
# Upstream CI uses GHCR (ghcr.io) which requires authentication via GITHUB_TOKEN.
43+
# This fork uses the default DockerHub registry instead (no auth needed).
44+
# DOCKER_REGISTRY: ghcr.io
4445
strategy:
4546
# Create a matrix of Node versions to test against (in parallel)
4647
matrix:
@@ -112,21 +113,18 @@ jobs:
112113
# Upload code coverage report to artifact (for one version of Node only),
113114
# so that it can be shared with the 'codecov' job (see below)
114115
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
116+
# NOTE: Coverage is disabled in CI due to Chrome OOM, so this step will be skipped
115117
- name: Upload code coverage report to Artifact
116118
uses: actions/upload-artifact@v4
117119
if: matrix.node-version == '18.x'
118120
with:
119121
name: coverage-report-${{ matrix.node-version }}
120122
path: 'coverage/dspace-angular/lcov.info'
123+
if-no-files-found: ignore
121124
retention-days: 14
122125

123-
# Login to our Docker registry, so that we can access private Docker images using "docker compose" below.
124-
- name: Login to ${{ env.DOCKER_REGISTRY }}
125-
uses: docker/login-action@v3
126-
with:
127-
registry: ${{ env.DOCKER_REGISTRY }}
128-
username: ${{ github.repository_owner }}
129-
password: ${{ secrets.GITHUB_TOKEN }}
126+
# DataShare fork: DockerHub images are public, no login needed.
127+
# Upstream uses GHCR login here, but those images are private to the DSpace org.
130128

131129
# Using "docker compose" start backend using CI configuration
132130
# and load assetstore from a cached copy
@@ -189,14 +187,14 @@ jobs:
189187
done
190188
echo "App started successfully."
191189
192-
# Get homepage and verify that the <meta name="title"> tag includes "DSpace".
190+
# Get homepage and verify that the <meta name="title"> tag includes "DataShare".
193191
# If it does, then SSR is working, as this tag is created by our MetadataService.
194192
# This step also prints entire HTML of homepage for easier debugging if grep fails.
195193
- name: Verify SSR (server-side rendering) on Homepage
196194
run: |
197195
result=$(wget -O- -q http://127.0.0.1:4000/home)
198196
echo "$result"
199-
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DSpace
197+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DataShare
200198
201199
# Get a specific community in our test data and verify that the "<h1>" tag includes "Publications" (the community name).
202200
# If it does, then SSR is working.
@@ -331,10 +329,10 @@ jobs:
331329
uses: Wandalen/wretry.action@v1.3.0
332330
with:
333331
action: codecov/codecov-action@v4
334-
# Ensure codecov-action throws an error when it fails to upload
335-
# This allows us to auto-restart the action if an error is thrown
332+
# NOTE: fail_ci_if_error is false because coverage is currently disabled (Chrome OOM).
333+
# Change to true once coverage is re-enabled.
336334
with: |
337-
fail_ci_if_error: true
335+
fail_ci_if_error: false
338336
token: ${{ secrets.CODECOV_TOKEN }}
339337
# Try re-running action 5 times max
340338
attempt_limit: 5

.github/workflows/codescan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040
# Initializes the CodeQL tools for scanning.
4141
# https://github.com/github/codeql-action
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v2
43+
uses: github/codeql-action/init@v3
4444
with:
4545
languages: javascript
4646

4747
# Autobuild attempts to build any compiled languages
4848
- name: Autobuild
49-
uses: github/codeql-action/autobuild@v2
49+
uses: github/codeql-action/autobuild@v3
5050

5151
# Perform GitHub Code Scanning.
5252
- name: Perform CodeQL Analysis
53-
uses: github/codeql-action/analyze@v2
53+
uses: github/codeql-action/analyze@v3

cypress/e2e/collection-create.cy.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ it('should show loading component while saving', () => {
77
const title = 'Test Collection Title';
88
cy.get('#title').type(title);
99

10+
// Intercept the POST to slow the response, ensuring ds-loading is visible
11+
cy.intercept('POST', '/server/api/core/collections', (req) => {
12+
req.on('response', (res) => {
13+
res.setDelay(1000);
14+
});
15+
}).as('createCollection');
16+
1017
cy.get('button[type="submit"]').click();
1118

1219
cy.get('ds-loading').should('be.visible');

cypress/e2e/homepage.cy.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ describe('Homepage', () => {
66
cy.visit('/');
77
});
88

9-
it('should display translated title "DSpace Repository :: Home"', () => {
10-
cy.title().should('eq', 'DSpace Repository :: Home');
9+
it('should display translated title "Edinburgh DataShare :: Home"', () => {
10+
cy.title().should('eq', 'Edinburgh DataShare :: Home');
1111
});
1212

1313
it('should contain a news section', () => {
@@ -26,6 +26,9 @@ describe('Homepage', () => {
2626
// Wait for homepage tag to appear
2727
cy.get('ds-home-page').should('be.visible');
2828

29+
// Wait for all loading components to finish before running a11y check
30+
cy.get('ds-loading').should('not.exist');
31+
2932
// Analyze <ds-home-page> for accessibility issues
3033
testA11y('ds-home-page');
3134
});

cypress/e2e/item-edit.cy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ describe('Edit Item > Edit Metadata tab', () => {
2323
// <ds-edit-item-page> tag must be loaded
2424
cy.get('ds-edit-item-page').should('be.visible');
2525

26+
// Wait for any loading spinners to disappear
27+
cy.get('ds-edit-item-page ds-loading').should('not.exist');
28+
2629
// wait for all the ds-dso-edit-metadata-value components to be rendered
2730
cy.get('ds-dso-edit-metadata-value div[role="row"]').each(($row: HTMLDivElement) => {
2831
cy.wrap($row).find('div[role="cell"]').should('be.visible');

cypress/e2e/submission.cy.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ describe('New Submission page', () => {
4141
// All select boxes fail to have a name / aria-label.
4242
// This is a bug in ng-dynamic-forms and may require https://github.com/DSpace/dspace-angular/issues/2216
4343
'select-name': { enabled: false },
44+
// DataShare's custom inline relation-group form renders sub-field inputs
45+
// without programmatic label association (upstream uses a modal popup instead).
46+
'label': { enabled: false },
4447
},
4548

4649
} as Options,
@@ -70,6 +73,9 @@ describe('New Submission page', () => {
7073
// (as it has required fields)
7174
cy.get('div#traditionalpageone-header i.fa-exclamation-circle').should('be.visible');
7275

76+
// DATASHARE: Open first section panel (DataShare uses one-section-at-a-time accordion)
77+
cy.get('#traditionalpageone-header button').click();
78+
7379
// Title field should have class "is-invalid" applied, as it's required
7480
cy.get('input#dc_title').should('have.class', 'is-invalid');
7581

@@ -119,14 +125,23 @@ describe('New Submission page', () => {
119125
// This page is restricted, so we will be shown the login form. Fill it out & submit.
120126
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
121127

128+
// DATASHARE: Open first section panel (DataShare uses one-section-at-a-time accordion)
129+
cy.get('#traditionalpageone-header button').click();
130+
122131
// Fill out all required fields (Title, Date)
123132
cy.get('input#dc_title').type('DSpace logo uploaded via e2e tests');
124133
cy.get('input#dc_date_issued_year').type('2022');
125134

135+
// DATASHARE: Open license section
136+
cy.get('#license-header button').click();
137+
126138
// Confirm the required license by checking checkbox
127139
// (NOTE: requires "force:true" cause Cypress claims this checkbox is covered by its own <span>)
128140
cy.get('input#granted').check( { force: true } );
129141

142+
// DATASHARE: Open upload section
143+
cy.get('#upload-header button').click();
144+
130145
// Before using Cypress drag & drop, we have to manually trigger the "dragover" event.
131146
// This ensures our UI displays the dropzone that covers the entire submission page.
132147
// (For some reason Cypress drag & drop doesn't trigger this even itself & upload won't work without this trigger)
@@ -201,6 +216,9 @@ describe('New Submission page', () => {
201216
} as Options,
202217
);
203218

219+
// DATASHARE: Open person section panel (DataShare uses one-section-at-a-time accordion)
220+
cy.get('#personStep-header button').click();
221+
204222
// Click the lookup button next to "Publication" field
205223
cy.get('button[data-test="lookup-button"]').click();
206224

karma.conf.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ module.exports = function (config) {
3535
logLevel: config.LOG_INFO,
3636
autoWatch: true,
3737
browsers: ['Chrome'],
38+
customLaunchers: {
39+
ChromeHeadlessCI: {
40+
base: 'ChromeHeadless',
41+
flags: ['--no-sandbox', '--disable-gpu', '--js-flags=--max-old-space-size=4096'],
42+
},
43+
},
44+
browserDisconnectTimeout: 60000,
45+
browserDisconnectTolerance: 3,
46+
browserNoActivityTimeout: 300000,
3847
singleRun: false,
3948
restartOnFileChange: true
4049
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"build:lint": "rimraf 'lint/dist/**/*.js' 'lint/dist/**/*.js.map' && tsc -b lint/tsconfig.json",
2020
"test": "ng test --source-map=true --watch=false --configuration test",
2121
"test:watch": "nodemon --exec \"ng test --source-map=true --watch=true --configuration test\"",
22-
"test:headless": "ng test --source-map=true --watch=false --configuration test --browsers=ChromeHeadless --code-coverage",
22+
"test:headless": "ng test --source-map=true --watch=false --configuration test --browsers=ChromeHeadlessCI --code-coverage",
2323
"test:lint": "yarn build:lint && yarn test:lint:nobuild",
2424
"test:lint:nobuild": "jasmine --config=lint/jasmine.json",
2525
"lint": "yarn build:lint && yarn lint:nobuild",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="container">
22
<!-- DATASHARE - start -->
3-
<h1 style="margin-bottom: 1.5rem;">{{ 'communityList.title' | translate }}</h1>
3+
<h2 style="margin-bottom: 1.5rem;">{{ 'communityList.title' | translate }}</h2>
44
<!-- DATASHARE - end -->
55
<ds-community-list></ds-community-list>
66
</div>

src/app/datashare/datashare-submission-form-section-container.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import { Injectable, signal } from '@angular/core';
1+
import {
2+
Injectable,
3+
signal,
4+
} from '@angular/core';
25

36
@Injectable({
4-
providedIn: 'root'
7+
providedIn: 'root',
58
})
69
export class DatashareSubmissionFormSectionContainerService {
710

0 commit comments

Comments
 (0)