Skip to content

Commit 5ed56d1

Browse files
committed
Merged in DSC-648-alignment-with-7.3 (pull request DSpace#328)
alignment with DSpace 7.3
2 parents 14ce8c7 + e8b84db commit 5ed56d1

957 files changed

Lines changed: 25225 additions & 15025 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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
# Create a matrix of Node versions to test against (in parallel)
2424
matrix:
25-
node-version: [12.x, 14.x]
25+
node-version: [14.x, 16.x]
2626
# Do NOT exit immediately if one matrix job fails
2727
fail-fast: false
2828
# These are the actual CI steps to perform per job
@@ -72,18 +72,21 @@ jobs:
7272
- name: Run lint
7373
run: yarn run lint --quiet
7474

75+
- name: Check for circular dependencies
76+
run: yarn run check-circ-deps
77+
7578
- name: Run build
7679
run: yarn run build:prod
7780

7881
- name: Run specs (unit tests)
7982
run: yarn run test:headless
8083

8184
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
82-
# Upload coverage reports to Codecov (for Node v12 only)
85+
# Upload coverage reports to Codecov (for one version of Node only)
8386
# https://github.com/codecov/codecov-action
8487
- name: Upload coverage to Codecov.io
8588
uses: codecov/codecov-action@v2
86-
if: matrix.node-version == '12.x'
89+
if: matrix.node-version == '16.x'
8790

8891
# Using docker-compose start backend using CI configuration
8992
# and load assetstore from a cached copy

.github/workflows/docker.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
# We turn off 'latest' tag by default.
3232
TAGS_FLAVOR: |
3333
latest=false
34+
# Architectures / Platforms for which we will build Docker images
35+
# If this is a PR, we ONLY build for AMD64. For PRs we only do a sanity check test to ensure Docker builds work.
36+
# If this is NOT a PR (e.g. a tag or merge commit), also build for ARM64.
37+
PLATFORMS: linux/amd64${{ github.event_name != 'pull_request' && ', linux/arm64' || '' }}
3438

3539
steps:
3640
# https://github.com/actions/checkout
@@ -41,6 +45,10 @@ jobs:
4145
- name: Setup Docker Buildx
4246
uses: docker/setup-buildx-action@v1
4347

48+
# https://github.com/docker/setup-qemu-action
49+
- name: Set up QEMU emulation to build for multiple architectures
50+
uses: docker/setup-qemu-action@v2
51+
4452
# https://github.com/docker/login-action
4553
- name: Login to DockerHub
4654
# Only login if not a PR, as PRs only trigger a Docker build and not a push
@@ -70,6 +78,7 @@ jobs:
7078
with:
7179
context: .
7280
file: ./Dockerfile
81+
platforms: ${{ env.PLATFORMS }}
7382
# For pull requests, we run the Docker build (to ensure no PR changes break the build),
7483
# but we ONLY do an image push to DockerHub if it's NOT a PR
7584
push: ${{ github.event_name != 'pull_request' }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ package-lock.json
3737

3838
.env
3939
/nbproject/
40+
41+
junit.xml

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ EXPOSE 4000
99
# We run yarn install with an increased network timeout (5min) to avoid "ESOCKETTIMEDOUT" errors from hub.docker.com
1010
# See, for example https://github.com/yarnpkg/yarn/issues/5540
1111
RUN yarn install --network-timeout 300000
12-
CMD yarn run start:dev
12+
13+
# On startup, run in DEVELOPMENT mode (this defaults to live reloading enabled, etc).
14+
# Listen / accept connections from all IP addresses.
15+
# NOTE: At this time it is only possible to run Docker container in Production mode
16+
# if you have a public IP. See https://github.com/DSpace/dspace-angular/issues/1485
17+
CMD yarn serve --host 0.0.0.0

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ You can find additional information on the DSpace 7 Angular UI on the [wiki](htt
1313
Quick start
1414
-----------
1515

16-
**Ensure you're running [Node](https://nodejs.org) `v12.x`, `v14.x` or `v16.x`, [npm](https://www.npmjs.com/) >= `v5.x` and [yarn](https://yarnpkg.com) == `v1.x`**
16+
**Ensure you're running [Node](https://nodejs.org) `v14.x` or `v16.x`, [npm](https://www.npmjs.com/) >= `v5.x` and [yarn](https://yarnpkg.com) == `v1.x`**
1717

1818
```bash
1919
# clone the repo
@@ -68,7 +68,7 @@ Requirements
6868
------------
6969

7070
- [Node.js](https://nodejs.org) and [yarn](https://yarnpkg.com)
71-
- Ensure you're running node `v12.x`, `v14.x` or `v16.x` and yarn == `v1.x`
71+
- Ensure you're running node `v14.x` or `v16.x` and yarn == `v1.x`
7272

7373
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.
7474

@@ -308,8 +308,11 @@ All E2E tests must be created under the `./cypress/integration/` folder, and mus
308308
* In the [Cypress Test Runner](https://docs.cypress.io/guides/core-concepts/test-runner), you'll Cypress automatically visit the page. This first test will succeed, as all you are doing is making sure the _page exists_.
309309
* From here, you can use the [Selector Playground](https://docs.cypress.io/guides/core-concepts/test-runner#Selector-Playground) in the Cypress Test Runner window to determine how to tell Cypress to interact with a specific HTML element on that page.
310310
* Most commands start by telling Cypress to [get()](https://docs.cypress.io/api/commands/get) a specific element, using a CSS or jQuery style selector
311+
* It's generally best not to rely on attributes like `class` and `id` in tests, as those are likely to change later on. Instead, you can add a `data-test` attribute to makes it clear that it's required for a test.
311312
* Cypress can then do actions like [click()](https://docs.cypress.io/api/commands/click) an element, or [type()](https://docs.cypress.io/api/commands/type) text in an input field, etc.
312-
* Cypress can also validate that something occurs, using [should()](https://docs.cypress.io/api/commands/should) assertions.
313+
* When running with server-side rendering enabled, the client first receives HTML without the JS; only once the page is rendered client-side do some elements (e.g. a button that toggles a Bootstrap dropdown) become fully interactive. This can trip up Cypress in some cases as it may try to `click` or `type` in an element that's not fully loaded yet, causing tests to fail.
314+
* To work around this issue, define the attributes you use for Cypress selectors as `[attr.data-test]="'button' | ngBrowserOnly"`. This will only show the attribute in CSR HTML, forcing Cypress to wait until CSR is complete before interacting with the element.
315+
* Cypress can also validate that something occurs, using [should()](https://docs.cypress.io/api/commands/should) assertions.
313316
* Any time you save your test file, the Cypress Test Runner will reload & rerun it. This allows you can see your results quickly as you write the tests & correct any broken tests rapidly.
314317
* Cypress also has a great guide on [writing your first test](https://on.cypress.io/writing-first-test) with much more info. Keep in mind, while the examples in the Cypress docs often involve Javascript files (.js), the same examples will work in our Typescript (.ts) e2e tests.
315318

angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
"bundleName": "dspace-theme"
6868
}
6969
],
70-
"scripts": []
70+
"scripts": [],
71+
"baseHref": "/"
7172
},
7273
"configurations": {
7374
"development": {

config/config.example.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ languages:
163163
- code: fi
164164
label: Suomi
165165
active: true
166+
- code: tr
167+
label: Türkçe
168+
active: true
166169
- code: bn
167170
label: বাংলা
168171
active: true
@@ -176,10 +179,12 @@ browseBy:
176179
# The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
177180
defaultLowerLimit: 1900
178181

179-
# Item Page Config
182+
# Item Config
180183
item:
181184
edit:
182185
undoTimeout: 10000 # 10 seconds
186+
# Show the item access status label in items lists
187+
showAccessStatuses: false
183188

184189
# When the search results are retrieved, for each item type the metadata with a valid authority value are inspected.
185190
# Referenced items will be fetched with a find all by id strategy to avoid individual rest requests
@@ -259,6 +264,10 @@ themes:
259264
rel: stylesheet
260265
href: "https://fonts.googleapis.com/icon?family=Material+Icons"
261266

267+
# The default bundles that should always be displayed as suggestions when you upload a new bundle
268+
bundle:
269+
- standardBundles: [ ORIGINAL, THUMBNAIL, LICENSE ]
270+
262271
# Whether to enable media viewer for image and/or video Bitstreams (i.e. Bitstreams whose MIME type starts with 'image' or 'video').
263272
# For images, this enables a gallery viewer where you can zoom or page through images.
264273
# For videos, this enables embedded video streaming

cypress/integration/my-dspace.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ xdescribe('My DSpace page', () => {
6565
cy.visit('/mydspace');
6666

6767
// Open the New Submission dropdown
68-
cy.get('#dropdownSubmission').click();
68+
cy.get('button[data-test="submission-dropdown"]').click();
6969
// Click on the "Item" type in that dropdown
7070
cy.get('#entityControlsDropdownMenu button[title="none"]').click();
7171

@@ -98,7 +98,7 @@ xdescribe('My DSpace page', () => {
9898
const id = subpaths[2];
9999

100100
// Click the "Save for Later" button to save this submission
101-
cy.get('button#saveForLater').click();
101+
cy.get('ds-submission-form-footer [data-test="save-for-later"]').click();
102102

103103
// "Save for Later" should send us to MyDSpace
104104
cy.url().should('include', '/mydspace');
@@ -122,7 +122,7 @@ xdescribe('My DSpace page', () => {
122122
cy.url().should('include', '/workspaceitems/' + id + '/edit');
123123

124124
// Discard our new submission by clicking Discard in Submission form & confirming
125-
cy.get('button#discard').click();
125+
cy.get('ds-submission-form-footer [data-test="discard"]').click();
126126
cy.get('button#discard_submit').click();
127127

128128
// Discarding should send us back to MyDSpace
@@ -135,7 +135,7 @@ xdescribe('My DSpace page', () => {
135135
cy.visit('/mydspace');
136136

137137
// Open the New Import dropdown
138-
cy.get('#dropdownImport').click();
138+
cy.get('button[data-test="import-dropdown"]').click();
139139
// Click on the "Item" type in that dropdown
140140
cy.get('#importControlsDropdownMenu button[title="none"]').click();
141141

cypress/integration/search-page.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('Search Page', () => {
2424

2525
// Click each filter toggle to open *every* filter
2626
// (As we want to scan filter section for accessibility issues as well)
27-
cy.get('.filter-toggle').click({ multiple: true });
27+
cy.get('[data-test="filter-toggle"]').click({ multiple: true });
2828

2929
// Analyze <ds-search-page> for accessibility issues
3030
/* testA11y(

cypress/integration/submission.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ xdescribe('New Submission page', () => {
4242
cy.get('button#deposit').click();
4343

4444
// A warning alert should display.
45+
cy.get('ds-notification div.alert-success').should('not.exist');
4546
cy.get('ds-notification div.alert-warning').should('be.visible');
4647

4748
// First section should have an exclamation error in the header

0 commit comments

Comments
 (0)