mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
65272: TemplateItem object and normalized version
This commit is contained in:
22
src/app/core/cache/models/normalized-template-item.model.ts
vendored
Normal file
22
src/app/core/cache/models/normalized-template-item.model.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { inheritSerialization, deserialize } from 'cerialize';
|
||||
|
||||
import { mapsTo, relationship } from '../builders/build-decorators';
|
||||
import { TemplateItem } from '../../shared/template-item.model';
|
||||
import { NormalizedItem } from './normalized-item.model';
|
||||
import { Collection } from '../../shared/collection.model';
|
||||
|
||||
/**
|
||||
* Normalized model class for a DSpace Template Item
|
||||
*/
|
||||
@mapsTo(TemplateItem)
|
||||
@inheritSerialization(NormalizedItem)
|
||||
export class NormalizedTemplateItem extends NormalizedItem {
|
||||
|
||||
/**
|
||||
* The Collection that this item is a template for
|
||||
*/
|
||||
@deserialize
|
||||
@relationship(Collection, false)
|
||||
templateItemOf: string;
|
||||
|
||||
}
|
@@ -141,6 +141,7 @@ import { NormalizedExternalSource } from './cache/models/normalized-external-sou
|
||||
import { NormalizedExternalSourceEntry } from './cache/models/normalized-external-source-entry.model';
|
||||
import { ExternalSourceService } from './data/external-source.service';
|
||||
import { LookupRelationService } from './data/lookup-relation.service';
|
||||
import { NormalizedTemplateItem } from './cache/models/normalized-template-item.model';
|
||||
|
||||
/**
|
||||
* When not in production, endpoint responses can be mocked for testing purposes
|
||||
@@ -302,7 +303,8 @@ export const normalizedModels =
|
||||
NormalizedRelationshipType,
|
||||
NormalizedItemType,
|
||||
NormalizedExternalSource,
|
||||
NormalizedExternalSourceEntry
|
||||
NormalizedExternalSourceEntry,
|
||||
NormalizedTemplateItem
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
18
src/app/core/shared/template-item.model.ts
Normal file
18
src/app/core/shared/template-item.model.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Item } from './item.model';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { RemoteData } from '../data/remote-data';
|
||||
import { Collection } from './collection.model';
|
||||
import { ResourceType } from './resource-type';
|
||||
|
||||
/**
|
||||
* Class representing a DSpace Template Item
|
||||
*/
|
||||
export class TemplateItem extends Item {
|
||||
static type = new ResourceType('templateItem');
|
||||
|
||||
/**
|
||||
* The Collection that this item is a template for
|
||||
*/
|
||||
templateItemOf: Observable<RemoteData<Collection>>;
|
||||
|
||||
}
|
Reference in New Issue
Block a user