mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 11:33:04 +00:00
41650: moved files and made small full item page changes
This commit is contained in:
33
src/app/item-page/full/full-item-page.component.ts
Normal file
33
src/app/item-page/full/full-item-page.component.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Item } from "../../core/shared/item.model";
|
||||
import { RemoteData } from "../../core/data/remote-data";
|
||||
import { Observable } from "rxjs";
|
||||
import { Bitstream } from "../../core/shared/bitstream.model";
|
||||
import { ItemPageComponent } from "../simple/item-page.component";
|
||||
import { Metadatum } from "../../core/shared/metadatum.model";
|
||||
|
||||
/**
|
||||
* This component renders a simple item page.
|
||||
* The route parameter 'id' is used to request the item it represents.
|
||||
* All fields of the item that should be displayed, are defined in its template.
|
||||
*/
|
||||
|
||||
@Component({
|
||||
selector: 'ds-full-item-page',
|
||||
styleUrls: ['./full-item-page.component.css'],
|
||||
templateUrl: './full-item-page.component.html',
|
||||
})
|
||||
export class FullItemPageComponent extends ItemPageComponent {
|
||||
|
||||
metadata: Array<Metadatum>;
|
||||
|
||||
universalInit() {
|
||||
|
||||
}
|
||||
|
||||
initialize(params) {
|
||||
super.initialize(params);
|
||||
this.metadata = this.item.payload.flatMap(i => i.metadata);
|
||||
}
|
||||
|
||||
}
|
@@ -1,12 +1,14 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { ItemPageComponent } from './item-page.component';
|
||||
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', pathMatch: 'full', component: FullItemPageComponent },
|
||||
])
|
||||
]
|
||||
})
|
||||
|
@@ -1 +0,0 @@
|
||||
@import '../../styles/variables.scss';
|
@@ -1,19 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ItemPageComponent } from './item-page.component';
|
||||
import { ItemPageComponent } from './simple/item-page.component';
|
||||
import { ItemPageRoutingModule } from './item-page-routing.module';
|
||||
import { MetadataValuesComponent } from './metadata-values/metadata-values.component';
|
||||
import { MetadataUriValuesComponent } from './metadata-uri-values/metadata-uri-values.component';
|
||||
import { MetadataFieldWrapperComponent } from './metadata-field-wrapper/metadata-field-wrapper.component';
|
||||
import { ItemPageAuthorFieldComponent } from './specific-field/author/item-page-author-field.component';
|
||||
import { ItemPageDateFieldComponent } from './specific-field/date/item-page-date-field.component';
|
||||
import { ItemPageAbstractFieldComponent } from './specific-field/abstract/item-page-abstract-field.component';
|
||||
import { ItemPageUriFieldComponent } from './specific-field/uri/item-page-uri-field.component';
|
||||
import { ItemPageTitleFieldComponent } from './specific-field/title/item-page-title-field.component';
|
||||
import { ItemPageSpecificFieldComponent } from './specific-field/item-page-specific-field.component';
|
||||
import { MetadataValuesComponent } from './simple/metadata-values/metadata-values.component';
|
||||
import { MetadataUriValuesComponent } from './simple/metadata-uri-values/metadata-uri-values.component';
|
||||
import { MetadataFieldWrapperComponent } from './simple/metadata-field-wrapper/metadata-field-wrapper.component';
|
||||
import { ItemPageAuthorFieldComponent } from './simple/specific-field/author/item-page-author-field.component';
|
||||
import { ItemPageDateFieldComponent } from './simple/specific-field/date/item-page-date-field.component';
|
||||
import { ItemPageAbstractFieldComponent } from './simple/specific-field/abstract/item-page-abstract-field.component';
|
||||
import { ItemPageUriFieldComponent } from './simple/specific-field/uri/item-page-uri-field.component';
|
||||
import { ItemPageTitleFieldComponent } from './simple/specific-field/title/item-page-title-field.component';
|
||||
import { ItemPageSpecificFieldComponent } from './simple/specific-field/item-page-specific-field.component';
|
||||
import { SharedModule } from './../shared/shared.module';
|
||||
import { FileSectionComponent } from "./file-section/file-section.component";
|
||||
import { CollectionsComponent } from "./collections/collections.component";
|
||||
import { FileSectionComponent } from "./simple/file-section/file-section.component";
|
||||
import { CollectionsComponent } from "./simple/collections/collections.component";
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Collection } from "../../core/shared/collection.model";
|
||||
import { Collection } from "../../../core/shared/collection.model";
|
||||
import { Observable } from "rxjs";
|
||||
import { Item } from "../../core/shared/item.model";
|
||||
import { Item } from "../../../core/shared/item.model";
|
||||
|
||||
/**
|
||||
* This component renders the parent collections section of the item
|
@@ -1,6 +1,6 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Bitstream } from "../../core/shared/bitstream.model";
|
||||
import { Item } from "../../core/shared/item.model";
|
||||
import { Bitstream } from "../../../core/shared/bitstream.model";
|
||||
import { Item } from "../../../core/shared/item.model";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
/**
|
1
src/app/item-page/simple/item-page.component.scss
Normal file
1
src/app/item-page/simple/item-page.component.scss
Normal file
@@ -0,0 +1 @@
|
||||
@import '../../../styles/variables';
|
@@ -1,10 +1,10 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Item } from "../core/shared/item.model";
|
||||
import { ItemDataService } from "../core/data/item-data.service";
|
||||
import { RemoteData } from "../core/data/remote-data";
|
||||
import { Item } from "../../core/shared/item.model";
|
||||
import { ItemDataService } from "../../core/data/item-data.service";
|
||||
import { RemoteData } from "../../core/data/remote-data";
|
||||
import { Observable } from "rxjs";
|
||||
import { Bitstream } from "../core/shared/bitstream.model";
|
||||
import { Bitstream } from "../../core/shared/bitstream.model";
|
||||
|
||||
/**
|
||||
* This component renders a simple item page.
|
||||
@@ -37,11 +37,16 @@ export class ItemPageComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.sub = this.route.params.subscribe(params => {
|
||||
this.id = +params['id'];
|
||||
this.item = this.items.findById(params['id']);
|
||||
this.thumbnail = this.item.payload.flatMap(i => i.getThumbnail());
|
||||
this.initialize(params);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
initialize(params) {
|
||||
this.id = +params['id'];
|
||||
this.item = this.items.findById(params['id']);
|
||||
this.thumbnail = this.item.payload.flatMap(i => i.getThumbnail());
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Item } from "../../../core/shared/item.model";
|
||||
import { Item } from "../../../../core/shared/item.model";
|
||||
import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.component";
|
||||
|
||||
@Component({
|
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Item } from "../../../core/shared/item.model";
|
||||
import { Item } from "../../../../core/shared/item.model";
|
||||
import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.component";
|
||||
|
||||
@Component({
|
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Item } from "../../../core/shared/item.model";
|
||||
import { Item } from "../../../../core/shared/item.model";
|
||||
import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.component";
|
||||
|
||||
@Component({
|
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Item } from "../../core/shared/item.model";
|
||||
import { Item } from "../../../core/shared/item.model";
|
||||
|
||||
/**
|
||||
* This component can be used to represent metadata on a simple item page.
|
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Item } from "../../../core/shared/item.model";
|
||||
import { Item } from "../../../../core/shared/item.model";
|
||||
import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.component";
|
||||
|
||||
@Component({
|
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Item } from "../../../core/shared/item.model";
|
||||
import { Item } from "../../../../core/shared/item.model";
|
||||
import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.component";
|
||||
|
||||
@Component({
|
Reference in New Issue
Block a user