Skip to content

Commit 7b27251

Browse files
Merge remote-tracking branch 'upstream/main' into fixed-default-input-values-not-working_contribute-main
# Conflicts: # src/app/shared/search/themed-search.component.ts
2 parents 80b9052 + 3fcb113 commit 7b27251

1,075 files changed

Lines changed: 74081 additions & 46413 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.

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ trim_trailing_whitespace = false
1515

1616
[*.ts]
1717
quote_type = single
18+
19+
[*.json5]
20+
ij_json_keep_blank_lines_in_code = 3

.eslintrc.json

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"eslint-plugin-import",
77
"eslint-plugin-jsdoc",
88
"eslint-plugin-deprecation",
9-
"eslint-plugin-unused-imports"
9+
"unused-imports",
10+
"eslint-plugin-lodash",
11+
"eslint-plugin-jsonc"
1012
],
1113
"overrides": [
1214
{
@@ -202,7 +204,13 @@
202204
"deprecation/deprecation": "warn",
203205

204206
"import/order": "off",
205-
"import/no-deprecated": "warn"
207+
"import/no-deprecated": "warn",
208+
"import/no-namespace": "error",
209+
"unused-imports/no-unused-imports": "error",
210+
"lodash/import-scope": [
211+
"error",
212+
"method"
213+
]
206214
}
207215
},
208216
{
@@ -217,6 +225,42 @@
217225
"@angular-eslint/template/no-negated-async": "off",
218226
"@angular-eslint/template/eqeqeq": "off"
219227
}
228+
},
229+
{
230+
"files": [
231+
"*.json5"
232+
],
233+
"extends": [
234+
"plugin:jsonc/recommended-with-jsonc"
235+
],
236+
"rules": {
237+
"no-irregular-whitespace": "error",
238+
"no-trailing-spaces": "error",
239+
"jsonc/comma-dangle": [
240+
"error",
241+
"always-multiline"
242+
],
243+
"jsonc/indent": [
244+
"error",
245+
2
246+
],
247+
"jsonc/key-spacing": [
248+
"error",
249+
{
250+
"beforeColon": false,
251+
"afterColon": true,
252+
"mode": "strict"
253+
}
254+
],
255+
"jsonc/no-dupe-keys": "off",
256+
"jsonc/quotes": [
257+
"error",
258+
"double",
259+
{
260+
"avoidEscape": false
261+
}
262+
]
263+
}
220264
}
221265
]
222266
}

.github/pull_request_template.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## References
22
_Add references/links to any related issues or PRs. These may include:_
3-
* Fixes #[issue-number]
4-
* Requires DSpace/DSpace#[pr-number] (if a REST API PR is required to test this)
3+
* Fixes #`issue-number` (if this fixes an issue ticket)
4+
* Requires DSpace/DSpace#`pr-number` (if a REST API PR is required to test this)
55

66
## Description
77
Short summary of changes (1-2 sentences).
@@ -19,8 +19,10 @@ List of changes in this PR:
1919
_This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!_
2020

