diff --git a/.travis.yml b/.travis.yml index e009520b68..119151e71d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,14 +18,16 @@ cache: directories: - node_modules +bundler_args: --retry 5 + before_install: - - yarn run global + - travis_retry yarn run global install: - - yarn install + - travis_retry yarn install before_script: - - yarn run build + - travis_wait yarn run build - export CHROME_BIN=chromium-browser - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start diff --git a/resources/i18n/en.json b/resources/i18n/en.json index 43b90d7165..7489228eb5 100644 --- a/resources/i18n/en.json +++ b/resources/i18n/en.json @@ -4,6 +4,12 @@ "link.dspace": "DSpace software", "link.duraspace": "DuraSpace" }, + "collection": { + "page": { + "news": "News", + "license": "License" + } + }, "item": { "page": { "author": "Author", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 42304c865e..95bfc73517 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -9,6 +9,7 @@ import { SharedModule } from './shared/shared.module'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { HeaderComponent } from './header/header.component'; +import { CollectionPageModule } from './collection-page/collection-page.module'; import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component'; @@ -22,6 +23,7 @@ import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component'; SharedModule, HomeModule, ItemPageModule, + CollectionPageModule, CoreModule.forRoot(), AppRoutingModule ], diff --git a/src/app/collection-page/collection-page-routing.module.ts b/src/app/collection-page/collection-page-routing.module.ts new file mode 100644 index 0000000000..ac8c9b9cb5 --- /dev/null +++ b/src/app/collection-page/collection-page-routing.module.ts @@ -0,0 +1,13 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { CollectionPageComponent } from './collection-page.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: 'collections/:id', component: CollectionPageComponent } + ]) + ] +}) +export class CollectionPageRoutingModule { } diff --git a/src/app/collection-page/collection-page.component.html b/src/app/collection-page/collection-page.component.html new file mode 100644 index 0000000000..e9a4ab9916 --- /dev/null +++ b/src/app/collection-page/collection-page.component.html @@ -0,0 +1,16 @@ +
+ + + + + + + + + + +
diff --git a/src/app/collection-page/collection-page.component.scss b/src/app/collection-page/collection-page.component.scss new file mode 100644 index 0000000000..da97dd7a62 --- /dev/null +++ b/src/app/collection-page/collection-page.component.scss @@ -0,0 +1 @@ +@import '../../styles/variables.scss'; diff --git a/src/app/collection-page/collection-page.component.ts b/src/app/collection-page/collection-page.component.ts new file mode 100644 index 0000000000..42afe78881 --- /dev/null +++ b/src/app/collection-page/collection-page.component.ts @@ -0,0 +1,35 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Params } from '@angular/router'; + +import { Collection } from "../core/shared/collection.model"; +import { Bitstream } from "../core/shared/bitstream.model"; +import { RemoteData } from "../core/data/remote-data"; +import { CollectionDataService } from "../core/data/collection-data.service"; + +@Component({ + selector: 'ds-collection-page', + styleUrls: ['./collection-page.component.css'], + templateUrl: './collection-page.component.html', +}) +export class CollectionPageComponent implements OnInit { + collectionData: RemoteData; + logoData: RemoteData; + + constructor( + private collectionDataService: CollectionDataService, + private route: ActivatedRoute + ) { + this.universalInit(); + } + + ngOnInit(): void { + this.route.params.subscribe((params: Params) => { + this.collectionData = this.collectionDataService.findById(params['id']) + this.collectionData.payload + .subscribe(collection => this.logoData = collection.logo); + }); + } + + universalInit() { + } +} diff --git a/src/app/collection-page/collection-page.module.ts b/src/app/collection-page/collection-page.module.ts new file mode 100644 index 0000000000..9b204cb0bb --- /dev/null +++ b/src/app/collection-page/collection-page.module.ts @@ -0,0 +1,33 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TranslateModule } from "@ngx-translate/core"; + +import { CollectionPageComponent } from './collection-page.component'; +import { FieldWrapperComponent } from './field-wrapper/field-wrapper.component'; +import { CollectionPageNameComponent } from './name/collection-page-name.component'; +import { CollectionPageLogoComponent } from './logo/collection-page-logo.component'; +import { CollectionPageIntroductoryTextComponent } from './introductory-text/collection-page-introductory-text.component'; +import { CollectionPageNewsComponent } from './news/collection-page-news.component'; +import { CollectionPageCopyrightComponent } from './copyright/collection-page-copyright.component'; +import { CollectionPageLicenseComponent } from './license/collection-page-license.component'; +import { CollectionPageRoutingModule } from './collection-page-routing.module'; + +@NgModule({ + imports: [ + CollectionPageRoutingModule, + CommonModule, + TranslateModule, + ], + declarations: [ + CollectionPageComponent, + FieldWrapperComponent, + CollectionPageNameComponent, + CollectionPageLogoComponent, + CollectionPageIntroductoryTextComponent, + CollectionPageNewsComponent, + CollectionPageCopyrightComponent, + CollectionPageLicenseComponent, + ] +}) +export class CollectionPageModule { } diff --git a/src/app/collection-page/copyright/collection-page-copyright.component.html b/src/app/collection-page/copyright/collection-page-copyright.component.html new file mode 100644 index 0000000000..db7b77d614 --- /dev/null +++ b/src/app/collection-page/copyright/collection-page-copyright.component.html @@ -0,0 +1,3 @@ + +

