Skip to content

Commit 1ccc7c6

Browse files
committed
Merge branch 'refs/heads/main' into main-optimize-metadata-represenation-rendering
# Conflicts: # src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts # src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts
2 parents 6e4589b + 02e91dd commit 1ccc7c6

2,407 files changed

Lines changed: 53841 additions & 33169 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: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@
1111
"eslint-plugin-jsonc",
1212
"eslint-plugin-rxjs",
1313
"eslint-plugin-simple-import-sort",
14-
"eslint-plugin-import-newlines"
14+
"eslint-plugin-import-newlines",
15+
"eslint-plugin-jsonc",
16+
"dspace-angular-ts",
17+
"dspace-angular-html"
18+
],
19+
"ignorePatterns": [
20+
"lint/test/fixture"
1521
],
1622
"overrides": [
1723
{
@@ -21,7 +27,8 @@
2127
"parserOptions": {
2228
"project": [
2329
"./tsconfig.json",
24-
"./cypress/tsconfig.json"
30+
"./cypress/tsconfig.json",
31+
"./lint/tsconfig.json"
2532
],
2633
"createDefaultProgram": true
2734
},
@@ -38,7 +45,10 @@
3845
"error",
3946
2,
4047
{
41-
"SwitchCase": 1
48+
"SwitchCase": 1,
49+
"ignoredNodes": [
50+
"ClassBody.body > PropertyDefinition[decorators.length > 0] > .key"
51+
]
4252
}
4353
],
4454
"max-classes-per-file": [
@@ -152,7 +162,6 @@
152162
}
153163
],
154164
"@angular-eslint/no-attribute-decorator": "error",
155-
"@angular-eslint/no-forward-ref": "error",
156165
"@angular-eslint/no-output-native": "warn",
157166
"@angular-eslint/no-output-on-prefix": "warn",
158167
"@angular-eslint/no-conflicting-lifecycle": "warn",
@@ -213,6 +222,15 @@
213222
"@typescript-eslint/no-unsafe-return": "off",
214223
"@typescript-eslint/restrict-template-expressions": "off",
215224
"@typescript-eslint/require-await": "off",
225+
"@typescript-eslint/no-base-to-string": [
226+
"error",
227+
{
228+
"ignoredTypeNames": [
229+
"ResourceType",
230+
"Error"
231+
]
232+
}
233+
],
216234

217235
"deprecation/deprecation": "warn",
218236

@@ -239,7 +257,12 @@
239257
"method"
240258
],
241259

