Skip to content

Commit 9371c0b

Browse files
author
Jens Vannerum
committed
Merge branch 'main' into w2p-94474_clarify-process-state
# Conflicts: # src/assets/i18n/de.json5 # src/assets/i18n/es.json5 # src/assets/i18n/lv.json5 # src/assets/i18n/tr.json5
2 parents 81d3b17 + 31167a3 commit 9371c0b

1,815 files changed

Lines changed: 102551 additions & 33714 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.

.browserslistrc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
# For additional information regarding the format and rule options, please see:
33
# https://github.com/browserslist/browserslist#queries
44

5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
58
# You can see what browsers were selected by your queries by running:
69
# npx browserslist
710

8-
> 0.5%
9-
last 2 versions
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
1016
Firefox ESR
11-
not IE 9-11 # For IE 9-11 support, remove 'not'.
17+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

.eslintrc.json

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
{
2+
"root": true,
3+
"plugins": [
4+
"@typescript-eslint",
5+
"@angular-eslint/eslint-plugin",
6+
"eslint-plugin-import",
7+
"eslint-plugin-jsdoc",
8+
"eslint-plugin-deprecation",
9+
"eslint-plugin-unused-imports"
10+
],
11+
"overrides": [
12+
{
13+
"files": [
14+
"*.ts"
15+
],
16+
"parserOptions": {
17+
"project": [
18+
"./tsconfig.json",
19+
"./cypress/tsconfig.json"
20+
],
21+
"createDefaultProgram": true
22+
},
23+
"extends": [
24+
"eslint:recommended",
25+
"plugin:@typescript-eslint/recommended",
26+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
27+
"plugin:@angular-eslint/recommended",
28+
"plugin:@angular-eslint/template/process-inline-templates"
29+
],
30+
"rules": {
31+
"max-classes-per-file": [
32+
"error",
33+
1
34+
],
35+
"comma-dangle": [
36+
"off",
37+
"always-multiline"
38+
],
39+
"eol-last": [
40+
"error",
41+
"always"
42+
],
43+
"no-console": [
44+
"error",
45+
{
46+
"allow": [
47+
"log",
48+
"warn",
49+
"dir",
50+
"timeLog",
51+
"assert",
52+
"clear",
53+
"count",
54+
"countReset",
55+
"group",
56+
"groupEnd",
57+
"table",
58+
"debug",
59+
"info",
60+
"dirxml",
61+
"error",
62+
"groupCollapsed",
63+
"Console",
64+
"profile",
65+
"profileEnd",
66+
"timeStamp",
67+
"context"
68+
]
69+
}
70+
],
71+
"curly": "error",
72+
"brace-style": [
73+
"error",
74+
"1tbs",
75+
{
76+
"allowSingleLine": true
77+
}
78+
],
79+
"eqeqeq": [
80+
"error",
81+
"always",
82+
{
83+
"null": "ignore"
84+
}
85+
],
86+
"radix": "error",
87+
"guard-for-in": "error",
88+
"no-bitwise": "error",
89+
"no-restricted-imports": "error",
90+
"no-caller": "error",
91+
"no-debugger": "error",
92+
"no-redeclare": "error",
93+
"no-eval": "error",
94+
"no-fallthrough": "error",
95+
"no-trailing-spaces": "error",
96+
"space-infix-ops": "error",
97+
"keyword-spacing": "error",
98+
"no-var": "error",
99+
"no-unused-expressions": [
100+
"error",
101+
{
102+
"allowTernary": true
103+
}
104+
],
105+
"prefer-const": "off", // todo: re-enable & fix errors (more strict than it used to be in TSLint)
106+
"prefer-spread": "off",
107+
"no-underscore-dangle": "off",
108+
109+
// todo: disabled rules from eslint:recommended, consider re-enabling & fixing
110+
"no-prototype-builtins": "off",
111+
"no-useless-escape": "off",
112+
"no-case-declarations": "off",
113+
"no-extra-boolean-cast": "off",
114+
115+
"@angular-eslint/directive-selector": [
116+
"error",
117+
{
118+
"type": "attribute",
119+
"prefix": "ds",
120+
"style": "camelCase"
121+
}
122+
],
123+
"@angular-eslint/component-selector": [
124+
"error",
125+
{
126+
"type": "element",
127+
"prefix": "ds",
128+
"style": "kebab-case"
129+
}
130+
],
131+
"@angular-eslint/pipe-prefix": [
132+
"error",
133+
{
134+
"prefixes": [
135+
"ds"
136+
]
137+
}
138+
],
139+
"@angular-eslint/no-attribute-decorator": "error",
140+
"@angular-eslint/no-forward-ref": "error",
141+
"@angular-eslint/no-output-native": "warn",
142+
"@angular-eslint/no-output-on-prefix": "warn",
143+
"@angular-eslint/no-conflicting-lifecycle": "warn",
144+
145+
"@typescript-eslint/no-inferrable-types":[
146+
"error",
147+
{
148+
"ignoreParameters": true
149+
}
150+
],
151+
"@typescript-eslint/quotes": [
152+
"error",
153+
"single",
154+
{
155+
"avoidEscape": true,
156+
"allowTemplateLiterals": true
157+
}
158+
],
159+
"@typescript-eslint/semi": "error",
160+
"@typescript-eslint/no-shadow": "error",
161+
"@typescript-eslint/dot-notation": "error",
162+
"@typescript-eslint/consistent-type-definitions": "error",
163+
"@typescript-eslint/prefer-function-type": "error",
164+
"@typescript-eslint/naming-convention": [
165+
"error",
166+
{
167+
"selector": "property",
168+
"format": null
169+
}
170+
],
171+
"@typescript-eslint/member-ordering": [
172+
"error",
173+
{
174+
"default": [
175+
"static-field",
176+
"instance-field",
177+
"static-method",
178+
"instance-method"
179+
]
180+
}
181+
],
182+
"@typescript-eslint/type-annotation-spacing": "error",
183+
"@typescript-eslint/unified-signatures": "error",
184+
"@typescript-eslint/ban-types": "warn", // todo: deal with {} type issues & re-enable
185+
"@typescript-eslint/no-floating-promises": "warn",
186+
"@typescript-eslint/no-misused-promises": "warn",
187+
"@typescript-eslint/restrict-plus-operands": "warn",
188+
"@typescript-eslint/unbound-method": "off",
189+
"@typescript-eslint/ban-ts-comment": "off",
190+
"@typescript-eslint/no-var-requires": "off",
191+
"@typescript-eslint/no-unused-vars": "off",
192+
"@typescript-eslint/no-unnecessary-type-assertion": "off",
193+
"@typescript-eslint/no-explicit-any": "off",
194+
"@typescript-eslint/no-unsafe-assignment": "off",
195+
"@typescript-eslint/no-unsafe-member-access": "off",
196+
"@typescript-eslint/no-unsafe-call": "off",
197+
"@typescript-eslint/no-unsafe-argument": "off",
198+
"@typescript-eslint/no-unsafe-return": "off",
199+
"@typescript-eslint/restrict-template-expressions": "off",
200+
"@typescript-eslint/require-await": "off",
201+
202+
"deprecation/deprecation": "warn",
203+
204+
"import/order": "off",
205+
"import/no-deprecated": "warn"
206+
}
207+
},
208+
{
209+
"files": [
210+
"*.html"
211+
],
212+
"extends": [
213+
"plugin:@angular-eslint/template/recommended"
214+
],
215+
"rules": {
216+
// todo: re-enable & fix errors
217+
"@angular-eslint/template/no-negated-async": "off",
218+
"@angular-eslint/template/eqeqeq": "off"
219+
}
220+
}
221+
]
222+
}