+
\ No newline at end of file diff --git a/src/app/collection-page/copyright/collection-page-copyright.component.scss b/src/app/collection-page/copyright/collection-page-copyright.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/collection-page/copyright/collection-page-copyright.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/collection-page/copyright/collection-page-copyright.component.ts b/src/app/collection-page/copyright/collection-page-copyright.component.ts new file mode 100644 index 0000000000..e4bc21553f --- /dev/null +++ b/src/app/collection-page/copyright/collection-page-copyright.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; + + +@Component({ + selector: 'ds-collection-page-copyright', + styleUrls: ['./collection-page-copyright.component.css'], + templateUrl: './collection-page-copyright.component.html', +}) +export class CollectionPageCopyrightComponent { + @Input() copyrightText: String; +} diff --git a/src/app/collection-page/field-wrapper/field-wrapper.component.html b/src/app/collection-page/field-wrapper/field-wrapper.component.html new file mode 100644 index 0000000000..677ff2f918 --- /dev/null +++ b/src/app/collection-page/field-wrapper/field-wrapper.component.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/src/app/collection-page/field-wrapper/field-wrapper.component.scss b/src/app/collection-page/field-wrapper/field-wrapper.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/collection-page/field-wrapper/field-wrapper.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/collection-page/field-wrapper/field-wrapper.component.ts b/src/app/collection-page/field-wrapper/field-wrapper.component.ts new file mode 100644 index 0000000000..c8420661ea --- /dev/null +++ b/src/app/collection-page/field-wrapper/field-wrapper.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; + + +@Component({ + selector: 'ds-field-wrapper', + styleUrls: ['./field-wrapper.component.css'], + templateUrl: './field-wrapper.component.html', +}) +export class FieldWrapperComponent { + @Input() name: String; +} diff --git a/src/app/collection-page/introductory-text/collection-page-introductory-text.component.html b/src/app/collection-page/introductory-text/collection-page-introductory-text.component.html new file mode 100644 index 0000000000..904a6d7f21 --- /dev/null +++ b/src/app/collection-page/introductory-text/collection-page-introductory-text.component.html @@ -0,0 +1,3 @@ + +

