65272: Missing JSDocs + id and uuid serializing fix for NormalizedTemplateItem

This commit is contained in:
Kristof De Langhe
2020-01-23 17:24:46 +01:00
parent a714958c04
commit 98937bd240
2 changed files with 14 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
import { inheritSerialization, deserialize } from 'cerialize'; import { inheritSerialization, deserialize, autoserializeAs } from 'cerialize';
import { mapsTo, relationship } from '../builders/build-decorators'; import { mapsTo, relationship } from '../builders/build-decorators';
import { TemplateItem } from '../../shared/template-item.model'; import { TemplateItem } from '../../shared/template-item.model';
@@ -12,6 +12,18 @@ import { Collection } from '../../shared/collection.model';
@inheritSerialization(NormalizedItem) @inheritSerialization(NormalizedItem)
export class NormalizedTemplateItem extends NormalizedItem { export class NormalizedTemplateItem extends NormalizedItem {
/**
* The human-readable identifier of this DSpaceObject
*/
@autoserializeAs(String)
id: string;
/**
* The universally unique identifier of this DSpaceObject
*/
@autoserializeAs(String, 'id')
uuid: string;
/** /**
* The Collection that this item is a template for * The Collection that this item is a template for
*/ */

View File

@@ -261,6 +261,7 @@ export abstract class DataService<T extends CacheableObject> implements UpdateDa
* Add a new patch to the object cache * Add a new patch to the object cache
* The patch is derived from the differences between the given object and its version in the object cache * The patch is derived from the differences between the given object and its version in the object cache
* @param {DSpaceObject} object The given object * @param {DSpaceObject} object The given object
* @param ignoreMetadataFields An optional list of metadata fields to ignore updates for (* is allowed as a wildcard, for example: dc.description.*)
*/ */
update(object: T, ignoreMetadataFields: string[] = []): Observable<RemoteData<T>> { update(object: T, ignoreMetadataFields: string[] = []): Observable<RemoteData<T>> {
const ignoreMetadataFieldsPrefix = ignoreMetadataFields.map((field) => field.indexOf('*') > -1 ? field.slice(0, field.indexOf('*')) : field); const ignoreMetadataFieldsPrefix = ignoreMetadataFields.map((field) => field.indexOf('*') > -1 ? field.slice(0, field.indexOf('*')) : field);