From d932b44a7705f0745ce2e25eaf5fc12824755137 Mon Sep 17 00:00:00 2001 From: Lotte Hofstede Date: Wed, 3 May 2017 14:28:26 +0200 Subject: [PATCH] 40416: small fixes and thumbnails --- src/app/core/cache/models/bundle-builder.ts | 146 ++++++++++-------- .../core/cache/models/collection-builder.ts | 20 +-- src/app/core/cache/models/item-builder.ts | 20 +-- .../models/normalized-bitstream.model.ts | 5 +- src/app/core/shared/dspace-object.model.ts | 138 +++++++++-------- src/app/core/shared/item.model.ts | 74 +++++---- src/app/item-page/item-page.component.html | 11 +- src/app/item-page/item-page.component.ts | 46 +++--- src/app/item-page/item-page.module.ts | 2 + .../item-page-abstract-field.component.ts | 3 +- .../item-page-author-field.component.ts | 3 +- .../date/item-page-date-field.component.ts | 3 +- .../item-page-specific-field.component.html | 2 +- .../item-page-specific-field.component.ts | 3 +- .../item-page-thumbnail-field.component.ts | 0 .../item-page-title-field.component.html | 2 +- .../title/item-page-title-field.component.ts | 3 +- .../uri/item-page-uri-field.component.html | 2 +- .../uri/item-page-uri-field.component.ts | 3 +- src/app/thumbnail/thumbnail.component.html | 3 + src/app/thumbnail/thumbnail.component.scss | 1 + src/app/thumbnail/thumbnail.component.ts | 24 +++ src/backend/bundles.ts | 4 +- 23 files changed, 302 insertions(+), 216 deletions(-) delete mode 100644 src/app/item-page/specific-field/thumbnail/item-page-thumbnail-field.component.ts create mode 100644 src/app/thumbnail/thumbnail.component.html create mode 100644 src/app/thumbnail/thumbnail.component.scss create mode 100644 src/app/thumbnail/thumbnail.component.ts diff --git a/src/app/core/cache/models/bundle-builder.ts b/src/app/core/cache/models/bundle-builder.ts index b360c28f58..934539fbae 100644 --- a/src/app/core/cache/models/bundle-builder.ts +++ b/src/app/core/cache/models/bundle-builder.ts @@ -14,80 +14,98 @@ import { NormalizedBitstream } from "./normalized-bitstream.model"; export class BundleBuilder { - constructor( - protected objectCache: ObjectCacheService, - protected responseCache: ResponseCacheService, - protected requestService: RequestService, - protected store: Store, - protected href: string, - protected normalized: NormalizedBundle - ) { - } - - build(): Bundle { - let links: any = {}; - - if (hasValue(this.normalized.bitstreams)) { - //for some reason the dispatches in the forEach don't - //fire without this timeout. A zone issue? - setTimeout(() => { - this.normalized.bitstreams.forEach((href: string) => { - const isCached = this.objectCache.hasBySelfLink(href); - const isPending = this.requestService.isPending(href); - - if (!(isCached || isPending)) { - const request = new Request(href, NormalizedBitstream); - this.store.dispatch(new RequestConfigureAction(request)); - this.store.dispatch(new RequestExecuteAction(href)); - } - }); - }, 0); - - links.bitstreams = this.normalized.bitstreams.map((href: string) => { - return new BitstreamRDBuilder( - this.objectCache, - this.responseCache, - this.requestService, - this.store, - href - ).build(); - }); + constructor(protected objectCache: ObjectCacheService, + protected responseCache: ResponseCacheService, + protected requestService: RequestService, + protected store: Store, + protected href: string, + protected normalized: NormalizedBundle) { + } + + build(): Bundle { + let links: any = {}; + + if (hasValue(this.normalized.bitstreams)) { + //for some reason the dispatches in the forEach don't + //fire without this timeout. A zone issue? + setTimeout(() => { + this.normalized.bitstreams.forEach((href: string) => { + const isCached = this.objectCache.hasBySelfLink(href); + const isPending = this.requestService.isPending(href); + + if (!(isCached || isPending)) { + const request = new Request(href, NormalizedBitstream); + this.store.dispatch(new RequestConfigureAction(request)); + this.store.dispatch(new RequestExecuteAction(href)); + } + }); + }, 0); + + links.bitstreams = this.normalized.bitstreams.map((href: string) => { + return new BitstreamRDBuilder( + this.objectCache, + this.responseCache, + this.requestService, + this.store, + href + ).build(); + }); + } + + if (hasValue(this.normalized.primaryBitstream)) { + const href = this.normalized.primaryBitstream; + //for some reason the dispatches in the forEach don't + //fire without this timeout. A zone issue? + setTimeout(() => { + const isCached = this.objectCache.hasBySelfLink(href); + const isPending = this.requestService.isPending(href); + + if (!(isCached || isPending)) { + const request = new Request(href, NormalizedBitstream); + this.store.dispatch(new RequestConfigureAction(request)); + this.store.dispatch(new RequestExecuteAction(href)); + } + }, 0); + links.primaryBitstream = + new BitstreamRDBuilder( + this.objectCache, + this.responseCache, + this.requestService, + this.store, + href + ).build(); + } + return Object.assign(new Bundle(), this.normalized, links); } - return Object.assign(new Bundle(), this.normalized, links); - } } export class BundleRDBuilder extends SingleRemoteDataBuilder { - constructor( - objectCache: ObjectCacheService, - responseCache: ResponseCacheService, - requestService: RequestService, - store: Store, - href: string - ) { - super(objectCache, responseCache, requestService, store, href, NormalizedBundle); - } + constructor(objectCache: ObjectCacheService, + responseCache: ResponseCacheService, + requestService: RequestService, + store: Store, + href: string) { + super(objectCache, responseCache, requestService, store, href, NormalizedBundle); + } - protected normalizedToDomain(normalized: NormalizedBundle): Bundle { - return new BundleBuilder(this.objectCache, this.responseCache, this.requestService, this.store, this.href, normalized).build(); - } + protected normalizedToDomain(normalized: NormalizedBundle): Bundle { + return new BundleBuilder(this.objectCache, this.responseCache, this.requestService, this.store, this.href, normalized).build(); + } } export class BundleListRDBuilder extends ListRemoteDataBuilder { - constructor( - objectCache: ObjectCacheService, - responseCache: ResponseCacheService, - requestService: RequestService, - store: Store, - href: string - ) { - super(objectCache, responseCache, requestService, store, href, NormalizedBundle); - } + constructor(objectCache: ObjectCacheService, + responseCache: ResponseCacheService, + requestService: RequestService, + store: Store, + href: string) { + super(objectCache, responseCache, requestService, store, href, NormalizedBundle); + } - protected normalizedToDomain(normalized: NormalizedBundle): Bundle { - return new BundleBuilder(this.objectCache, this.responseCache, this.requestService, this.store, this.href, normalized).build(); - } + protected normalizedToDomain(normalized: NormalizedBundle): Bundle { + return new BundleBuilder(this.objectCache, this.responseCache, this.requestService, this.store, this.href, normalized).build(); + } } diff --git a/src/app/core/cache/models/collection-builder.ts b/src/app/core/cache/models/collection-builder.ts index 3291d10518..f0cc93fab7 100644 --- a/src/app/core/cache/models/collection-builder.ts +++ b/src/app/core/cache/models/collection-builder.ts @@ -29,16 +29,18 @@ export class CollectionBuilder { let links: any = {}; if (hasValue(this.normalized.items)) { - this.normalized.items.forEach((href: string) => { - const isCached = this.objectCache.hasBySelfLink(href); - const isPending = this.requestService.isPending(href); + setTimeout(() => { + this.normalized.items.forEach((href: string) => { + const isCached = this.objectCache.hasBySelfLink(href); + const isPending = this.requestService.isPending(href); - if (!(isCached || isPending)) { - const request = new Request(href, NormalizedItem); - this.store.dispatch(new RequestConfigureAction(request)); - this.store.dispatch(new RequestExecuteAction(href)); - } - }); + if (!(isCached || isPending)) { + const request = new Request(href, NormalizedItem); + this.store.dispatch(new RequestConfigureAction(request)); + this.store.dispatch(new RequestExecuteAction(href)); + } + }); + }, 0); links.items = this.normalized.items.map((href: string) => { return new ItemRDBuilder( diff --git a/src/app/core/cache/models/item-builder.ts b/src/app/core/cache/models/item-builder.ts index 6935741e38..89e83e6d4e 100644 --- a/src/app/core/cache/models/item-builder.ts +++ b/src/app/core/cache/models/item-builder.ts @@ -28,16 +28,18 @@ export class ItemBuilder { let links: any = {}; if (hasValue(this.normalized.bundles)) { - this.normalized.bundles.forEach((href: string) => { - const isCached = this.objectCache.hasBySelfLink(href); - const isPending = this.requestService.isPending(href); + setTimeout(() => { + this.normalized.bundles.forEach((href: string) => { + const isCached = this.objectCache.hasBySelfLink(href); + const isPending = this.requestService.isPending(href); - if (!(isCached || isPending)) { - const request = new Request(href, NormalizedBundle); - this.store.dispatch(new RequestConfigureAction(request)); - this.store.dispatch(new RequestExecuteAction(href)); - } - }); + if (!(isCached || isPending)) { + const request = new Request(href, NormalizedBundle); + this.store.dispatch(new RequestConfigureAction(request)); + this.store.dispatch(new RequestExecuteAction(href)); + } + }); + }, 0); links.bundles = this.normalized.bundles.map((href: string) => { return new BundleRDBuilder( diff --git a/src/app/core/cache/models/normalized-bitstream.model.ts b/src/app/core/cache/models/normalized-bitstream.model.ts index b6b1302f79..fb48867ab3 100644 --- a/src/app/core/cache/models/normalized-bitstream.model.ts +++ b/src/app/core/cache/models/normalized-bitstream.model.ts @@ -1,4 +1,4 @@ -import { inheritSerialization } from "cerialize"; +import { inheritSerialization, autoserialize } from "cerialize"; import { NormalizedDSpaceObject } from "./normalized-dspace-object.model"; @inheritSerialization(NormalizedDSpaceObject) @@ -33,4 +33,7 @@ export class NormalizedBitstream extends NormalizedDSpaceObject { * The Bundle that owns this Bitstream */ owner: string; + + @autoserialize + retrieve: string; } diff --git a/src/app/core/shared/dspace-object.model.ts b/src/app/core/shared/dspace-object.model.ts index cb800a9681..7b4fbaea5c 100644 --- a/src/app/core/shared/dspace-object.model.ts +++ b/src/app/core/shared/dspace-object.model.ts @@ -8,77 +8,87 @@ import { CacheableObject } from "../cache/object-cache.reducer"; */ export abstract class DSpaceObject implements CacheableObject { - @autoserialize - self: string; + @autoserialize + self: string; - /** - * The human-readable identifier of this DSpaceObject - */ - @autoserialize - id: string; + /** + * The human-readable identifier of this DSpaceObject + */ + @autoserialize + id: string; - /** - * The universally unique identifier of this DSpaceObject - */ - @autoserialize - uuid: string; + /** + * The universally unique identifier of this DSpaceObject + */ + @autoserialize + uuid: string; - /** - * A string representing the kind of DSpaceObject, e.g. community, item, … - */ - type: string; + /** + * A string representing the kind of DSpaceObject, e.g. community, item, … + */ + type: string; - /** - * The name for this DSpaceObject - */ - @autoserialize - name: string; + /** + * The name for this DSpaceObject + */ + @autoserialize + name: string; - /** - * An array containing all metadata of this DSpaceObject - */ - @autoserializeAs(Metadatum) - metadata: Array; + /** + * An array containing all metadata of this DSpaceObject + */ + @autoserializeAs(Metadatum) + metadata: Array; - /** - * An array of DSpaceObjects that are direct parents of this DSpaceObject - */ - parents: Array; + /** + * An array of DSpaceObjects that are direct parents of this DSpaceObject + */ + parents: Array; - /** - * The DSpaceObject that owns this DSpaceObject - */ - owner: DSpaceObject; + /** + * The DSpaceObject that owns this DSpaceObject + */ + owner: DSpaceObject; - /** - * Find a metadata field by key and language - * - * This method returns the value of the first element - * in the metadata array that matches the provided - * key and language - * - * @param key - * @param language - * @return string - */ - findMetadata(key: string, language?: string): string { - const metadatum = this.metadata - .find((metadatum: Metadatum) => { - return metadatum.key === key && - (isEmpty(language) || metadatum.language === language) - }); - if (isNotEmpty(metadatum)) { - return metadatum.value; - } - else { - return undefined; - } - } + /** + * Find a metadata field by key and language + * + * This method returns the value of the first element + * in the metadata array that matches the provided + * key and language + * + * @param key + * @param language + * @return string + */ + findMetadata(key: string, language?: string): string { + const metadatum = this.metadata + .find((metadatum: Metadatum) => { + return metadatum.key === key && + (isEmpty(language) || metadatum.language === language) + }); + if (isNotEmpty(metadatum)) { + return metadatum.value; + } + else { + return undefined; + } + } - filterMetadata(keys: string[]): Array { - return this.metadata - .filter((metadatum: Metadatum) => { - return keys.some(key => key === metadatum.key); - }); - } + /** + * Find metadata by an array of keys + * + * This method returns the values of the element + * in the metadata array that match the provided + * key(s) + * + * @param key(s) + * @return Array + */ + filterMetadata(keys: string[]): Array { + return this.metadata + .filter((metadatum: Metadatum) => { + return keys.some(key => key === metadatum.key); + }); + } } diff --git a/src/app/core/shared/item.model.ts b/src/app/core/shared/item.model.ts index ca93ea7ad3..3a021d4acb 100644 --- a/src/app/core/shared/item.model.ts +++ b/src/app/core/shared/item.model.ts @@ -3,42 +3,62 @@ import { DSpaceObject } from "./dspace-object.model"; import { Collection } from "./collection.model"; import { RemoteData } from "../data/remote-data"; import { Bundle } from "./bundle.model"; +import { Bitstream } from "./bitstream.model"; +import { Observable } from "rxjs"; @inheritSerialization(DSpaceObject) export class Item extends DSpaceObject { - /** - * A string representing the unique handle of this Item - */ - @autoserialize - handle: string; + /** + * A string representing the unique handle of this Item + */ + @autoserialize + handle: string; - /** - * The Date of the last modification of this Item - */ - lastModified: Date; + /** + * The Date of the last modification of this Item + */ + lastModified: Date; - /** - * A boolean representing if this Item is currently archived or not - */ - isArchived: boolean; + /** + * A boolean representing if this Item is currently archived or not + */ + isArchived: boolean; - /** - * A boolean representing if this Item is currently withdrawn or not - */ - isWithdrawn: boolean; + /** + * A boolean representing if this Item is currently withdrawn or not + */ + isWithdrawn: boolean; - /** - * An array of Collections that are direct parents of this Item - */ - @autoserializeAs(Collection) - parents: Array; + /** + * An array of Collections that are direct parents of this Item + */ + @autoserializeAs(Collection) + parents: Array; - /** - * The Collection that owns this Item - */ - owner: Collection; + /** + * The Collection that owns this Item + */ + owner: Collection; - bundles: Array> + bundles: Array>; + + getThumbnail(): Observable { + const bundle: Observable = this.getBundle("THUMBNAIL"); + return bundle.flatMap( + b => b.primaryBitstream.payload + ); + } + + getBundle(name: String): Observable { + return Observable.combineLatest( + ...this.bundles.map(b => b.payload), + (...bundles: Array) => bundles) + .map(bundles => { + return bundles.find((bundle: Bundle) => { + return bundle.name === name + }); + }); + } } diff --git a/src/app/item-page/item-page.component.html b/src/app/item-page/item-page.component.html index d5069ce529..f6022ec103 100644 --- a/src/app/item-page/item-page.component.html +++ b/src/app/item-page/item-page.component.html @@ -1,8 +1,9 @@
Item page component - - - - - + + + + + +
diff --git a/src/app/item-page/item-page.component.ts b/src/app/item-page/item-page.component.ts index 215b98cbd9..d18963f3de 100644 --- a/src/app/item-page/item-page.component.ts +++ b/src/app/item-page/item-page.component.ts @@ -1,35 +1,41 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Item } from "../core/shared/item.model"; -import { ItemDataService } from "../core/data-services/item-data.service"; -import { RemoteData } from "../core/data-services/remote-data"; +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"; @Component({ - selector: 'ds-item-page', - styleUrls: ['./item-page.component.css'], - templateUrl: './item-page.component.html' + selector: 'ds-item-page', + styleUrls: ['./item-page.component.css'], + templateUrl: './item-page.component.html', + // changeDetection: ChangeDetectionStrategy.OnPush }) export class ItemPageComponent implements OnInit { - id: number; - private sub: any; - item : RemoteData; + id: number; + private sub: any; + item: RemoteData; + thumbnail: Observable; - constructor( private route: ActivatedRoute, private items : ItemDataService) { - this.universalInit(); - } + constructor(private route: ActivatedRoute, private items: ItemDataService) { + this.universalInit(); + } - universalInit() { + universalInit() { - } + } - ngOnInit(): void { - this.sub = this.route.params.subscribe(params => { - this.id = +params['id']; - this.item = this.items.findById(params['id']); - }); + 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()); + }); - } + + } } diff --git a/src/app/item-page/item-page.module.ts b/src/app/item-page/item-page.module.ts index 9185b29867..dcdd7b7130 100644 --- a/src/app/item-page/item-page.module.ts +++ b/src/app/item-page/item-page.module.ts @@ -12,6 +12,7 @@ import { ItemPageUriFieldComponent } from './specific-field/uri/item-page-uri-fi import { ItemPageTitleFieldComponent } from './specific-field/title/item-page-title-field.component'; import { ItemPageSpecificFieldComponent } from './specific-field/item-page-specific-field.component'; import { SharedModule } from './../shared/shared.module'; +import { ThumbnailComponent } from "../thumbnail/thumbnail.component"; @NgModule({ declarations: [ @@ -25,6 +26,7 @@ import { SharedModule } from './../shared/shared.module'; ItemPageUriFieldComponent, ItemPageTitleFieldComponent, ItemPageSpecificFieldComponent, + ThumbnailComponent, ], imports: [ ItemPageRoutingModule, diff --git a/src/app/item-page/specific-field/abstract/item-page-abstract-field.component.ts b/src/app/item-page/specific-field/abstract/item-page-abstract-field.component.ts index 6d7de927ee..d10fb84feb 100644 --- a/src/app/item-page/specific-field/abstract/item-page-abstract-field.component.ts +++ b/src/app/item-page/specific-field/abstract/item-page-abstract-field.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, Input } from '@angular/core'; import { Item } from "../../../core/shared/item.model"; -import { Observable } from "rxjs"; import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.component"; @Component({ @@ -9,7 +8,7 @@ import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.comp }) export class ItemPageAbstractFieldComponent extends ItemPageSpecificFieldComponent implements OnInit { - @Input() item: Observable; + @Input() item: Item; fields : string[] = [ "dc.description.abstract" diff --git a/src/app/item-page/specific-field/author/item-page-author-field.component.ts b/src/app/item-page/specific-field/author/item-page-author-field.component.ts index 15ee8c1af0..b7f0ba4ecb 100644 --- a/src/app/item-page/specific-field/author/item-page-author-field.component.ts +++ b/src/app/item-page/specific-field/author/item-page-author-field.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, Input } from '@angular/core'; import { Item } from "../../../core/shared/item.model"; -import { Observable } from "rxjs"; import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.component"; @Component({ @@ -9,7 +8,7 @@ import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.comp }) export class ItemPageAuthorFieldComponent extends ItemPageSpecificFieldComponent implements OnInit { - @Input() item: Observable; + @Input() item: Item; fields : string[] = [ "dc.contributor.author", diff --git a/src/app/item-page/specific-field/date/item-page-date-field.component.ts b/src/app/item-page/specific-field/date/item-page-date-field.component.ts index 097557882a..19d931c467 100644 --- a/src/app/item-page/specific-field/date/item-page-date-field.component.ts +++ b/src/app/item-page/specific-field/date/item-page-date-field.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, Input } from '@angular/core'; import { Item } from "../../../core/shared/item.model"; -import { Observable } from "rxjs"; import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.component"; @Component({ @@ -9,7 +8,7 @@ import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.comp }) export class ItemPageDateFieldComponent extends ItemPageSpecificFieldComponent implements OnInit { - @Input() item: Observable; + @Input() item: Item; fields : string[] = [ "dc.date.issued" diff --git a/src/app/item-page/specific-field/item-page-specific-field.component.html b/src/app/item-page/specific-field/item-page-specific-field.component.html index 0b526954d0..4a27848ec6 100644 --- a/src/app/item-page/specific-field/item-page-specific-field.component.html +++ b/src/app/item-page/specific-field/item-page-specific-field.component.html @@ -1,3 +1,3 @@
- +
diff --git a/src/app/item-page/specific-field/item-page-specific-field.component.ts b/src/app/item-page/specific-field/item-page-specific-field.component.ts index e803494919..9368f3610f 100644 --- a/src/app/item-page/specific-field/item-page-specific-field.component.ts +++ b/src/app/item-page/specific-field/item-page-specific-field.component.ts @@ -1,13 +1,12 @@ import { Component, OnInit, Input } from '@angular/core'; import { Item } from "../../core/shared/item.model"; -import { Observable } from "rxjs"; @Component({ templateUrl: './item-page-specific-field.component.html' }) export class ItemPageSpecificFieldComponent implements OnInit { - @Input() item: Observable; + @Input() item: Item; fields : string[]; label : string; diff --git a/src/app/item-page/specific-field/thumbnail/item-page-thumbnail-field.component.ts b/src/app/item-page/specific-field/thumbnail/item-page-thumbnail-field.component.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/app/item-page/specific-field/title/item-page-title-field.component.html b/src/app/item-page/specific-field/title/item-page-title-field.component.html index 2ec5c0bb16..4c53e2e3e2 100644 --- a/src/app/item-page/specific-field/title/item-page-title-field.component.html +++ b/src/app/item-page/specific-field/title/item-page-title-field.component.html @@ -1,3 +1,3 @@

- +

diff --git a/src/app/item-page/specific-field/title/item-page-title-field.component.ts b/src/app/item-page/specific-field/title/item-page-title-field.component.ts index 12d14074c7..e9fea3fdee 100644 --- a/src/app/item-page/specific-field/title/item-page-title-field.component.ts +++ b/src/app/item-page/specific-field/title/item-page-title-field.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, Input } from '@angular/core'; import { Item } from "../../../core/shared/item.model"; -import { Observable } from "rxjs"; import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.component"; @Component({ @@ -9,7 +8,7 @@ import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.comp }) export class ItemPageTitleFieldComponent extends ItemPageSpecificFieldComponent implements OnInit { - @Input() item: Observable; + @Input() item: Item; fields : string[] = [ "dc.title" diff --git a/src/app/item-page/specific-field/uri/item-page-uri-field.component.html b/src/app/item-page/specific-field/uri/item-page-uri-field.component.html index 844131a48b..fde79d6a04 100644 --- a/src/app/item-page/specific-field/uri/item-page-uri-field.component.html +++ b/src/app/item-page/specific-field/uri/item-page-uri-field.component.html @@ -1,3 +1,3 @@
- +
diff --git a/src/app/item-page/specific-field/uri/item-page-uri-field.component.ts b/src/app/item-page/specific-field/uri/item-page-uri-field.component.ts index 3df3ae2682..4ca523849d 100644 --- a/src/app/item-page/specific-field/uri/item-page-uri-field.component.ts +++ b/src/app/item-page/specific-field/uri/item-page-uri-field.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, Input } from '@angular/core'; import { Item } from "../../../core/shared/item.model"; -import { Observable } from "rxjs"; import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.component"; @Component({ @@ -9,7 +8,7 @@ import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.comp }) export class ItemPageUriFieldComponent extends ItemPageSpecificFieldComponent implements OnInit { - @Input() item: Observable; + @Input() item: Item; fields : string[] = [ "dc.identifier.uri" diff --git a/src/app/thumbnail/thumbnail.component.html b/src/app/thumbnail/thumbnail.component.html new file mode 100644 index 0000000000..8cec21e358 --- /dev/null +++ b/src/app/thumbnail/thumbnail.component.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/src/app/thumbnail/thumbnail.component.scss b/src/app/thumbnail/thumbnail.component.scss new file mode 100644 index 0000000000..da97dd7a62 --- /dev/null +++ b/src/app/thumbnail/thumbnail.component.scss @@ -0,0 +1 @@ +@import '../../styles/variables.scss'; diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts new file mode 100644 index 0000000000..84da2ffbb9 --- /dev/null +++ b/src/app/thumbnail/thumbnail.component.ts @@ -0,0 +1,24 @@ +import { Component, Input } from '@angular/core'; +import { Bitstream } from "../core/shared/bitstream.model"; +import { Observable } from "rxjs"; + +@Component({ + selector: 'ds-thumbnail', + styleUrls: ['./thumbnail.component.css'], + templateUrl: './thumbnail.component.html' +}) +export class ThumbnailComponent { + + @Input() thumbnail : Observable; + data: any = {}; + + constructor() { + this.universalInit(); + + } + + universalInit() { + + } + +} diff --git a/src/backend/bundles.ts b/src/backend/bundles.ts index fde6409635..9ec0630dbd 100644 --- a/src/backend/bundles.ts +++ b/src/backend/bundles.ts @@ -8,7 +8,7 @@ export const BUNDLES = [ "bitstreams": [ { "href": "/bitstreams/3678" }, ], - "primaryBitstream": { "href": "/bitstreams/43c57c2b-206f-4645-8c8f-5f10c84b09fa" } + "primaryBitstream": { "href": "/bitstreams/3678" } }, "id": "2355", "uuid": "35e0606d-5e18-4f9c-aa61-74fc751cc3f9", @@ -26,7 +26,7 @@ export const BUNDLES = [ "bitstreams": [ { "href": "/bitstreams/8842" }, ], - "primaryBitstream": { "href": "/bitstreams/1a013ecc-fb25-4689-a44f-f1383ad26632" } + "primaryBitstream": { "href": "/bitstreams/8842" } }, "id": "5687", "uuid": "a469c57a-abcf-45c3-83e4-b187ebd708fd",