mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge branch 'search-features' into resolvers-branch
This commit is contained in:
21
.dockerignore
Normal file
21
.dockerignore
Normal file
@@ -0,0 +1,21 @@
|
||||
.git
|
||||
node-modules
|
||||
__build__
|
||||
__server_build__
|
||||
typings
|
||||
tsd_typings
|
||||
npm-debug.log
|
||||
dist
|
||||
coverage
|
||||
.idea
|
||||
*.iml
|
||||
*.ngfactory.ts
|
||||
*.css.shim.ts
|
||||
*.scss.shim.ts
|
||||
.DS_Store
|
||||
webpack.records.json
|
||||
npm-debug.log.*
|
||||
morgan.log
|
||||
yarn-error.log
|
||||
*.css
|
||||
package-lock.json
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
# This image will be published as dspace/dspace-angular
|
||||
# See https://dspace-labs.github.io/DSpace-Docker-Images/ for usage details
|
||||
|
||||
FROM node:8-alpine
|
||||
WORKDIR /app
|
||||
ADD . /app/
|
||||
EXPOSE 3000
|
||||
|
||||
RUN yarn install
|
||||
CMD yarn run watch
|
@@ -60,7 +60,7 @@ describe('CollectionsComponent', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('When the requested item request has succeeded', () => {
|
||||
describe('When the requested item request has failed', () => {
|
||||
beforeEach(() => {
|
||||
collectionsComponent.item = failedMockItem;
|
||||
fixture.detectChanges();
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { IDToUUIDSerializer } from './it-to-uuid-serializer';
|
||||
import { IDToUUIDSerializer } from './id-to-uuid-serializer';
|
||||
|
||||
describe('IDToUUIDSerializer', () => {
|
||||
let serializer: IDToUUIDSerializer;
|
35
src/app/core/cache/id-to-uuid-serializer.ts
vendored
Normal file
35
src/app/core/cache/id-to-uuid-serializer.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
|
||||
/**
|
||||
* Serializer to create unique fake UUID's from id's that might otherwise be the same across multiple object types
|
||||
*/
|
||||
export class IDToUUIDSerializer {
|
||||
/**
|
||||
* @param {string} prefix To prepend the original ID with
|
||||
*/
|
||||
constructor(private prefix: string) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to serialize a UUID
|
||||
* @param {string} uuid
|
||||
* @returns {any} undefined Fake UUID's should not be sent back to the server, but only be used in the UI
|
||||
*/
|
||||
Serialize(uuid: string): any {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to deserialize a UUID
|
||||
* @param {string} id Identifier to transform in to a UUID
|
||||
* @returns {string} UUID based on the prefix and the given id
|
||||
*/
|
||||
Deserialize(id: string): string {
|
||||
if (hasValue(id)) {
|
||||
return `${this.prefix}-${id}`;
|
||||
} else {
|
||||
return id;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
19
src/app/core/cache/it-to-uuid-serializer.ts
vendored
19
src/app/core/cache/it-to-uuid-serializer.ts
vendored
@@ -1,19 +0,0 @@
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
|
||||
export class IDToUUIDSerializer {
|
||||
constructor(private prefix: string) {
|
||||
}
|
||||
|
||||
Serialize(uuid: string): any {
|
||||
return undefined; // ui-only uuid doesn't need to be sent back to the server
|
||||
}
|
||||
|
||||
Deserialize(id: string): string {
|
||||
if (hasValue(id)) {
|
||||
return `${this.prefix}-${id}`;
|
||||
} else {
|
||||
return id;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
64
src/app/core/cache/models/action-type.model.ts
vendored
Normal file
64
src/app/core/cache/models/action-type.model.ts
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* Enum representing the Action Type of a Resource Policy
|
||||
*/
|
||||
export enum ActionType {
|
||||
/**
|
||||
* Action of reading, viewing or downloading something
|
||||
*/
|
||||
READ = 0,
|
||||
|
||||
/**
|
||||
* Action of modifying something
|
||||
*/
|
||||
WRITE = 1,
|
||||
|
||||
/**
|
||||
* Action of deleting something
|
||||
*/
|
||||
DELETE = 2,
|
||||
|
||||
/**
|
||||
* Action of adding something to a container
|
||||
*/
|
||||
ADD = 3,
|
||||
|
||||
/**
|
||||
* Action of removing something from a container
|
||||
*/
|
||||
REMOVE = 4,
|
||||
|
||||
/**
|
||||
* Action of performing workflow step 1
|
||||
*/
|
||||
WORKFLOW_STEP_1 = 5,
|
||||
|
||||
/**
|
||||
* Action of performing workflow step 2
|
||||
*/
|
||||
WORKFLOW_STEP_2 = 6,
|
||||
|
||||
/**
|
||||
* Action of performing workflow step 3
|
||||
*/
|
||||
WORKFLOW_STEP_3 = 7,
|
||||
|
||||
/**
|
||||
* Action of performing a workflow abort
|
||||
*/
|
||||
WORKFLOW_ABORT = 8,
|
||||
|
||||
/**
|
||||
* Default Read policies for Bitstreams submitted to container
|
||||
*/
|
||||
DEFAULT_BITSTREAM_READ = 9,
|
||||
|
||||
/**
|
||||
* Default Read policies for Items submitted to container
|
||||
*/
|
||||
DEFAULT_ITEM_READ = 10,
|
||||
|
||||
/**
|
||||
* Administrative actions
|
||||
*/
|
||||
ADMIN = 11,
|
||||
}
|
@@ -2,34 +2,65 @@ import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize'
|
||||
import { BitstreamFormat } from '../../shared/bitstream-format.model';
|
||||
|
||||
import { mapsTo } from '../builders/build-decorators';
|
||||
import { IDToUUIDSerializer } from '../it-to-uuid-serializer';
|
||||
import { IDToUUIDSerializer } from '../id-to-uuid-serializer';
|
||||
import { NormalizedObject } from './normalized-object.model';
|
||||
import { SupportLevel } from './support-level.model';
|
||||
|
||||
/**
|
||||
* Normalized model class for a Bitstream Format
|
||||
*/
|
||||
@mapsTo(BitstreamFormat)
|
||||
@inheritSerialization(NormalizedObject)
|
||||
export class NormalizedBitstreamFormat extends NormalizedObject {
|
||||
|
||||
/**
|
||||
* Short description of this Bitstream Format
|
||||
*/
|
||||
@autoserialize
|
||||
shortDescription: string;
|
||||
|
||||
/**
|
||||
* Description of this Bitstream Format
|
||||
*/
|
||||
@autoserialize
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* String representing the MIME type of this Bitstream Format
|
||||
*/
|
||||
@autoserialize
|
||||
mimetype: string;
|
||||
|
||||
/**
|
||||
* The level of support the system offers for this Bitstream Format
|
||||
*/
|
||||
@autoserialize
|
||||
supportLevel: number;
|
||||
supportLevel: SupportLevel;
|
||||
|
||||
/**
|
||||
* True if the Bitstream Format is used to store system information, rather than the content of items in the system
|
||||
*/
|
||||
@autoserialize
|
||||
internal: boolean;
|
||||
|
||||
/**
|
||||
* String representing this Bitstream Format's file extension
|
||||
*/
|
||||
@autoserialize
|
||||
extensions: string;
|
||||
|
||||
/**
|
||||
* Identifier for this Bitstream Format
|
||||
* Note that this ID is unique for bitstream formats,
|
||||
* but might not be unique across different object types
|
||||
*/
|
||||
@autoserialize
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* Universally unique identifier for this Bitstream Format
|
||||
* Consist of a prefix and the id field to ensure the identifier is unique across all object types
|
||||
*/
|
||||
@autoserializeAs(new IDToUUIDSerializer('bitstream-format'), 'id')
|
||||
uuid: string;
|
||||
}
|
||||
|
@@ -5,6 +5,9 @@ import { Bitstream } from '../../shared/bitstream.model';
|
||||
import { mapsTo, relationship } from '../builders/build-decorators';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
|
||||
/**
|
||||
* Normalized model class for a DSpace Bitstream
|
||||
*/
|
||||
@mapsTo(Bitstream)
|
||||
@inheritSerialization(NormalizedDSpaceObject)
|
||||
export class NormalizedBitstream extends NormalizedDSpaceObject {
|
||||
|
@@ -5,6 +5,9 @@ import { Bundle } from '../../shared/bundle.model';
|
||||
import { mapsTo, relationship } from '../builders/build-decorators';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
|
||||
/**
|
||||
* Normalized model class for a DSpace Bundle
|
||||
*/
|
||||
@mapsTo(Bundle)
|
||||
@inheritSerialization(NormalizedDSpaceObject)
|
||||
export class NormalizedBundle extends NormalizedDSpaceObject {
|
||||
@@ -25,6 +28,9 @@ export class NormalizedBundle extends NormalizedDSpaceObject {
|
||||
*/
|
||||
owner: string;
|
||||
|
||||
/**
|
||||
* List of Bitstreams that are part of this Bundle
|
||||
*/
|
||||
@autoserialize
|
||||
@relationship(ResourceType.Bitstream, true)
|
||||
bitstreams: string[];
|
||||
|
@@ -5,6 +5,9 @@ import { Collection } from '../../shared/collection.model';
|
||||
import { mapsTo, relationship } from '../builders/build-decorators';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
|
||||
/**
|
||||
* Normalized model class for a DSpace Collection
|
||||
*/
|
||||
@mapsTo(Collection)
|
||||
@inheritSerialization(NormalizedDSpaceObject)
|
||||
export class NormalizedCollection extends NormalizedDSpaceObject {
|
||||
@@ -36,6 +39,9 @@ export class NormalizedCollection extends NormalizedDSpaceObject {
|
||||
@relationship(ResourceType.Community, false)
|
||||
owner: string;
|
||||
|
||||
/**
|
||||
* List of Items that are part of (not necessarily owned by) this Collection
|
||||
*/
|
||||
@autoserialize
|
||||
@relationship(ResourceType.Item, true)
|
||||
items: string[];
|
||||
|
@@ -1,10 +1,13 @@
|
||||
import { autoserialize, inheritSerialization, autoserializeAs } from 'cerialize';
|
||||
import { autoserialize, inheritSerialization } from 'cerialize';
|
||||
|
||||
import { NormalizedDSpaceObject } from './normalized-dspace-object.model';
|
||||
import { Community } from '../../shared/community.model';
|
||||
import { mapsTo, relationship } from '../builders/build-decorators';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
|
||||
/**
|
||||
* Normalized model class for a DSpace Community
|
||||
*/
|
||||
@mapsTo(Community)
|
||||
@inheritSerialization(NormalizedDSpaceObject)
|
||||
export class NormalizedCommunity extends NormalizedDSpaceObject {
|
||||
@@ -36,6 +39,9 @@ export class NormalizedCommunity extends NormalizedDSpaceObject {
|
||||
@relationship(ResourceType.Community, false)
|
||||
owner: string;
|
||||
|
||||
/**
|
||||
* List of Collections that are owned by this Community
|
||||
*/
|
||||
@autoserialize
|
||||
@relationship(ResourceType.Collection, true)
|
||||
collections: string[];
|
||||
|
@@ -5,6 +5,9 @@ import { Item } from '../../shared/item.model';
|
||||
import { mapsTo, relationship } from '../builders/build-decorators';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
|
||||
/**
|
||||
* Normalized model class for a DSpace Item
|
||||
*/
|
||||
@mapsTo(Item)
|
||||
@inheritSerialization(NormalizedDSpaceObject)
|
||||
export class NormalizedItem extends NormalizedDSpaceObject {
|
||||
@@ -53,6 +56,9 @@ export class NormalizedItem extends NormalizedDSpaceObject {
|
||||
@relationship(ResourceType.Collection, false)
|
||||
owningCollection: string;
|
||||
|
||||
/**
|
||||
* List of Bitstreams that are owned by this Item
|
||||
*/
|
||||
@autoserialize
|
||||
@relationship(ResourceType.Bitstream, true)
|
||||
bitstreams: string[];
|
||||
|
@@ -1,23 +1,49 @@
|
||||
import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize';
|
||||
import { ResourcePolicy } from '../../shared/resource-policy.model';
|
||||
|
||||
import { mapsTo } from '../builders/build-decorators';
|
||||
import { IDToUUIDSerializer } from '../it-to-uuid-serializer';
|
||||
import { mapsTo, relationship } from '../builders/build-decorators';
|
||||
import { NormalizedObject } from './normalized-object.model';
|
||||
import { IDToUUIDSerializer } from '../id-to-uuid-serializer';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
import { ActionType } from './action-type.model';
|
||||
|
||||
/**
|
||||
* Normalized model class for a Resource Policy
|
||||
*/
|
||||
@mapsTo(ResourcePolicy)
|
||||
@inheritSerialization(NormalizedObject)
|
||||
export class NormalizedResourcePolicy extends NormalizedObject {
|
||||
|
||||
/**
|
||||
* The action that is allowed by this Resource Policy
|
||||
*/
|
||||
action: ActionType;
|
||||
|
||||
/**
|
||||
* The name for this Resource Policy
|
||||
*/
|
||||
@autoserialize
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The uuid of the Group this Resource Policy applies to
|
||||
*/
|
||||
@relationship(ResourceType.Group, false)
|
||||
@autoserializeAs(String, 'groupUUID')
|
||||
group: string;
|
||||
|
||||
/**
|
||||
* Identifier for this Resource Policy
|
||||
* Note that this ID is unique for resource policies,
|
||||
* but might not be unique across different object types
|
||||
*/
|
||||
@autoserialize
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* The universally unique identifier for this Resource Policy
|
||||
* Consist of a prefix and the id field to ensure the identifier is unique across all object types
|
||||
*/
|
||||
@autoserializeAs(new IDToUUIDSerializer('resource-policy'), 'id')
|
||||
uuid: string;
|
||||
}
|
||||
|
19
src/app/core/cache/models/support-level.model.ts
vendored
Normal file
19
src/app/core/cache/models/support-level.model.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Enum representing the Support Level of a Bitstream Format
|
||||
*/
|
||||
export enum SupportLevel {
|
||||
/**
|
||||
* Unknown for Bitstream Formats that are unknown to the system
|
||||
*/
|
||||
Unknown = 0,
|
||||
|
||||
/**
|
||||
* Unknown for Bitstream Formats that are known to the system, but not fully supported
|
||||
*/
|
||||
Known = 1,
|
||||
|
||||
/**
|
||||
* Supported for Bitstream Formats that are known to the system and fully supported
|
||||
*/
|
||||
Supported = 2,
|
||||
}
|
@@ -196,8 +196,6 @@ describe('IntegrationResponseParsingService', () => {
|
||||
|
||||
it('should return a IntegrationSuccessResponse with data definition', () => {
|
||||
const response = service.parse(validRequest, validResponse);
|
||||
console.log((response as any).dataDefinition);
|
||||
console.log(definitions);
|
||||
expect((response as any).dataDefinition).toEqual(definitions);
|
||||
});
|
||||
|
||||
|
@@ -2,24 +2,54 @@
|
||||
import { CacheableObject } from '../cache/object-cache.reducer';
|
||||
import { ResourceType } from './resource-type';
|
||||
|
||||
/**
|
||||
* Model class for a Bitstream Format
|
||||
*/
|
||||
export class BitstreamFormat implements CacheableObject {
|
||||
|
||||
/**
|
||||
* Short description of this Bitstream Format
|
||||
*/
|
||||
shortDescription: string;
|
||||
|
||||
/**
|
||||
* Description of this Bitstream Format
|
||||
*/
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* String representing the MIME type of this Bitstream Format
|
||||
*/
|
||||
mimetype: string;
|
||||
|
||||
/**
|
||||
* The level of support the system offers for this Bitstream Format
|
||||
*/
|
||||
supportLevel: number;
|
||||
|
||||
/**
|
||||
* True if the Bitstream Format is used to store system information, rather than the content of items in the system
|
||||
*/
|
||||
internal: boolean;
|
||||
|
||||
/**
|
||||
* String representing this Bitstream Format's file extension
|
||||
*/
|
||||
extensions: string;
|
||||
|
||||
/**
|
||||
* The link to the rest endpoint where this Bitstream Format can be found
|
||||
*/
|
||||
self: string;
|
||||
|
||||
/**
|
||||
* A ResourceType representing the kind of Object of this BitstreamFormat
|
||||
*/
|
||||
type: ResourceType;
|
||||
|
||||
/**
|
||||
* Universally unique identifier for this Bitstream Format
|
||||
*/
|
||||
uuid: string;
|
||||
|
||||
}
|
||||
|
@@ -1,20 +1,40 @@
|
||||
|
||||
import { CacheableObject } from '../cache/object-cache.reducer';
|
||||
import { ResourceType } from './resource-type';
|
||||
import { Group } from '../eperson/models/group.model';
|
||||
import { ActionType } from '../cache/models/action-type.model';
|
||||
|
||||
/**
|
||||
* Model class for a Resource Policy
|
||||
*/
|
||||
export class ResourcePolicy implements CacheableObject {
|
||||
/**
|
||||
* The action that is allowed by this Resource Policy
|
||||
*/
|
||||
action: ActionType;
|
||||
|
||||
action: string;
|
||||
|
||||
/**
|
||||
* The name for this Resource Policy
|
||||
*/
|
||||
name: string;
|
||||
|
||||
// TODO group should ofcourse become a group object
|
||||
group: string;
|
||||
/**
|
||||
* The Group this Resource Policy applies to
|
||||
*/
|
||||
group: Group;
|
||||
|
||||
/**
|
||||
* The link to the rest endpoint where this Resource Policy can be found
|
||||
*/
|
||||
self: string;
|
||||
|
||||
/**
|
||||
* A ResourceType representing the kind of Object of this ResourcePolicy
|
||||
*/
|
||||
type: ResourceType;
|
||||
|
||||
/**
|
||||
* The universally unique identifier for this Resource Policy
|
||||
*/
|
||||
uuid: string;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user