Skip to content

Commit 27a83d6

Browse files
Merge remote-tracking branch 'upstream/main' into theme-fixes_contribute-main
2 parents 3a13ea8 + 41a00e3 commit 27a83d6

742 files changed

Lines changed: 6120 additions & 1811 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 & 6 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": [
@@ -212,6 +222,15 @@
212222
"@typescript-eslint/no-unsafe-return": "off",
213223
"@typescript-eslint/restrict-template-expressions": "off",
214224
"@typescript-eslint/require-await": "off",
225+
"@typescript-eslint/no-base-to-string": [
226+
"error",
227+
{
228+
"ignoredTypeNames": [
229+
"ResourceType",
230+
"Error"
231+
]
232+
}
233+
],
215234

216235
"deprecation/deprecation": "warn",
217236

@@ -238,7 +257,12 @@
238257
"method"
239258
],
240259

241-
"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"
242266
}
243267
},
244268
{
@@ -253,7 +277,10 @@
253277
"createDefaultProgram": true
254278
},
255279
"rules": {
256-
"prefer-const": "off"
280+
"prefer-const": "off",
281+
282+
// Custom DSpace Angular rules
283+
"dspace-angular-ts/themed-component-usages": "error"
257284
}
258285
},
259286
{
@@ -262,7 +289,11 @@
262289
],
263290
"extends": [
264291
"plugin:@angular-eslint/template/recommended"
265-
]
292+
],
293+
"rules": {
294+
// Custom DSpace Angular rules
295+
"dspace-angular-html/themed-component-usages": "error"
296+
}
266297
},
267298
{
268299
"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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

angular.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@
266266
"options": {
267267
"lintFilePatterns": [
268268
"src/**/*.ts",
269+
"cypress/**/*.ts",
270+
"lint/**/*.ts",
269271
"src/**/*.html",
270272
"src/**/*.json5"
271273
]

cypress/e2e/item-template.cy.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const ADD_TEMPLATE_ITEM_PAGE = '/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('/itemtemplate');
2+
3+
describe('Item Template', () => {
4+
beforeEach(() => {
5+
cy.visit(ADD_TEMPLATE_ITEM_PAGE);
6+
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
7+
});
8+
9+
it('should load properly', () => {
10+
cy.contains('.ds-header-row .lbl-cell', 'Field', { timeout: 10000 }).should('exist').should('be.visible');
11+
cy.contains('.ds-header-row b', 'Value', { timeout: 10000 }).should('exist').should('be.visible');
12+
cy.contains('.ds-header-row b', 'Lang', { timeout: 10000 }).should('exist').should('be.visible');
13+
cy.contains('.ds-header-row b', 'Edit', { timeout: 10000 }).should('exist').should('be.visible');
14+
});
15+
});

cypress/e2e/login-modal.cy.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@ import { testA11y } from 'cypress/support/utils';
33
const page = {
44
openLoginMenu() {
55
// Click the "Log In" dropdown menu in header
6-
cy.get('ds-themed-header [data-test="login-menu"]').click();
6+
cy.get('ds-header [data-test="login-menu"]').click();
77
},
88
openUserMenu() {
99
// Once logged in, click the User menu in header
10-
cy.get('ds-themed-header [data-test="user-menu"]').click();
10+
cy.get('ds-header [data-test="user-menu"]').click();
1111
},
1212
submitLoginAndPasswordByPressingButton(email, password) {
1313
// Enter email
14-
cy.get('ds-themed-header [data-test="email"]').type(email);
14+
cy.get('ds-header [data-test="email"]').type(email);
1515
// Enter password
16-
cy.get('ds-themed-header [data-test="password"]').type(password);
16+
cy.get('ds-header [data-test="password"]').type(password);
1717
// Click login button
18-
cy.get('ds-themed-header [data-test="login-button"]').click();
18+
cy.get('ds-header [data-test="login-button"]').click();
1919
},
2020
submitLoginAndPasswordByPressingEnter(email, password) {
2121
// In opened Login modal, fill out email & password, then click Enter
22-
cy.get('ds-themed-header [data-test="email"]').type(email);
23-
cy.get('ds-themed-header [data-test="password"]').type(password);
24-
cy.get('ds-themed-header [data-test="password"]').type('{enter}');
22+
cy.get('ds-header [data-test="email"]').type(email);
23+
cy.get('ds-header [data-test="password"]').type(password);
24+
cy.get('ds-header [data-test="password"]').type('{enter}');
2525
},
2626
submitLogoutByPressingButton() {
2727
// This is the POST command that will actually log us out
2828
cy.intercept('POST', '/server/api/authn/logout').as('logout');
2929
// Click logout button
30-
cy.get('ds-themed-header [data-test="logout-button"]').click();
30+
cy.get('ds-header [data-test="logout-button"]').click();
3131
// Wait until above POST command responds before continuing
3232
// (This ensures next action waits until logout completes)
3333
cy.wait('@logout');
@@ -102,10 +102,10 @@ describe('Login Modal', () => {
102102
page.openLoginMenu();
103103

104104
// Registration link should be visible
105-
cy.get('ds-themed-header [data-test="register"]').should('be.visible');
105+
cy.get('ds-header [data-test="register"]').should('be.visible');
106106

107107
// Click registration link & you should go to registration page
108-
cy.get('ds-themed-header [data-test="register"]').click();
108+
cy.get('ds-header [data-test="register"]').click();
109109
cy.location('pathname').should('eq', '/register');
110110
cy.get('ds-register-email').should('exist');
111111

@@ -119,10 +119,10 @@ describe('Login Modal', () => {
119119
page.openLoginMenu();
120120

121121
// Forgot password link should be visible
122-
cy.get('ds-themed-header [data-test="forgot"]').should('be.visible');
122+
cy.get('ds-header [data-test="forgot"]').should('be.visible');
123123

124124
// Click link & you should go to Forgot Password page
125-
cy.get('ds-themed-header [data-test="forgot"]').click();
125+
cy.get('ds-header [data-test="forgot"]').click();
126126
cy.location('pathname').should('eq', '/forgot');
127127
cy.get('ds-forgot-email').should('exist');
128128

cypress/e2e/search-navbar.cy.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
const page = {
22
fillOutQueryInNavBar(query) {
33
// Click the magnifying glass
4-
cy.get('ds-themed-header [data-test="header-search-icon"]').click();
4+
cy.get('ds-header [data-test="header-search-icon"]').click();
55
// Fill out a query in input that appears
6-
cy.get('ds-themed-header [data-test="header-search-box"]').type(query);
6+
cy.get('ds-header [data-test="header-search-box"]').type(query);
77
},
88
submitQueryByPressingEnter() {
9-
cy.get('ds-themed-header [data-test="header-search-box"]').type('{enter}');
9+
cy.get('ds-header [data-test="header-search-box"]').type('{enter}');
1010
},
1111
submitQueryByPressingIcon() {
12-
cy.get('ds-themed-header [data-test="header-search-icon"]').click();
12+
cy.get('ds-header [data-test="header-search-icon"]').click();
1313
},
1414
};
1515

docker/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ the Docker compose scripts in this 'docker' folder.
2020

2121
### Dockerfile
2222

23-
This Dockerfile is used to build a *development* DSpace 7 Angular UI image, published as 'dspace/dspace-angular'
23+
This Dockerfile is used to build a *development* DSpace Angular UI image, published as 'dspace/dspace-angular'
2424

2525
```
2626
docker build -t dspace/dspace-angular:latest .
@@ -46,11 +46,11 @@ A default/demo version of this image is built *automatically*.
4646

4747
## 'docker' directory
4848
- docker-compose.yml
49-
- Starts DSpace Angular with Docker Compose from the current branch. This file assumes that a DSpace 7 REST instance will also be started in Docker.
49+
- Starts DSpace Angular with Docker Compose from the current branch. This file assumes that a DSpace REST instance will also be started in Docker.
5050
- docker-compose-rest.yml
51-
- Runs a published instance of the DSpace 7 REST API - persists data in Docker volumes
51+
- Runs a published instance of the DSpace REST API - persists data in Docker volumes
5252
- docker-compose-ci.yml
53-
- Runs a published instance of the DSpace 7 REST API for CI testing. The database is re-populated from a SQL dump on each startup.
53+
- Runs a published instance of the DSpace REST API for CI testing. The database is re-populated from a SQL dump on each startup.
5454
- cli.yml
5555
- Docker compose file that provides a DSpace CLI container to work with a running DSpace REST container.
5656
- cli.assetstore.yml
@@ -71,7 +71,7 @@ docker-compose -f docker/docker-compose.yml build
7171

7272
This command provides a quick way to start both the frontend & backend from this single codebase
7373
```
74-
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d
74+
docker-compose -p d8 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d
7575
```
7676

7777
Keep in mind, you may also start the backend by cloning the 'DSpace/DSpace' GitHub repository separately. See the next section.
@@ -86,14 +86,14 @@ _The system will be started in 2 steps. Each step shares the same docker network
8686

8787
From 'DSpace/DSpace' clone (build first as needed):
8888
```
89-
docker-compose -p d7 up -d
89+
docker-compose -p d8 up -d
9090
```
9191

9292
NOTE: More detailed instructions on starting the backend via Docker can be found in the [Docker Compose instructions for the Backend](https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/README.md).
9393

9494
From 'DSpace/dspace-angular' clone (build first as needed)
9595
```
96-
docker-compose -p d7 -f docker/docker-compose.yml up -d
96+
docker-compose -p d8 -f docker/docker-compose.yml up -d
9797
```
9898

9999
At this point, you should be able to access the UI from http://localhost:4000,
@@ -107,38 +107,38 @@ This allows you to run the Angular UI in *production* mode, pointing it at the d
107107
```
108108
docker-compose -f docker/docker-compose-dist.yml pull
109109
docker-compose -f docker/docker-compose-dist.yml build
110-
docker-compose -p d7 -f docker/docker-compose-dist.yml up -d
110+
docker-compose -p d8 -f docker/docker-compose-dist.yml up -d
111111
```
112112

113113
## Ingest test data from AIPDIR
114114

115115
Create an administrator
116116
```
117-
docker-compose -p d7 -f docker/cli.yml run --rm dspace-cli create-administrator -e test@test.edu -f admin -l user -p admin -c en
117+
docker-compose -p d8 -f docker/cli.yml run --rm dspace-cli create-administrator -e test@test.edu -f admin -l user -p admin -c en
118118
```
119119

120120
Load content from AIP files
121121
```
122-
docker-compose -p d7 -f docker/cli.yml -f ./docker/cli.ingest.yml run --rm dspace-cli
122+
docker-compose -p d8 -f docker/cli.yml -f ./docker/cli.ingest.yml run --rm dspace-cli
123123
```
124124

125125
## Alternative Ingest - Use Entities dataset
126126
_Delete your docker volumes or use a unique project (-p) name_
127127

128128
Start DSpace with Database Content from a database dump
129129
```
130-
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/db.entities.yml up -d
130+
docker-compose -p d8 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/db.entities.yml up -d
131131
```
132132

133133
Load assetstore content and trigger a re-index of the repository
134134
```
135-
docker-compose -p d7 -f docker/cli.yml -f docker/cli.assetstore.yml run --rm dspace-cli
135+
docker-compose -p d8 -f docker/cli.yml -f docker/cli.assetstore.yml run --rm dspace-cli
136136
```
137137

138138
## End to end testing of the REST API (runs in GitHub Actions CI).
139139
_In this instance, only the REST api runs in Docker using the Entities dataset. GitHub Actions will perform CI testing of Angular using Node to drive the tests. See `.github/workflows/build.yml` for more details._
140140

141141
This command is only really useful for testing our Continuous Integration process.
142142
```
143-
docker-compose -p d7ci -f docker/docker-compose-ci.yml up -d
143+
docker-compose -p d8ci -f docker/docker-compose-ci.yml up -d
144144
```

docker/docker-compose-ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ services:
3333
# Tell Statistics to commit all views immediately instead of waiting on Solr's autocommit.
3434
# This allows us to generate statistics in e2e tests so that statistics pages can be tested thoroughly.
3535
solr__D__statistics__P__autoCommit: 'false'
36+
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
3637
image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
3738
depends_on:
3839
- dspacedb
@@ -60,15 +61,19 @@ services:
6061
# NOTE: This is customized to use our loadsql image, so that we are using a database with existing test data
6162
dspacedb:
6263
container_name: dspacedb
64+
image: "${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest-loadsql}"
6365
environment:
6466
# This LOADSQL should be kept in sync with the LOADSQL in
6567
# https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/db.entities.yml
6668
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
6769
LOADSQL: https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql
6870
PGDATA: /pgdata
69-
image: dspace/dspace-postgres-pgcrypto:loadsql
71+
POSTGRES_PASSWORD: dspace
7072
networks:
7173
- dspacenet
74+
ports:
75+
- published: 5432
76+
target: 5432
7277
stdin_open: true
7378
tty: true
7479
volumes:
@@ -105,6 +110,8 @@ services:
105110
cp -r /opt/solr/server/solr/configsets/statistics/* statistics
106111
precreate-core qaevent /opt/solr/server/solr/configsets/qaevent
107112
cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
113+
precreate-core suggestion /opt/solr/server/solr/configsets/suggestion
114+
cp -r /opt/solr/server/solr/configsets/suggestion/* suggestion
108115
exec solr -f
109116
volumes:
110117
assetstore:

0 commit comments

Comments
 (0)