Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dspace-cris-7' into DSC-472
Browse files Browse the repository at this point in the history
  • Loading branch information
atarix83 committed Apr 6, 2022
2 parents 77a9803 + 4e345a9 commit 7078fd8
Show file tree
Hide file tree
Showing 173 changed files with 3,273 additions and 1,446 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
186 changes: 93 additions & 93 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,93 @@
# Docker Compose files

***
: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.
***

## 'Dockerfile' in root directory
This Dockerfile is used to build a *development* DSpace 7 Angular UI image, published as 'dspace/dspace-angular'

```
docker build -t dspace/dspace-angular:dspace-7_x .
```

This image is built *automatically* after each commit is made to the `main` branch.

Admins to our DockerHub repo can manually publish with the following command.
```
docker push dspace/dspace-angular:dspace-7_x
```

## docker directory
- docker-compose.yml
- 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.
- docker-compose-rest.yml
- Runs a published instance of the DSpace 7 REST API - persists data in Docker volumes
- docker-compose-ci.yml
- 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.
- cli.yml
- Docker compose file that provides a DSpace CLI container to work with a running DSpace REST container.
- cli.assetstore.yml
- 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.


## To refresh / pull DSpace images from Dockerhub
```
docker-compose -f docker/docker-compose.yml pull
```

## To build DSpace images using code in your branch
```
docker-compose -f docker/docker-compose.yml build
```

## To start DSpace (REST and Angular) from your branch

```
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d
```

## Run DSpace REST and DSpace Angular from local branches.
_The system will be started in 2 steps. Each step shares the same docker network._

From DSpace/DSpace (build as needed)
```
docker-compose -p d7 up -d
```

From DSpace/DSpace-angular
```
docker-compose -p d7 -f docker/docker-compose.yml up -d
```

## Ingest test data from AIPDIR

Create an administrator
```
docker-compose -p d7 -f docker/cli.yml run --rm dspace-cli create-administrator -e [email protected] -f admin -l user -p admin -c en
```

Load content from AIP files
```
docker-compose -p d7 -f docker/cli.yml -f ./docker/cli.ingest.yml run --rm dspace-cli
```

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

Start DSpace with Database Content from a database dump
```
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/db.entities.yml up -d
```

Load assetstore content and trigger a re-index of the repository
```
docker-compose -p d7 -f docker/cli.yml -f docker/cli.assetstore.yml run --rm dspace-cli
```

## End to end testing of the rest api (runs in travis).
_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._

```
docker-compose -p d7ci -f docker/docker-compose-travis.yml up -d
```
# Docker Compose files

***
: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.
***

## 'Dockerfile' in root directory
This Dockerfile is used to build a *development* DSpace 7 Angular UI image, published as 'dspace/dspace-angular'

```
docker build -t dspace/dspace-angular:dspace-7_x .
```

This image is built *automatically* after each commit is made to the `main` branch.

Admins to our DockerHub repo can manually publish with the following command.
```
docker push dspace/dspace-angular:dspace-7_x
```

## docker directory
- docker-compose.yml
- 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.
- docker-compose-rest.yml
- Runs a published instance of the DSpace 7 REST API - persists data in Docker volumes
- docker-compose-ci.yml
- 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.
- cli.yml
- Docker compose file that provides a DSpace CLI container to work with a running DSpace REST container.
- cli.assetstore.yml
- 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.


## To refresh / pull DSpace images from Dockerhub
```
docker-compose -f docker/docker-compose.yml pull
```

## To build DSpace images using code in your branch
```
docker-compose -f docker/docker-compose.yml build
```

## To start DSpace (REST and Angular) from your branch

```
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d
```

## Run DSpace REST and DSpace Angular from local branches.
_The system will be started in 2 steps. Each step shares the same docker network._

From DSpace/DSpace (build as needed)
```
docker-compose -p d7 up -d
```

From DSpace/DSpace-angular
```
docker-compose -p d7 -f docker/docker-compose.yml up -d
```

## Ingest test data from AIPDIR

Create an administrator
```
docker-compose -p d7 -f docker/cli.yml run --rm dspace-cli create-administrator -e [email protected] -f admin -l user -p admin -c en
```

Load content from AIP files
```
docker-compose -p d7 -f docker/cli.yml -f ./docker/cli.ingest.yml run --rm dspace-cli
```

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

Start DSpace with Database Content from a database dump
```
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/db.entities.yml up -d
```

Load assetstore content and trigger a re-index of the repository
```
docker-compose -p d7 -f docker/cli.yml -f docker/cli.assetstore.yml run --rm dspace-cli
```

## End to end testing of the rest api (runs in travis).
_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._

```
docker-compose -p d7ci -f docker/docker-compose-travis.yml up -d
```
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"rxjs": "^6.6.3",
"sortablejs": "1.13.0",
"tslib": "^2.0.0",
"url-parse": "^1.5.3",
"url-parse": "^1.5.6",
"uuid": "^8.3.2",
"webfontloader": "1.6.28",
"zone.js": "^0.10.3"
Expand Down Expand Up @@ -168,7 +168,7 @@
"jasmine-core": "~3.6.0",
"jasmine-marbles": "0.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "^5.2.3",
"karma": "^6.3.14",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/env-to-yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (!fs.existsSync(envFullPath)) {
}

