mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge branch 'master' into live-rest-backend
This commit is contained in:
@@ -18,14 +18,16 @@ cache:
|
|||||||
directories:
|
directories:
|
||||||
- node_modules
|
- node_modules
|
||||||
|
|
||||||
|
bundler_args: --retry 5
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- yarn run global
|
- travis_retry yarn run global
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- yarn install
|
- travis_retry yarn install
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- yarn run build
|
- travis_wait yarn run build
|
||||||
- export CHROME_BIN=chromium-browser
|
- export CHROME_BIN=chromium-browser
|
||||||
- export DISPLAY=:99.0
|
- export DISPLAY=:99.0
|
||||||
- sh -e /etc/init.d/xvfb start
|
- sh -e /etc/init.d/xvfb start
|
||||||
|
@@ -4,6 +4,12 @@
|
|||||||
"link.dspace": "DSpace software",
|
"link.dspace": "DSpace software",
|
||||||
"link.duraspace": "DuraSpace"
|
"link.duraspace": "DuraSpace"
|
||||||
},
|
},
|
||||||
|
"collection": {
|
||||||
|
"page": {
|
||||||
|
"news": "News",
|
||||||
|
"license": "License"
|
||||||
|
}
|
||||||
|
},
|
||||||
"item": {
|
"item": {
|
||||||
"page": {
|
"page": {
|
||||||
"author": "Author",
|
"author": "Author",
|
||||||
|
@@ -9,6 +9,7 @@ import { SharedModule } from './shared/shared.module';
|
|||||||
import { AppRoutingModule } from './app-routing.module';
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { HeaderComponent } from './header/header.component';
|
import { HeaderComponent } from './header/header.component';
|
||||||
|
import { CollectionPageModule } from './collection-page/collection-page.module';
|
||||||
import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';
|
import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';
|
||||||
|
|
||||||
|
|
||||||
@@ -22,6 +23,7 @@ import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';
|
|||||||
SharedModule,
|
SharedModule,
|
||||||
HomeModule,
|
HomeModule,
|
||||||
ItemPageModule,
|
ItemPageModule,
|
||||||
|
CollectionPageModule,
|
||||||
CoreModule.forRoot(),
|
CoreModule.forRoot(),
|
||||||
AppRoutingModule
|
AppRoutingModule
|
||||||
],
|
],
|
||||||
|
13
src/app/collection-page/collection-page-routing.module.ts
Normal file
13
src/app/collection-page/collection-page-routing.module.ts
Normal file
@@ -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 { }
|
16
src/app/collection-page/collection-page.component.html
Normal file
16
src/app/collection-page/collection-page.component.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<div class="collection-page" *ngIf="collectionData.hasSucceeded | async">
|
||||||
|
<ds-collection-page-name [name]="(collectionData.payload | async)?.name"></ds-collection-page-name>
|
||||||
|
<ds-collection-page-logo *ngIf="logoData" [logo]="logoData.payload | async"></ds-collection-page-logo>
|
||||||
|
<ds-collection-page-introductory-text
|
||||||
|
[introductoryText]="(collectionData.payload | async)?.introductoryText">
|
||||||
|
</ds-collection-page-introductory-text>
|
||||||
|
<ds-collection-page-news
|
||||||
|
[sidebarText]="(collectionData.payload | async)?.sidebarText">
|
||||||
|
</ds-collection-page-news>
|
||||||
|
<ds-collection-page-copyright
|
||||||
|
[copyrightText]="(collectionData.payload | async)?.copyrightText">
|
||||||
|
</ds-collection-page-copyright>
|
||||||
|
<ds-collection-page-license
|
||||||
|
[license]="(collectionData.payload | async)?.license">
|
||||||
|
</ds-collection-page-license>
|
||||||
|
</div>
|
1
src/app/collection-page/collection-page.component.scss
Normal file
1
src/app/collection-page/collection-page.component.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
@import '../../styles/variables.scss';
|
35
src/app/collection-page/collection-page.component.ts
Normal file
35
src/app/collection-page/collection-page.component.ts
Normal file
@@ -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<Collection>;
|
||||||
|
logoData: RemoteData<Bitstream>;
|
||||||
|
|
||||||
|
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() {
|
||||||
|
}
|
||||||
|
}
|
33
src/app/collection-page/collection-page.module.ts
Normal file
33
src/app/collection-page/collection-page.module.ts
Normal file
@@ -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 { }
|
@@ -0,0 +1,3 @@
|
|||||||
|
<ds-field-wrapper *ngIf="copyrightText" class="collection-page-copyright">
|
||||||
|
<p [innerHtml]="copyrightText"></p>
|
||||||
|
</ds-field-wrapper>
|
@@ -0,0 +1 @@
|
|||||||
|
@import '../../../styles/variables.scss';
|
@@ -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;
|
||||||
|
}
|
@@ -0,0 +1,3 @@
|
|||||||
|
<div class="collection-page-field-wrapper">
|
||||||
|
<ng-content></ng-content>
|
||||||
|
</div>
|
@@ -0,0 +1 @@
|
|||||||
|
@import '../../../styles/variables.scss';
|
@@ -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;
|
||||||
|
}
|
@@ -0,0 +1,3 @@
|
|||||||
|
<ds-field-wrapper *ngIf="introductoryText" class="collection-page-introductory-text">
|
||||||
|
<p [innerHtml]="introductoryText"></p>
|
||||||
|
</ds-field-wrapper>
|
@@ -0,0 +1 @@
|
|||||||
|
@import '../../../styles/variables.scss';
|
@@ -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;
|
||||||
|
}
|
@@ -0,0 +1,4 @@
|
|||||||
|
<ds-field-wrapper *ngIf="license" class="collection-page-license">
|
||||||
|
<h2>{{ 'collection.page.license' | translate }}</h2>
|
||||||
|
<p>{{ license }}</p>
|
||||||
|
</ds-field-wrapper>
|
@@ -0,0 +1 @@
|
|||||||
|
@import '../../../styles/variables.scss';
|
@@ -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;
|
||||||
|
}
|
@@ -0,0 +1,3 @@
|
|||||||
|
<ds-field-wrapper *ngIf="logo" class="collection-page-logo">
|
||||||
|
<img [src]="logo.url" class="img-responsive" alt="Collection logo" />
|
||||||
|
</ds-field-wrapper>
|
@@ -0,0 +1 @@
|
|||||||
|
@import '../../../styles/variables.scss';
|
@@ -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;
|
||||||
|
}
|
@@ -0,0 +1 @@
|
|||||||
|
<h1 *ngIf="name">{{ name }}</h1>
|
@@ -0,0 +1 @@
|
|||||||
|
@import '../../../styles/variables.scss';
|
@@ -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;
|
||||||
|
}
|
@@ -0,0 +1,4 @@
|
|||||||
|
<ds-field-wrapper *ngIf="sidebarText" class="collection-page-news">
|
||||||
|
<h2>{{ 'collection.page.news' | translate }}</h2>
|
||||||
|
<p [innerHtml]="sidebarText"></p>
|
||||||
|
</ds-field-wrapper>
|
@@ -0,0 +1 @@
|
|||||||
|
@import '../../../styles/variables.scss';
|
@@ -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;
|
||||||
|
}
|
@@ -17,6 +17,8 @@ export class NormalizedCollection extends NormalizedDSpaceObject {
|
|||||||
/**
|
/**
|
||||||
* The Bitstream that represents the logo of this Collection
|
* The Bitstream that represents the logo of this Collection
|
||||||
*/
|
*/
|
||||||
|
@autoserialize
|
||||||
|
@relationship(ResourceType.Bitstream)
|
||||||
logo: string;
|
logo: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -43,6 +43,40 @@ export const BITSTREAMS = {
|
|||||||
],
|
],
|
||||||
"format": "JPEG",
|
"format": "JPEG",
|
||||||
"mimetype": "image/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"
|
||||||
|
},
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@@ -6,7 +6,8 @@ export const COLLECTIONS = {
|
|||||||
"items": [
|
"items": [
|
||||||
{ "href": "/items/8871" },
|
{ "href": "/items/8871" },
|
||||||
{ "href": "/items/9978" }
|
{ "href": "/items/9978" }
|
||||||
]
|
],
|
||||||
|
"logo": { "href": "/bitstreams/4688" }
|
||||||
},
|
},
|
||||||
"id": "5179",
|
"id": "5179",
|
||||||
"uuid": "9e32a2e2-6b91-4236-a361-995ccdc14c60",
|
"uuid": "9e32a2e2-6b91-4236-a361-995ccdc14c60",
|
||||||
|
@@ -10,5 +10,5 @@
|
|||||||
* ];
|
* ];
|
||||||
**/
|
**/
|
||||||
export const routes: string[] = [
|
export const routes: string[] = [
|
||||||
'home', 'items/:id' , '**'
|
'home', 'items/:id' , 'collections/:id', '**'
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user