mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 11:33:04 +00:00
40416: Start of file section
This commit is contained in:
@@ -50,6 +50,16 @@ export class Item extends DSpaceObject {
|
||||
);
|
||||
}
|
||||
|
||||
getFiles(): Array<Observable<Bitstream>> {
|
||||
return this.getBundle("ORIGINAL").map(bundle => bundle.bitstreams.map(bitstream => bitstream.payload.flatMap(b => b))).;
|
||||
// const bundle: Observable<Bundle> = this.getBundle("ORIGINAL");
|
||||
// return bundle.map(
|
||||
// bundle => bundle.bitstreams.flatMap(
|
||||
// bitstream => bitstream.payload
|
||||
// )
|
||||
// );
|
||||
}
|
||||
|
||||
getBundle(name: String): Observable<Bundle> {
|
||||
return Observable.combineLatest(
|
||||
...this.bundles.map(b => b.payload),
|
||||
|
@@ -0,0 +1,4 @@
|
||||
<div class="item-page-specific-field">
|
||||
<ds-metadata-uri-values [values]="item.getBundle("ORIGINAL")" [separator]="separator" [label]="label"></ds-metadata-uri-values>
|
||||
</div>
|
||||
|
24
src/app/item-page/file-section/file-section.component.ts
Normal file
24
src/app/item-page/file-section/file-section.component.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { Bitstream } from "../../core/shared/bitstream.model";
|
||||
import { Item } from "../../core/shared/item.model";
|
||||
|
||||
@Component({
|
||||
selector: 'ds-metadata-field-wrapper',
|
||||
styleUrls: ['./metadata-field-wrapper.component.css'],
|
||||
templateUrl: './metadata-field-wrapper.component.html'
|
||||
})
|
||||
export class MetadataFieldWrapperComponent {
|
||||
|
||||
@Input() item: Item;
|
||||
files: Array<Bitstream>;
|
||||
|
||||
constructor() {
|
||||
this.universalInit();
|
||||
|
||||
}
|
||||
|
||||
universalInit() {
|
||||
this.files = this.item.getBundle("ORIGINAL").map(bundle => bundle.bitstreams.map(bitstream => bitstream.payload));
|
||||
}
|
||||
|
||||
}
|
@@ -6,7 +6,7 @@ import { ItemPageComponent } from './item-page.component';
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: 'item/:id', pathMatch: 'full', component: ItemPageComponent },
|
||||
{ path: 'items/:id', pathMatch: 'full', component: ItemPageComponent },
|
||||
])
|
||||
]
|
||||
})
|
||||
|
@@ -6,4 +6,5 @@
|
||||
<ds-item-page-author-field [item]="item.payload | async"></ds-item-page-author-field>
|
||||
<ds-item-page-abstract-field [item]="item.payload | async"></ds-item-page-abstract-field>
|
||||
<ds-item-page-uri-field [item]="item.payload | async"></ds-item-page-uri-field>
|
||||
<ds-item-page-file-section [item]="item.payload | async"></ds-item-page-file-section>
|
||||
</div>
|
||||
|
@@ -10,5 +10,5 @@
|
||||
* ];
|
||||
**/
|
||||
export const routes: string[] = [
|
||||
'home', 'item/:id' , '**'
|
||||
'home', 'items/:id' , '**'
|
||||
];
|
||||
|
Reference in New Issue
Block a user