.gitattributes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# By default, auto detect text files and perform LF normalization
2+
# This ensures code is always checked in with LF line endings
3+
* text=auto
4+
5+
# JS and TS files must always use LF for Angular tools to work
6+
# Some Angular tools expect LF line endings, even on Windows.
7+
# This ensures Windows always checks out these files with LF line endings
8+
# We've copied many of these rules from https://github.com/angular/angular-cli/
9+
*.js eol=lf
10+
*.ts eol=lf
11+
*.json eol=lf
12+
*.json5 eol=lf
13+
*.css eol=lf
14+
*.scss eol=lf
15+
*.html eol=lf
16+
*.svg eol=lf

.github/workflows/build.yml

Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@ jobs:
1616
DSPACE_REST_PORT: 8080
1717
DSPACE_REST_NAMESPACE: '/server'
1818
DSPACE_REST_SSL: false
19-
# When Chrome version is specified, we pin to a specific version of Chrome & ChromeDriver
20-
# Comment this out to use the latest release of both.
21-
CHROME_VERSION: "90.0.4430.212-1"
19+
# When Chrome version is specified, we pin to a specific version of Chrome
20+
# Comment this out to use the latest release
21+
#CHROME_VERSION: "90.0.4430.212-1"
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
2929
steps:
3030
# https://github.com/actions/checkout
3131
- name: Checkout codebase
32-
uses: actions/checkout@v1
32+
uses: actions/checkout@v2
3333

