Skip to content

Commit 7078fd8

Browse files
committed
Merge remote-tracking branch 'origin/dspace-cris-7' into DSC-472
2 parents 77a9803 + 4e345a9 commit 7078fd8

173 files changed

Lines changed: 3273 additions & 1446 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.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

docker/README.md

Lines changed: 93 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,93 @@
1-
# Docker Compose files
2-
3-
***
4-
:warning: **NOT PRODUCTION READY** The below Docker Compose resources are not guaranteed "production ready" at this time. They have been built for development/testing only. Therefore, DSpace Docker images may not be fully secured or up-to-date. While you are welcome to base your own images on these DSpace images/resources, these should not be used "as is" in any production scenario.
5-
***
6-
7-
## 'Dockerfile' in root directory
8-
This Dockerfile is used to build a *development* DSpace 7 Angular UI image, published as 'dspace/dspace-angular'
9-
10-
```
11-
docker build -t dspace/dspace-angular:dspace-7_x .
12-
```
13-
14-
This image is built *automatically* after each commit is made to the `main` branch.
15-
16-
Admins to our DockerHub repo can manually publish with the following command.
17-
```
18-
docker push dspace/dspace-angular:dspace-7_x
19-
```
20-
21-
## docker directory
22-
- docker-compose.yml
23-
- 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.
24-
- docker-compose-rest.yml
25-
- Runs a published instance of the DSpace 7 REST API - persists data in Docker volumes
26-
- docker-compose-ci.yml
27-
- 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.
28-
- cli.yml
29-
- Docker compose file that provides a DSpace CLI container to work with a running DSpace REST container.
30-
- cli.assetstore.yml
31-
- Docker compose file that will download and install data into a DSpace REST assetstore. This script points to a default dataset that will be utilized for CI testing.
32-
33-
34-
## To refresh / pull DSpace images from Dockerhub
35-
```
36-
docker-compose -f docker/docker-compose.yml pull
37-
```
38-
39-
## To build DSpace images using code in your branch
40-
```
41-
docker-compose -f docker/docker-compose.yml build
42-
```
43-
44-
## To start DSpace (REST and Angular) from your branch
45-
46-
```
47-
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d
48-
```
49-
50-
## Run DSpace REST and DSpace Angular from local branches.
51-
_The system will be started in 2 steps. Each step shares the same docker network._
52-
53-
From DSpace/DSpace (build as needed)
54-
```
55-
docker-compose -p d7 up -d
56-
```
57-
58-
From DSpace/DSpace-angular
59-
```
60-
docker-compose -p d7 -f docker/docker-compose.yml up -d
61-
```
62-
63-
## Ingest test data from AIPDIR
64-
65-
Create an administrator
66-
```
67-
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
68-
```
69-
70-
Load content from AIP files
71-
```
72-
docker-compose -p d7 -f docker/cli.yml -f ./docker/cli.ingest.yml run --rm dspace-cli
73-
```
74-
75-
## Alternative Ingest - Use Entities dataset
76-
_Delete your docker volumes or use a unique project (-p) name_
77-
78-
Start DSpace with Database Content from a database dump
79-
```
80-
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/db.entities.yml up -d
81-
```
82-
83-
Load assetstore content and trigger a re-index of the repository
84-
```
85-
docker-compose -p d7 -f docker/cli.yml -f docker/cli.assetstore.yml run --rm dspace-cli
86-
```
87-
88-
## End to end testing of the rest api (runs in travis).
89-
_In this instance, only the REST api runs in Docker using the Entities dataset. Travis will perform CI testing of Angular using Node to drive the tests._
90-
91-
```
92-
docker-compose -p d7ci -f docker/docker-compose-travis.yml up -d
93-
```
1+
# Docker Compose files
2+
3+
***
4+
:warning: **NOT PRODUCTION READY** The below Docker Compose resources are not guaranteed "production ready" at this time. They have been built for development/testing only. Therefore, DSpace Docker images may not be fully secured or up-to-date. While you are welcome to base your own images on these DSpace images/resources, these should not be used "as is" in any production scenario.
5+
***
6+
7+
## 'Dockerfile' in root directory
8+
This Dockerfile is used to build a *development* DSpace 7 Angular UI image, published as 'dspace/dspace-angular'
9+
10+
```
11+
docker build -t dspace/dspace-angular:dspace-7_x .
12+
```
13+
14+
This image is built *automatically* after each commit is made to the `main` branch.
15+
16+
Admins to our DockerHub repo can manually publish with the following command.
17+
```
18+
docker push dspace/dspace-angular:dspace-7_x
19+
```
20+
21+
## docker directory
22+
- docker-compose.yml
23+
- 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.
24+
- docker-compose-rest.yml
25+
- Runs a published instance of the DSpace 7 REST API - persists data in Docker volumes
26+
- docker-compose-ci.yml
27+
- 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.
28+
- cli.yml
29+
- Docker compose file that provides a DSpace CLI container to work with a running DSpace REST container.
30+
- cli.assetstore.yml
31+
- Docker compose file that will download and install data into a DSpace REST assetstore. This script points to a default dataset that will be utilized for CI testing.
32+
33+
34+
## To refresh / pull DSpace images from Dockerhub
35+
```
36+
docker-compose -f docker/docker-compose.yml pull
37+
```
38+
39+
## To build DSpace images using code in your branch
40+
```
41+
docker-compose -f docker/docker-compose.yml build
42+
```
43+
44+
## To start DSpace (REST and Angular) from your branch
45+
46+
```
47+
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d
48+
```
49+
50+
## Run DSpace REST and DSpace Angular from local branches.
51+
_The system will be started in 2 steps. Each step shares the same docker network._
52+
53+
From DSpace/DSpace (build as needed)
54+
```
55+
docker-compose -p d7 up -d
56+
```
57+
58+
From DSpace/DSpace-angular
59+
```
60+
docker-compose -p d7 -f docker/docker-compose.yml up -d
61+
```
62+
63+
## Ingest test data from AIPDIR
64+
65+
Create an administrator
66+
```
67+
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
68+
```
69+
70+
Load content from AIP files
71+
```
72+
docker-compose -p d7 -f docker/cli.yml -f ./docker/cli.ingest.yml run --rm dspace-cli
73+
```
74+
75+
## Alternative Ingest - Use Entities dataset
76+
_Delete your docker volumes or use a unique project (-p) name_
77+
78+
Start DSpace with Database Content from a database dump
79+
```
80+
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/db.entities.yml up -d
81+
```
82+
83+
Load assetstore content and trigger a re-index of the repository
84+
```
85+
docker-compose -p d7 -f docker/cli.yml -f docker/cli.assetstore.yml run --rm dspace-cli
86+
```
87+
88+
## End to end testing of the rest api (runs in travis).
89+
_In this instance, only the REST api runs in Docker using the Entities dataset. Travis will perform CI testing of Angular using Node to drive the tests._
90+
91+
```
92+
docker-compose -p d7ci -f docker/docker-compose-travis.yml up -d
93+
```

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"rxjs": "^6.6.3",
127127
"sortablejs": "1.13.0",
128128
"tslib": "^2.0.0",
129-
"url-parse": "^1.5.3",
129+
"url-parse": "^1.5.6",
130130
"uuid": "^8.3.2",
131131
"webfontloader": "1.6.28",
132132
"zone.js": "^0.10.3"
@@ -168,7 +168,7 @@
168168
"jasmine-core": "~3.6.0",
169169
"jasmine-marbles": "0.6.0",
170170
"jasmine-spec-reporter": "~5.0.0",
171-
"karma": "^5.2.3",
171+
"karma": "^6.3.14",
172172
"karma-chrome-launcher": "~3.1.0",
173173
"karma-coverage-istanbul-reporter": "~3.0.2",
174174
"karma-jasmine": "~4.0.0",

