Skip to content

Commit 78e8fab

Browse files
committed
Merge remote-tracking branch '4scienceGithub/DURACOM-235' into DURACOM-235
# Conflicts: # src/app/collection-page/create-collection-page/create-collection-page.component.html # src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.ts
2 parents dbf9d29 + a525b06 commit 78e8fab

3,162 files changed

Lines changed: 115221 additions & 58210 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: 84 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@
88
"eslint-plugin-deprecation",
99
"unused-imports",
1010
"eslint-plugin-lodash",
11-
"eslint-plugin-jsonc"
11+
"eslint-plugin-jsonc",
12+
"eslint-plugin-rxjs",
13+
"eslint-plugin-simple-import-sort",
14+
"eslint-plugin-import-newlines",
15+
"eslint-plugin-jsonc",
16+
"dspace-angular-ts",
17+
"dspace-angular-html"
18+
],
19+
"ignorePatterns": [
20+
"lint/test/fixture"
1221
],
1322
"overrides": [
1423
{
@@ -18,7 +27,8 @@
1827
"parserOptions": {
1928
"project": [
2029
"./tsconfig.json",
21-
"./cypress/tsconfig.json"
30+
"./cypress/tsconfig.json",
31+
"./lint/tsconfig.json"
2232
],
2333
"createDefaultProgram": true
2434
},
@@ -27,17 +37,32 @@
2737
"plugin:@typescript-eslint/recommended",
2838
"plugin:@typescript-eslint/recommended-requiring-type-checking",
2939
"plugin:@angular-eslint/recommended",
30-
"plugin:@angular-eslint/template/process-inline-templates"
40+
"plugin:@angular-eslint/template/process-inline-templates",
41+
"plugin:rxjs/recommended"
3142
],
3243
"rules": {
44+
"indent": [
45+
"error",
46+
2,
47+
{
48+
"SwitchCase": 1,
49+
"ignoredNodes": [
50+
"ClassBody.body > PropertyDefinition[decorators.length > 0] > .key"
51+
]
52+
}
53+
],
3354
"max-classes-per-file": [
3455
"error",
3556
1
3657
],
3758
"comma-dangle": [
38-
"off",
59+
"error",
3960
"always-multiline"
4061
],
62+
"object-curly-spacing": [
63+
"error",
64+
"always"
65+
],
4166
"eol-last": [
4267
"error",
4368
"always"
@@ -104,15 +129,13 @@
104129
"allowTernary": true
105130
}
106131
],
107-
"prefer-const": "off", // todo: re-enable & fix errors (more strict than it used to be in TSLint)
132+
"prefer-const": "error",
133+
"no-case-declarations": "error",
134+
"no-extra-boolean-cast": "error",
108135
"prefer-spread": "off",
109136
"no-underscore-dangle": "off",
110-
111-
// todo: disabled rules from eslint:recommended, consider re-enabling & fixing
112137
"no-prototype-builtins": "off",
113138
"no-useless-escape": "off",
114-
"no-case-declarations": "off",
115-
"no-extra-boolean-cast": "off",
116139

117140
"@angular-eslint/directive-selector": [
118141
"error",
@@ -139,7 +162,6 @@
139162
}
140163
],
141164
"@angular-eslint/no-attribute-decorator": "error",
142-
"@angular-eslint/no-forward-ref": "error",
143165
"@angular-eslint/no-output-native": "warn",
144166
"@angular-eslint/no-output-on-prefix": "warn",
145167
"@angular-eslint/no-conflicting-lifecycle": "warn",
@@ -183,7 +205,7 @@
183205
],
184206
"@typescript-eslint/type-annotation-spacing": "error",
185207
"@typescript-eslint/unified-signatures": "error",
186-
"@typescript-eslint/ban-types": "warn", // todo: deal with {} type issues & re-enable
208+
"@typescript-eslint/ban-types": "error",
187209
"@typescript-eslint/no-floating-promises": "warn",
188210
"@typescript-eslint/no-misused-promises": "warn",
189211
"@typescript-eslint/restrict-plus-operands": "warn",
@@ -200,17 +222,65 @@
200222
"@typescript-eslint/no-unsafe-return": "off",
201223
"@typescript-eslint/restrict-template-expressions": "off",
202224
"@typescript-eslint/require-await": "off",
225+
"@typescript-eslint/no-base-to-string": [
226+
"error",
227+
{
228+
"ignoredTypeNames": [
229+
"ResourceType",
230+
"Error"
231+
]
232+
}
233+
],
203234

204235
"deprecation/deprecation": "warn",
205236

237+
"simple-import-sort/imports": "error",
238+
"simple-import-sort/exports": "error",
206239
"import/order": "off",
240+
"import/first": "error",
241+
"import/newline-after-import": "error",
242+
"import/no-duplicates": "error",
207243
"import/no-deprecated": "warn",
208244
"import/no-namespace": "error",
245+
"import-newlines/enforce": [
246+
"error",
247+
{
248+
"items": 1,
249+
"semi": true,
250+
"forceSingleLine": true
251+
}
252+
],
253+
209254
"unused-imports/no-unused-imports": "error",
210255
"lodash/import-scope": [
211256
"error",
212257
"method"
213-
]
258+
],
259+
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"
266+
}
267+
},
268+
{
269+
"files": [
270+
"*.spec.ts"
271+
],
272+
"parserOptions": {
273+
"project": [
274+
"./tsconfig.json",
275+
"./cypress/tsconfig.json"
276+
],
277+
"createDefaultProgram": true
278+
},
279+
"rules": {
280+
"prefer-const": "off",
281+
282+
// Custom DSpace Angular rules
283+
"dspace-angular-ts/themed-component-usages": "error"
214284
}
215285
},
216286
{
@@ -221,9 +291,8 @@
221291
"plugin:@angular-eslint/template/recommended"
222292
],
223293
"rules": {
224-
// todo: re-enable & fix errors
225-
"@angular-eslint/template/no-negated-async": "off",
226-
"@angular-eslint/template/eqeqeq": "off"
294+
// Custom DSpace Angular rules
295+
"dspace-angular-html/themed-component-usages": "error"
227296
}
228297
},
229298
{

.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

0 commit comments

Comments
 (0)