+
\ No newline at end of file diff --git a/src/app/collection-page/introductory-text/collection-page-introductory-text.component.scss b/src/app/collection-page/introductory-text/collection-page-introductory-text.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/collection-page/introductory-text/collection-page-introductory-text.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/collection-page/introductory-text/collection-page-introductory-text.component.ts b/src/app/collection-page/introductory-text/collection-page-introductory-text.component.ts new file mode 100644 index 0000000000..f6526c9943 --- /dev/null +++ b/src/app/collection-page/introductory-text/collection-page-introductory-text.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; + + +@Component({ + selector: 'ds-collection-page-introductory-text', + styleUrls: ['./collection-page-introductory-text.component.css'], + templateUrl: './collection-page-introductory-text.component.html', +}) +export class CollectionPageIntroductoryTextComponent { + @Input() introductoryText: String; +} diff --git a/src/app/collection-page/license/collection-page-license.component.html b/src/app/collection-page/license/collection-page-license.component.html new file mode 100644 index 0000000000..af0a6e4261 --- /dev/null +++ b/src/app/collection-page/license/collection-page-license.component.html @@ -0,0 +1,4 @@ + +

{{ 'collection.page.license' | translate }}

+

{{ license }}

+
\ No newline at end of file diff --git a/src/app/collection-page/license/collection-page-license.component.scss b/src/app/collection-page/license/collection-page-license.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/collection-page/license/collection-page-license.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/collection-page/license/collection-page-license.component.ts b/src/app/collection-page/license/collection-page-license.component.ts new file mode 100644 index 0000000000..8f269cca8c --- /dev/null +++ b/src/app/collection-page/license/collection-page-license.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; + + +@Component({ + selector: 'ds-collection-page-license', + styleUrls: ['./collection-page-license.component.css'], + templateUrl: './collection-page-license.component.html', +}) +export class CollectionPageLicenseComponent { + @Input() license: String; +} diff --git a/src/app/collection-page/logo/collection-page-logo.component.html b/src/app/collection-page/logo/collection-page-logo.component.html new file mode 100644 index 0000000000..1c331e2e25 --- /dev/null +++ b/src/app/collection-page/logo/collection-page-logo.component.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/app/collection-page/logo/collection-page-logo.component.scss b/src/app/collection-page/logo/collection-page-logo.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/collection-page/logo/collection-page-logo.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/collection-page/logo/collection-page-logo.component.ts b/src/app/collection-page/logo/collection-page-logo.component.ts new file mode 100644 index 0000000000..22c34422ea --- /dev/null +++ b/src/app/collection-page/logo/collection-page-logo.component.ts @@ -0,0 +1,13 @@ +import { Component, Input } from '@angular/core'; + +import { Bitstream } from "../../core/shared/bitstream.model"; + + +@Component({ + selector: 'ds-collection-page-logo', + styleUrls: ['./collection-page-logo.component.css'], + templateUrl: './collection-page-logo.component.html', +}) +export class CollectionPageLogoComponent { + @Input() logo: Bitstream; +} diff --git a/src/app/collection-page/name/collection-page-name.component.html b/src/app/collection-page/name/collection-page-name.component.html new file mode 100644 index 0000000000..21f1f65331 --- /dev/null +++ b/src/app/collection-page/name/collection-page-name.component.html @@ -0,0 +1 @@ +

{{ name }}

\ No newline at end of file diff --git a/src/app/collection-page/name/collection-page-name.component.scss b/src/app/collection-page/name/collection-page-name.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/collection-page/name/collection-page-name.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/collection-page/name/collection-page-name.component.ts b/src/app/collection-page/name/collection-page-name.component.ts new file mode 100644 index 0000000000..30121fd01b --- /dev/null +++ b/src/app/collection-page/name/collection-page-name.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; + + +@Component({ + selector: 'ds-collection-page-name', + styleUrls: ['./collection-page-name.component.css'], + templateUrl: './collection-page-name.component.html', +}) +export class CollectionPageNameComponent { + @Input() name: String; +} diff --git a/src/app/collection-page/news/collection-page-news.component.html b/src/app/collection-page/news/collection-page-news.component.html new file mode 100644 index 0000000000..bd17c7ea77 --- /dev/null +++ b/src/app/collection-page/news/collection-page-news.component.html @@ -0,0 +1,4 @@ + +

