From 3d02e660da991bcddd2d98a3cb3a3d926293680f Mon Sep 17 00:00:00 2001 From: William Welling Date: Tue, 26 Sep 2017 11:44:07 -0500 Subject: [PATCH] fixed core and shared module usage, lazy loading modules --- .../collection-page-routing.module.ts | 2 +- .../collection-page.component.html | 0 .../collection-page.component.scss | 0 .../collection-page.component.ts | 0 .../collection-page.module.ts | 3 +- .../community-page-routing.module.ts | 2 +- .../community-page.component.html | 0 .../community-page.component.scss | 0 .../community-page.component.ts | 0 .../community-page.module.ts | 5 +-- ...ty-page-sub-collection-list.component.html | 0 ...ty-page-sub-collection-list.component.scss | 0 ...nity-page-sub-collection-list.component.ts | 0 .../home-news/home-news.component.html | 0 .../home-news/home-news.component.scss | 0 .../home-news/home-news.component.ts | 0 .../{home => +home}/home-routing.module.ts | 2 +- src/app/{home => +home}/home.component.html | 0 src/app/{home => +home}/home.component.scss | 0 src/app/{home => +home}/home.component.ts | 0 src/app/{home => +home}/home.module.ts | 11 +++-- .../top-level-community-list.component.html | 0 .../top-level-community-list.component.scss | 0 .../top-level-community-list.component.ts | 0 .../collections/collections.component.html | 0 .../collections/collections.component.ts | 0 .../metadata-field-wrapper.component.html | 0 .../metadata-field-wrapper.component.scss | 0 .../metadata-field-wrapper.component.ts | 0 .../metadata-uri-values.component.html | 0 .../metadata-uri-values.component.scss | 0 .../metadata-uri-values.component.ts | 0 .../metadata-values.component.html | 0 .../metadata-values.component.scss | 0 .../metadata-values.component.ts | 0 .../full-file-section.component.html | 0 .../full-file-section.component.scss | 0 .../full-file-section.component.ts | 0 .../full/full-item-page.component.html | 0 .../full/full-item-page.component.scss | 0 .../full/full-item-page.component.ts | 0 .../item-page-routing.module.ts | 13 +++--- .../item-page.module.ts | 43 ++++++++++--------- .../file-section/file-section.component.html | 0 .../file-section/file-section.component.ts | 0 .../item-page-abstract-field.component.ts | 0 .../item-page-author-field.component.ts | 0 .../date/item-page-date-field.component.ts | 0 .../item-page-specific-field.component.html | 0 .../item-page-specific-field.component.ts | 0 .../item-page-title-field.component.html | 0 .../title/item-page-title-field.component.ts | 0 .../uri/item-page-uri-field.component.html | 0 .../uri/item-page-uri-field.component.ts | 0 .../simple/item-page.component.html | 0 .../simple/item-page.component.scss | 0 .../simple/item-page.component.ts | 0 src/app/app-routing.module.ts | 4 ++ src/app/app.module.ts | 34 ++++++++------- src/app/browser-app.module.ts | 7 +-- src/app/core/core.module.ts | 23 +++++++--- .../{core => }/footer/footer.component.html | 0 .../{core => }/footer/footer.component.scss | 4 +- .../footer/footer.component.spec.ts | 0 src/app/{core => }/footer/footer.component.ts | 0 src/app/server-app.module.ts | 5 --- .../shared/pagination/pagination.component.ts | 8 ++-- src/app/shared/shared.module.ts | 12 ++---- src/tsconfig.browser.json | 1 + src/tsconfig.server.json | 1 + webpack.config.js | 4 -- 71 files changed, 89 insertions(+), 95 deletions(-) rename src/app/{collection-page => +collection-page}/collection-page-routing.module.ts (78%) rename src/app/{collection-page => +collection-page}/collection-page.component.html (100%) rename src/app/{collection-page => +collection-page}/collection-page.component.scss (100%) rename src/app/{collection-page => +collection-page}/collection-page.component.ts (100%) rename src/app/{collection-page => +collection-page}/collection-page.module.ts (90%) rename src/app/{community-page => +community-page}/community-page-routing.module.ts (78%) rename src/app/{community-page => +community-page}/community-page.component.html (100%) rename src/app/{community-page => +community-page}/community-page.component.scss (100%) rename src/app/{community-page => +community-page}/community-page.component.ts (100%) rename src/app/{community-page => +community-page}/community-page.module.ts (85%) rename src/app/{community-page => +community-page}/sub-collection-list/community-page-sub-collection-list.component.html (100%) rename src/app/{community-page => +community-page}/sub-collection-list/community-page-sub-collection-list.component.scss (100%) rename src/app/{community-page => +community-page}/sub-collection-list/community-page-sub-collection-list.component.ts (100%) rename src/app/{home => +home}/home-news/home-news.component.html (100%) rename src/app/{home => +home}/home-news/home-news.component.scss (100%) rename src/app/{home => +home}/home-news/home-news.component.ts (100%) rename src/app/{home => +home}/home-routing.module.ts (79%) rename src/app/{home => +home}/home.component.html (100%) rename src/app/{home => +home}/home.component.scss (100%) rename src/app/{home => +home}/home.component.ts (100%) rename src/app/{home => +home}/home.module.ts (86%) rename src/app/{home => +home}/top-level-community-list/top-level-community-list.component.html (100%) rename src/app/{home => +home}/top-level-community-list/top-level-community-list.component.scss (100%) rename src/app/{home => +home}/top-level-community-list/top-level-community-list.component.ts (100%) rename src/app/{item-page => +item-page}/field-components/collections/collections.component.html (100%) rename src/app/{item-page => +item-page}/field-components/collections/collections.component.ts (100%) rename src/app/{item-page => +item-page}/field-components/metadata-field-wrapper/metadata-field-wrapper.component.html (100%) rename src/app/{item-page => +item-page}/field-components/metadata-field-wrapper/metadata-field-wrapper.component.scss (100%) rename src/app/{item-page => +item-page}/field-components/metadata-field-wrapper/metadata-field-wrapper.component.ts (100%) rename src/app/{item-page => +item-page}/field-components/metadata-uri-values/metadata-uri-values.component.html (100%) rename src/app/{item-page => +item-page}/field-components/metadata-uri-values/metadata-uri-values.component.scss (100%) rename src/app/{item-page => +item-page}/field-components/metadata-uri-values/metadata-uri-values.component.ts (100%) rename src/app/{item-page => +item-page}/field-components/metadata-values/metadata-values.component.html (100%) rename src/app/{item-page => +item-page}/field-components/metadata-values/metadata-values.component.scss (100%) rename src/app/{item-page => +item-page}/field-components/metadata-values/metadata-values.component.ts (100%) rename src/app/{item-page => +item-page}/full/field-components/file-section/full-file-section.component.html (100%) rename src/app/{item-page => +item-page}/full/field-components/file-section/full-file-section.component.scss (100%) rename src/app/{item-page => +item-page}/full/field-components/file-section/full-file-section.component.ts (100%) rename src/app/{item-page => +item-page}/full/full-item-page.component.html (100%) rename src/app/{item-page => +item-page}/full/full-item-page.component.scss (100%) rename src/app/{item-page => +item-page}/full/full-item-page.component.ts (100%) rename src/app/{item-page => +item-page}/item-page-routing.module.ts (56%) rename src/app/{item-page => +item-page}/item-page.module.ts (74%) rename src/app/{item-page => +item-page}/simple/field-components/file-section/file-section.component.html (100%) rename src/app/{item-page => +item-page}/simple/field-components/file-section/file-section.component.ts (100%) rename src/app/{item-page => +item-page}/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts (100%) rename src/app/{item-page => +item-page}/simple/field-components/specific-field/author/item-page-author-field.component.ts (100%) rename src/app/{item-page => +item-page}/simple/field-components/specific-field/date/item-page-date-field.component.ts (100%) rename src/app/{item-page => +item-page}/simple/field-components/specific-field/item-page-specific-field.component.html (100%) rename src/app/{item-page => +item-page}/simple/field-components/specific-field/item-page-specific-field.component.ts (100%) rename src/app/{item-page => +item-page}/simple/field-components/specific-field/title/item-page-title-field.component.html (100%) rename src/app/{item-page => +item-page}/simple/field-components/specific-field/title/item-page-title-field.component.ts (100%) rename src/app/{item-page => +item-page}/simple/field-components/specific-field/uri/item-page-uri-field.component.html (100%) rename src/app/{item-page => +item-page}/simple/field-components/specific-field/uri/item-page-uri-field.component.ts (100%) rename src/app/{item-page => +item-page}/simple/item-page.component.html (100%) rename src/app/{item-page => +item-page}/simple/item-page.component.scss (100%) rename src/app/{item-page => +item-page}/simple/item-page.component.ts (100%) rename src/app/{core => }/footer/footer.component.html (100%) rename src/app/{core => }/footer/footer.component.scss (70%) rename src/app/{core => }/footer/footer.component.spec.ts (100%) rename src/app/{core => }/footer/footer.component.ts (100%) diff --git a/src/app/collection-page/collection-page-routing.module.ts b/src/app/+collection-page/collection-page-routing.module.ts similarity index 78% rename from src/app/collection-page/collection-page-routing.module.ts rename to src/app/+collection-page/collection-page-routing.module.ts index ac8c9b9cb5..c62643acc2 100644 --- a/src/app/collection-page/collection-page-routing.module.ts +++ b/src/app/+collection-page/collection-page-routing.module.ts @@ -6,7 +6,7 @@ import { CollectionPageComponent } from './collection-page.component'; @NgModule({ imports: [ RouterModule.forChild([ - { path: 'collections/:id', component: CollectionPageComponent } + { path: ':id', component: CollectionPageComponent, pathMatch: 'full' } ]) ] }) diff --git a/src/app/collection-page/collection-page.component.html b/src/app/+collection-page/collection-page.component.html similarity index 100% rename from src/app/collection-page/collection-page.component.html rename to src/app/+collection-page/collection-page.component.html diff --git a/src/app/collection-page/collection-page.component.scss b/src/app/+collection-page/collection-page.component.scss similarity index 100% rename from src/app/collection-page/collection-page.component.scss rename to src/app/+collection-page/collection-page.component.scss diff --git a/src/app/collection-page/collection-page.component.ts b/src/app/+collection-page/collection-page.component.ts similarity index 100% rename from src/app/collection-page/collection-page.component.ts rename to src/app/+collection-page/collection-page.component.ts diff --git a/src/app/collection-page/collection-page.module.ts b/src/app/+collection-page/collection-page.module.ts similarity index 90% rename from src/app/collection-page/collection-page.module.ts rename to src/app/+collection-page/collection-page.module.ts index 5ec618b9e5..b4cc7ff32d 100644 --- a/src/app/collection-page/collection-page.module.ts +++ b/src/app/+collection-page/collection-page.module.ts @@ -9,10 +9,9 @@ import { CollectionPageRoutingModule } from './collection-page-routing.module'; @NgModule({ imports: [ - CollectionPageRoutingModule, CommonModule, SharedModule, - TranslateModule, + CollectionPageRoutingModule ], declarations: [ CollectionPageComponent, diff --git a/src/app/community-page/community-page-routing.module.ts b/src/app/+community-page/community-page-routing.module.ts similarity index 78% rename from src/app/community-page/community-page-routing.module.ts rename to src/app/+community-page/community-page-routing.module.ts index 40585617f6..e090a93087 100644 --- a/src/app/community-page/community-page-routing.module.ts +++ b/src/app/+community-page/community-page-routing.module.ts @@ -6,7 +6,7 @@ import { CommunityPageComponent } from './community-page.component'; @NgModule({ imports: [ RouterModule.forChild([ - { path: 'communities/:id', component: CommunityPageComponent } + { path: ':id', component: CommunityPageComponent, pathMatch: 'full' } ]) ] }) diff --git a/src/app/community-page/community-page.component.html b/src/app/+community-page/community-page.component.html similarity index 100% rename from src/app/community-page/community-page.component.html rename to src/app/+community-page/community-page.component.html diff --git a/src/app/community-page/community-page.component.scss b/src/app/+community-page/community-page.component.scss similarity index 100% rename from src/app/community-page/community-page.component.scss rename to src/app/+community-page/community-page.component.scss diff --git a/src/app/community-page/community-page.component.ts b/src/app/+community-page/community-page.component.ts similarity index 100% rename from src/app/community-page/community-page.component.ts rename to src/app/+community-page/community-page.component.ts diff --git a/src/app/community-page/community-page.module.ts b/src/app/+community-page/community-page.module.ts similarity index 85% rename from src/app/community-page/community-page.module.ts rename to src/app/+community-page/community-page.module.ts index 647aa6f681..252fd3b2c6 100644 --- a/src/app/community-page/community-page.module.ts +++ b/src/app/+community-page/community-page.module.ts @@ -1,6 +1,5 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; @@ -11,11 +10,9 @@ import { CommunityPageRoutingModule } from './community-page-routing.module'; @NgModule({ imports: [ - CommunityPageRoutingModule, CommonModule, - TranslateModule, - RouterModule, SharedModule, + CommunityPageRoutingModule ], declarations: [ CommunityPageComponent, diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.html b/src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.html similarity index 100% rename from src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.html rename to src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.html diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss b/src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.scss similarity index 100% rename from src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss rename to src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.scss diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts b/src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.ts similarity index 100% rename from src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts rename to src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.ts diff --git a/src/app/home/home-news/home-news.component.html b/src/app/+home/home-news/home-news.component.html similarity index 100% rename from src/app/home/home-news/home-news.component.html rename to src/app/+home/home-news/home-news.component.html diff --git a/src/app/home/home-news/home-news.component.scss b/src/app/+home/home-news/home-news.component.scss similarity index 100% rename from src/app/home/home-news/home-news.component.scss rename to src/app/+home/home-news/home-news.component.scss diff --git a/src/app/home/home-news/home-news.component.ts b/src/app/+home/home-news/home-news.component.ts similarity index 100% rename from src/app/home/home-news/home-news.component.ts rename to src/app/+home/home-news/home-news.component.ts diff --git a/src/app/home/home-routing.module.ts b/src/app/+home/home-routing.module.ts similarity index 79% rename from src/app/home/home-routing.module.ts rename to src/app/+home/home-routing.module.ts index 62a0799f2f..9bc4619f74 100644 --- a/src/app/home/home-routing.module.ts +++ b/src/app/+home/home-routing.module.ts @@ -6,7 +6,7 @@ import { HomeComponent } from './home.component'; @NgModule({ imports: [ RouterModule.forChild([ - { path: 'home', component: HomeComponent } + { path: '', component: HomeComponent, pathMatch: 'full' } ]) ] }) diff --git a/src/app/home/home.component.html b/src/app/+home/home.component.html similarity index 100% rename from src/app/home/home.component.html rename to src/app/+home/home.component.html diff --git a/src/app/home/home.component.scss b/src/app/+home/home.component.scss similarity index 100% rename from src/app/home/home.component.scss rename to src/app/+home/home.component.scss diff --git a/src/app/home/home.component.ts b/src/app/+home/home.component.ts similarity index 100% rename from src/app/home/home.component.ts rename to src/app/+home/home.component.ts diff --git a/src/app/home/home.module.ts b/src/app/+home/home.module.ts similarity index 86% rename from src/app/home/home.module.ts rename to src/app/+home/home.module.ts index d5b60f4752..2941b9c6fd 100644 --- a/src/app/home/home.module.ts +++ b/src/app/+home/home.module.ts @@ -1,21 +1,20 @@ import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TranslateModule } from '@ngx-translate/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 '@ngx-translate/core'; + import { SharedModule } from '../shared/shared.module'; @NgModule({ imports: [ CommonModule, - HomeRoutingModule, - RouterModule, SharedModule, - TranslateModule + HomeRoutingModule ], declarations: [ HomeComponent, 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 similarity index 100% rename from src/app/home/top-level-community-list/top-level-community-list.component.html rename to src/app/+home/top-level-community-list/top-level-community-list.component.html 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 similarity index 100% rename from src/app/home/top-level-community-list/top-level-community-list.component.scss rename to src/app/+home/top-level-community-list/top-level-community-list.component.scss 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 similarity index 100% rename from src/app/home/top-level-community-list/top-level-community-list.component.ts rename to src/app/+home/top-level-community-list/top-level-community-list.component.ts diff --git a/src/app/item-page/field-components/collections/collections.component.html b/src/app/+item-page/field-components/collections/collections.component.html similarity index 100% rename from src/app/item-page/field-components/collections/collections.component.html rename to src/app/+item-page/field-components/collections/collections.component.html diff --git a/src/app/item-page/field-components/collections/collections.component.ts b/src/app/+item-page/field-components/collections/collections.component.ts similarity index 100% rename from src/app/item-page/field-components/collections/collections.component.ts rename to src/app/+item-page/field-components/collections/collections.component.ts diff --git a/src/app/item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.html b/src/app/+item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.html similarity index 100% rename from src/app/item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.html rename to src/app/+item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.html diff --git a/src/app/item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.scss b/src/app/+item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.scss similarity index 100% rename from src/app/item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.scss rename to src/app/+item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.scss diff --git a/src/app/item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.ts b/src/app/+item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.ts similarity index 100% rename from src/app/item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.ts rename to src/app/+item-page/field-components/metadata-field-wrapper/metadata-field-wrapper.component.ts diff --git a/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.html b/src/app/+item-page/field-components/metadata-uri-values/metadata-uri-values.component.html similarity index 100% rename from src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.html rename to src/app/+item-page/field-components/metadata-uri-values/metadata-uri-values.component.html diff --git a/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.scss b/src/app/+item-page/field-components/metadata-uri-values/metadata-uri-values.component.scss similarity index 100% rename from src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.scss rename to src/app/+item-page/field-components/metadata-uri-values/metadata-uri-values.component.scss diff --git a/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts b/src/app/+item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts similarity index 100% rename from src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts rename to src/app/+item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.html b/src/app/+item-page/field-components/metadata-values/metadata-values.component.html similarity index 100% rename from src/app/item-page/field-components/metadata-values/metadata-values.component.html rename to src/app/+item-page/field-components/metadata-values/metadata-values.component.html diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.scss b/src/app/+item-page/field-components/metadata-values/metadata-values.component.scss similarity index 100% rename from src/app/item-page/field-components/metadata-values/metadata-values.component.scss rename to src/app/+item-page/field-components/metadata-values/metadata-values.component.scss diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts b/src/app/+item-page/field-components/metadata-values/metadata-values.component.ts similarity index 100% rename from src/app/item-page/field-components/metadata-values/metadata-values.component.ts rename to src/app/+item-page/field-components/metadata-values/metadata-values.component.ts diff --git a/src/app/item-page/full/field-components/file-section/full-file-section.component.html b/src/app/+item-page/full/field-components/file-section/full-file-section.component.html similarity index 100% rename from src/app/item-page/full/field-components/file-section/full-file-section.component.html rename to src/app/+item-page/full/field-components/file-section/full-file-section.component.html diff --git a/src/app/item-page/full/field-components/file-section/full-file-section.component.scss b/src/app/+item-page/full/field-components/file-section/full-file-section.component.scss similarity index 100% rename from src/app/item-page/full/field-components/file-section/full-file-section.component.scss rename to src/app/+item-page/full/field-components/file-section/full-file-section.component.scss diff --git a/src/app/item-page/full/field-components/file-section/full-file-section.component.ts b/src/app/+item-page/full/field-components/file-section/full-file-section.component.ts similarity index 100% rename from src/app/item-page/full/field-components/file-section/full-file-section.component.ts rename to src/app/+item-page/full/field-components/file-section/full-file-section.component.ts diff --git a/src/app/item-page/full/full-item-page.component.html b/src/app/+item-page/full/full-item-page.component.html similarity index 100% rename from src/app/item-page/full/full-item-page.component.html rename to src/app/+item-page/full/full-item-page.component.html diff --git a/src/app/item-page/full/full-item-page.component.scss b/src/app/+item-page/full/full-item-page.component.scss similarity index 100% rename from src/app/item-page/full/full-item-page.component.scss rename to src/app/+item-page/full/full-item-page.component.scss diff --git a/src/app/item-page/full/full-item-page.component.ts b/src/app/+item-page/full/full-item-page.component.ts similarity index 100% rename from src/app/item-page/full/full-item-page.component.ts rename to src/app/+item-page/full/full-item-page.component.ts diff --git a/src/app/item-page/item-page-routing.module.ts b/src/app/+item-page/item-page-routing.module.ts similarity index 56% rename from src/app/item-page/item-page-routing.module.ts rename to src/app/+item-page/item-page-routing.module.ts index 2cd0c200ad..9dca4d0f6e 100644 --- a/src/app/item-page/item-page-routing.module.ts +++ b/src/app/+item-page/item-page-routing.module.ts @@ -5,12 +5,13 @@ import { ItemPageComponent } from './simple/item-page.component'; import { FullItemPageComponent } from './full/full-item-page.component'; @NgModule({ - imports: [ - RouterModule.forChild([ - { path: 'items/:id', pathMatch: 'full', component: ItemPageComponent }, - { path: 'items/:id/full', component: FullItemPageComponent }, - ]) - ] + imports: [ + RouterModule.forChild([ + { path: ':id', component: ItemPageComponent, pathMatch: 'full' }, + { path: ':id/full', component: FullItemPageComponent } + ]) + ] }) export class ItemPageRoutingModule { + } diff --git a/src/app/item-page/item-page.module.ts b/src/app/+item-page/item-page.module.ts similarity index 74% rename from src/app/item-page/item-page.module.ts rename to src/app/+item-page/item-page.module.ts index 76aa46fdaa..05b2fd9c4a 100644 --- a/src/app/item-page/item-page.module.ts +++ b/src/app/+item-page/item-page.module.ts @@ -19,27 +19,28 @@ import { FullItemPageComponent } from './full/full-item-page.component'; import { FullFileSectionComponent } from './full/field-components/file-section/full-file-section.component'; @NgModule({ - declarations: [ - ItemPageComponent, - FullItemPageComponent, - MetadataValuesComponent, - MetadataUriValuesComponent, - MetadataFieldWrapperComponent, - ItemPageAuthorFieldComponent, - ItemPageDateFieldComponent, - ItemPageAbstractFieldComponent, - ItemPageUriFieldComponent, - ItemPageTitleFieldComponent, - ItemPageSpecificFieldComponent, - FileSectionComponent, - CollectionsComponent, - FullFileSectionComponent - ], - imports: [ - ItemPageRoutingModule, - CommonModule, - SharedModule - ] + imports: [ + CommonModule, + SharedModule, + ItemPageRoutingModule + ], + declarations: [ + ItemPageComponent, + FullItemPageComponent, + MetadataValuesComponent, + MetadataUriValuesComponent, + MetadataFieldWrapperComponent, + ItemPageAuthorFieldComponent, + ItemPageDateFieldComponent, + ItemPageAbstractFieldComponent, + ItemPageUriFieldComponent, + ItemPageTitleFieldComponent, + ItemPageSpecificFieldComponent, + FileSectionComponent, + CollectionsComponent, + FullFileSectionComponent + ] }) export class ItemPageModule { + } diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.html b/src/app/+item-page/simple/field-components/file-section/file-section.component.html similarity index 100% rename from src/app/item-page/simple/field-components/file-section/file-section.component.html rename to src/app/+item-page/simple/field-components/file-section/file-section.component.html diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.ts b/src/app/+item-page/simple/field-components/file-section/file-section.component.ts similarity index 100% rename from src/app/item-page/simple/field-components/file-section/file-section.component.ts rename to src/app/+item-page/simple/field-components/file-section/file-section.component.ts diff --git a/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts b/src/app/+item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts similarity index 100% rename from src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts rename to src/app/+item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts diff --git a/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts b/src/app/+item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts similarity index 100% rename from src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts rename to src/app/+item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts diff --git a/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts b/src/app/+item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts similarity index 100% rename from src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts rename to src/app/+item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-specific-field.component.html b/src/app/+item-page/simple/field-components/specific-field/item-page-specific-field.component.html similarity index 100% rename from src/app/item-page/simple/field-components/specific-field/item-page-specific-field.component.html rename to src/app/+item-page/simple/field-components/specific-field/item-page-specific-field.component.html diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-specific-field.component.ts b/src/app/+item-page/simple/field-components/specific-field/item-page-specific-field.component.ts similarity index 100% rename from src/app/item-page/simple/field-components/specific-field/item-page-specific-field.component.ts rename to src/app/+item-page/simple/field-components/specific-field/item-page-specific-field.component.ts diff --git a/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.html b/src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.html similarity index 100% rename from src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.html rename to src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.html diff --git a/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts b/src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts similarity index 100% rename from src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts rename to src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts diff --git a/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.html b/src/app/+item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.html similarity index 100% rename from src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.html rename to src/app/+item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.html diff --git a/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts b/src/app/+item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts similarity index 100% rename from src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts rename to src/app/+item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts diff --git a/src/app/item-page/simple/item-page.component.html b/src/app/+item-page/simple/item-page.component.html similarity index 100% rename from src/app/item-page/simple/item-page.component.html rename to src/app/+item-page/simple/item-page.component.html diff --git a/src/app/item-page/simple/item-page.component.scss b/src/app/+item-page/simple/item-page.component.scss similarity index 100% rename from src/app/item-page/simple/item-page.component.scss rename to src/app/+item-page/simple/item-page.component.scss diff --git a/src/app/item-page/simple/item-page.component.ts b/src/app/+item-page/simple/item-page.component.ts similarity index 100% rename from src/app/item-page/simple/item-page.component.ts rename to src/app/+item-page/simple/item-page.component.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index e9344dd916..bf71718d2b 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -7,6 +7,10 @@ import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component'; imports: [ RouterModule.forChild([ { path: '', redirectTo: '/home', pathMatch: 'full' }, + { path: 'home', loadChildren: './+home/home.module#HomeModule' }, + { path: 'communities', loadChildren: './+community-page/community-page.module#CommunityPageModule' }, + { path: 'collections', loadChildren: './+collection-page/collection-page.module#CollectionPageModule' }, + { path: 'items', loadChildren: './+item-page/item-page.module#ItemPageModule' }, { path: '**', pathMatch: 'full', component: PageNotFoundComponent }, ]) ], diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 45ac39c4db..192ee6b0ec 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,10 +1,16 @@ import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; import { HttpModule } from '@angular/http'; import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; import { StoreModule } from '@ngrx/store'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; +import { TranslateModule } from '@ngx-translate/core'; + +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; + import { appReducers } from './app.reducer'; import { appEffects } from './app.effects'; @@ -15,13 +21,9 @@ import { AppRoutingModule } from './app-routing.module'; import { TransferHttpModule } from '../modules/transfer-http/transfer-http.module'; -import { HomeModule } from './home/home.module'; -import { ItemPageModule } from './item-page/item-page.module'; -import { CollectionPageModule } from './collection-page/collection-page.module'; -import { CommunityPageModule } from './community-page/community-page.module'; - import { AppComponent } from './app.component'; import { HeaderComponent } from './header/header.component'; +import { FooterComponent } from './footer/footer.component'; import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component'; import { GLOBAL_CONFIG, ENV_CONFIG } from '../config'; @@ -34,27 +36,27 @@ export function getConfig() { @NgModule({ imports: [ - SharedModule, + CommonModule, FormsModule, - CoreModule.forRoot(), HttpModule, - TransferHttpModule, - HomeModule, - ItemPageModule, - CollectionPageModule, - CommunityPageModule, + RouterModule, AppRoutingModule, + TransferHttpModule, + CoreModule.forRoot(), + NgbModule.forRoot(), + TranslateModule.forRoot(), + EffectsModule.forRoot(appEffects), StoreModule.forRoot(appReducers, { metaReducers: appMetaReducers }), - StoreDevtoolsModule.instrument({ maxAge: 50 }), - EffectsModule.forRoot(appEffects) + StoreDevtoolsModule.instrument({ maxAge: 50 }) ], providers: [ - { provide: GLOBAL_CONFIG, useFactory: (getConfig) }, + { provide: GLOBAL_CONFIG, useFactory: (getConfig) } ], declarations: [ AppComponent, HeaderComponent, - PageNotFoundComponent, + FooterComponent, + PageNotFoundComponent ], exports: [AppComponent] }) diff --git a/src/app/browser-app.module.ts b/src/app/browser-app.module.ts index 1fcf82215e..dda60cf664 100644 --- a/src/app/browser-app.module.ts +++ b/src/app/browser-app.module.ts @@ -3,15 +3,12 @@ import { Http } from '@angular/http'; import { HttpClientModule, HttpClient } from '@angular/common/http'; import { RouterModule } from '@angular/router'; import { BrowserModule } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { IdlePreload, IdlePreloadModule } from '@angularclass/idle-preload'; import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; - import { EffectsModule } from '@ngrx/effects'; import { TransferState } from '../modules/transfer-state/transfer-state'; @@ -36,7 +33,7 @@ export function init(cache: TransferState) { } export function createTranslateLoader(http: HttpClient) { - return new TranslateHttpLoader(http, './assets/i18n/', '.json'); + return new TranslateHttpLoader(http, 'assets/i18n/', '.json'); } @NgModule({ @@ -55,14 +52,12 @@ export function createTranslateLoader(http: HttpClient) { deps: [HttpClient] } }), - NgbModule.forRoot(), BrowserCookiesModule, BrowserDataLoaderModule, BrowserTransferStateModule, BrowserTransferStoreModule, EffectsModule.forRoot([BrowserTransferStoreEffects]), StoreRouterConnectingModule, - BrowserAnimationsModule, AppModule ], providers: [ diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 2f98eecb0c..03ab18138b 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -4,7 +4,6 @@ import { CommonModule } from '@angular/common'; import { SharedModule } from '../shared/shared.module'; import { isNotEmpty } from '../shared/empty.util'; -import { FooterComponent } from './footer/footer.component'; import { DSpaceRESTv2Service } from './dspace-rest-v2/dspace-rest-v2.service'; import { ObjectCacheService } from './cache/object-cache.service'; import { ResponseCacheService } from './cache/response-cache.service'; @@ -19,31 +18,41 @@ import { EffectsModule } from '@ngrx/effects'; import { StoreModule } from '@ngrx/store'; import { coreReducers } from './core.reducers'; +import { ApiService } from '../shared/api.service'; + +import { HostWindowService } from '../shared/host-window.service'; +import { NativeWindowFactory, NativeWindowService } from '../shared/window.service'; + +import { ServerResponseService } from '../shared/server-response.service'; + const IMPORTS = [ CommonModule, - SharedModule, - StoreModule.forFeature('core', coreReducers, { }), + StoreModule.forFeature('core', coreReducers, {}), EffectsModule.forFeature(coreEffects) ]; const DECLARATIONS = [ - FooterComponent + ]; const EXPORTS = [ - FooterComponent + ]; const PROVIDERS = [ + ApiService, CommunityDataService, CollectionDataService, - ItemDataService, DSpaceRESTv2Service, + HostWindowService, + ItemDataService, ObjectCacheService, PaginationComponentOptions, ResponseCacheService, RequestService, - RemoteDataBuildService + RemoteDataBuildService, + ServerResponseService, + { provide: NativeWindowService, useFactory: NativeWindowFactory } ]; @NgModule({ diff --git a/src/app/core/footer/footer.component.html b/src/app/footer/footer.component.html similarity index 100% rename from src/app/core/footer/footer.component.html rename to src/app/footer/footer.component.html diff --git a/src/app/core/footer/footer.component.scss b/src/app/footer/footer.component.scss similarity index 70% rename from src/app/core/footer/footer.component.scss rename to src/app/footer/footer.component.scss index 3cf9757d7f..4a409af122 100644 --- a/src/app/core/footer/footer.component.scss +++ b/src/app/footer/footer.component.scss @@ -1,5 +1,5 @@ -@import '../../../styles/variables.scss'; -@import '../../../../node_modules/bootstrap/scss/_variables.scss'; +@import '../../styles/variables.scss'; +@import '../../../node_modules/bootstrap/scss/_variables.scss'; $footer-bg: $gray-lighter; $footer-border: 1px solid darken($footer-bg, 10%); $footer-padding: $spacer * 1.5; diff --git a/src/app/core/footer/footer.component.spec.ts b/src/app/footer/footer.component.spec.ts similarity index 100% rename from src/app/core/footer/footer.component.spec.ts rename to src/app/footer/footer.component.spec.ts diff --git a/src/app/core/footer/footer.component.ts b/src/app/footer/footer.component.ts similarity index 100% rename from src/app/core/footer/footer.component.ts rename to src/app/footer/footer.component.ts diff --git a/src/app/server-app.module.ts b/src/app/server-app.module.ts index ed54351654..b5aff68132 100644 --- a/src/app/server-app.module.ts +++ b/src/app/server-app.module.ts @@ -5,7 +5,6 @@ import { ApplicationRef, NgModule, APP_BOOTSTRAP_LISTENER } from '@angular/core' import { RouterModule } from '@angular/router'; import { ServerModule } from '@angular/platform-server'; import { BrowserModule } from '@angular/platform-browser'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Request } from 'express'; @@ -13,8 +12,6 @@ import { REQUEST } from '@nguniversal/express-engine/tokens'; import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; - import { Store } from '@ngrx/store'; import { EffectsModule } from '@ngrx/effects'; @@ -67,14 +64,12 @@ export function createTranslateLoader() { deps: [] } }), - NgbModule.forRoot(), ServerModule, ServerCookiesModule, ServerDataLoaderModule, ServerTransferStateModule, ServerTransferStoreModule, EffectsModule.forRoot([ServerTransferStoreEffects]), - NoopAnimationsModule, AppModule ], providers: [ diff --git a/src/app/shared/pagination/pagination.component.ts b/src/app/shared/pagination/pagination.component.ts index a6c3b02aca..459b3d59cf 100644 --- a/src/app/shared/pagination/pagination.component.ts +++ b/src/app/shared/pagination/pagination.component.ts @@ -186,10 +186,10 @@ export class PaginationComponent implements OnChanges, OnDestroy, OnInit { this.checkConfig(this.paginationOptions); if (this.pageInfoState) { - this.subs.push(this.pageInfoState.subscribe((pageInfo) => { - /* TODO: this is a temporary fix for the pagination start index (0 or 1) discrepancy between the rest and the frontend respectively */ - this.currentPageState = pageInfo.currentPage + 1; - })); + this.subs.push(this.pageInfoState.subscribe((pageInfo) => { + /* TODO: this is a temporary fix for the pagination start index (0 or 1) discrepancy between the rest and the frontend respectively */ + this.currentPageState = pageInfo.currentPage + 1; + })); } this.id = this.paginationOptions.id || null; diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index e94f40730e..40c07b15d6 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -7,13 +7,11 @@ import { NgxPaginationModule } from 'ngx-pagination'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { ApiService } from './api.service'; import { PaginationComponent } from './pagination/pagination.component'; import { FileSizePipe } from './utils/file-size-pipe'; import { ThumbnailComponent } from '../thumbnail/thumbnail.component'; import { SafeUrlPipe } from './utils/safe-url-pipe'; -import { HostWindowService } from './host-window.service'; -import { NativeWindowFactory, NativeWindowService } from './window.service'; + import { ComcolPageContentComponent } from './comcol-page-content/comcol-page-content.component'; import { ComcolPageHeaderComponent } from './comcol-page-header/comcol-page-header.component'; import { ComcolPageLogoComponent } from './comcol-page-logo/comcol-page-logo.component'; @@ -24,7 +22,6 @@ import { ItemListElementComponent } from '../object-list/item-list-element/item- import { CommunityListElementComponent } from '../object-list/community-list-element/community-list-element.component'; import { CollectionListElementComponent } from '../object-list/collection-list-element/collection-list-element.component'; import { TruncatePipe } from './utils/truncate.pipe'; -import { ServerResponseService } from './server-response.service'; const MODULES = [ // Do NOT include UniversalModule, HttpModule, or JsonpModule here @@ -38,11 +35,11 @@ const MODULES = [ ]; const PIPES = [ + // put shared pipes here FileSizePipe, SafeUrlPipe, EnumKeysPipe, TruncatePipe - // put pipes here ]; const COMPONENTS = [ @@ -60,10 +57,7 @@ const COMPONENTS = [ ]; const PROVIDERS = [ - ApiService, - HostWindowService, - { provide: NativeWindowService, useFactory: NativeWindowFactory }, - ServerResponseService + ]; @NgModule({ diff --git a/src/tsconfig.browser.json b/src/tsconfig.browser.json index a14de3972a..c6de43675d 100644 --- a/src/tsconfig.browser.json +++ b/src/tsconfig.browser.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "angularCompilerOptions": { + "genDir": ".", "entryModule": "./app/browser-app.module#BrowserAppModule" } } diff --git a/src/tsconfig.server.json b/src/tsconfig.server.json index b86ab358f9..52cab4e57e 100644 --- a/src/tsconfig.server.json +++ b/src/tsconfig.server.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "angularCompilerOptions": { + "genDir": ".", "entryModule": "./app/server-app.module#ServerAppModule" } } diff --git a/webpack.config.js b/webpack.config.js index 003088b123..6ca8966591 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,10 +8,6 @@ const { getAotPlugin } = require('./webpack/webpack.aot'); -const { - root -} = require('./webpack/helpers'); - module.exports = function(options, webpackOptions) { options = options || {};