scripts/env-to-yaml.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (!fs.existsSync(envFullPath)) {
2424
}
2525

2626
try {
27-
const env = require(envFullPath);
27+
const env = require(envFullPath).environment;
2828

2929
const config = yaml.dump(env);
3030
if (args[1]) {

src/app/admin/admin-sidebar/admin-sidebar.component.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
6868

6969
inFocus$: BehaviorSubject<boolean>;
7070

71-
constructor(protected menuService: MenuService,
71+
constructor(
72+
protected menuService: MenuService,
7273
protected injector: Injector,
73-
private variableService: CSSVariableService,
74-
private authService: AuthService,
75-
private modalService: NgbModal,
74+
protected variableService: CSSVariableService,
75+
protected authService: AuthService,
76+
protected modalService: NgbModal,
7677
public authorizationService: AuthorizationDataService,
77-
private scriptDataService: ScriptDataService,
78+
protected scriptDataService: ScriptDataService,
7879
public route: ActivatedRoute
7980
) {
8081
super(menuService, injector, authorizationService, route);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Component } from '@angular/core';
2+
import { ThemedComponent } from '../../shared/theme-support/themed.component';
3+
import { AdminSidebarComponent } from './admin-sidebar.component';
4+
5+
/**
6+
* Themed wrapper for AdminSidebarComponent
7+
*/
8+
@Component({
9+
selector: 'ds-themed-admin-sidebar',
10+
styleUrls: [],
11+
templateUrl: '../../shared/theme-support/themed.component.html',
12+
})
13+
export class ThemedAdminSidebarComponent extends ThemedComponent<AdminSidebarComponent> {
14+
protected getComponentName(): string {
15+
return 'AdminSidebarComponent';
16+
}
17+
18+
protected importThemedComponent(themeName: string): Promise<any> {
19+
return import(`../../../themes/${themeName}/app/admin/admin-sidebar/admin-sidebar.component`);
20+
}
21+
22+
protected importUnthemedComponent(): Promise<any> {
23+
return import('./admin-sidebar.component');
24+
}
25+
}

src/app/app-routing.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { GroupAdministratorGuard } from './core/data/feature-authorization/featu
3333
import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component';
3434
import { ServerCheckGuard } from './core/server-check/server-check.guard';
3535
import { SUGGESTION_MODULE_PATH } from './suggestions-page/suggestions-page-routing-paths';
36+
import { StatisticsAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard';
3637

3738
@NgModule({
3839
imports: [
@@ -237,7 +238,6 @@ import { SUGGESTION_MODULE_PATH } from './suggestions-page/suggestions-page-rout
237238
path: 'statistics',
238239
loadChildren: () => import('./statistics-page/statistics-page-routing.module')
239240
.then((m) => m.StatisticsPageRoutingModule),
240-
canActivate: [SiteAdministratorGuard]
241241
},
242242
{
243243
path: ACCESS_CONTROL_MODULE_PATH,

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import { ThemedHeaderNavbarWrapperComponent } from './header-nav-wrapper/themed-
5757
import { IdleModalComponent } from './shared/idle-modal/idle-modal.component';
5858
import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component';
5959
import { PageInternalServerErrorComponent } from './page-internal-server-error/page-internal-server-error.component';
60+
import { ThemedAdminSidebarComponent } from './admin/admin-sidebar/themed-admin-sidebar.component';
6061
import { APP_CONFIG, AppConfig } from '../config/app-config.interface';
6162
import { SocialComponent } from './social/social.component';
6263

@@ -173,6 +174,7 @@ const DECLARATIONS = [
173174
HeaderNavbarWrapperComponent,
174175
ThemedHeaderNavbarWrapperComponent,
175176
AdminSidebarComponent,
177+
ThemedAdminSidebarComponent,
176178
AdminSidebarSectionComponent,
177179
ExpandableAdminSidebarSectionComponent,
178180
FooterComponent,

src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ describe('EditBitstreamPageComponent', () => {
122122
{
123123
value: 'Bitstream title'
124124
}
125+
],
126+
'dc.type': [
127+
{
128+
value: 'Logo'
129+
}
125130
]
126131
},
127132
format: createSuccessfulRemoteDataObject$(selectedFormat),
@@ -196,6 +201,10 @@ describe('EditBitstreamPageComponent', () => {
196201
expect(rawForm.descriptionContainer.description).toEqual(bitstream.firstMetadataValue('dc.description'));
197202
});
198203

204+
it('should fill in the bitstream\'s file type', () => {
205+
expect(rawForm.fileTypeContainer.fileType).toEqual(bitstream.firstMetadataValue('dc.type'));
206+
});
207+
199208
it('should select the correct format', () => {
200209
expect(rawForm.formatContainer.selectedFormat).toEqual(selectedFormat.id);
201210
});
@@ -295,6 +304,11 @@ describe('EditBitstreamPageComponent', () => {
295304
value: 'Bitstream title'
296305
}
297306
],
307+
'dc.type': [
308+
{
309+
value: 'Logo'
310+
}
311+
],
298312
'iiif.label': [
299313
{
300314
value: 'chapter one'
@@ -414,6 +428,11 @@ describe('EditBitstreamPageComponent', () => {
414428
value: 'Bitstream title'
415429
}
416430
],
431+
'dc.type': [
432+
{
433+
value: 'Logo'
434+
}
435+
],
417436
'iiif.label': [
418437
{
419438
value: 'chapter one'

0 commit comments

Comments
 (0)