242-
"rxjs/no-nested-subscribe": "off" // todo: go over _all_ cases
260+
"rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases
261+
262+
// Custom DSpace Angular rules
263+
"dspace-angular-ts/themed-component-classes": "error",
264+
"dspace-angular-ts/themed-component-selectors": "error",
265+
"dspace-angular-ts/themed-component-usages": "error"
243266
}
244267
},
245268
{
@@ -254,7 +277,10 @@
254277
"createDefaultProgram": true
255278
},
256279
"rules": {
257-
"prefer-const": "off"
280+
"prefer-const": "off",
281+
282+
// Custom DSpace Angular rules
283+
"dspace-angular-ts/themed-component-usages": "error"
258284
}
259285
},
260286
{
@@ -263,7 +289,11 @@
263289
],
264290
"extends": [
265291
"plugin:@angular-eslint/template/recommended"
266-
]
292+
],
293+
"rules": {
294+
// Custom DSpace Angular rules
295+
"dspace-angular-html/themed-component-usages": "error"
296+
}
267297
},
268298
{
269299
"files": [

.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
*.css eol=lf
1414
*.scss eol=lf
1515
*.html eol=lf
16-
*.svg eol=lf
16+
*.svg eol=lf
17+
18+
# Generated documentation should have LF line endings to reduce git noise
19+
docs/lint/**/*.md eol=lf

.github/workflows/build.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ jobs:
3333
#CHROME_VERSION: "90.0.4430.212-1"
3434
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
3535
NODE_OPTIONS: '--max-old-space-size=4096'
36-
# Project name to use when running docker-compose prior to e2e tests
36+
# Project name to use when running "docker compose" prior to e2e tests
3737
COMPOSE_PROJECT_NAME: 'ci'
3838
strategy:
3939
# Create a matrix of Node versions to test against (in parallel)
4040
matrix:
41-
node-version: [16.x, 18.x]
41+
node-version: [18.x, 20.x]
4242
# Do NOT exit immediately if one matrix job fails
4343
fail-fast: false
4444
# These are the actual CI steps to perform per job
@@ -74,7 +74,7 @@ jobs:
7474
id: yarn-cache-dir-path
7575
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
7676
- name: Cache Yarn dependencies
77-
uses: actions/cache@v3
77+
uses: actions/cache@v4
7878
with:
7979
# Cache entire Yarn cache directory (see previous step)
8080
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -85,8 +85,14 @@ jobs:
8585
- name: Install Yarn dependencies
8686
run: yarn install --frozen-lockfile
8787

88+
- name: Build lint plugins
89+
run: yarn run build:lint
90+
91+
- name: Run lint plugin tests
92+
run: yarn run test:lint:nobuild
93+
8894
- name: Run lint
89-
run: yarn run lint --quiet
95+
run: yarn run lint:nobuild --quiet
9096

9197
- name: Check for circular dependencies
9298
run: yarn run check-circ-deps
@@ -101,19 +107,19 @@ jobs:
101107
# so that it can be shared with the 'codecov' job (see below)
102108
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
103109
- name: Upload code coverage report to Artifact
104-
uses: actions/upload-artifact@v3
110+
uses: actions/upload-artifact@v4
105111
if: matrix.node-version == '18.x'
106112
with:
107-
name: dspace-angular coverage report
113+
name: coverage-report-${{ matrix.node-version }}
108114
path: 'coverage/dspace-angular/lcov.info'
109115
retention-days: 14
110116

111-
# Using docker-compose start backend using CI configuration
117+
# Using "docker compose" start backend using CI configuration
112118
# and load assetstore from a cached copy
113119
- name: Start DSpace REST Backend via Docker (for e2e tests)
114120
run: |
115-
docker-compose -f ./docker/docker-compose-ci.yml up -d
116-
docker-compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
121+
docker compose -f ./docker/docker-compose-ci.yml up -d
122+
docker compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
117123
docker container ls
118124
119125
# Run integration tests via Cypress.io
@@ -135,19 +141,19 @@ jobs:
135141
# Cypress always creates a video of all e2e tests (whether they succeeded or failed)
136142
# Save those in an Artifact
137143
- name: Upload e2e test videos to Artifacts
138-
uses: actions/upload-artifact@v3
144+
uses: actions/upload-artifact@v4
139145
if: always()
140146
with:
141-
name: e2e-test-videos
147+
name: e2e-test-videos-${{ matrix.node-version }}
142148
path: cypress/videos
143149

144150
# If e2e tests fail, Cypress creates a screenshot of what happened
145151
# Save those in an Artifact
146152
- name: Upload e2e test failure screenshots to Artifacts
147-
uses: actions/upload-artifact@v3
153+
uses: actions/upload-artifact@v4
148154
if: failure()
149155
with:
150-
name: e2e-test-screenshots
156+
name: e2e-test-screenshots-${{ matrix.node-version }}
151157
path: cypress/screenshots
152158

153159
- name: Stop app (in case it stays up after e2e tests)
@@ -182,7 +188,7 @@ jobs:
182188
run: kill -9 $(lsof -t -i:4000)
183189

184190
- name: Shutdown Docker containers
185-
run: docker-compose -f ./docker/docker-compose-ci.yml down
191+
run: docker compose -f ./docker/docker-compose-ci.yml down
186192

187193
# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
188194
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
@@ -197,7 +203,7 @@ jobs:
197203

198204
# Download artifacts from previous 'tests' job
199205
- name: Download coverage artifacts
200-
uses: actions/download-artifact@v3
206+
uses: actions/download-artifact@v4
201207

202208
# Now attempt upload to Codecov using its action.
203209
# NOTE: We use a retry action to retry the Codecov upload if it fails the first time.
@@ -207,11 +213,12 @@ jobs:
207213
- name: Upload coverage to Codecov.io
208214
uses: Wandalen/wretry.action@v1.3.0
209215
with:
210-
action: codecov/codecov-action@v3
216+
action: codecov/codecov-action@v4
211217
# Ensure codecov-action throws an error when it fails to upload
212218
# This allows us to auto-restart the action if an error is thrown
213219
with: |
214220
fail_ci_if_error: true
221+
token: ${{ secrets.CODECOV_TOKEN }}
215222
# Try re-running action 5 times max
216223
attempt_limit: 5
217224
# Run again in 30 seconds

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
2929
uses: DSpace/DSpace/.github/workflows/reusable-docker-build.yml@main
3030
with:
31-
build_id: dspace-angular
31+
build_id: dspace-angular-dev
3232
image_name: dspace/dspace-angular
3333
dockerfile_path: ./Dockerfile
3434
secrets:

.github/workflows/issue_opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# Only add to project board if issue is flagged as "needs triage" or has no labels
1717
# NOTE: By default we flag new issues as "needs triage" in our issue template
1818
if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '')
19-
uses: actions/add-to-project@v0.5.0
19+
uses: actions/add-to-project@v1.0.0
2020
# Note, the authentication token below is an ORG level Secret.
2121
# It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions
2222
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token

.github/workflows/pull_request_opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
# Assign the PR to whomever created it. This is useful for visualizing assignments on project boards
2222
# See https://github.com/toshimaru/auto-author-assign
2323
- name: Assign PR to creator
24-
uses: toshimaru/auto-author-assign@v2.0.1
24+
uses: toshimaru/auto-author-assign@v2.1.0

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.angular/cache
2+
/.nx
23
/__build__
34
/__server_build__
45
/node_modules

angular.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,22 @@
109109
"serve": {
110110
"builder": "@angular-builders/custom-webpack:dev-server",
111111
"options": {
112-
"browserTarget": "dspace-angular:build",
112+
"buildTarget": "dspace-angular:build",
113113
"port": 4000
114114
},
115115
"configurations": {
116116
"development": {
117-
"browserTarget": "dspace-angular:build:development"
117+
"buildTarget": "dspace-angular:build:development"
118118
},
119119
"production": {
120-
"browserTarget": "dspace-angular:build:production"
120+
"buildTarget": "dspace-angular:build:production"
121121
}
122122
}
123123
},
124124
"extract-i18n": {
125125
"builder": "@angular-devkit/build-angular:extract-i18n",
126126
"options": {
127-
"browserTarget": "dspace-angular:build"
127+
"buildTarget": "dspace-angular:build"
128128
}
129129
},
130130
"test": {
@@ -217,23 +217,23 @@
217217
}
218218
},
219219
"serve-ssr": {
220-
"builder": "@nguniversal/builders:ssr-dev-server",
220+
"builder": "@angular-devkit/build-angular:ssr-dev-server",
221221
"options": {
222-
"browserTarget": "dspace-angular:build",
222+
"buildTarget": "dspace-angular:build",
223223
"serverTarget": "dspace-angular:server",
224224
"port": 4000
225225
},
226226
"configurations": {
227227
"production": {
228-
"browserTarget": "dspace-angular:build:production",
228+
"buildTarget": "dspace-angular:build:production",
229229
"serverTarget": "dspace-angular:server:production"
230230
}
231231
}
232232
},
233233
"prerender": {
234-
"builder": "@nguniversal/builders:prerender",
234+
"builder": "@angular-devkit/build-angular:prerender",
235235
"options": {
236-
"browserTarget": "dspace-angular:build:production",
236+
"buildTarget": "dspace-angular:build:production",
237237
"serverTarget": "dspace-angular:server:production",
238238
"routes": [
239239
"/"
@@ -266,6 +266,8 @@
266266
"options": {
267267
"lintFilePatterns": [
268268
"src/**/*.ts",
269+
"cypress/**/*.ts",
270+
"lint/**/*.ts",
269271
"src/**/*.html",
270272
"src/**/*.json5"
271273
]

0 commit comments

Comments
 (0)