2121
- [ ] My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
22-
- [ ] My PR passes [TSLint](https://palantir.github.io/tslint/) validation using `yarn run lint`
23-
- [ ] My PR doesn't introduce circular dependencies
22+
- [ ] My PR passes [ESLint](https://eslint.org/) validation using `yarn lint`
23+
- [ ] My PR doesn't introduce circular dependencies (verified via `yarn check-circ-deps`)
2424
- [ ] My PR includes [TypeDoc](https://typedoc.org/) comments for _all new (or modified) public methods and classes_. It also includes TypeDoc for large or complex private methods.
2525
- [ ] My PR passes all specs/tests and includes new/updated specs or tests based on the [Code Testing Guide](https://wiki.lyrasis.org/display/DSPACE/Code+Testing+Guide).
26-
- [ ] If my PR includes new, third-party dependencies (in `package.json`), I've made sure their licenses align with the [DSpace BSD License](https://github.com/DSpace/DSpace/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation.
26+
- [ ] If my PR includes new libraries/dependencies (in `package.json`), I've made sure their licenses align with the [DSpace BSD License](https://github.com/DSpace/DSpace/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation.
27+
- [ ] If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
28+
- [ ] If my PR fixes an issue ticket, I've [linked them together](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).

.github/workflows/build.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,46 @@ name: Build
66
# Run this Build for all pushes / PRs to current branch
77
on: [push, pull_request]
88

9+
permissions:
10+
contents: read # to fetch code (actions/checkout)
11+
912
jobs:
1013
tests:
1114
runs-on: ubuntu-latest
1215
env:
1316
# The ci step will test the dspace-angular code against DSpace REST.
1417
# Direct that step to utilize a DSpace REST service that has been started in docker.
15-
DSPACE_REST_HOST: localhost
18+
# NOTE: These settings should be kept in sync with those in [src]/docker/docker-compose-ci.yml
19+
DSPACE_REST_HOST: 127.0.0.1
1620
DSPACE_REST_PORT: 8080
1721
DSPACE_REST_NAMESPACE: '/server'
1822
DSPACE_REST_SSL: false
23+
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 18+
24+
DSPACE_UI_HOST: 127.0.0.1
25+
DSPACE_UI_PORT: 4000
26+
# Ensure all SSR caching is disabled in test environment
27+
DSPACE_CACHE_SERVERSIDE_BOTCACHE_MAX: 0
28+
DSPACE_CACHE_SERVERSIDE_ANONYMOUSCACHE_MAX: 0
29+
# Tell Cypress to run e2e tests using the same UI URL
30+
CYPRESS_BASE_URL: http://127.0.0.1:4000
1931
# When Chrome version is specified, we pin to a specific version of Chrome
2032
# Comment this out to use the latest release
2133
#CHROME_VERSION: "90.0.4430.212-1"
2234
strategy:
2335
# Create a matrix of Node versions to test against (in parallel)
2436
matrix:
25-
node-version: [14.x, 16.x]
37+
node-version: [16.x, 18.x]
2638
# Do NOT exit immediately if one matrix job fails
2739
fail-fast: false
2840
# These are the actual CI steps to perform per job
2941
steps:
3042
# https://github.com/actions/checkout
3143
- name: Checkout codebase
32-
uses: actions/checkout@v2
44+
uses: actions/checkout@v3
3345

3446
# https://github.com/actions/setup-node
3547
- name: Install Node.js ${{ matrix.node-version }}
36-
uses: actions/setup-node@v2
48+
uses: actions/setup-node@v3
3749
with:
3850
node-version: ${{ matrix.node-version }}
3951

@@ -58,7 +70,7 @@ jobs:
5870
id: yarn-cache-dir-path
5971
run: echo "::set-output name=dir::$(yarn cache dir)"
6072
- name: Cache Yarn dependencies
61-
uses: actions/cache@v2
73+
uses: actions/cache@v3
6274
with:
6375
# Cache entire Yarn cache directory (see previous step)
6476
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -85,7 +97,7 @@ jobs:
8597
# Upload coverage reports to Codecov (for one version of Node only)
8698
# https://github.com/codecov/codecov-action
8799
- name: Upload coverage to Codecov.io
88-
uses: codecov/codecov-action@v2
100+
uses: codecov/codecov-action@v3
89101
if: matrix.node-version == '16.x'
90102

91103
# Using docker-compose start backend using CI configuration
@@ -100,7 +112,7 @@ jobs:
100112
# https://github.com/cypress-io/github-action
101113
# (NOTE: to run these e2e tests locally, just use 'ng e2e')
102114
- name: Run e2e tests (integration tests)
103-
uses: cypress-io/github-action@v2
115+
uses: cypress-io/github-action@v4
104116
with:
105117
# Run tests in Chrome, headless mode
106118
browser: chrome
@@ -109,14 +121,14 @@ jobs:
109121
start: yarn run serve:ssr
110122
# Wait for backend & frontend to be available
111123
# NOTE: We use the 'sites' REST endpoint to also ensure the database is ready
112-
wait-on: http://localhost:8080/server/api/core/sites, http://localhost:4000
124+
wait-on: http://127.0.0.1:8080/server/api/core/sites, http://127.0.0.1:4000
113125
# Wait for 2 mins max for everything to respond
114126
wait-on-timeout: 120
115127

116128
# Cypress always creates a video of all e2e tests (whether they succeeded or failed)
117129
# Save those in an Artifact
118130
- name: Upload e2e test videos to Artifacts
119-
uses: actions/upload-artifact@v2
131+
uses: actions/upload-artifact@v3
120132
if: always()
121133
with:
122134
name: e2e-test-videos
@@ -125,7 +137,7 @@ jobs:
125137
# If e2e tests fail, Cypress creates a screenshot of what happened
126138
# Save those in an Artifact
127139
- name: Upload e2e test failure screenshots to Artifacts
128-
uses: actions/upload-artifact@v2
140+
uses: actions/upload-artifact@v3
129141
if: failure()
130142
with:
131143
name: e2e-test-screenshots
@@ -144,7 +156,7 @@ jobs:
144156
run: |
145157
nohup yarn run serve:ssr &
146158
printf 'Waiting for app to start'
147-
until curl --output /dev/null --silent --head --fail http://localhost:4000/home; do
159+
until curl --output /dev/null --silent --head --fail http://127.0.0.1:4000/home; do
148160
printf '.'
149161
sleep 2
150162
done
@@ -155,7 +167,7 @@ jobs:
155167
# This step also prints entire HTML of homepage for easier debugging if grep fails.
156168
- name: Verify SSR (server-side rendering)
157169
run: |
158-
result=$(wget -O- -q http://localhost:4000/home)
170+
result=$(wget -O- -q http://127.0.0.1:4000/home)
159171
echo "$result"
160172
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DSpace
161173

.github/workflows/codescan.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# DSpace CodeQL code scanning configuration for GitHub
2+
# https://docs.github.com/en/code-security/code-scanning
3+
#
4+
# NOTE: Code scanning must be run separate from our default build.yml
5+
# because CodeQL requires a fresh build with all tests *disabled*.
6+
name: "Code Scanning"
7+
8+
# Run this code scan for all pushes / PRs to main branch. Also run once a week.
9+
on:
10+
push:
11+
branches: [ main ]
12+
pull_request:
13+
branches: [ main ]
14+
# Don't run if PR is only updating static documentation
15+
paths-ignore:
16+
- '**/*.md'
17+
- '**/*.txt'
18+
schedule:
19+
- cron: "37 0 * * 1"
20+
21+
jobs:
22+
analyze:
23+
name: Analyze Code
24+
runs-on: ubuntu-latest
25+
# Limit permissions of this GitHub action. Can only write to security-events
26+
permissions:
27+
actions: read
28+
contents: read
29+
security-events: write
30+
31+
steps:
32+
# https://github.com/actions/checkout
33+
- name: Checkout repository
34+
uses: actions/checkout@v3
35+
36+
# Initializes the CodeQL tools for scanning.
37+
# https://github.com/github/codeql-action
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@v2
40+
with:
41+
languages: javascript
42+
43+
# Autobuild attempts to build any compiled languages
44+
- name: Autobuild
45+
uses: github/codeql-action/autobuild@v2
46+
47+
# Perform GitHub Code Scanning.
48+
- name: Perform CodeQL Analysis
49+
uses: github/codeql-action/analyze@v2

.github/workflows/docker.yml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- 'dspace-**'
1313
pull_request:
1414

15+
permissions:
16+
contents: read # to fetch code (actions/checkout)
17+
1518
jobs:
1619
docker:
1720
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
@@ -39,11 +42,11 @@ jobs:
3942
steps:
4043
# https://github.com/actions/checkout
4144
- name: Checkout codebase
42-
uses: actions/checkout@v2
45+
uses: actions/checkout@v3
4346

4447
# https://github.com/docker/setup-buildx-action
4548
- name: Setup Docker Buildx
46-
uses: docker/setup-buildx-action@v1
49+
uses: docker/setup-buildx-action@v2
4750

4851
# https://github.com/docker/setup-qemu-action
4952
- name: Set up QEMU emulation to build for multiple architectures
@@ -53,7 +56,7 @@ jobs:
5356
- name: Login to DockerHub
5457
# Only login if not a PR, as PRs only trigger a Docker build and not a push
5558
if: github.event_name != 'pull_request'
56-
uses: docker/login-action@v1
59+
uses: docker/login-action@v2
5760
with:
5861
username: ${{ secrets.DOCKER_USERNAME }}
5962
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
@@ -65,7 +68,7 @@ jobs:
6568
# Get Metadata for docker_build step below
6669
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular' image
6770
id: meta_build
68-
uses: docker/metadata-action@v3
71+
uses: docker/metadata-action@v4
6972
with:
7073
images: dspace/dspace-angular
7174
tags: ${{ env.IMAGE_TAGS }}
@@ -74,7 +77,7 @@ jobs:
7477
# https://github.com/docker/build-push-action
7578
- name: Build and push 'dspace-angular' image
7679
id: docker_build
77-
uses: docker/build-push-action@v2
80+
uses: docker/build-push-action@v3
7881
with:
7982
context: .
8083
file: ./Dockerfile
@@ -85,3 +88,33 @@ jobs:
8588
# Use tags / labels provided by 'docker/metadata-action' above
8689
tags: ${{ steps.meta_build.outputs.tags }}
8790
labels: ${{ steps.meta_build.outputs.labels }}
91+
92+
#####################################################
93+
# Build/Push the 'dspace/dspace-angular' image ('-dist' tag)
94+
#####################################################
95+
# https://github.com/docker/metadata-action
96+
# Get Metadata for docker_build_dist step below
97+
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular-dist' image
98+
id: meta_build_dist
99+
uses: docker/metadata-action@v4
100+
with:
101+
images: dspace/dspace-angular
102+
tags: ${{ env.IMAGE_TAGS }}
103+
# As this is a "dist" image, its tags are all suffixed with "-dist". Otherwise, it uses the same
104+
# tagging logic as the primary 'dspace/dspace-angular' image above.
105+
flavor: ${{ env.TAGS_FLAVOR }}
106+
suffix=-dist
107+
108+
- name: Build and push 'dspace-angular-dist' image
109+
id: docker_build_dist
110+
uses: docker/build-push-action@v3
111+
with:
112+
context: .
113+
file: ./Dockerfile.dist
114+
platforms: ${{ env.PLATFORMS }}
115+
# For pull requests, we run the Docker build (to ensure no PR changes break the build),
116+
# but we ONLY do an image push to DockerHub if it's NOT a PR
117+
push: ${{ github.event_name != 'pull_request' }}
118+
# Use tags / labels provided by 'docker/metadata-action' above
119+
tags: ${{ steps.meta_build_dist.outputs.tags }}
120+
labels: ${{ steps.meta_build_dist.outputs.labels }}

.github/workflows/issue_opened.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,22 @@ on:
55
issues:
66
types: [opened]
77

8+
permissions: {}
89
jobs:
910
automation:
1011
runs-on: ubuntu-latest
1112
steps:
1213
# Add the new issue to a project board, if it needs triage
13-
# See https://github.com/marketplace/actions/create-project-card-action
14-
- name: Add issue to project board
14+
# See https://github.com/actions/add-to-project
15+
- name: Add issue to triage board
1516
# Only add to project board if issue is flagged as "needs triage" or has no labels
1617
# NOTE: By default we flag new issues as "needs triage" in our issue template
1718
if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '')
18-
uses: technote-space/create-project-card-action@v1
19+
uses: actions/add-to-project@v0.3.0
1920
# Note, the authentication token below is an ORG level Secret.
20-
# It must be created/recreated manually via a personal access token with "public_repo" and "admin:org" permissions
21+
# It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions
2122
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token
2223
# This is necessary because the "DSpace Backlog" project is an org level project (i.e. not repo specific)
2324
with:
24-
GITHUB_TOKEN: ${{ secrets.ORG_PROJECT_TOKEN }}
25-
PROJECT: DSpace Backlog
26-
COLUMN: Triage
27-
CHECK_ORG_PROJECT: true
28-
# Ignore errors
29-
continue-on-error: true
25+
github-token: ${{ secrets.TRIAGE_PROJECT_TOKEN }}
26+
project-url: https://github.com/orgs/DSpace/projects/24

0 commit comments

Comments
 (0)