diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts
index ee7b101f96..90ea2026e3 100644
--- a/e2e/app.e2e-spec.ts
+++ b/e2e/app.e2e-spec.ts
@@ -12,8 +12,8 @@ describe('protractor App', function() {
expect(page.getPageTitleText()).toEqual('DSpace');
});
- it('should display title "Hello, World!"', () => {
+ it('should display header "Welcome to DSpace"', () => {
page.navigateTo();
- expect(page.getFirstPText()).toEqual('Hello, World!');
+ expect(page.getFirstHeaderText()).toEqual('Welcome to DSpace');
});
});
diff --git a/e2e/app.po.ts b/e2e/app.po.ts
index 164c524620..d8d2acf120 100644
--- a/e2e/app.po.ts
+++ b/e2e/app.po.ts
@@ -12,4 +12,8 @@ export class ProtractorPage {
getFirstPText() {
return element(by.xpath('//p[1]')).getText();
}
-}
\ No newline at end of file
+
+ getFirstHeaderText() {
+ return element(by.xpath('//h1[1]')).getText();
+ }
+}
diff --git a/resources/i18n/en.json b/resources/i18n/en.json
index 4613acb742..5578af2e85 100644
--- a/resources/i18n/en.json
+++ b/resources/i18n/en.json
@@ -1,10 +1,4 @@
{
- "example": {
- "with": {
- "data": "{{greeting}}, {{recipient}}!"
- }
- },
-
"footer": {
"copyright": "copyright © 2002-{{ year }}",
"link.dspace": "DSpace software",
@@ -34,5 +28,12 @@
"link": {
"home-page": "Take me to the home page"
}
+ },
+
+ "home": {
+ "top-level-communities": {
+ "head": "Communities in DSpace",
+ "help": "Select a community to browse its collections."
+ }
}
}
diff --git a/src/app/app.component.html b/src/app/app.component.html
index 87d3703586..a227b80ab0 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -4,12 +4,6 @@
-
{{ 'example.with.data' | translate:data }}
-
{{ example }}
-
- development
- production
-
diff --git a/src/app/app.component.scss b/src/app/app.component.scss
index 2a58ae0aa2..7b86523886 100644
--- a/src/app/app.component.scss
+++ b/src/app/app.component.scss
@@ -15,11 +15,3 @@
.main-content {
flex: 1 0 auto;
}
-
-h2.red {
- color: red;
-}
-
-h2.green {
- color: green;
-}
diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts
index d56be1a807..5c1db4f4fd 100644
--- a/src/app/app.component.spec.ts
+++ b/src/app/app.component.spec.ts
@@ -52,8 +52,8 @@ describe('App component', () => {
comp = fixture.componentInstance; // component test instance
- // query for the title
by CSS element selector
- de = fixture.debugElement.query(By.css('p'));
+ // query for the
by CSS element selector
+ de = fixture.debugElement.query(By.css('div.outer-wrapper'));
el = de.nativeElement;
});
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index b27fdd354b..de623bad3b 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -3,7 +3,6 @@ import {
ChangeDetectionStrategy,
Inject,
ViewEncapsulation,
- OnDestroy,
OnInit, HostListener
} from "@angular/core";
import { TranslateService } from "ng2-translate";
@@ -11,7 +10,7 @@ import { HostWindowState } from "./shared/host-window.reducer";
import { Store } from "@ngrx/store";
import { HostWindowResizeAction } from "./shared/host-window.actions";
-import { GLOBAL_CONFIG, GlobalConfig } from '../config';
+import { EnvConfig, GLOBAL_CONFIG, GlobalConfig } from '../config';
@Component({
changeDetection: ChangeDetectionStrategy.Default,
@@ -20,15 +19,7 @@ import { GLOBAL_CONFIG, GlobalConfig } from '../config';
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
-export class AppComponent implements OnDestroy, OnInit {
- private translateSubscription: any;
-
- example: string;
-
- data: any = {
- greeting: 'Hello',
- recipient: 'World'
- };
+export class AppComponent implements OnInit {
constructor(
@Inject(GLOBAL_CONFIG) public EnvConfig: GlobalConfig,
@@ -42,15 +33,9 @@ export class AppComponent implements OnDestroy, OnInit {
}
ngOnInit() {
- this.translateSubscription = this.translate.get('example.with.data', { greeting: 'Hello', recipient: 'DSpace' }).subscribe((translation: string) => {
- this.example = translation;
- });
- }
-
- ngOnDestroy() {
- if (this.translateSubscription) {
- this.translateSubscription.unsubscribe();
- }
+ const env: string = EnvConfig.production ? "Production" : "Development";
+ const color: string = EnvConfig.production ? "red" : "green";
+ console.info(`Environment: %c${env}`, `color: ${color}; font-weight: bold;`);
}
@HostListener('window:resize', ['$event'])
diff --git a/src/app/home/home-news/home-news.component.html b/src/app/home/home-news/home-news.component.html
new file mode 100644
index 0000000000..4393228e94
--- /dev/null
+++ b/src/app/home/home-news/home-news.component.html
@@ -0,0 +1,19 @@
+
+
+
+
+
Welcome to DSpace
+
DSpace is an open source software platform that enables organisations to:
+
+ - capture and describe digital material using a submission workflow module, or a variety
+ of
+ programmatic ingest options
+
+ - distribute an organisation's digital assets over the web through a search and retrieval
+ system
+
+ - preserve digital assets over the long term
+
+
+
+
diff --git a/src/app/home/home-news/home-news.component.scss b/src/app/home/home-news/home-news.component.scss
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/src/app/home/home-news/home-news.component.ts b/src/app/home/home-news/home-news.component.ts
new file mode 100644
index 0000000000..2cf3c9cf56
--- /dev/null
+++ b/src/app/home/home-news/home-news.component.ts
@@ -0,0 +1,19 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'ds-home-news',
+ styleUrls: ['./home-news.component.css'],
+ templateUrl: './home-news.component.html'
+})
+export class HomeNewsComponent implements OnInit {
+ constructor() {
+ this.universalInit();
+ }
+
+ universalInit() {
+
+ }
+
+ ngOnInit(): void {
+ }
+}
diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html
index 06cac4108b..fd7d4b6309 100644
--- a/src/app/home/home.component.html
+++ b/src/app/home/home.component.html
@@ -1,3 +1,2 @@
-
- Home component
-
+
+
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts
index 9cb0704a0a..9c46b79791 100644
--- a/src/app/home/home.component.ts
+++ b/src/app/home/home.component.ts
@@ -1,16 +1,11 @@
-import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
+import { Component, OnInit } from '@angular/core';
@Component({
- changeDetection: ChangeDetectionStrategy.Default,
- encapsulation: ViewEncapsulation.Emulated,
selector: 'ds-home',
styleUrls: ['./home.component.css'],
templateUrl: './home.component.html'
})
-export class HomeComponent {
-
- data: any = {};
-
+export class HomeComponent implements OnInit {
constructor() {
this.universalInit();
}
@@ -19,4 +14,6 @@ export class HomeComponent {
}
+ ngOnInit(): void {
+ }
}
diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts
index 0d68ab9805..cd4221a97b 100644
--- a/src/app/home/home.module.ts
+++ b/src/app/home/home.module.ts
@@ -3,14 +3,22 @@ import { NgModule } from '@angular/core';
import { HomeComponent } from './home.component';
import { HomeRoutingModule } from './home-routing.module';
import { CommonModule } from "@angular/common";
+import { TopLevelCommunityListComponent } from "./top-level-community-list/top-level-community-list.component";
+import { HomeNewsComponent } from "./home-news/home-news.component";
+import { RouterModule } from "@angular/router";
+import { TranslateModule } from "ng2-translate";
@NgModule({
imports: [
CommonModule,
- HomeRoutingModule
+ HomeRoutingModule,
+ RouterModule,
+ TranslateModule
],
declarations: [
- HomeComponent
+ HomeComponent,
+ TopLevelCommunityListComponent,
+ HomeNewsComponent
]
})
export class HomeModule { }
diff --git a/src/app/home/top-level-community-list/top-level-community-list.component.html b/src/app/home/top-level-community-list/top-level-community-list.component.html
new file mode 100644
index 0000000000..7fe291ba87
--- /dev/null
+++ b/src/app/home/top-level-community-list/top-level-community-list.component.html
@@ -0,0 +1,12 @@
+
+
{{'home.top-level-communities.head' | translate}}
+
{{'home.top-level-communities.help' | translate}}
+
+
diff --git a/src/app/home/top-level-community-list/top-level-community-list.component.scss b/src/app/home/top-level-community-list/top-level-community-list.component.scss
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/src/app/home/top-level-community-list/top-level-community-list.component.ts b/src/app/home/top-level-community-list/top-level-community-list.component.ts
new file mode 100644
index 0000000000..87f9fad517
--- /dev/null
+++ b/src/app/home/top-level-community-list/top-level-community-list.component.ts
@@ -0,0 +1,27 @@
+import { Component, OnInit } from '@angular/core';
+import { CommunityDataService } from "../../core/data/community-data.service";
+import { RemoteData } from "../../core/data/remote-data";
+import { Community } from "../../core/shared/community.model";
+
+@Component({
+ selector: 'ds-top-level-community-list',
+ styleUrls: ['./top-level-community-list.component.css'],
+ templateUrl: './top-level-community-list.component.html'
+})
+export class TopLevelCommunityListComponent implements OnInit {
+ topLevelCommunities: RemoteData
;
+
+ constructor(
+ private cds: CommunityDataService
+ ) {
+ this.universalInit();
+ }
+
+ universalInit() {
+
+ }
+
+ ngOnInit(): void {
+ this.topLevelCommunities = this.cds.findAll();
+ }
+}