Skip to content

Commit c9d9e12

Browse files
committed
Merge remote-tracking branch 'origin/main' into poc-eslint-plugin-autofix-selectors
2 parents 3a0c964 + a8f65ce commit c9d9e12

35 files changed

Lines changed: 180 additions & 90 deletions

File tree

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+
});

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:

docker/docker-compose-rest.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ services:
2929
# __D__ => "-" (e.g. google__D__metadata => google-metadata)
3030
# dspace.dir, dspace.server.url, dspace.ui.url and dspace.name
3131
dspace__P__dir: /dspace
32-
dspace__P__server__P__url: http://localhost:8080/server
33-
dspace__P__ui__P__url: http://localhost:4000
32+
# Uncomment to set a non-default value for dspace.server.url or dspace.ui.url
33+
# dspace__P__server__P__url: http://localhost:8080/server
34+
# dspace__P__ui__P__url: http://localhost:4000
3435
dspace__P__name: 'DSpace Started with Docker Compose'
3536
# db.url: Ensure we are using the 'dspacedb' image for our database
3637
db__P__url: 'jdbc:postgresql://dspacedb:5432/dspace'
@@ -39,6 +40,7 @@ services:
3940
# proxies.trusted.ipranges: This setting is required for a REST API running in Docker to trust requests
4041
# from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above.
4142
proxies__P__trusted__P__ipranges: '172.23.0'
43+
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
4244
image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
4345
depends_on:
4446
- dspacedb
@@ -50,6 +52,7 @@ services:
5052
stdin_open: true
5153
tty: true
5254
volumes:
55+
# Keep DSpace assetstore directory between reboots
5356
- assetstore:/dspace/assetstore
5457
# Ensure that the database is ready BEFORE starting tomcat
5558
# 1. While a TCP connection to dspacedb port 5432 is not available, continue to sleep
@@ -65,9 +68,11 @@ services:
6568
# DSpace database container
6669
dspacedb:
6770
container_name: dspacedb
71+
# Uses a custom Postgres image with pgcrypto installed
72+
image: "${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}"
6873
environment:
6974
PGDATA: /pgdata
70-
image: "${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}"
75+
POSTGRES_PASSWORD: dspace
7176
networks:
7277
- dspacenet
7378
ports:
@@ -113,6 +118,8 @@ services:
113118
cp -r /opt/solr/server/solr/configsets/statistics/* statistics
114119
precreate-core qaevent /opt/solr/server/solr/configsets/qaevent
115120
cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
121+
precreate-core suggestion /opt/solr/server/solr/configsets/suggestion
122+
cp -r /opt/solr/server/solr/configsets/suggestion/* suggestion
116123
exec solr -f
117124
volumes:
118125
assetstore:

src/app/core/submission/submission-json-patch-operations.service.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ describe('SubmissionJsonPatchOperationsService', () => {
1717
const rdbService = {} as RemoteDataBuildService;
1818
const halEndpointService = {} as HALEndpointService;
1919

20+
const uuid = '91ecbeda-99fe-42ac-9430-b9b75af56f78';
21+
const href = 'https://rest.api/some/self/link?with=maybe&a=few&other=parameters';
22+
2023
function initTestService() {
2124
return new SubmissionJsonPatchOperationsService(
2225
requestService,
@@ -36,4 +39,16 @@ describe('SubmissionJsonPatchOperationsService', () => {
3639
expect((service as any).patchRequestConstructor).toEqual(SubmissionPatchRequest);
3740
});
3841

42+
describe(`getRequestInstance`, () => {
43+
it(`should add a parameter to embed the item to the request URL`, () => {
44+
const result = (service as any).getRequestInstance(uuid, href);
45+
const resultURL = new URL(result.href);
46+
expect(resultURL.searchParams.get('embed')).toEqual('item');
47+
48+
// if we delete the embed item param, it should be identical to the original url
49+
resultURL.searchParams.delete('embed', 'item');
50+
expect(href).toEqual(resultURL.toString());
51+
});
52+
});
53+
3954
});

src/app/core/submission/submission-json-patch-operations.service.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { RequestService } from '../data/request.service';
88
import { JsonPatchOperationsService } from '../json-patch/json-patch-operations.service';
99
import { HALEndpointService } from '../shared/hal-endpoint.service';
1010
import { SubmitDataResponseDefinitionObject } from '../shared/submit-data-response-definition.model';
11+
import { URLCombiner } from '../url-combiner/url-combiner';
1112

1213
/**
1314
* A service that provides methods to make JSON Patch requests.
@@ -26,4 +27,20 @@ export class SubmissionJsonPatchOperationsService extends JsonPatchOperationsSer
2627
super();
2728
}
2829

30+
/**
31+
* Return an instance for RestRequest class
32+
*
33+
* @param uuid
34+
* The request uuid
35+
* @param href
36+
* The request href
37+
* @param body
38+
* The request body
39+
* @return Object<PatchRequestDefinition>
40+
* instance of PatchRequestDefinition
41+
*/
42+
protected getRequestInstance(uuid: string, href: string, body?: any): SubmissionPatchRequest {
43+
return new this.patchRequestConstructor(uuid, new URLCombiner(href, '?embed=item').toString(), body);
44+
}
45+
2946
}

src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import {
2424
import {
2525
BehaviorSubject,
2626
combineLatest as observableCombineLatest,
27-
EMPTY,
2827
Observable,
28+
of,
2929
Subscription,
3030
} from 'rxjs';
3131
import {
@@ -188,7 +188,7 @@ export class DsoEditMetadataComponent implements OnInit, OnDestroy {
188188
const lazyProvider$: Observable<UpdateDataService<DSpaceObject>> = lazyDataService(this.dataServiceMap, this.dsoType, this.parentInjector);
189189
return lazyProvider$;
190190
} else {
191-
return EMPTY;
191+
return of(this.updateDataService);
192192
}
193193
}
194194

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<a class="badge badge-primary mr-1 mb-1"
1+
<a class="badge badge-primary mb-1"
22
[attr.aria-label]="'search.filters.remove' | translate:{ type: ('search.filters.applied.' + key) | translate, value: normalizeFilterValue(value) }"
33
[routerLink]="searchLink"
44
[queryParams]="(removeParameters | async)" queryParamsHandling="merge">
5-
{{('search.filters.applied.' + key) | translate}}: {{'search.filters.' + filterName + '.' + value | translate: {default: normalizeFilterValue(value)} }}
6-
<span aria-hidden="true"> ×</span>
5+
<span class="d-flex">
6+
<span class="flex-grow-1 text-left">{{('search.filters.applied.' + key) | translate}}: {{'search.filters.' + filterName + '.' + value | translate: {default: normalizeFilterValue(value)} }}</span>
7+
<span class="pl-1" aria-hidden="true">×</span>
8+
</span>
79
</a>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.badge {
2+
white-space: inherit;
3+
}

src/app/shared/search/search-labels/search-label/search-label.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { stripOperatorFromFilterValue } from '../../search.utils';
2626
@Component({
2727
selector: 'ds-search-label',
2828
templateUrl: './search-label.component.html',
29+
styleUrls: ['./search-label.component.scss'],
2930
standalone: true,
3031
imports: [RouterLink, AsyncPipe, TranslateModule],
3132
})

0 commit comments

Comments
 (0)