{{ 'collection.page.news' | translate }}

+

+
\ No newline at end of file diff --git a/src/app/collection-page/news/collection-page-news.component.scss b/src/app/collection-page/news/collection-page-news.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/collection-page/news/collection-page-news.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/collection-page/news/collection-page-news.component.ts b/src/app/collection-page/news/collection-page-news.component.ts new file mode 100644 index 0000000000..479c37a7c6 --- /dev/null +++ b/src/app/collection-page/news/collection-page-news.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; + + +@Component({ + selector: 'ds-collection-page-news', + styleUrls: ['./collection-page-news.component.css'], + templateUrl: './collection-page-news.component.html', +}) +export class CollectionPageNewsComponent { + @Input() sidebarText: String; +} diff --git a/src/app/core/cache/models/normalized-collection.model.ts b/src/app/core/cache/models/normalized-collection.model.ts index fe5fbbca15..cf30024d0b 100644 --- a/src/app/core/cache/models/normalized-collection.model.ts +++ b/src/app/core/cache/models/normalized-collection.model.ts @@ -17,6 +17,8 @@ export class NormalizedCollection extends NormalizedDSpaceObject { /** * The Bitstream that represents the logo of this Collection */ + @autoserialize + @relationship(ResourceType.Bitstream) logo: string; /** diff --git a/src/backend/bitstreams.ts b/src/backend/bitstreams.ts index 537cd5890b..da6a87e042 100644 --- a/src/backend/bitstreams.ts +++ b/src/backend/bitstreams.ts @@ -43,6 +43,40 @@ export const BITSTREAMS = { ], "format": "JPEG", "mimetype": "image/jpeg" - } + }, + { + "_links": { + "self": { "href": "/bitstreams/8934" }, + "bundle": { "href": "/bundles/99f78e5e-3677-43b0-aaef-cddaa1a49092" }, + "retrieve": { "href": "/rest/bitstreams/ba7d24f2-8fc7-4b8e-b7b6-6c32be1c12a6/retrieve" } + }, + "id": "8934", + "uuid": "ba7d24f2-8fc7-4b8e-b7b6-6c32be1c12a6", + "name": "license.txt", + "size": 41183, + "checksum": { + "value": "8ad416e8a39e645020e13e06f1427814", + "algorithm": "MD5" + }, + "metadata": [ + { "key": "dc.title", "value": "license.txt", "language": null }, + { "key": "dc.description", "value": "License", "language": "en" } + ], + "format": "Text", + "mimetype": "text/plain" + }, + { + "_links": { + "self": { "href": "/bitstreams/4688" }, + }, + "id": "4688", + "uuid": "1bb1be24-c934-41e3-a0fb-ca7a71ab0e71", + "type": "bitstream", + "name": "collection-5179-logo.png", + "size": 299832, + "url": "/bitstreams/1bb1be24-c934-41e3-a0fb-ca7a71ab0e71/retrieve", + "format": "PNG", + "mimetype": "image/png" + }, ] }; diff --git a/src/backend/collections.ts b/src/backend/collections.ts index ffc56b0140..5170f14c46 100644 --- a/src/backend/collections.ts +++ b/src/backend/collections.ts @@ -6,7 +6,8 @@ export const COLLECTIONS = { "items": [ { "href": "/items/8871" }, { "href": "/items/9978" } - ] + ], + "logo": { "href": "/bitstreams/4688" } }, "id": "5179", "uuid": "9e32a2e2-6b91-4236-a361-995ccdc14c60", diff --git a/src/server.routes.ts b/src/server.routes.ts index 704ea15df5..19ba0264aa 100644 --- a/src/server.routes.ts +++ b/src/server.routes.ts @@ -10,5 +10,5 @@ * ]; **/ export const routes: string[] = [ - 'home', 'items/:id' , '**' + 'home', 'items/:id' , 'collections/:id', '**' ];