3434
# https://github.com/actions/setup-node
3535
- name: Install Node.js ${{ matrix.node-version }}
36-
uses: actions/setup-node@v1
36+
uses: actions/setup-node@v2
3737
with:
3838
node-version: ${{ matrix.node-version }}
3939

@@ -66,17 +66,14 @@ jobs:
6666
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
6767
restore-keys: ${{ runner.os }}-yarn-
6868

69-
- name: Install latest ChromeDriver compatible with installed Chrome
70-
# needs to be npm, the --detect_chromedriver_version flag doesn't work with yarn global
71-
run: |
72-
npm install -g chromedriver --detect_chromedriver_version
73-
chromedriver -v
74-
7569
- name: Install Yarn dependencies
7670
run: yarn install --frozen-lockfile
7771

7872
- name: Run lint
79-
run: yarn run lint
73+
run: yarn run lint --quiet
74+
75+
- name: Check for circular dependencies
76+
run: yarn run check-circ-deps
8077

8178
- name: Run build
8279
run: yarn run build:prod
@@ -85,11 +82,11 @@ jobs:
8582
run: yarn run test:headless
8683

8784
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
88-
# Upload coverage reports to Codecov (for Node v12 only)
85+
# Upload coverage reports to Codecov (for one version of Node only)
8986
# https://github.com/codecov/codecov-action
9087
- name: Upload coverage to Codecov.io
91-
uses: codecov/codecov-action@v1
92-
if: matrix.node-version == '12.x'
88+
uses: codecov/codecov-action@v2
89+
if: matrix.node-version == '16.x'
9390

9491
# Using docker-compose start backend using CI configuration
9592
# and load assetstore from a cached copy
@@ -99,23 +96,48 @@ jobs:
9996
docker-compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
10097
docker container ls
10198
102-
# Wait until the REST API returns a 200 response (or for a max of 30 seconds)
103-
# https://github.com/nev7n/wait_for_response
104-
- name: Wait for DSpace REST Backend to be ready (for e2e tests)
105-
uses: nev7n/wait_for_response@v1
99+
# Run integration tests via Cypress.io
100+
# https://github.com/cypress-io/github-action
101+
# (NOTE: to run these e2e tests locally, just use 'ng e2e')
102+
- name: Run e2e tests (integration tests)
103+
uses: cypress-io/github-action@v2
106104
with:
107-
# We use the 'sites' endpoint to also ensure the database is ready
108-
url: 'http://localhost:8080/server/api/core/sites'
109-
responseCode: 200
110-
timeout: 30000
111-
112-
- name: Get DSpace REST Backend info/properties
113-
run: curl http://localhost:8080/server/api
105+
# Run tests in Chrome, headless mode
106+
browser: chrome
107+
headless: true
108+
# Start app before running tests (will be stopped automatically after tests finish)
109+
start: yarn run serve:ssr
110+
# Wait for backend & frontend to be available
111+
# 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
113+
# Wait for 2 mins max for everything to respond
114+
wait-on-timeout: 120
115+
116+
# Cypress always creates a video of all e2e tests (whether they succeeded or failed)
117+
# Save those in an Artifact
118+
- name: Upload e2e test videos to Artifacts
119+
uses: actions/upload-artifact@v2
120+
if: always()
121+
with:
122+
name: e2e-test-videos
123+
path: cypress/videos
124+
125+
# If e2e tests fail, Cypress creates a screenshot of what happened
126+
# Save those in an Artifact
127+
- name: Upload e2e test failure screenshots to Artifacts
128+
uses: actions/upload-artifact@v2
129+
if: failure()
130+
with:
131+
name: e2e-test-screenshots
132+
path: cypress/screenshots
114133

115-
- name: Run e2e tests (integration tests)
134+
- name: Stop app (in case it stays up after e2e tests)
116135
run: |
117-
chromedriver --url-base='/wd/hub' --port=4444 &
118-
yarn run e2e:ci
136+
app_pid=$(lsof -t -i:4000)
137+
if [[ ! -z $app_pid ]]; then
138+
echo "App was still up! (PID: $app_pid)"
139+
kill -9 $app_pid
140+
fi
119141
120142
# Start up the app with SSR enabled (run in background)
121143
- name: Start app in SSR (server-side rendering) mode

0 commit comments

Comments
 (0)