try {
const env = require(envFullPath);
const env = require(envFullPath).environment;

const config = yaml.dump(env);
if (args[1]) {
Expand Down
11 changes: 6 additions & 5 deletions src/app/admin/admin-sidebar/admin-sidebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,14 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {

inFocus$: BehaviorSubject<boolean>;

constructor(protected menuService: MenuService,
constructor(
protected menuService: MenuService,
protected injector: Injector,
private variableService: CSSVariableService,
private authService: AuthService,
private modalService: NgbModal,
protected variableService: CSSVariableService,
protected authService: AuthService,
protected modalService: NgbModal,
public authorizationService: AuthorizationDataService,
private scriptDataService: ScriptDataService,
protected scriptDataService: ScriptDataService,
public route: ActivatedRoute
) {
super(menuService, injector, authorizationService, route);
Expand Down
25 changes: 25 additions & 0 deletions src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Component } from '@angular/core';
import { ThemedComponent } from '../../shared/theme-support/themed.component';
import { AdminSidebarComponent } from './admin-sidebar.component';

/**
* Themed wrapper for AdminSidebarComponent
*/
@Component({
selector: 'ds-themed-admin-sidebar',
styleUrls: [],
templateUrl: '../../shared/theme-support/themed.component.html',
})
export class ThemedAdminSidebarComponent extends ThemedComponent<AdminSidebarComponent> {
protected getComponentName(): string {
return 'AdminSidebarComponent';
}

protected importThemedComponent(themeName: string): Promise<any> {
return import(`../../../themes/${themeName}/app/admin/admin-sidebar/admin-sidebar.component`);
}

protected importUnthemedComponent(): Promise<any> {
return import('./admin-sidebar.component');
}
}
2 changes: 1 addition & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { GroupAdministratorGuard } from './core/data/feature-authorization/featu
import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component';
import { ServerCheckGuard } from './core/server-check/server-check.guard';
import { SUGGESTION_MODULE_PATH } from './suggestions-page/suggestions-page-routing-paths';
import { StatisticsAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard';

@NgModule({
imports: [
Expand Down Expand Up @@ -237,7 +238,6 @@ import { SUGGESTION_MODULE_PATH } from './suggestions-page/suggestions-page-rout
path: 'statistics',
loadChildren: () => import('./statistics-page/statistics-page-routing.module')
.then((m) => m.StatisticsPageRoutingModule),
canActivate: [SiteAdministratorGuard]
},
{
path: ACCESS_CONTROL_MODULE_PATH,
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import { ThemedHeaderNavbarWrapperComponent } from './header-nav-wrapper/themed-
import { IdleModalComponent } from './shared/idle-modal/idle-modal.component';
import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component';
import { PageInternalServerErrorComponent } from './page-internal-server-error/page-internal-server-error.component';
import { ThemedAdminSidebarComponent } from './admin/admin-sidebar/themed-admin-sidebar.component';
import { APP_CONFIG, AppConfig } from '../config/app-config.interface';
import { SocialComponent } from './social/social.component';

Expand Down Expand Up @@ -173,6 +174,7 @@ const DECLARATIONS = [
HeaderNavbarWrapperComponent,
ThemedHeaderNavbarWrapperComponent,
AdminSidebarComponent,
ThemedAdminSidebarComponent,
AdminSidebarSectionComponent,
ExpandableAdminSidebarSectionComponent,
FooterComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ describe('EditBitstreamPageComponent', () => {
{
value: 'Bitstream title'
}
],
'dc.type': [
{
value: 'Logo'
}
]
},
format: createSuccessfulRemoteDataObject$(selectedFormat),
Expand Down Expand Up @@ -196,6 +201,10 @@ describe('EditBitstreamPageComponent', () => {
expect(rawForm.descriptionContainer.description).toEqual(bitstream.firstMetadataValue('dc.description'));
});

it('should fill in the bitstream\'s file type', () => {
expect(rawForm.fileTypeContainer.fileType).toEqual(bitstream.firstMetadataValue('dc.type'));
});

it('should select the correct format', () => {
expect(rawForm.formatContainer.selectedFormat).toEqual(selectedFormat.id);
});
Expand Down Expand Up @@ -295,6 +304,11 @@ describe('EditBitstreamPageComponent', () => {
value: 'Bitstream title'
}
],
'dc.type': [
{
value: 'Logo'
}
],
'iiif.label': [
{
value: 'chapter one'
Expand Down Expand Up @@ -414,6 +428,11 @@ describe('EditBitstreamPageComponent', () => {
value: 'Bitstream title'
}
],
'dc.type': [
{
value: 'Logo'
}
],
'iiif.label': [
{
value: 'chapter one'
Expand Down
Loading

0 comments on commit 7078fd8

Please sign in to comment.