From a5086b8d117cdad0efd2ab8e65e042643dac432e Mon Sep 17 00:00:00 2001 From: lotte Date: Wed, 24 Apr 2019 16:51:46 +0200 Subject: [PATCH 01/38] 61949: replacing object factories with decorator --- .../workflowitems-edit-page-routing.module.ts | 2 +- .../workflowitems-edit-page.module.ts | 6 ++-- src/app/app-routing.module.ts | 2 +- src/app/core/auth/auth-type.ts | 5 ---- .../models/normalized-auth-status.model.ts | 2 ++ .../normalized-bitstream-format.model.ts | 3 ++ .../models/normalized-bitstream.model.ts | 2 ++ .../cache/models/normalized-bundle.model.ts | 2 ++ .../models/normalized-collection.model.ts | 2 ++ .../models/normalized-community.model.ts | 2 ++ .../models/normalized-dspace-object.model.ts | 2 ++ .../cache/models/normalized-item.model.ts | 2 ++ .../cache/models/normalized-license.model.ts | 3 ++ .../cache/models/normalized-object-factory.ts | 4 +-- .../normalized-resource-policy.model.ts | 3 ++ ...zed-config-submission-definitions.model.ts | 5 ++++ src/app/core/core.module.ts | 4 +-- .../models/normalized-eperson.model.ts | 2 ++ .../eperson/models/normalized-group.model.ts | 2 ++ ...field.model.ts => metadata-field.model.ts} | 9 +----- ...hema.model.ts => metadata-schema.model.ts} | 5 ---- .../normalized-metadata-field.model.ts | 30 +++++++++++++++++++ .../normalized-metadata-schema.model.ts | 5 +++- .../core/shared/resource-type.decorator.ts | 16 ++++++++++ src/app/core/shared/resource-type.ts | 5 ++-- .../models/normalized-workflowitem.model.ts | 8 +++-- .../models/normalized-workspaceitem.model.ts | 10 ++++--- .../submission/models/workflowitem.model.ts | 6 ++-- .../submission/models/workspaceitem.model.ts | 4 +-- .../submission/workflowitem-data.service.ts | 6 ++-- .../objects/submission-objects.effects.ts | 8 ++--- 31 files changed, 118 insertions(+), 49 deletions(-) delete mode 100644 src/app/core/auth/auth-type.ts rename src/app/core/metadata/{metadatafield.model.ts => metadata-field.model.ts} (72%) rename src/app/core/metadata/{metadataschema.model.ts => metadata-schema.model.ts} (66%) create mode 100644 src/app/core/metadata/normalized-metadata-field.model.ts create mode 100644 src/app/core/shared/resource-type.decorator.ts diff --git a/src/app/+workflowitems-edit-page/workflowitems-edit-page-routing.module.ts b/src/app/+workflowitems-edit-page/workflowitems-edit-page-routing.module.ts index aa182eb291..d5df70698c 100644 --- a/src/app/+workflowitems-edit-page/workflowitems-edit-page-routing.module.ts +++ b/src/app/+workflowitems-edit-page/workflowitems-edit-page-routing.module.ts @@ -20,4 +20,4 @@ import { SubmissionEditComponent } from '../submission/edit/submission-edit.comp /** * This module defines the default component to load when navigating to the workflowitems edit page path. */ -export class WorkflowitemsEditPageRoutingModule { } +export class WorkflowItemsEditPageRoutingModule { } diff --git a/src/app/+workflowitems-edit-page/workflowitems-edit-page.module.ts b/src/app/+workflowitems-edit-page/workflowitems-edit-page.module.ts index fbb53d8dcc..7a89f18c7d 100644 --- a/src/app/+workflowitems-edit-page/workflowitems-edit-page.module.ts +++ b/src/app/+workflowitems-edit-page/workflowitems-edit-page.module.ts @@ -1,12 +1,12 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { SharedModule } from '../shared/shared.module'; -import { WorkflowitemsEditPageRoutingModule } from './workflowitems-edit-page-routing.module'; +import { WorkflowItemsEditPageRoutingModule } from './workflowitems-edit-page-routing.module'; import { SubmissionModule } from '../submission/submission.module'; @NgModule({ imports: [ - WorkflowitemsEditPageRoutingModule, + WorkflowItemsEditPageRoutingModule, CommonModule, SharedModule, SubmissionModule, @@ -16,6 +16,6 @@ import { SubmissionModule } from '../submission/submission.module'; /** * This module handles all modules that need to access the workflowitems edit page. */ -export class WorkflowitemsEditPageModule { +export class WorkflowItemsEditPageModule { } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index be956ee895..266839f64b 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -31,7 +31,7 @@ export function getCommunityModulePath() { { path: 'logout', loadChildren: './+logout-page/logout-page.module#LogoutPageModule' }, { path: 'submit', loadChildren: './+submit-page/submit-page.module#SubmitPageModule' }, { path: 'workspaceitems', loadChildren: './+workspaceitems-edit-page/workspaceitems-edit-page.module#WorkspaceitemsEditPageModule' }, - { path: 'workflowitems', loadChildren: './+workflowitems-edit-page/workflowitems-edit-page.module#WorkflowitemsEditPageModule' }, + { path: 'workflowitems', loadChildren: './+workflowitems-edit-page/workflowitems-edit-page.module#WorkflowItemsEditPageModule' }, { path: '**', pathMatch: 'full', component: PageNotFoundComponent }, ]) ], diff --git a/src/app/core/auth/auth-type.ts b/src/app/core/auth/auth-type.ts deleted file mode 100644 index f0460449ea..0000000000 --- a/src/app/core/auth/auth-type.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum AuthType { - EPerson = 'eperson', - Status = 'status', - Group = 'group' -} diff --git a/src/app/core/auth/models/normalized-auth-status.model.ts b/src/app/core/auth/models/normalized-auth-status.model.ts index a13a996604..46d0177fdc 100644 --- a/src/app/core/auth/models/normalized-auth-status.model.ts +++ b/src/app/core/auth/models/normalized-auth-status.model.ts @@ -4,9 +4,11 @@ import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { ResourceType } from '../../shared/resource-type'; import { NormalizedObject } from '../../cache/models/normalized-object.model'; import { IDToUUIDSerializer } from '../../cache/id-to-uuid-serializer'; +import { resourceType } from '../../shared/resource-type.decorator'; @mapsTo(AuthStatus) @inheritSerialization(NormalizedObject) +@resourceType(ResourceType.AuthStatus) export class NormalizedAuthStatus extends NormalizedObject { @autoserialize id: string; diff --git a/src/app/core/cache/models/normalized-bitstream-format.model.ts b/src/app/core/cache/models/normalized-bitstream-format.model.ts index 994792d535..66fbd84176 100644 --- a/src/app/core/cache/models/normalized-bitstream-format.model.ts +++ b/src/app/core/cache/models/normalized-bitstream-format.model.ts @@ -5,12 +5,15 @@ import { mapsTo } from '../builders/build-decorators'; import { IDToUUIDSerializer } from '../id-to-uuid-serializer'; import { NormalizedObject } from './normalized-object.model'; import { SupportLevel } from './support-level.model'; +import { resourceType } from '../../shared/resource-type.decorator'; +import { ResourceType } from '../../shared/resource-type'; /** * Normalized model class for a Bitstream Format */ @mapsTo(BitstreamFormat) @inheritSerialization(NormalizedObject) +@resourceType(ResourceType.BitstreamFormat) export class NormalizedBitstreamFormat extends NormalizedObject { /** diff --git a/src/app/core/cache/models/normalized-bitstream.model.ts b/src/app/core/cache/models/normalized-bitstream.model.ts index 64a17aae84..c2042878da 100644 --- a/src/app/core/cache/models/normalized-bitstream.model.ts +++ b/src/app/core/cache/models/normalized-bitstream.model.ts @@ -4,12 +4,14 @@ import { NormalizedDSpaceObject } from './normalized-dspace-object.model'; import { Bitstream } from '../../shared/bitstream.model'; import { mapsTo, relationship } from '../builders/build-decorators'; import { ResourceType } from '../../shared/resource-type'; +import { resourceType } from '../../shared/resource-type.decorator'; /** * Normalized model class for a DSpace Bitstream */ @mapsTo(Bitstream) @inheritSerialization(NormalizedDSpaceObject) +@resourceType(ResourceType.Bitstream) export class NormalizedBitstream extends NormalizedDSpaceObject { /** diff --git a/src/app/core/cache/models/normalized-bundle.model.ts b/src/app/core/cache/models/normalized-bundle.model.ts index 342b13629f..c77a1d027f 100644 --- a/src/app/core/cache/models/normalized-bundle.model.ts +++ b/src/app/core/cache/models/normalized-bundle.model.ts @@ -4,12 +4,14 @@ import { NormalizedDSpaceObject } from './normalized-dspace-object.model'; import { Bundle } from '../../shared/bundle.model'; import { mapsTo, relationship } from '../builders/build-decorators'; import { ResourceType } from '../../shared/resource-type'; +import { resourceType } from '../../shared/resource-type.decorator'; /** * Normalized model class for a DSpace Bundle */ @mapsTo(Bundle) @inheritSerialization(NormalizedDSpaceObject) +@resourceType(ResourceType.Bundle) export class NormalizedBundle extends NormalizedDSpaceObject { /** * The primary bitstream of this Bundle diff --git a/src/app/core/cache/models/normalized-collection.model.ts b/src/app/core/cache/models/normalized-collection.model.ts index ddfcc29a2c..e726a967e7 100644 --- a/src/app/core/cache/models/normalized-collection.model.ts +++ b/src/app/core/cache/models/normalized-collection.model.ts @@ -4,12 +4,14 @@ import { NormalizedDSpaceObject } from './normalized-dspace-object.model'; import { Collection } from '../../shared/collection.model'; import { mapsTo, relationship } from '../builders/build-decorators'; import { ResourceType } from '../../shared/resource-type'; +import { resourceType } from '../../shared/resource-type.decorator'; /** * Normalized model class for a DSpace Collection */ @mapsTo(Collection) @inheritSerialization(NormalizedDSpaceObject) +@resourceType(ResourceType.Collection) export class NormalizedCollection extends NormalizedDSpaceObject { /** diff --git a/src/app/core/cache/models/normalized-community.model.ts b/src/app/core/cache/models/normalized-community.model.ts index f561089949..85dce37e82 100644 --- a/src/app/core/cache/models/normalized-community.model.ts +++ b/src/app/core/cache/models/normalized-community.model.ts @@ -4,12 +4,14 @@ 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'; +import { resourceType } from '../../shared/resource-type.decorator'; /** * Normalized model class for a DSpace Community */ @mapsTo(Community) @inheritSerialization(NormalizedDSpaceObject) +@resourceType(ResourceType.Community) export class NormalizedCommunity extends NormalizedDSpaceObject { /** diff --git a/src/app/core/cache/models/normalized-dspace-object.model.ts b/src/app/core/cache/models/normalized-dspace-object.model.ts index e12faa4a77..84e3f41f42 100644 --- a/src/app/core/cache/models/normalized-dspace-object.model.ts +++ b/src/app/core/cache/models/normalized-dspace-object.model.ts @@ -4,11 +4,13 @@ import { MetadataMap, MetadataMapSerializer } from '../../shared/metadata.models import { ResourceType } from '../../shared/resource-type'; import { mapsTo } from '../builders/build-decorators'; import { NormalizedObject } from './normalized-object.model'; +import { resourceType } from '../../shared/resource-type.decorator'; /** * An model class for a DSpaceObject. */ @mapsTo(DSpaceObject) +@resourceType(ResourceType.DSpaceObject) export class NormalizedDSpaceObject extends NormalizedObject { /** diff --git a/src/app/core/cache/models/normalized-item.model.ts b/src/app/core/cache/models/normalized-item.model.ts index 9e8c034e81..c5be6d8e2e 100644 --- a/src/app/core/cache/models/normalized-item.model.ts +++ b/src/app/core/cache/models/normalized-item.model.ts @@ -4,12 +4,14 @@ import { NormalizedDSpaceObject } from './normalized-dspace-object.model'; import { Item } from '../../shared/item.model'; import { mapsTo, relationship } from '../builders/build-decorators'; import { ResourceType } from '../../shared/resource-type'; +import { resourceType } from '../../shared/resource-type.decorator'; /** * Normalized model class for a DSpace Item */ @mapsTo(Item) @inheritSerialization(NormalizedDSpaceObject) +@resourceType(ResourceType.Item) export class NormalizedItem extends NormalizedDSpaceObject { /** diff --git a/src/app/core/cache/models/normalized-license.model.ts b/src/app/core/cache/models/normalized-license.model.ts index 02bd1808c8..105a0f288e 100644 --- a/src/app/core/cache/models/normalized-license.model.ts +++ b/src/app/core/cache/models/normalized-license.model.ts @@ -2,12 +2,15 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { mapsTo } from '../builders/build-decorators'; import { NormalizedDSpaceObject } from './normalized-dspace-object.model'; import { License } from '../../shared/license.model'; +import { resourceType } from '../../shared/resource-type.decorator'; +import { ResourceType } from '../../shared/resource-type'; /** * Normalized model class for a Collection License */ @mapsTo(License) @inheritSerialization(NormalizedDSpaceObject) +@resourceType(ResourceType.License) export class NormalizedLicense extends NormalizedDSpaceObject { /** diff --git a/src/app/core/cache/models/normalized-object-factory.ts b/src/app/core/cache/models/normalized-object-factory.ts index 2a0db803df..b83b39e437 100644 --- a/src/app/core/cache/models/normalized-object-factory.ts +++ b/src/app/core/cache/models/normalized-object-factory.ts @@ -59,10 +59,10 @@ export class NormalizedObjectFactory { case ResourceType.MetadataField: { return NormalizedGroup } - case ResourceType.Workspaceitem: { + case ResourceType.WorkspaceItem: { return NormalizedWorkspaceItem } - case ResourceType.Workflowitem: { + case ResourceType.WorkflowItem: { return NormalizedWorkflowItem } case ResourceType.SubmissionDefinition: diff --git a/src/app/core/cache/models/normalized-resource-policy.model.ts b/src/app/core/cache/models/normalized-resource-policy.model.ts index 9438c1da0a..2f779d0773 100644 --- a/src/app/core/cache/models/normalized-resource-policy.model.ts +++ b/src/app/core/cache/models/normalized-resource-policy.model.ts @@ -5,12 +5,15 @@ import { mapsTo } from '../builders/build-decorators'; import { NormalizedObject } from './normalized-object.model'; import { IDToUUIDSerializer } from '../id-to-uuid-serializer'; import { ActionType } from './action-type.model'; +import { resourceType } from '../../shared/resource-type.decorator'; +import { ResourceType } from '../../shared/resource-type'; /** * Normalized model class for a Resource Policy */ @mapsTo(ResourcePolicy) @inheritSerialization(NormalizedObject) +@resourceType(ResourceType.ResourcePolicy) export class NormalizedResourcePolicy extends NormalizedObject { /** diff --git a/src/app/core/config/models/normalized-config-submission-definitions.model.ts b/src/app/core/config/models/normalized-config-submission-definitions.model.ts index 3887c566c1..0d98132c0f 100644 --- a/src/app/core/config/models/normalized-config-submission-definitions.model.ts +++ b/src/app/core/config/models/normalized-config-submission-definitions.model.ts @@ -3,11 +3,16 @@ import { SubmissionSectionModel } from './config-submission-section.model'; import { PaginatedList } from '../../data/paginated-list'; import { NormalizedConfigObject } from './normalized-config.model'; import { SubmissionDefinitionsModel } from './config-submission-definitions.model'; +import { resourceType } from '../../shared/resource-type.decorator'; +import { ResourceType } from '../../shared/resource-type'; +import { mapsTo } from '../../cache/builders/build-decorators'; /** * Normalized class for the configuration describing the submission */ +@mapsTo(SubmissionDefinitionsModel) @inheritSerialization(NormalizedConfigObject) +@resourceType(ResourceType.SubmissionDefinitions) export class NormalizedSubmissionDefinitionsModel extends NormalizedConfigObject { /** diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 6e94028a0a..2ca5af0294 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -64,7 +64,7 @@ import { RegistryService } from './registry/registry.service'; import { RegistryMetadataschemasResponseParsingService } from './data/registry-metadataschemas-response-parsing.service'; import { RegistryMetadatafieldsResponseParsingService } from './data/registry-metadatafields-response-parsing.service'; import { RegistryBitstreamformatsResponseParsingService } from './data/registry-bitstreamformats-response-parsing.service'; -import { WorkflowitemDataService } from './submission/workflowitem-data.service'; +import { WorkflowItemDataService } from './submission/workflowitem-data.service'; import { NotificationsService } from '../shared/notifications/notifications.service'; import { UploaderService } from '../shared/uploader/uploader.service'; import { FileService } from './shared/file.service'; @@ -152,7 +152,7 @@ const PROVIDERS = [ UUIDService, NotificationsService, WorkspaceitemDataService, - WorkflowitemDataService, + WorkflowItemDataService, UploaderService, FileService, DSpaceObjectDataService, diff --git a/src/app/core/eperson/models/normalized-eperson.model.ts b/src/app/core/eperson/models/normalized-eperson.model.ts index ad4b20ee80..01d9ef3681 100644 --- a/src/app/core/eperson/models/normalized-eperson.model.ts +++ b/src/app/core/eperson/models/normalized-eperson.model.ts @@ -6,9 +6,11 @@ import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-obj import { EPerson } from './eperson.model'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { ResourceType } from '../../shared/resource-type'; +import { resourceType } from '../../shared/resource-type.decorator'; @mapsTo(EPerson) @inheritSerialization(NormalizedDSpaceObject) +@resourceType(ResourceType.EPerson) export class NormalizedEPerson extends NormalizedDSpaceObject implements CacheableObject, ListableObject { /** diff --git a/src/app/core/eperson/models/normalized-group.model.ts b/src/app/core/eperson/models/normalized-group.model.ts index f86bec8628..776f248127 100644 --- a/src/app/core/eperson/models/normalized-group.model.ts +++ b/src/app/core/eperson/models/normalized-group.model.ts @@ -6,9 +6,11 @@ import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-obj import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { Group } from './group.model'; import { ResourceType } from '../../shared/resource-type'; +import { resourceType } from '../../shared/resource-type.decorator'; @mapsTo(Group) @inheritSerialization(NormalizedDSpaceObject) +@resourceType(ResourceType.Group) export class NormalizedGroup extends NormalizedDSpaceObject implements CacheableObject, ListableObject { /** diff --git a/src/app/core/metadata/metadatafield.model.ts b/src/app/core/metadata/metadata-field.model.ts similarity index 72% rename from src/app/core/metadata/metadatafield.model.ts rename to src/app/core/metadata/metadata-field.model.ts index ba28b59d0e..f773ff8b49 100644 --- a/src/app/core/metadata/metadatafield.model.ts +++ b/src/app/core/metadata/metadata-field.model.ts @@ -1,25 +1,18 @@ -import { MetadataSchema } from './metadataschema.model'; -import { autoserialize } from 'cerialize'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; import { isNotEmpty } from '../../shared/empty.util'; +import { MetadataSchema } from './metadata-schema.model'; export class MetadataField implements ListableObject { - @autoserialize id: number; - @autoserialize self: string; - @autoserialize element: string; - @autoserialize qualifier: string; - @autoserialize scopeNote: string; - @autoserialize schema: MetadataSchema; toString(separator: string = '.'): string { diff --git a/src/app/core/metadata/metadataschema.model.ts b/src/app/core/metadata/metadata-schema.model.ts similarity index 66% rename from src/app/core/metadata/metadataschema.model.ts rename to src/app/core/metadata/metadata-schema.model.ts index 13fb8e8b4e..d141f56e2c 100644 --- a/src/app/core/metadata/metadataschema.model.ts +++ b/src/app/core/metadata/metadata-schema.model.ts @@ -1,16 +1,11 @@ -import { autoserialize } from 'cerialize'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; export class MetadataSchema implements ListableObject { - @autoserialize id: number; - @autoserialize self: string; - @autoserialize prefix: string; - @autoserialize namespace: string; } diff --git a/src/app/core/metadata/normalized-metadata-field.model.ts b/src/app/core/metadata/normalized-metadata-field.model.ts new file mode 100644 index 0000000000..29a3376532 --- /dev/null +++ b/src/app/core/metadata/normalized-metadata-field.model.ts @@ -0,0 +1,30 @@ +import { autoserialize, deserialize } from 'cerialize'; +import { mapsTo, relationship } from '../cache/builders/build-decorators'; +import { ResourceType } from '../shared/resource-type'; +import { resourceType } from '../shared/resource-type.decorator'; +import { MetadataField } from './metadata-field.model'; +import { NormalizedObject } from '../cache/models/normalized-object.model'; +import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; + +@mapsTo(MetadataField) +@resourceType(ResourceType.MetadataField) +export class NormalizedMetadataField extends NormalizedObject implements ListableObject { + @autoserialize + id: number; + + @autoserialize + self: string; + + @autoserialize + element: string; + + @autoserialize + qualifier: string; + + @autoserialize + scopeNote: string; + + @deserialize + @relationship(ResourceType.MetadataSchema) + schema: string; +} diff --git a/src/app/core/metadata/normalized-metadata-schema.model.ts b/src/app/core/metadata/normalized-metadata-schema.model.ts index c121938940..aa6eb6a50a 100644 --- a/src/app/core/metadata/normalized-metadata-schema.model.ts +++ b/src/app/core/metadata/normalized-metadata-schema.model.ts @@ -2,12 +2,15 @@ import { autoserialize } from 'cerialize'; import { NormalizedObject } from '../cache/models/normalized-object.model'; import { mapsTo } from '../cache/builders/build-decorators'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; -import { MetadataSchema } from './metadataschema.model'; +import { resourceType } from '../shared/resource-type.decorator'; +import { ResourceType } from '../shared/resource-type'; +import { MetadataSchema } from './metadata-schema.model'; /** * Normalized class for a DSpace MetadataSchema */ @mapsTo(MetadataSchema) +@resourceType(ResourceType.MetadataSchema) export class NormalizedMetadataSchema extends NormalizedObject implements ListableObject { /** * The unique identifier for this schema diff --git a/src/app/core/shared/resource-type.decorator.ts b/src/app/core/shared/resource-type.decorator.ts new file mode 100644 index 0000000000..da5259b968 --- /dev/null +++ b/src/app/core/shared/resource-type.decorator.ts @@ -0,0 +1,16 @@ +import { CacheableObject } from '../cache/object-cache.reducer'; +import { GenericConstructor } from './generic-constructor'; + +const resourceTypeForObjectMap = new Map(); +export function resourceType(resourceType: string) { + return function decorator(objectConstructor: GenericConstructor) { + if (!objectConstructor) { + return; + } + resourceTypeForObjectMap.set(resourceType, objectConstructor); + }; +} + +export function rendersSectionType(resourceType: string) { + return resourceTypeForObjectMap.get(resourceType); +} diff --git a/src/app/core/shared/resource-type.ts b/src/app/core/shared/resource-type.ts index 484f1ea6e2..02283a5dde 100644 --- a/src/app/core/shared/resource-type.ts +++ b/src/app/core/shared/resource-type.ts @@ -12,12 +12,13 @@ export enum ResourceType { MetadataSchema = 'metadataschema', MetadataField = 'metadatafield', License = 'license', - Workflowitem = 'workflowitem', - Workspaceitem = 'workspaceitem', + WorkflowItem = 'workflowitem', + WorkspaceItem = 'workspaceitem', SubmissionDefinitions = 'submissiondefinitions', SubmissionDefinition = 'submissiondefinition', SubmissionForm = 'submissionform', SubmissionForms = 'submissionforms', SubmissionSections = 'submissionsections', SubmissionSection = 'submissionsection', + AuthStatus = 'status' } diff --git a/src/app/core/submission/models/normalized-workflowitem.model.ts b/src/app/core/submission/models/normalized-workflowitem.model.ts index a3fa8992a2..354b8e7c06 100644 --- a/src/app/core/submission/models/normalized-workflowitem.model.ts +++ b/src/app/core/submission/models/normalized-workflowitem.model.ts @@ -1,16 +1,18 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; -import { Workflowitem } from './workflowitem.model'; +import { WorkflowItem } from './workflowitem.model'; import { NormalizedSubmissionObject } from './normalized-submission-object.model'; import { ResourceType } from '../../shared/resource-type'; +import { resourceType } from '../../shared/resource-type.decorator'; /** * An model class for a NormalizedWorkflowItem. */ -@mapsTo(Workflowitem) +@mapsTo(WorkflowItem) @inheritSerialization(NormalizedSubmissionObject) -export class NormalizedWorkflowItem extends NormalizedSubmissionObject { +@resourceType(ResourceType.WorkflowItem) +export class NormalizedWorkflowItem extends NormalizedSubmissionObject { /** * The collection this workflowitem belonging to diff --git a/src/app/core/submission/models/normalized-workspaceitem.model.ts b/src/app/core/submission/models/normalized-workspaceitem.model.ts index 7c15925c98..a381aac00b 100644 --- a/src/app/core/submission/models/normalized-workspaceitem.model.ts +++ b/src/app/core/submission/models/normalized-workspaceitem.model.ts @@ -1,19 +1,21 @@ import { autoserialize, inheritSerialization } from 'cerialize'; -import { Workspaceitem } from './workspaceitem.model'; +import { WorkspaceItem } from './workspaceitem.model'; import { NormalizedSubmissionObject } from './normalized-submission-object.model'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-object.model'; import { ResourceType } from '../../shared/resource-type'; -import { Workflowitem } from './workflowitem.model'; +import { WorkflowItem } from './workflowitem.model'; +import { resourceType } from '../../shared/resource-type.decorator'; /** * An model class for a NormalizedWorkspaceItem. */ -@mapsTo(Workspaceitem) +@mapsTo(WorkspaceItem) @inheritSerialization(NormalizedDSpaceObject) @inheritSerialization(NormalizedSubmissionObject) -export class NormalizedWorkspaceItem extends NormalizedSubmissionObject { +@resourceType(ResourceType.WorkspaceItem) +export class NormalizedWorkspaceItem extends NormalizedSubmissionObject { /** * The collection this workspaceitem belonging to diff --git a/src/app/core/submission/models/workflowitem.model.ts b/src/app/core/submission/models/workflowitem.model.ts index f1a0467f43..4a1666fdef 100644 --- a/src/app/core/submission/models/workflowitem.model.ts +++ b/src/app/core/submission/models/workflowitem.model.ts @@ -1,7 +1,7 @@ -import { Workspaceitem } from './workspaceitem.model'; +import { WorkspaceItem } from './workspaceitem.model'; /** - * A model class for a Workflowitem. + * A model class for a WorkflowItem. */ -export class Workflowitem extends Workspaceitem { +export class WorkflowItem extends WorkspaceItem { } diff --git a/src/app/core/submission/models/workspaceitem.model.ts b/src/app/core/submission/models/workspaceitem.model.ts index 6548191ba2..136ca346c1 100644 --- a/src/app/core/submission/models/workspaceitem.model.ts +++ b/src/app/core/submission/models/workspaceitem.model.ts @@ -1,8 +1,8 @@ import { SubmissionObject } from './submission-object.model'; /** - * A model class for a Workspaceitem. + * A model class for a WorkspaceItem. */ -export class Workspaceitem extends SubmissionObject { +export class WorkspaceItem extends SubmissionObject { } diff --git a/src/app/core/submission/workflowitem-data.service.ts b/src/app/core/submission/workflowitem-data.service.ts index e739a62e81..fd769745da 100644 --- a/src/app/core/submission/workflowitem-data.service.ts +++ b/src/app/core/submission/workflowitem-data.service.ts @@ -6,7 +6,7 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv import { CoreState } from '../core.reducers'; import { DataService } from '../data/data.service'; import { RequestService } from '../data/request.service'; -import { Workflowitem } from './models/workflowitem.model'; +import { WorkflowItem } from './models/workflowitem.model'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { FindAllOptions } from '../data/request.models'; import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service'; @@ -18,12 +18,12 @@ import { DSOChangeAnalyzer } from '../data/dso-change-analyzer.service'; * A service that provides methods to make REST requests with workflowitems endpoint. */ @Injectable() -export class WorkflowitemDataService extends DataService { +export class WorkflowItemDataService extends DataService { protected linkPath = 'workflowitems'; protected forceBypassCache = true; constructor( - protected comparator: DSOChangeAnalyzer, + protected comparator: DSOChangeAnalyzer, protected dataBuildService: NormalizedObjectBuildService, protected halService: HALEndpointService, protected http: HttpClient, diff --git a/src/app/submission/objects/submission-objects.effects.ts b/src/app/submission/objects/submission-objects.effects.ts index f5c8887320..ba82fe1e65 100644 --- a/src/app/submission/objects/submission-objects.effects.ts +++ b/src/app/submission/objects/submission-objects.effects.ts @@ -30,9 +30,9 @@ import { } from './submission-objects.actions'; import { SectionsService } from '../sections/sections.service'; import { isEmpty, isNotEmpty, isNotUndefined } from '../../shared/empty.util'; -import { Workspaceitem } from '../../core/submission/models/workspaceitem.model'; +import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model'; import { SubmissionService } from '../submission.service'; -import { Workflowitem } from '../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../core/submission/models/workflowitem.model'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { SubmissionObject } from '../../core/submission/models/submission-object.model'; import { TranslateService } from '@ngx-translate/core'; @@ -265,7 +265,7 @@ export class SubmissionObjectEffects { let canDeposit = true; if (isNotEmpty(response)) { - response.forEach((item: Workspaceitem | Workflowitem) => { + response.forEach((item: WorkspaceItem | WorkflowItem) => { const {errors} = item; if (errors && !isEmpty(errors)) { @@ -303,7 +303,7 @@ export class SubmissionObjectEffects { this.notificationsService.success(null, this.translate.get('submission.sections.general.save_success_notice')); } - response.forEach((item: Workspaceitem | Workflowitem) => { + response.forEach((item: WorkspaceItem | WorkflowItem) => { let errorsList = Object.create({}); const {errors} = item; From 6438c65381e7b9729fa19656a4750acee09ac58e Mon Sep 17 00:00:00 2001 From: lotte Date: Thu, 25 Apr 2019 17:13:58 +0200 Subject: [PATCH 02/38] continued refactoring resource type factories --- .../metadata-registry.actions.ts | 4 +- .../metadata-registry.component.ts | 2 +- .../metadata-registry.reducers.ts | 4 +- .../metadata-schema-form.component.ts | 2 +- .../metadata-field-form.component.ts | 4 +- .../metadata-schema.component.ts | 4 +- .../edit-in-place-field.component.ts | 2 +- src/app/core/auth/auth-object-factory.ts | 29 ------- .../auth/auth-response-parsing.service.ts | 6 +- .../cache/models/normalized-object-factory.ts | 85 ------------------- src/app/core/cache/response.models.ts | 5 +- .../config/models/config-object-factory.ts | 36 -------- ...zed-config-submission-definitions.model.ts | 2 +- ...ormalized-config-submission-forms.model.ts | 5 ++ ...malized-config-submission-section.model.ts | 5 ++ .../data/base-response-parsing.service.ts | 18 ++-- .../data/metadatafield-parsing.service.ts | 4 +- .../normalized-authority-value.model.ts | 3 + ...registry-metadataschemas-response.model.ts | 2 +- .../core/shared/resource-type.decorator.ts | 8 +- src/app/core/shared/resource-type.ts | 3 +- 21 files changed, 47 insertions(+), 186 deletions(-) delete mode 100644 src/app/core/auth/auth-object-factory.ts delete mode 100644 src/app/core/cache/models/normalized-object-factory.ts delete mode 100644 src/app/core/config/models/config-object-factory.ts diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.actions.ts b/src/app/+admin/admin-registries/metadata-registry/metadata-registry.actions.ts index 7358123462..96f9d345f5 100644 --- a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.actions.ts +++ b/src/app/+admin/admin-registries/metadata-registry/metadata-registry.actions.ts @@ -1,7 +1,7 @@ import { Action } from '@ngrx/store'; import { type } from '../../../shared/ngrx/type'; -import { MetadataSchema } from '../../../core/metadata/metadataschema.model'; -import { MetadataField } from '../../../core/metadata/metadatafield.model'; +import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; +import { MetadataField } from '../../../core/metadata/metadata-field.model'; /** * For each action type in an action group, make a simple diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.ts b/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.ts index 88c807e3bc..302974b5c2 100644 --- a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.ts +++ b/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.ts @@ -3,7 +3,6 @@ import { RegistryService } from '../../../core/registry/registry.service'; import { Observable, combineLatest as observableCombineLatest } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; import { PaginatedList } from '../../../core/data/paginated-list'; -import { MetadataSchema } from '../../../core/metadata/metadataschema.model'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { map, take } from 'rxjs/operators'; import { hasValue } from '../../../shared/empty.util'; @@ -12,6 +11,7 @@ import { zip } from 'rxjs/internal/observable/zip'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { Route, Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; +import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; @Component({ selector: 'ds-metadata-registry', diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.ts b/src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.ts index d20e3d5bcc..e805c8b8fc 100644 --- a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.ts +++ b/src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.ts @@ -1,4 +1,3 @@ -import { MetadataSchema } from '../../../core/metadata/metadataschema.model'; import { MetadataRegistryAction, MetadataRegistryActionTypes, @@ -9,7 +8,8 @@ import { MetadataRegistrySelectFieldAction, MetadataRegistrySelectSchemaAction } from './metadata-registry.actions'; -import { MetadataField } from '../../../core/metadata/metadatafield.model'; +import { MetadataField } from '../../../core/metadata/metadata-field.model'; +import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; /** * The metadata registry state. diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts b/src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts index 23a5765058..23e7309a00 100644 --- a/src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts +++ b/src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts @@ -9,9 +9,9 @@ import { FormGroup } from '@angular/forms'; import { RegistryService } from '../../../../core/registry/registry.service'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; import { take } from 'rxjs/operators'; -import { MetadataSchema } from '../../../../core/metadata/metadataschema.model'; import { TranslateService } from '@ngx-translate/core'; import { combineLatest } from 'rxjs/internal/observable/combineLatest'; +import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; @Component({ selector: 'ds-metadata-schema-form', diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts b/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts index 2da2b45021..0811530343 100644 --- a/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts +++ b/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts @@ -1,5 +1,4 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; -import { MetadataSchema } from '../../../../core/metadata/metadataschema.model'; import { DynamicFormControlModel, DynamicFormLayout, @@ -8,10 +7,11 @@ import { import { FormGroup } from '@angular/forms'; import { RegistryService } from '../../../../core/registry/registry.service'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; -import { MetadataField } from '../../../../core/metadata/metadatafield.model'; import { take } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; import { combineLatest } from 'rxjs/internal/observable/combineLatest'; +import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; +import { MetadataField } from '../../../../core/metadata/metadata-field.model'; @Component({ selector: 'ds-metadata-field-form', diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.ts b/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.ts index bdc7d5ed27..2974c1c087 100644 --- a/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.ts +++ b/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.ts @@ -4,8 +4,6 @@ import { ActivatedRoute, Router } from '@angular/router'; import { Observable, combineLatest as observableCombineLatest } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; import { PaginatedList } from '../../../core/data/paginated-list'; -import { MetadataField } from '../../../core/metadata/metadatafield.model'; -import { MetadataSchema } from '../../../core/metadata/metadataschema.model'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { map, take } from 'rxjs/operators'; import { hasValue } from '../../../shared/empty.util'; @@ -13,6 +11,8 @@ import { RestResponse } from '../../../core/cache/response.models'; import { zip } from 'rxjs/internal/observable/zip'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { TranslateService } from '@ngx-translate/core'; +import { MetadataField } from '../../../core/metadata/metadata-field.model'; +import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; @Component({ selector: 'ds-metadata-schema', diff --git a/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.ts b/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.ts index 0b9bc62c55..1722cde8bc 100644 --- a/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.ts +++ b/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.ts @@ -4,13 +4,13 @@ import { RegistryService } from '../../../../core/registry/registry.service'; import { cloneDeep } from 'lodash'; import { BehaviorSubject, Observable, of as observableOf } from 'rxjs'; import { map, take } from 'rxjs/operators'; -import { MetadataField } from '../../../../core/metadata/metadatafield.model'; import { InputSuggestion } from '../../../../shared/input-suggestions/input-suggestions.model'; import { FieldChangeType } from '../../../../core/data/object-updates/object-updates.actions'; import { FieldUpdate } from '../../../../core/data/object-updates/object-updates.reducer'; import { ObjectUpdatesService } from '../../../../core/data/object-updates/object-updates.service'; import { NgModel } from '@angular/forms'; import { MetadatumViewModel } from '../../../../core/shared/metadata.models'; +import { MetadataField } from '../../../../core/metadata/metadata-field.model'; @Component({ // tslint:disable-next-line:component-selector diff --git a/src/app/core/auth/auth-object-factory.ts b/src/app/core/auth/auth-object-factory.ts deleted file mode 100644 index 02458f4e3e..0000000000 --- a/src/app/core/auth/auth-object-factory.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { AuthType } from './auth-type'; -import { GenericConstructor } from '../shared/generic-constructor'; -import { NormalizedAuthStatus } from './models/normalized-auth-status.model'; -import { NormalizedEPerson } from '../eperson/models/normalized-eperson.model'; -import { NormalizedObject } from '../cache/models/normalized-object.model'; -import { CacheableObject } from '../cache/object-cache.reducer'; -import { NormalizedGroup } from '../eperson/models/normalized-group.model'; - -export class AuthObjectFactory { - public static getConstructor(type): GenericConstructor> { - switch (type) { - case AuthType.EPerson: { - return NormalizedEPerson - } - - case AuthType.Group: { - return NormalizedGroup - } - - case AuthType.Status: { - return NormalizedAuthStatus - } - - default: { - return undefined; - } - } - } -} diff --git a/src/app/core/auth/auth-response-parsing.service.ts b/src/app/core/auth/auth-response-parsing.service.ts index 1993f6d162..a5a160531c 100644 --- a/src/app/core/auth/auth-response-parsing.service.ts +++ b/src/app/core/auth/auth-response-parsing.service.ts @@ -1,6 +1,5 @@ import { Inject, Injectable } from '@angular/core'; -import { AuthObjectFactory } from './auth-object-factory'; import { BaseResponseParsingService } from '../data/base-response-parsing.service'; import { AuthStatusResponse, RestResponse } from '../cache/response.models'; import { DSpaceRESTV2Response } from '../dspace-rest-v2/dspace-rest-v2-response.model'; @@ -10,16 +9,13 @@ import { isNotEmpty } from '../../shared/empty.util'; import { ObjectCacheService } from '../cache/object-cache.service'; import { ResponseParsingService } from '../data/parsing.service'; import { RestRequest } from '../data/request.models'; -import { AuthType } from './auth-type'; import { AuthStatus } from './models/auth-status.model'; import { NormalizedAuthStatus } from './models/normalized-auth-status.model'; import { NormalizedObject } from '../cache/models/normalized-object.model'; -import { DSpaceObject } from '../shared/dspace-object.model'; @Injectable() export class AuthResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - protected objectFactory = AuthObjectFactory; protected toCache = true; constructor(@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig, @@ -29,7 +25,7 @@ export class AuthResponseParsingService extends BaseResponseParsingService imple parse(request: RestRequest, data: DSpaceRESTV2Response): RestResponse { if (isNotEmpty(data.payload) && isNotEmpty(data.payload._links) && (data.statusCode === 200)) { - const response = this.process, AuthType>(data.payload, request.uuid); + const response = this.process>(data.payload, request.uuid); return new AuthStatusResponse(response, data.statusCode, data.statusText); } else { return new AuthStatusResponse(data.payload as NormalizedAuthStatus, data.statusCode, data.statusText); diff --git a/src/app/core/cache/models/normalized-object-factory.ts b/src/app/core/cache/models/normalized-object-factory.ts deleted file mode 100644 index b83b39e437..0000000000 --- a/src/app/core/cache/models/normalized-object-factory.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { NormalizedBitstream } from './normalized-bitstream.model'; -import { NormalizedBundle } from './normalized-bundle.model'; -import { NormalizedItem } from './normalized-item.model'; -import { NormalizedCollection } from './normalized-collection.model'; -import { GenericConstructor } from '../../shared/generic-constructor'; -import { NormalizedCommunity } from './normalized-community.model'; -import { ResourceType } from '../../shared/resource-type'; -import { NormalizedObject } from './normalized-object.model'; -import { NormalizedLicense } from './normalized-license.model'; -import { NormalizedResourcePolicy } from './normalized-resource-policy.model'; -import { NormalizedWorkspaceItem } from '../../submission/models/normalized-workspaceitem.model'; -import { NormalizedEPerson } from '../../eperson/models/normalized-eperson.model'; -import { NormalizedGroup } from '../../eperson/models/normalized-group.model'; -import { NormalizedWorkflowItem } from '../../submission/models/normalized-workflowitem.model'; -import { NormalizedBitstreamFormat } from './normalized-bitstream-format.model'; -import { NormalizedMetadataSchema } from '../../metadata/normalized-metadata-schema.model'; -import { CacheableObject } from '../object-cache.reducer'; -import { NormalizedSubmissionDefinitionsModel } from '../../config/models/normalized-config-submission-definitions.model'; -import { NormalizedSubmissionFormsModel } from '../../config/models/normalized-config-submission-forms.model'; -import { NormalizedSubmissionSectionModel } from '../../config/models/normalized-config-submission-section.model'; -import { NormalizedAuthStatus } from '../../auth/models/normalized-auth-status.model'; - -export class NormalizedObjectFactory { - public static getConstructor(type: ResourceType): GenericConstructor> { - switch (type) { - case ResourceType.Bitstream: { - return NormalizedBitstream - } - case ResourceType.Bundle: { - return NormalizedBundle - } - case ResourceType.Item: { - return NormalizedItem - } - case ResourceType.Collection: { - return NormalizedCollection - } - case ResourceType.Community: { - return NormalizedCommunity - } - case ResourceType.BitstreamFormat: { - return NormalizedBitstreamFormat - } - case ResourceType.License: { - return NormalizedLicense - } - case ResourceType.ResourcePolicy: { - return NormalizedResourcePolicy - } - case ResourceType.EPerson: { - return NormalizedEPerson - } - case ResourceType.Group: { - return NormalizedGroup - } - case ResourceType.MetadataSchema: { - return NormalizedMetadataSchema - } - case ResourceType.MetadataField: { - return NormalizedGroup - } - case ResourceType.WorkspaceItem: { - return NormalizedWorkspaceItem - } - case ResourceType.WorkflowItem: { - return NormalizedWorkflowItem - } - case ResourceType.SubmissionDefinition: - case ResourceType.SubmissionDefinitions: { - return NormalizedSubmissionDefinitionsModel - } - case ResourceType.SubmissionForm: - case ResourceType.SubmissionForms: { - return NormalizedSubmissionFormsModel - } - case ResourceType.SubmissionSection: - case ResourceType.SubmissionSections: { - return NormalizedSubmissionSectionModel - } - default: { - return undefined; - } - } - } -} diff --git a/src/app/core/cache/response.models.ts b/src/app/core/cache/response.models.ts index 810dcf1799..753f9dab1e 100644 --- a/src/app/core/cache/response.models.ts +++ b/src/app/core/cache/response.models.ts @@ -8,13 +8,12 @@ import { IntegrationModel } from '../integration/models/integration.model'; import { RegistryMetadataschemasResponse } from '../registry/registry-metadataschemas-response.model'; import { RegistryMetadatafieldsResponse } from '../registry/registry-metadatafields-response.model'; import { RegistryBitstreamformatsResponse } from '../registry/registry-bitstreamformats-response.model'; -import { AuthStatus } from '../auth/models/auth-status.model'; -import { MetadataSchema } from '../metadata/metadataschema.model'; -import { MetadataField } from '../metadata/metadatafield.model'; import { PaginatedList } from '../data/paginated-list'; import { SubmissionObject } from '../submission/models/submission-object.model'; import { DSpaceObject } from '../shared/dspace-object.model'; import { NormalizedAuthStatus } from '../auth/models/normalized-auth-status.model'; +import { MetadataField } from '../metadata/metadata-field.model'; +import { MetadataSchema } from '../metadata/metadata-schema.model'; /* tslint:disable:max-classes-per-file */ export class RestResponse { diff --git a/src/app/core/config/models/config-object-factory.ts b/src/app/core/config/models/config-object-factory.ts deleted file mode 100644 index 44b2e377c4..0000000000 --- a/src/app/core/config/models/config-object-factory.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { GenericConstructor } from '../../shared/generic-constructor'; -import { ConfigType } from './config-type'; -import { ConfigObject } from './config.model'; -import { NormalizedSubmissionDefinitionsModel } from './normalized-config-submission-definitions.model'; -import { NormalizedSubmissionFormsModel } from './normalized-config-submission-forms.model'; -import { NormalizedSubmissionSectionModel } from './normalized-config-submission-section.model'; -import { NormalizedSubmissionUploadsModel } from './normalized-config-submission-uploads.model'; - -/** - * Class to return normalized models for config objects - */ -export class ConfigObjectFactory { - public static getConstructor(type): GenericConstructor { - switch (type) { - case ConfigType.SubmissionDefinition: - case ConfigType.SubmissionDefinitions: { - return NormalizedSubmissionDefinitionsModel - } - case ConfigType.SubmissionForm: - case ConfigType.SubmissionForms: { - return NormalizedSubmissionFormsModel - } - case ConfigType.SubmissionSection: - case ConfigType.SubmissionSections: { - return NormalizedSubmissionSectionModel - } - case ConfigType.SubmissionUpload: - case ConfigType.SubmissionUploads: { - return NormalizedSubmissionUploadsModel - } - default: { - return undefined; - } - } - } -} diff --git a/src/app/core/config/models/normalized-config-submission-definitions.model.ts b/src/app/core/config/models/normalized-config-submission-definitions.model.ts index 0d98132c0f..87df838378 100644 --- a/src/app/core/config/models/normalized-config-submission-definitions.model.ts +++ b/src/app/core/config/models/normalized-config-submission-definitions.model.ts @@ -12,7 +12,7 @@ import { mapsTo } from '../../cache/builders/build-decorators'; */ @mapsTo(SubmissionDefinitionsModel) @inheritSerialization(NormalizedConfigObject) -@resourceType(ResourceType.SubmissionDefinitions) +@resourceType(ResourceType.SubmissionDefinitions, ResourceType.SubmissionDefinition) export class NormalizedSubmissionDefinitionsModel extends NormalizedConfigObject { /** diff --git a/src/app/core/config/models/normalized-config-submission-forms.model.ts b/src/app/core/config/models/normalized-config-submission-forms.model.ts index a957e8c7fa..2856fe46fc 100644 --- a/src/app/core/config/models/normalized-config-submission-forms.model.ts +++ b/src/app/core/config/models/normalized-config-submission-forms.model.ts @@ -1,11 +1,16 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { NormalizedConfigObject } from './normalized-config.model'; import { FormRowModel, SubmissionFormsModel } from './config-submission-forms.model'; +import { resourceType } from '../../shared/resource-type.decorator'; +import { ResourceType } from '../../shared/resource-type'; +import { mapsTo } from '../../cache/builders/build-decorators'; /** * Normalized class for the configuration describing the submission form */ +@mapsTo(SubmissionFormsModel) @inheritSerialization(NormalizedConfigObject) +@resourceType(ResourceType.SubmissionForm, ResourceType.SubmissionForms) export class NormalizedSubmissionFormsModel extends NormalizedConfigObject { /** diff --git a/src/app/core/config/models/normalized-config-submission-section.model.ts b/src/app/core/config/models/normalized-config-submission-section.model.ts index c876acf607..174cd5a10a 100644 --- a/src/app/core/config/models/normalized-config-submission-section.model.ts +++ b/src/app/core/config/models/normalized-config-submission-section.model.ts @@ -3,11 +3,16 @@ import { SectionsType } from '../../../submission/sections/sections-type'; import { NormalizedConfigObject } from './normalized-config.model'; import { SubmissionFormsModel } from './config-submission-forms.model'; import { SubmissionSectionVisibility } from './config-submission-section.model'; +import { mapsTo } from '../../cache/builders/build-decorators'; +import { resourceType } from '../../shared/resource-type.decorator'; +import { ResourceType } from '../../shared/resource-type'; /** * Normalized class for the configuration describing the submission section */ +@mapsTo(SubmissionFormsModel) @inheritSerialization(NormalizedConfigObject) +@resourceType(ResourceType.SubmissionForm, ResourceType.SubmissionForms) export class NormalizedSubmissionSectionModel extends NormalizedConfigObject { /** diff --git a/src/app/core/data/base-response-parsing.service.ts b/src/app/core/data/base-response-parsing.service.ts index 334aadd379..15f52e0939 100644 --- a/src/app/core/data/base-response-parsing.service.ts +++ b/src/app/core/data/base-response-parsing.service.ts @@ -9,15 +9,15 @@ import { PaginatedList } from './paginated-list'; import { ResourceType } from '../shared/resource-type'; import { RESTURLCombiner } from '../url-combiner/rest-url-combiner'; import { isRestDataObject, isRestPaginatedList } from '../cache/builders/normalized-object-build.service'; +import { getNormalizedConstructorByType } from '../shared/resource-type.decorator'; /* tslint:disable:max-classes-per-file */ export abstract class BaseResponseParsingService { protected abstract EnvConfig: GlobalConfig; protected abstract objectCache: ObjectCacheService; - protected abstract objectFactory: any; protected abstract toCache: boolean; - protected process(data: any, requestUUID: string): any { + protected process(data: any, requestUUID: string): any { if (isNotEmpty(data)) { if (hasNoValue(data) || (typeof data !== 'object')) { return data; @@ -32,7 +32,7 @@ export abstract class BaseResponseParsingService { .keys(data._embedded) .filter((property) => data._embedded.hasOwnProperty(property)) .forEach((property) => { - const parsedObj = this.process(data._embedded[property], requestUUID); + const parsedObj = this.process(data._embedded[property], requestUUID); if (isNotEmpty(parsedObj)) { if (isRestPaginatedList(data._embedded[property])) { object[property] = parsedObj; @@ -61,7 +61,7 @@ export abstract class BaseResponseParsingService { } } - protected processPaginatedList(data: any, requestUUID: string): PaginatedList { + protected processPaginatedList(data: any, requestUUID: string): PaginatedList { const pageInfo: PageInfo = this.processPageInfo(data); let list = data._embedded; @@ -73,7 +73,7 @@ export abstract class BaseResponseParsingService { return new PaginatedList(pageInfo, page, ); } - protected processArray(data: any, requestUUID: string): ObjectDomain[] { + protected processArray(data: any, requestUUID: string): ObjectDomain[] { let array: ObjectDomain[] = []; data.forEach((datum) => { array = [...array, this.process(datum, requestUUID)]; @@ -82,10 +82,10 @@ export abstract class BaseResponseParsingService { return array; } - protected deserialize(obj): any { - const type: ObjectType = obj.type; + protected deserialize(obj): any { + const type: ResourceType = obj.type; if (hasValue(type)) { - const normObjConstructor = this.objectFactory.getConstructor(type) as GenericConstructor; + const normObjConstructor = getNormalizedConstructorByType(type) as GenericConstructor; if (hasValue(normObjConstructor)) { const serializer = new DSpaceRESTv2Serializer(normObjConstructor); @@ -103,7 +103,7 @@ export abstract class BaseResponseParsingService { } } - protected cache(obj, requestUUID) { + protected cache(obj, requestUUID) { if (this.toCache) { this.addToObjectCache(obj, requestUUID); } diff --git a/src/app/core/data/metadatafield-parsing.service.ts b/src/app/core/data/metadatafield-parsing.service.ts index f9582c394d..092285e9c5 100644 --- a/src/app/core/data/metadatafield-parsing.service.ts +++ b/src/app/core/data/metadatafield-parsing.service.ts @@ -3,8 +3,8 @@ import { DSpaceRESTV2Response } from '../dspace-rest-v2/dspace-rest-v2-response. import { RestRequest } from './request.models'; import { ResponseParsingService } from './parsing.service'; import { Injectable } from '@angular/core'; -import { MetadatafieldSuccessResponse, MetadataschemaSuccessResponse, RestResponse } from '../cache/response.models'; -import { MetadataField } from '../metadata/metadatafield.model'; +import { MetadatafieldSuccessResponse, RestResponse } from '../cache/response.models'; +import { MetadataField } from '../metadata/metadata-field.model'; /** * A service responsible for parsing DSpaceRESTV2Response data related to a single MetadataField to a valid RestResponse diff --git a/src/app/core/integration/models/normalized-authority-value.model.ts b/src/app/core/integration/models/normalized-authority-value.model.ts index 5ebb61281d..6e6c7ee798 100644 --- a/src/app/core/integration/models/normalized-authority-value.model.ts +++ b/src/app/core/integration/models/normalized-authority-value.model.ts @@ -2,12 +2,15 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { IntegrationModel } from './integration.model'; import { mapsTo } from '../../cache/builders/build-decorators'; import { AuthorityValue } from './authority.value'; +import { resourceType } from '../../shared/resource-type.decorator'; +import { ResourceType } from '../../shared/resource-type'; /** * Normalized model class for an Authority Value */ @mapsTo(AuthorityValue) @inheritSerialization(IntegrationModel) +@resourceType(ResourceType.Authority) export class NormalizedAuthorityValue extends IntegrationModel { @autoserialize diff --git a/src/app/core/registry/registry-metadataschemas-response.model.ts b/src/app/core/registry/registry-metadataschemas-response.model.ts index 5f4799abd7..f27550bbe0 100644 --- a/src/app/core/registry/registry-metadataschemas-response.model.ts +++ b/src/app/core/registry/registry-metadataschemas-response.model.ts @@ -1,6 +1,6 @@ -import { MetadataSchema } from '../metadata/metadataschema.model'; import { PageInfo } from '../shared/page-info.model'; import { autoserialize, autoserializeAs } from 'cerialize'; +import { MetadataSchema } from '../metadata/metadata-schema.model'; export class RegistryMetadataschemasResponse { @autoserializeAs(MetadataSchema) diff --git a/src/app/core/shared/resource-type.decorator.ts b/src/app/core/shared/resource-type.decorator.ts index da5259b968..a063eb8310 100644 --- a/src/app/core/shared/resource-type.decorator.ts +++ b/src/app/core/shared/resource-type.decorator.ts @@ -2,15 +2,17 @@ import { CacheableObject } from '../cache/object-cache.reducer'; import { GenericConstructor } from './generic-constructor'; const resourceTypeForObjectMap = new Map(); -export function resourceType(resourceType: string) { + +export function resourceType(...resourceType: string[]) { return function decorator(objectConstructor: GenericConstructor) { if (!objectConstructor) { return; } - resourceTypeForObjectMap.set(resourceType, objectConstructor); + resourceType.forEach((rt: string) => resourceTypeForObjectMap.set(rt, objectConstructor) + ) }; } -export function rendersSectionType(resourceType: string) { +export function getNormalizedConstructorByType(resourceType: string) { return resourceTypeForObjectMap.get(resourceType); } diff --git a/src/app/core/shared/resource-type.ts b/src/app/core/shared/resource-type.ts index 02283a5dde..c4eeb7a27d 100644 --- a/src/app/core/shared/resource-type.ts +++ b/src/app/core/shared/resource-type.ts @@ -20,5 +20,6 @@ export enum ResourceType { SubmissionForms = 'submissionforms', SubmissionSections = 'submissionsections', SubmissionSection = 'submissionsection', - AuthStatus = 'status' + AuthStatus = 'status', + Authority = 'authority' } From af291845ec1a4518963bb5643716b4641c0d38b7 Mon Sep 17 00:00:00 2001 From: lotte Date: Fri, 26 Apr 2019 16:40:49 +0200 Subject: [PATCH 03/38] continued refactoring --- .../item-metadata/item-metadata.component.ts | 2 +- src/app/core/auth/models/auth-status.model.ts | 8 ++++++-- .../auth/models/normalized-auth-status.model.ts | 4 ++++ .../builders/normalized-object-build.service.ts | 8 ++++---- .../cache/builders/remote-data-build.service.ts | 8 ++++---- .../models/normalized-dspace-object.model.ts | 5 +++-- .../cache/models/normalized-object.model.ts | 4 ++-- src/app/core/cache/object-cache.reducer.ts | 6 +++++- .../config/config-response-parsing.service.ts | 2 -- src/app/core/config/models/config.model.ts | 4 ++-- ...ormalized-config-submission-section.model.ts | 11 +++++++---- .../config/models/normalized-config.model.ts | 4 ++-- .../browse-entries-response-parsing.service.ts | 3 --- .../browse-items-response-parsing-service.ts | 4 ---- .../core/data/dso-response-parsing.service.ts | 6 +----- .../facet-config-response-parsing.service.ts | 1 - .../facet-value-map-response-parsing.service.ts | 1 - .../facet-value-response-parsing.service.ts | 1 - .../eperson/eperson-response-parsing.service.ts | 5 +---- .../integration/integration-object-factory.ts | 17 ----------------- .../integration-response-parsing.service.ts | 8 +++----- src/app/core/integration/intergration-type.ts | 4 ---- src/app/core/shared/bitstream-format.model.ts | 4 ++-- src/app/core/shared/browse-definition.model.ts | 6 ++++-- src/app/core/shared/browse-entry.model.ts | 8 ++++++-- src/app/core/shared/dspace-object.model.ts | 4 ++-- src/app/core/shared/resource-policy.model.ts | 4 ++-- src/app/core/shared/resource-type.decorator.ts | 9 +++++---- src/app/core/shared/resource-type.ts | 3 ++- .../submission-response-parsing.service.ts | 8 +++----- 30 files changed, 71 insertions(+), 91 deletions(-) delete mode 100644 src/app/core/integration/integration-object-factory.ts delete mode 100644 src/app/core/integration/intergration-type.ts diff --git a/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.ts b/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.ts index 6b3e05c818..8148b89bd4 100644 --- a/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.ts +++ b/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.ts @@ -17,9 +17,9 @@ import { NotificationsService } from '../../../shared/notifications/notification import { GLOBAL_CONFIG, GlobalConfig } from '../../../../config'; import { TranslateService } from '@ngx-translate/core'; import { RegistryService } from '../../../core/registry/registry.service'; -import { MetadataField } from '../../../core/metadata/metadatafield.model'; import { MetadatumViewModel } from '../../../core/shared/metadata.models'; import { Metadata } from '../../../core/shared/metadata.utils'; +import { MetadataField } from '../../../core/metadata/metadata-field.model'; @Component({ selector: 'ds-item-metadata', diff --git a/src/app/core/auth/models/auth-status.model.ts b/src/app/core/auth/models/auth-status.model.ts index 6e722a80c9..40ca71aa1b 100644 --- a/src/app/core/auth/models/auth-status.model.ts +++ b/src/app/core/auth/models/auth-status.model.ts @@ -3,9 +3,10 @@ import { AuthTokenInfo } from './auth-token-info.model'; import { EPerson } from '../../eperson/models/eperson.model'; import { RemoteData } from '../../data/remote-data'; import { Observable } from 'rxjs'; -import { CacheableObject } from '../../cache/object-cache.reducer'; +import { CacheableObject, TypedObject } from '../../cache/object-cache.reducer'; +import { ResourceType } from '../../shared/resource-type'; -export class AuthStatus implements CacheableObject { +export class AuthStatus implements CacheableObject, TypedObject { id: string; @@ -20,4 +21,7 @@ export class AuthStatus implements CacheableObject { token?: AuthTokenInfo; self: string; + + type: ResourceType; + } diff --git a/src/app/core/auth/models/normalized-auth-status.model.ts b/src/app/core/auth/models/normalized-auth-status.model.ts index 46d0177fdc..50956935ef 100644 --- a/src/app/core/auth/models/normalized-auth-status.model.ts +++ b/src/app/core/auth/models/normalized-auth-status.model.ts @@ -31,4 +31,8 @@ export class NormalizedAuthStatus extends NormalizedObject { @relationship(ResourceType.EPerson, false) @autoserialize eperson: string; + + + @autoserialize + type: ResourceType; } diff --git a/src/app/core/cache/builders/normalized-object-build.service.ts b/src/app/core/cache/builders/normalized-object-build.service.ts index 79665fec3d..357ae71872 100644 --- a/src/app/core/cache/builders/normalized-object-build.service.ts +++ b/src/app/core/cache/builders/normalized-object-build.service.ts @@ -1,9 +1,9 @@ import { Injectable } from '@angular/core'; import { NormalizedObject } from '../models/normalized-object.model'; -import { CacheableObject } from '../object-cache.reducer'; import { getRelationships } from './build-decorators'; -import { NormalizedObjectFactory } from '../models/normalized-object-factory'; import { hasValue, isNotEmpty } from '../../../shared/empty.util'; +import { TypedObject } from '../object-cache.reducer'; +import { getNormalizedConstructorByType } from '../../shared/resource-type.decorator'; /** * Return true if halObj has a value for `_links.self` @@ -35,8 +35,8 @@ export class NormalizedObjectBuildService { * * @param {TDomain} domainModel a domain model */ - normalize(domainModel: T): NormalizedObject { - const normalizedConstructor = NormalizedObjectFactory.getConstructor(domainModel.type); + normalize(domainModel: T): NormalizedObject { + const normalizedConstructor = getNormalizedConstructorByType(domainModel.type); const relationships = getRelationships(normalizedConstructor) || []; const normalizedModel = Object.assign({}, domainModel) as any; diff --git a/src/app/core/cache/builders/remote-data-build.service.ts b/src/app/core/cache/builders/remote-data-build.service.ts index c0b359e7ea..18687e254d 100644 --- a/src/app/core/cache/builders/remote-data-build.service.ts +++ b/src/app/core/cache/builders/remote-data-build.service.ts @@ -21,7 +21,7 @@ import { getRequestFromRequestUUID, getResourceLinksFromResponse } from '../../shared/operators'; -import { CacheableObject } from '../object-cache.reducer'; +import { CacheableObject, TypedObject } from '../object-cache.reducer'; @Injectable() export class RemoteDataBuildService { @@ -29,7 +29,7 @@ export class RemoteDataBuildService { protected requestService: RequestService) { } - buildSingle(href$: string | Observable): Observable> { + buildSingle(href$: string | Observable): Observable> { if (typeof href$ === 'string') { href$ = observableOf(href$); } @@ -107,7 +107,7 @@ export class RemoteDataBuildService { ); } - buildList(href$: string | Observable): Observable>> { + buildList(href$: string | Observable): Observable>> { if (typeof href$ === 'string') { href$ = observableOf(href$); } @@ -149,7 +149,7 @@ export class RemoteDataBuildService { return this.toRemoteDataObservable(requestEntry$, payload$); } - build(normalized: NormalizedObject): T { + build(normalized: NormalizedObject): T { const links: any = {}; const relationships = getRelationships(normalized.constructor) || []; diff --git a/src/app/core/cache/models/normalized-dspace-object.model.ts b/src/app/core/cache/models/normalized-dspace-object.model.ts index 84e3f41f42..65da89a4eb 100644 --- a/src/app/core/cache/models/normalized-dspace-object.model.ts +++ b/src/app/core/cache/models/normalized-dspace-object.model.ts @@ -5,13 +5,14 @@ import { ResourceType } from '../../shared/resource-type'; import { mapsTo } from '../builders/build-decorators'; import { NormalizedObject } from './normalized-object.model'; import { resourceType } from '../../shared/resource-type.decorator'; +import { TypedObject } from '../object-cache.reducer'; /** * An model class for a DSpaceObject. */ @mapsTo(DSpaceObject) @resourceType(ResourceType.DSpaceObject) -export class NormalizedDSpaceObject extends NormalizedObject { +export class NormalizedDSpaceObject extends NormalizedObject implements TypedObject { /** * The link to the rest endpoint where this object can be found @@ -40,7 +41,7 @@ export class NormalizedDSpaceObject extends NormalizedOb /** * A string representing the kind of DSpaceObject, e.g. community, item, … */ - @autoserializeAs(String) + @autoserializeAs(ResourceType) type: ResourceType; /** diff --git a/src/app/core/cache/models/normalized-object.model.ts b/src/app/core/cache/models/normalized-object.model.ts index 6ac8985d64..a80da98cca 100644 --- a/src/app/core/cache/models/normalized-object.model.ts +++ b/src/app/core/cache/models/normalized-object.model.ts @@ -1,10 +1,10 @@ -import { CacheableObject } from '../object-cache.reducer'; +import { CacheableObject, TypedObject } from '../object-cache.reducer'; import { autoserialize } from 'cerialize'; import { ResourceType } from '../../shared/resource-type'; /** * An abstract model class for a NormalizedObject. */ -export abstract class NormalizedObject implements CacheableObject { +export abstract class NormalizedObject implements CacheableObject, TypedObject { /** * The link to the rest endpoint where this object can be found diff --git a/src/app/core/cache/object-cache.reducer.ts b/src/app/core/cache/object-cache.reducer.ts index 982c77341e..97a48af1c1 100644 --- a/src/app/core/cache/object-cache.reducer.ts +++ b/src/app/core/cache/object-cache.reducer.ts @@ -32,6 +32,9 @@ export interface Patch { operations: Operation[]; } +export interface TypedObject { + type: ResourceType; +} /** * An interface to represent objects that can be cached * @@ -40,7 +43,6 @@ export interface Patch { export interface CacheableObject { uuid?: string; self: string; - type?: ResourceType; // isNew: boolean; // dirtyType: DirtyType; // hasDirtyAttributes: boolean; @@ -48,6 +50,8 @@ export interface CacheableObject { // save(): void; } +// export type TypedCacheableObject = TypedObject & CacheableObject; + /** * An entry in the ObjectCache */ diff --git a/src/app/core/config/config-response-parsing.service.ts b/src/app/core/config/config-response-parsing.service.ts index b81dc07624..de85b911bd 100644 --- a/src/app/core/config/config-response-parsing.service.ts +++ b/src/app/core/config/config-response-parsing.service.ts @@ -16,8 +16,6 @@ import { ObjectCacheService } from '../cache/object-cache.service'; @Injectable() export class ConfigResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - - protected objectFactory = ConfigObjectFactory; protected toCache = false; constructor( diff --git a/src/app/core/config/models/config.model.ts b/src/app/core/config/models/config.model.ts index 81f20a0b3c..2a7c3da882 100644 --- a/src/app/core/config/models/config.model.ts +++ b/src/app/core/config/models/config.model.ts @@ -1,7 +1,7 @@ -import { CacheableObject } from '../../cache/object-cache.reducer'; +import { CacheableObject, TypedObject } from '../../cache/object-cache.reducer'; import { ResourceType } from '../../shared/resource-type'; -export abstract class ConfigObject implements CacheableObject { +export abstract class ConfigObject implements CacheableObject, TypedObject { /** * The name for this configuration diff --git a/src/app/core/config/models/normalized-config-submission-section.model.ts b/src/app/core/config/models/normalized-config-submission-section.model.ts index 174cd5a10a..3f9bca8b7b 100644 --- a/src/app/core/config/models/normalized-config-submission-section.model.ts +++ b/src/app/core/config/models/normalized-config-submission-section.model.ts @@ -2,7 +2,10 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { SectionsType } from '../../../submission/sections/sections-type'; import { NormalizedConfigObject } from './normalized-config.model'; import { SubmissionFormsModel } from './config-submission-forms.model'; -import { SubmissionSectionVisibility } from './config-submission-section.model'; +import { + SubmissionSectionModel, + SubmissionSectionVisibility +} from './config-submission-section.model'; import { mapsTo } from '../../cache/builders/build-decorators'; import { resourceType } from '../../shared/resource-type.decorator'; import { ResourceType } from '../../shared/resource-type'; @@ -10,10 +13,10 @@ import { ResourceType } from '../../shared/resource-type'; /** * Normalized class for the configuration describing the submission section */ -@mapsTo(SubmissionFormsModel) +@mapsTo(SubmissionSectionModel) @inheritSerialization(NormalizedConfigObject) -@resourceType(ResourceType.SubmissionForm, ResourceType.SubmissionForms) -export class NormalizedSubmissionSectionModel extends NormalizedConfigObject { +@resourceType(ResourceType.SubmissionSection, ResourceType.SubmissionSections) +export class NormalizedSubmissionSectionModel extends NormalizedConfigObject { /** * The header for this section diff --git a/src/app/core/config/models/normalized-config.model.ts b/src/app/core/config/models/normalized-config.model.ts index 0b75158588..c463cd8b08 100644 --- a/src/app/core/config/models/normalized-config.model.ts +++ b/src/app/core/config/models/normalized-config.model.ts @@ -1,13 +1,13 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { NormalizedObject } from '../../cache/models/normalized-object.model'; -import { CacheableObject } from '../../cache/object-cache.reducer'; +import { CacheableObject, TypedObject } from '../../cache/object-cache.reducer'; import { ResourceType } from '../../shared/resource-type'; /** * Normalized abstract class for a configuration object */ @inheritSerialization(NormalizedObject) -export abstract class NormalizedConfigObject implements CacheableObject { +export abstract class NormalizedConfigObject implements CacheableObject, TypedObject { /** * The name for this configuration diff --git a/src/app/core/data/browse-entries-response-parsing.service.ts b/src/app/core/data/browse-entries-response-parsing.service.ts index 4690d738ed..5e6a9acaca 100644 --- a/src/app/core/data/browse-entries-response-parsing.service.ts +++ b/src/app/core/data/browse-entries-response-parsing.service.ts @@ -18,9 +18,6 @@ import { RestRequest } from './request.models'; @Injectable() export class BrowseEntriesResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - protected objectFactory = { - getConstructor: () => BrowseEntry - }; protected toCache = false; constructor( diff --git a/src/app/core/data/browse-items-response-parsing-service.ts b/src/app/core/data/browse-items-response-parsing-service.ts index fb950f6c68..324b36199a 100644 --- a/src/app/core/data/browse-items-response-parsing-service.ts +++ b/src/app/core/data/browse-items-response-parsing-service.ts @@ -18,10 +18,6 @@ import { NormalizedDSpaceObject } from '../cache/models/normalized-dspace-object */ @Injectable() export class BrowseItemsResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - - protected objectFactory = { - getConstructor: () => DSpaceObject - }; protected toCache = false; constructor( diff --git a/src/app/core/data/dso-response-parsing.service.ts b/src/app/core/data/dso-response-parsing.service.ts index eb95cdae8a..d6c3b2caa6 100644 --- a/src/app/core/data/dso-response-parsing.service.ts +++ b/src/app/core/data/dso-response-parsing.service.ts @@ -4,8 +4,6 @@ import { ObjectCacheService } from '../cache/object-cache.service'; import { GlobalConfig } from '../../../config/global-config.interface'; import { GLOBAL_CONFIG } from '../../../config'; import { NormalizedObject } from '../cache/models/normalized-object.model'; -import { ResourceType } from '../shared/resource-type'; -import { NormalizedObjectFactory } from '../cache/models/normalized-object-factory'; import { DSpaceRESTV2Response } from '../dspace-rest-v2/dspace-rest-v2-response.model'; import { RestResponse, DSOSuccessResponse } from '../cache/response.models'; import { RestRequest } from './request.models'; @@ -17,8 +15,6 @@ import { DSpaceObject } from '../shared/dspace-object.model'; @Injectable() export class DSOResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - - protected objectFactory = NormalizedObjectFactory; protected toCache = true; constructor( @@ -34,7 +30,7 @@ export class DSOResponseParsingService extends BaseResponseParsingService implem if (hasValue(data.payload) && hasValue(data.payload.page) && data.payload.page.totalElements === 0) { processRequestDTO = { page: [] }; } else { - processRequestDTO = this.process, ResourceType>(data.payload, request.uuid); + processRequestDTO = this.process>(data.payload, request.uuid); } let objectList = processRequestDTO; diff --git a/src/app/core/data/facet-config-response-parsing.service.ts b/src/app/core/data/facet-config-response-parsing.service.ts index e65e317642..15f520b249 100644 --- a/src/app/core/data/facet-config-response-parsing.service.ts +++ b/src/app/core/data/facet-config-response-parsing.service.ts @@ -15,7 +15,6 @@ import { GLOBAL_CONFIG } from '../../../config'; @Injectable() export class FacetConfigResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - objectFactory = {}; toCache = false; constructor( @Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig, diff --git a/src/app/core/data/facet-value-map-response-parsing.service.ts b/src/app/core/data/facet-value-map-response-parsing.service.ts index e03c1a78df..b67cef97c0 100644 --- a/src/app/core/data/facet-value-map-response-parsing.service.ts +++ b/src/app/core/data/facet-value-map-response-parsing.service.ts @@ -17,7 +17,6 @@ import { GLOBAL_CONFIG } from '../../../config'; @Injectable() export class FacetValueMapResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - objectFactory = {}; toCache = false; constructor( diff --git a/src/app/core/data/facet-value-response-parsing.service.ts b/src/app/core/data/facet-value-response-parsing.service.ts index e7665ebed2..49d72e0a01 100644 --- a/src/app/core/data/facet-value-response-parsing.service.ts +++ b/src/app/core/data/facet-value-response-parsing.service.ts @@ -12,7 +12,6 @@ import { GlobalConfig } from '../../../config/global-config.interface'; @Injectable() export class FacetValueResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - objectFactory = {}; toCache = false; constructor( @Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig, diff --git a/src/app/core/eperson/eperson-response-parsing.service.ts b/src/app/core/eperson/eperson-response-parsing.service.ts index 6c591b0b99..481f37d1fa 100644 --- a/src/app/core/eperson/eperson-response-parsing.service.ts +++ b/src/app/core/eperson/eperson-response-parsing.service.ts @@ -9,8 +9,6 @@ import { BaseResponseParsingService } from '../data/base-response-parsing.servic import { GLOBAL_CONFIG } from '../../../config'; import { GlobalConfig } from '../../../config/global-config.interface'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { NormalizedObjectFactory } from '../cache/models/normalized-object-factory'; -import { ResourceType } from '../shared/resource-type'; import { DSpaceObject } from '../shared/dspace-object.model'; /** @@ -19,7 +17,6 @@ import { DSpaceObject } from '../shared/dspace-object.model'; @Injectable() export class EpersonResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - protected objectFactory = NormalizedObjectFactory; protected toCache = false; constructor( @@ -31,7 +28,7 @@ export class EpersonResponseParsingService extends BaseResponseParsingService im parse(request: RestRequest, data: DSpaceRESTV2Response): RestResponse { if (isNotEmpty(data.payload) && isNotEmpty(data.payload._links)) { - const epersonDefinition = this.process(data.payload, request.href); + const epersonDefinition = this.process(data.payload, request.href); return new EpersonSuccessResponse(epersonDefinition[Object.keys(epersonDefinition)[0]], data.statusCode, data.statusText, this.processPageInfo(data.payload)); } else { return new ErrorResponse( diff --git a/src/app/core/integration/integration-object-factory.ts b/src/app/core/integration/integration-object-factory.ts deleted file mode 100644 index f66a070fdf..0000000000 --- a/src/app/core/integration/integration-object-factory.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { GenericConstructor } from '../shared/generic-constructor'; -import { IntegrationType } from './intergration-type'; -import { IntegrationModel } from './models/integration.model'; -import { NormalizedAuthorityValue } from './models/normalized-authority-value.model'; - -export class IntegrationObjectFactory { - public static getConstructor(type): GenericConstructor { - switch (type) { - case IntegrationType.Authority: { - return NormalizedAuthorityValue; - } - default: { - return undefined; - } - } - } -} diff --git a/src/app/core/integration/integration-response-parsing.service.ts b/src/app/core/integration/integration-response-parsing.service.ts index 2d3693cf3d..9793a69218 100644 --- a/src/app/core/integration/integration-response-parsing.service.ts +++ b/src/app/core/integration/integration-response-parsing.service.ts @@ -8,21 +8,19 @@ import { RestResponse } from '../cache/response.models'; import { isNotEmpty } from '../../shared/empty.util'; -import { IntegrationObjectFactory } from './integration-object-factory'; import { BaseResponseParsingService } from '../data/base-response-parsing.service'; import { GLOBAL_CONFIG } from '../../../config'; import { GlobalConfig } from '../../../config/global-config.interface'; import { ObjectCacheService } from '../cache/object-cache.service'; import { IntegrationModel } from './models/integration.model'; -import { IntegrationType } from './intergration-type'; import { AuthorityValue } from './models/authority.value'; import { PaginatedList } from '../data/paginated-list'; +import { ResourceType } from '../shared/resource-type'; @Injectable() export class IntegrationResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - protected objectFactory = IntegrationObjectFactory; protected toCache = true; constructor( @@ -34,7 +32,7 @@ export class IntegrationResponseParsingService extends BaseResponseParsingServic parse(request: RestRequest, data: DSpaceRESTV2Response): RestResponse { if (isNotEmpty(data.payload) && isNotEmpty(data.payload._links)) { - const dataDefinition = this.process(data.payload, request.uuid); + const dataDefinition = this.process(data.payload, request.uuid); return new IntegrationSuccessResponse(this.processResponse(dataDefinition), data.statusCode, data.statusText, this.processPageInfo(data.payload)); } else { return new ErrorResponse( @@ -49,7 +47,7 @@ export class IntegrationResponseParsingService extends BaseResponseParsingServic protected processResponse(data: PaginatedList): any { const returnList = Array.of(); data.page.forEach((item, index) => { - if (item.type === IntegrationType.Authority) { + if (item.type === ResourceType.Authority) { data.page[index] = Object.assign(new AuthorityValue(), item); } }); diff --git a/src/app/core/integration/intergration-type.ts b/src/app/core/integration/intergration-type.ts deleted file mode 100644 index 882dc6d8ce..0000000000 --- a/src/app/core/integration/intergration-type.ts +++ /dev/null @@ -1,4 +0,0 @@ - -export enum IntegrationType { - Authority = 'authority' -} diff --git a/src/app/core/shared/bitstream-format.model.ts b/src/app/core/shared/bitstream-format.model.ts index 9af345e607..c46df1724d 100644 --- a/src/app/core/shared/bitstream-format.model.ts +++ b/src/app/core/shared/bitstream-format.model.ts @@ -1,11 +1,11 @@ -import { CacheableObject } from '../cache/object-cache.reducer'; +import { CacheableObject, TypedObject } from '../cache/object-cache.reducer'; import { ResourceType } from './resource-type'; /** * Model class for a Bitstream Format */ -export class BitstreamFormat implements CacheableObject { +export class BitstreamFormat implements CacheableObject, TypedObject { /** * Short description of this Bitstream Format diff --git a/src/app/core/shared/browse-definition.model.ts b/src/app/core/shared/browse-definition.model.ts index 05263858c6..fe5fdd439b 100644 --- a/src/app/core/shared/browse-definition.model.ts +++ b/src/app/core/shared/browse-definition.model.ts @@ -1,7 +1,9 @@ import { autoserialize, autoserializeAs } from 'cerialize'; import { SortOption } from './sort-option.model'; +import { ResourceType } from './resource-type'; +import { TypedObject } from '../cache/object-cache.reducer'; -export class BrowseDefinition { +export class BrowseDefinition implements TypedObject { @autoserialize id: string; @@ -15,7 +17,7 @@ export class BrowseDefinition { defaultSortOrder: string; @autoserialize - type: string; + type: ResourceType; @autoserializeAs('metadata') metadataKeys: string[]; diff --git a/src/app/core/shared/browse-entry.model.ts b/src/app/core/shared/browse-entry.model.ts index 932c6946d1..6f018cedde 100644 --- a/src/app/core/shared/browse-entry.model.ts +++ b/src/app/core/shared/browse-entry.model.ts @@ -1,10 +1,14 @@ import { autoserialize, autoserializeAs } from 'cerialize'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; +import { ResourceType } from './resource-type'; +import { resourceType } from './resource-type.decorator'; +import { CacheableObject, TypedObject } from '../cache/object-cache.reducer'; -export class BrowseEntry implements ListableObject { +@resourceType(ResourceType.BrowseEntry) +export class BrowseEntry implements ListableObject, TypedObject { @autoserialize - type: string; + type: ResourceType; @autoserialize authority: string; diff --git a/src/app/core/shared/dspace-object.model.ts b/src/app/core/shared/dspace-object.model.ts index 71c6ee7837..422e215c90 100644 --- a/src/app/core/shared/dspace-object.model.ts +++ b/src/app/core/shared/dspace-object.model.ts @@ -3,7 +3,7 @@ import { Observable } from 'rxjs'; import { MetadataMap, MetadataValue, MetadataValueFilter, MetadatumViewModel } from './metadata.models'; import { Metadata } from './metadata.utils'; import { isUndefined } from '../../shared/empty.util'; -import { CacheableObject } from '../cache/object-cache.reducer'; +import { CacheableObject, TypedObject } from '../cache/object-cache.reducer'; import { RemoteData } from '../data/remote-data'; import { ResourceType } from './resource-type'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; @@ -11,7 +11,7 @@ import { ListableObject } from '../../shared/object-collection/shared/listable-o /** * An abstract model class for a DSpaceObject. */ -export class DSpaceObject implements CacheableObject, ListableObject { +export class DSpaceObject implements CacheableObject, ListableObject, TypedObject { private _name: string; diff --git a/src/app/core/shared/resource-policy.model.ts b/src/app/core/shared/resource-policy.model.ts index ee3d5293f5..21dcd44b01 100644 --- a/src/app/core/shared/resource-policy.model.ts +++ b/src/app/core/shared/resource-policy.model.ts @@ -1,4 +1,4 @@ -import { CacheableObject } from '../cache/object-cache.reducer'; +import { CacheableObject, TypedObject } 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'; @@ -6,7 +6,7 @@ import { ActionType } from '../cache/models/action-type.model'; /** * Model class for a Resource Policy */ -export class ResourcePolicy implements CacheableObject { +export class ResourcePolicy implements CacheableObject, TypedObject { /** * The action that is allowed by this Resource Policy */ diff --git a/src/app/core/shared/resource-type.decorator.ts b/src/app/core/shared/resource-type.decorator.ts index a063eb8310..28b2c7cefe 100644 --- a/src/app/core/shared/resource-type.decorator.ts +++ b/src/app/core/shared/resource-type.decorator.ts @@ -1,10 +1,11 @@ -import { CacheableObject } from '../cache/object-cache.reducer'; +import { CacheableObject, TypedObject } from '../cache/object-cache.reducer'; import { GenericConstructor } from './generic-constructor'; +import { ResourceType } from './resource-type'; const resourceTypeForObjectMap = new Map(); -export function resourceType(...resourceType: string[]) { - return function decorator(objectConstructor: GenericConstructor) { +export function resourceType(...resourceType: ResourceType[]) { + return function decorator(objectConstructor: GenericConstructor) { if (!objectConstructor) { return; } @@ -13,6 +14,6 @@ export function resourceType(...resourceType: string[]) { }; } -export function getNormalizedConstructorByType(resourceType: string) { +export function getNormalizedConstructorByType(resourceType: ResourceType) { return resourceTypeForObjectMap.get(resourceType); } diff --git a/src/app/core/shared/resource-type.ts b/src/app/core/shared/resource-type.ts index c4eeb7a27d..47c59b95dc 100644 --- a/src/app/core/shared/resource-type.ts +++ b/src/app/core/shared/resource-type.ts @@ -21,5 +21,6 @@ export enum ResourceType { SubmissionSections = 'submissionsections', SubmissionSection = 'submissionsection', AuthStatus = 'status', - Authority = 'authority' + Authority = 'authority', + BrowseEntry = 'browseEntry', } diff --git a/src/app/core/submission/submission-response-parsing.service.ts b/src/app/core/submission/submission-response-parsing.service.ts index 20dfb43cbd..494e4db46b 100644 --- a/src/app/core/submission/submission-response-parsing.service.ts +++ b/src/app/core/submission/submission-response-parsing.service.ts @@ -15,7 +15,6 @@ import { NormalizedWorkspaceItem } from './models/normalized-workspaceitem.model import { NormalizedWorkflowItem } from './models/normalized-workflowitem.model'; import { FormFieldMetadataValueObject } from '../../shared/form/builder/models/form-field-metadata-value.model'; import { SubmissionObject } from './models/submission-object.model'; -import { NormalizedObjectFactory } from '../cache/models/normalized-object-factory'; /** * Export a function to check if object has same properties of FormFieldMetadataValueObject @@ -75,7 +74,6 @@ export function normalizeSectionData(obj: any) { @Injectable() export class SubmissionResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - protected objectFactory = NormalizedObjectFactory; protected toCache = false; constructor(@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig, @@ -94,7 +92,7 @@ export class SubmissionResponseParsingService extends BaseResponseParsingService if (isNotEmpty(data.payload) && isNotEmpty(data.payload._links) && (data.statusCode === 201 || data.statusCode === 200)) { - const dataDefinition = this.processResponse(data.payload, request.href); + const dataDefinition = this.processResponse(data.payload, request.href); return new SubmissionSuccessResponse(dataDefinition, data.statusCode, data.statusText, this.processPageInfo(data.payload)); } else if (isEmpty(data.payload) && data.statusCode === 204) { // Response from a DELETE request @@ -116,8 +114,8 @@ export class SubmissionResponseParsingService extends BaseResponseParsingService * @param {string} requestHref * @returns {any[]} */ - protected processResponse(data: any, requestHref: string): any[] { - const dataDefinition = this.process(data, requestHref); + protected processResponse(data: any, requestHref: string): any[] { + const dataDefinition = this.process(data, requestHref); const normalizedDefinition = Array.of(); const processedList = Array.isArray(dataDefinition) ? dataDefinition : Array.of(dataDefinition); From b2ceb8e9d6d32a5b4f336445c5cb3b70fd5de168 Mon Sep 17 00:00:00 2001 From: lotte Date: Mon, 29 Apr 2019 16:21:36 +0200 Subject: [PATCH 04/38] 61949: finished refactoring, adding type doc --- .../metadata-registry.reducers.spec.ts | 4 +- .../metadata-schema-form.component.spec.ts | 2 +- .../metadata-field-form.component.spec.ts | 4 +- .../metadata-schema.component.spec.ts | 2 +- .../browse-by-metadata-page.component.spec.ts | 15 +-- .../edit-in-place-field.component.spec.ts | 4 +- .../item-metadata.component.spec.ts | 4 +- src/app/core/auth/auth.service.spec.ts | 2 +- src/app/core/auth/models/auth-status.model.ts | 37 ++++++- .../models/normalized-auth-status.model.ts | 13 ++- .../builders/remote-data-build.service.ts | 6 +- .../cache/models/normalized-object.model.ts | 2 +- .../core/cache/object-cache.reducer.spec.ts | 14 ++- src/app/core/cache/object-cache.reducer.ts | 5 +- src/app/core/cache/object-cache.service.ts | 6 +- .../config/config-response-parsing.service.ts | 4 +- src/app/core/config/models/config.model.ts | 4 +- .../config/models/normalized-config.model.ts | 2 +- src/app/core/core.module.ts | 77 +++++++++++---- src/app/core/data/data.service.ts | 4 +- .../core/data/metadata-schema-data.service.ts | 2 +- .../data/metadataschema-parsing.service.ts | 2 +- src/app/core/data/request.effects.ts | 4 +- src/app/core/metadata/metadata-field.model.ts | 32 ++++++ .../core/metadata/metadata-schema.model.ts | 21 ++++ .../normalized-metadata-field.model.ts | 28 ++++++ .../normalized-metadata-schema.model.ts | 6 ++ .../registry-metadatafields-response.model.ts | 14 ++- .../core/registry/registry.service.spec.ts | 25 +++-- src/app/core/registry/registry.service.ts | 98 ++++++++++++++++--- src/app/core/shared/bitstream-format.model.ts | 2 +- src/app/core/shared/browse-entry.model.ts | 23 ++++- src/app/core/shared/dspace-object.model.ts | 2 +- src/app/core/shared/resource-policy.model.ts | 5 +- .../core/shared/resource-type.decorator.ts | 18 +++- .../submission-response-parsing.service.ts | 1 - .../submission/workspaceitem-data.service.ts | 6 +- .../submission-upload-files.component.ts | 4 +- src/modules/app/browser-app.module.ts | 1 - 39 files changed, 397 insertions(+), 108 deletions(-) diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts b/src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts index f23c12c109..2f7d606c60 100644 --- a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts +++ b/src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts @@ -7,8 +7,8 @@ import { MetadataRegistrySelectSchemaAction } from './metadata-registry.actions'; import { metadataRegistryReducer, MetadataRegistryState } from './metadata-registry.reducers'; -import { MetadataSchema } from '../../../core/metadata/metadataschema.model'; -import { MetadataField } from '../../../core/metadata/metadatafield.model'; +import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; +import { MetadataField } from '../../../core/metadata/metadata-field.model'; class NullAction extends MetadataRegistryEditSchemaAction { type = null; diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts b/src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts index 42b6d1f133..fb76035d4b 100644 --- a/src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts +++ b/src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts @@ -10,7 +10,7 @@ import { EnumKeysPipe } from '../../../../shared/utils/enum-keys-pipe'; import { RegistryService } from '../../../../core/registry/registry.service'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; import { of as observableOf } from 'rxjs/internal/observable/of'; -import { MetadataSchema } from '../../../../core/metadata/metadataschema.model'; +import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; describe('MetadataSchemaFormComponent', () => { let component: MetadataSchemaFormComponent; diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts b/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts index 4364b0234a..45df65ebe5 100644 --- a/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts +++ b/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts @@ -3,7 +3,6 @@ import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing' import { MetadataFieldFormComponent } from './metadata-field-form.component'; import { RegistryService } from '../../../../core/registry/registry.service'; import { of as observableOf } from 'rxjs/internal/observable/of'; -import { MetadataField } from '../../../../core/metadata/metadatafield.model'; import { CommonModule } from '@angular/common'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; @@ -11,7 +10,8 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { EnumKeysPipe } from '../../../../shared/utils/enum-keys-pipe'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { MetadataSchema } from '../../../../core/metadata/metadataschema.model'; +import { MetadataField } from '../../../../core/metadata/metadata-field.model'; +import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; describe('MetadataFieldFormComponent', () => { let component: MetadataFieldFormComponent; diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts b/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts index 674798848b..9cec4475ea 100644 --- a/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts +++ b/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts @@ -3,7 +3,6 @@ import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing' import { of as observableOf } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; import { PaginatedList } from '../../../core/data/paginated-list'; -import { MetadataSchema } from '../../../core/metadata/metadataschema.model'; import { TranslateModule } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; import { ActivatedRoute, Router } from '@angular/router'; @@ -21,6 +20,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub'; import { RestResponse } from '../../../core/cache/response.models'; +import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; describe('MetadataSchemaComponent', () => { let comp: MetadataSchemaComponent; diff --git a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts b/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts index 98d7299984..26a4ff8fd5 100644 --- a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts +++ b/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts @@ -20,6 +20,7 @@ import { Item } from '../../core/shared/item.model'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { Community } from '../../core/shared/community.model'; import { MockRouter } from '../../shared/mocks/mock-router'; +import { ResourceType } from '../../core/shared/resource-type'; describe('BrowseByMetadataPageComponent', () => { let comp: BrowseByMetadataPageComponent; @@ -39,21 +40,21 @@ describe('BrowseByMetadataPageComponent', () => { const mockEntries = [ { - type: 'author', + type: ResourceType.BrowseEntry, authority: null, value: 'John Doe', language: 'en', count: 1 }, { - type: 'author', + type: ResourceType.BrowseEntry, authority: null, value: 'James Doe', language: 'en', count: 3 }, { - type: 'subject', + type: ResourceType.BrowseEntry, authority: null, value: 'Fake subject', language: 'en', @@ -68,7 +69,7 @@ describe('BrowseByMetadataPageComponent', () => { ]; const mockBrowseService = { - getBrowseEntriesFor: (options: BrowseEntrySearchOptions) => toRemoteData(mockEntries.filter((entry) => entry.type === options.metadataDefinition)), + getBrowseEntriesFor: (options: BrowseEntrySearchOptions) => toRemoteData(mockEntries), getBrowseItemsFor: (value: string, options: BrowseEntrySearchOptions) => toRemoteData(mockItems) }; @@ -105,12 +106,6 @@ describe('BrowseByMetadataPageComponent', () => { fixture.detectChanges(); }); - it('should fetch the correct entries depending on the metadata definition', () => { - comp.browseEntries$.subscribe((result) => { - expect(result.payload.page).toEqual(mockEntries.filter((entry) => entry.type === 'author')); - }); - }); - it('should not fetch any items when no value is provided', () => { expect(comp.items$).toBeUndefined(); }); diff --git a/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts b/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts index 09363b9964..bd1a4e5545 100644 --- a/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts @@ -6,17 +6,17 @@ import { ObjectUpdatesService } from '../../../../core/data/object-updates/objec import { of as observableOf } from 'rxjs'; import { RemoteData } from '../../../../core/data/remote-data'; import { PaginatedList } from '../../../../core/data/paginated-list'; -import { MetadataField } from '../../../../core/metadata/metadatafield.model'; import { By } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { SharedModule } from '../../../../shared/shared.module'; import { getTestScheduler } from 'jasmine-marbles'; import { InputSuggestion } from '../../../../shared/input-suggestions/input-suggestions.model'; import { TestScheduler } from 'rxjs/testing'; -import { MetadataSchema } from '../../../../core/metadata/metadataschema.model'; import { FieldChangeType } from '../../../../core/data/object-updates/object-updates.actions'; import { TranslateModule } from '@ngx-translate/core'; import { MetadatumViewModel } from '../../../../core/shared/metadata.models'; +import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; +import { MetadataField } from '../../../../core/metadata/metadata-field.model'; let comp: EditInPlaceFieldComponent; let fixture: ComponentFixture; diff --git a/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.spec.ts b/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.spec.ts index f2cd74fc2f..90008f3d72 100644 --- a/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.spec.ts @@ -24,9 +24,9 @@ import { RemoteData } from '../../../core/data/remote-data'; import { MetadatumViewModel } from '../../../core/shared/metadata.models'; import { RegistryService } from '../../../core/registry/registry.service'; import { PaginatedList } from '../../../core/data/paginated-list'; -import { MetadataSchema } from '../../../core/metadata/metadataschema.model'; -import { MetadataField } from '../../../core/metadata/metadatafield.model'; import { Metadata } from '../../../core/shared/metadata.utils'; +import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; +import { MetadataField } from '../../../core/metadata/metadata-field.model'; let comp: ItemMetadataComponent; let fixture: ComponentFixture; diff --git a/src/app/core/auth/auth.service.spec.ts b/src/app/core/auth/auth.service.spec.ts index ebb4026265..e766a45e48 100644 --- a/src/app/core/auth/auth.service.spec.ts +++ b/src/app/core/auth/auth.service.spec.ts @@ -43,7 +43,7 @@ describe('AuthService test', () => { pipe: observableOf(true) }); window = new NativeWindowRef(); - routerStub = new RouterStub() + routerStub = new RouterStub(); token = new AuthTokenInfo('test_token'); token.expires = Date.now() + (1000 * 60 * 60); authenticatedState = { diff --git a/src/app/core/auth/models/auth-status.model.ts b/src/app/core/auth/models/auth-status.model.ts index 40ca71aa1b..5349a574af 100644 --- a/src/app/core/auth/models/auth-status.model.ts +++ b/src/app/core/auth/models/auth-status.model.ts @@ -3,25 +3,56 @@ import { AuthTokenInfo } from './auth-token-info.model'; import { EPerson } from '../../eperson/models/eperson.model'; import { RemoteData } from '../../data/remote-data'; import { Observable } from 'rxjs'; -import { CacheableObject, TypedObject } from '../../cache/object-cache.reducer'; +import { CacheableObject } from '../../cache/object-cache.reducer'; import { ResourceType } from '../../shared/resource-type'; -export class AuthStatus implements CacheableObject, TypedObject { - +/** + * Object that represents the authenticated status of a user + */ +export class AuthStatus implements CacheableObject { + /** + * The unique identifier of this auth status + */ id: string; + /** + * The unique uuid of this auth status + */ + uuid: string; + + /** + * True if REST API is up and running, should never return false + */ okay: boolean; + /** + * If the auth status represents an authenticated state + */ authenticated: boolean; + /** + * Authentication error if there was one for this status + */ error?: AuthError; + /** + * The eperson of this auth status + */ eperson: Observable>; + /** + * True if the token is valid, false if there was no token or the token wasn't valid + */ token?: AuthTokenInfo; + /** + * The self link of this auth status' REST object + */ self: string; + /** + * The resource object of this auth status + */ type: ResourceType; } diff --git a/src/app/core/auth/models/normalized-auth-status.model.ts b/src/app/core/auth/models/normalized-auth-status.model.ts index 50956935ef..7693e330a2 100644 --- a/src/app/core/auth/models/normalized-auth-status.model.ts +++ b/src/app/core/auth/models/normalized-auth-status.model.ts @@ -10,9 +10,15 @@ import { resourceType } from '../../shared/resource-type.decorator'; @inheritSerialization(NormalizedObject) @resourceType(ResourceType.AuthStatus) export class NormalizedAuthStatus extends NormalizedObject { + /** + * The unique identifier of this auth status + */ @autoserialize id: string; + /** + * The unique generated uuid of this auth status + */ @autoserializeAs(new IDToUUIDSerializer('auth-status'), 'id') uuid: string; @@ -28,11 +34,16 @@ export class NormalizedAuthStatus extends NormalizedObject { @autoserialize authenticated: boolean; + /** + * The self link to the eperson of this auth status + */ @relationship(ResourceType.EPerson, false) @autoserialize eperson: string; - + /** + * The resource object of this auth status + */ @autoserialize type: ResourceType; } diff --git a/src/app/core/cache/builders/remote-data-build.service.ts b/src/app/core/cache/builders/remote-data-build.service.ts index 18687e254d..6b8034bafd 100644 --- a/src/app/core/cache/builders/remote-data-build.service.ts +++ b/src/app/core/cache/builders/remote-data-build.service.ts @@ -29,7 +29,7 @@ export class RemoteDataBuildService { protected requestService: RequestService) { } - buildSingle(href$: string | Observable): Observable> { + buildSingle(href$: string | Observable): Observable> { if (typeof href$ === 'string') { href$ = observableOf(href$); } @@ -107,7 +107,7 @@ export class RemoteDataBuildService { ); } - buildList(href$: string | Observable): Observable>> { + buildList(href$: string | Observable): Observable>> { if (typeof href$ === 'string') { href$ = observableOf(href$); } @@ -149,7 +149,7 @@ export class RemoteDataBuildService { return this.toRemoteDataObservable(requestEntry$, payload$); } - build(normalized: NormalizedObject): T { + build(normalized: NormalizedObject): T { const links: any = {}; const relationships = getRelationships(normalized.constructor) || []; diff --git a/src/app/core/cache/models/normalized-object.model.ts b/src/app/core/cache/models/normalized-object.model.ts index a80da98cca..ee758d984d 100644 --- a/src/app/core/cache/models/normalized-object.model.ts +++ b/src/app/core/cache/models/normalized-object.model.ts @@ -4,7 +4,7 @@ import { ResourceType } from '../../shared/resource-type'; /** * An abstract model class for a NormalizedObject. */ -export abstract class NormalizedObject implements CacheableObject, TypedObject { +export abstract class NormalizedObject implements CacheableObject { /** * The link to the rest endpoint where this object can be found diff --git a/src/app/core/cache/object-cache.reducer.spec.ts b/src/app/core/cache/object-cache.reducer.spec.ts index efa28d7249..4d4f5c745b 100644 --- a/src/app/core/cache/object-cache.reducer.spec.ts +++ b/src/app/core/cache/object-cache.reducer.spec.ts @@ -9,6 +9,7 @@ import { ResetObjectCacheTimestampsAction } from './object-cache.actions'; import { Operation } from 'fast-json-patch'; +import { ResourceType } from '../shared/resource-type'; class NullAction extends RemoveFromObjectCacheAction { type = null; @@ -28,6 +29,7 @@ describe('objectCacheReducer', () => { const testState = { [selfLink1]: { data: { + type: ResourceType.Item, self: selfLink1, foo: 'bar' }, @@ -39,6 +41,7 @@ describe('objectCacheReducer', () => { }, [selfLink2]: { data: { + type: ResourceType.Item, self: requestUUID2, foo: 'baz' }, @@ -67,7 +70,7 @@ describe('objectCacheReducer', () => { it('should add the payload to the cache in response to an ADD action', () => { const state = Object.create(null); - const objectToCache = { self: selfLink1 }; + const objectToCache = { self: selfLink1, type: ResourceType.Item }; const timeAdded = new Date().getTime(); const msToLive = 900000; const requestUUID = requestUUID1; @@ -80,7 +83,12 @@ describe('objectCacheReducer', () => { }); it('should overwrite an object in the cache in response to an ADD action if it already exists', () => { - const objectToCache = { self: selfLink1, foo: 'baz', somethingElse: true }; + const objectToCache = { + self: selfLink1, + foo: 'baz', + somethingElse: true, + type: ResourceType.Item + }; const timeAdded = new Date().getTime(); const msToLive = 900000; const requestUUID = requestUUID1; @@ -95,7 +103,7 @@ describe('objectCacheReducer', () => { it('should perform the ADD action without affecting the previous state', () => { const state = Object.create(null); - const objectToCache = { self: selfLink1 }; + const objectToCache = { self: selfLink1, type: ResourceType.Item }; const timeAdded = new Date().getTime(); const msToLive = 900000; const requestUUID = requestUUID1; diff --git a/src/app/core/cache/object-cache.reducer.ts b/src/app/core/cache/object-cache.reducer.ts index 97a48af1c1..9529fb2890 100644 --- a/src/app/core/cache/object-cache.reducer.ts +++ b/src/app/core/cache/object-cache.reducer.ts @@ -35,12 +35,13 @@ export interface Patch { export interface TypedObject { type: ResourceType; } + /** * An interface to represent objects that can be cached * * A cacheable object should have a self link */ -export interface CacheableObject { +export interface CacheableObject extends TypedObject { uuid?: string; self: string; // isNew: boolean; @@ -50,8 +51,6 @@ export interface CacheableObject { // save(): void; } -// export type TypedCacheableObject = TypedObject & CacheableObject; - /** * An entry in the ObjectCache */ diff --git a/src/app/core/cache/object-cache.service.ts b/src/app/core/cache/object-cache.service.ts index 483de65b98..4b4eaca196 100644 --- a/src/app/core/cache/object-cache.service.ts +++ b/src/app/core/cache/object-cache.service.ts @@ -4,13 +4,12 @@ import { applyPatch, Operation } from 'fast-json-patch'; import { combineLatest as observableCombineLatest, Observable } from 'rxjs'; import { distinctUntilChanged, filter, map, mergeMap, take, } from 'rxjs/operators'; -import { hasNoValue, hasValue, isNotEmpty } from '../../shared/empty.util'; +import { hasNoValue, isNotEmpty } from '../../shared/empty.util'; import { CoreState } from '../core.reducers'; import { coreSelector } from '../core.selectors'; import { RestRequestMethod } from '../data/rest-request-method'; import { selfLinkFromUuidSelector } from '../index/index.selectors'; import { GenericConstructor } from '../shared/generic-constructor'; -import { NormalizedObjectFactory } from './models/normalized-object-factory'; import { NormalizedObject } from './models/normalized-object.model'; import { AddPatchObjectCacheAction, @@ -21,6 +20,7 @@ import { import { CacheableObject, ObjectCacheEntry, ObjectCacheState } from './object-cache.reducer'; import { AddToSSBAction } from './server-sync-buffer.actions'; +import { getNormalizedConstructorByType } from '../shared/resource-type.decorator'; /** * The base selector function to select the object cache in the store @@ -109,7 +109,7 @@ export class ObjectCacheService { } ), map((entry: ObjectCacheEntry) => { - const type: GenericConstructor> = NormalizedObjectFactory.getConstructor(entry.data.type); + const type: GenericConstructor> = getNormalizedConstructorByType(entry.data.type); return Object.assign(new type(), entry.data) as NormalizedObject }) ); diff --git a/src/app/core/config/config-response-parsing.service.ts b/src/app/core/config/config-response-parsing.service.ts index de85b911bd..08fe581406 100644 --- a/src/app/core/config/config-response-parsing.service.ts +++ b/src/app/core/config/config-response-parsing.service.ts @@ -5,10 +5,8 @@ import { RestRequest } from '../data/request.models'; import { DSpaceRESTV2Response } from '../dspace-rest-v2/dspace-rest-v2-response.model'; import { ConfigSuccessResponse, ErrorResponse, RestResponse } from '../cache/response.models'; import { isNotEmpty } from '../../shared/empty.util'; -import { ConfigObjectFactory } from './models/config-object-factory'; import { ConfigObject } from './models/config.model'; -import { ConfigType } from './models/config-type'; import { BaseResponseParsingService } from '../data/base-response-parsing.service'; import { GLOBAL_CONFIG } from '../../../config'; import { GlobalConfig } from '../../../config/global-config.interface'; @@ -26,7 +24,7 @@ export class ConfigResponseParsingService extends BaseResponseParsingService imp parse(request: RestRequest, data: DSpaceRESTV2Response): RestResponse { if (isNotEmpty(data.payload) && isNotEmpty(data.payload._links) && (data.statusCode === 201 || data.statusCode === 200)) { - const configDefinition = this.process(data.payload, request.uuid); + const configDefinition = this.process(data.payload, request.uuid); return new ConfigSuccessResponse(configDefinition, data.statusCode, data.statusText, this.processPageInfo(data.payload)); } else { return new ErrorResponse( diff --git a/src/app/core/config/models/config.model.ts b/src/app/core/config/models/config.model.ts index 2a7c3da882..81f20a0b3c 100644 --- a/src/app/core/config/models/config.model.ts +++ b/src/app/core/config/models/config.model.ts @@ -1,7 +1,7 @@ -import { CacheableObject, TypedObject } from '../../cache/object-cache.reducer'; +import { CacheableObject } from '../../cache/object-cache.reducer'; import { ResourceType } from '../../shared/resource-type'; -export abstract class ConfigObject implements CacheableObject, TypedObject { +export abstract class ConfigObject implements CacheableObject { /** * The name for this configuration diff --git a/src/app/core/config/models/normalized-config.model.ts b/src/app/core/config/models/normalized-config.model.ts index c463cd8b08..d10be2d1c3 100644 --- a/src/app/core/config/models/normalized-config.model.ts +++ b/src/app/core/config/models/normalized-config.model.ts @@ -7,7 +7,7 @@ import { ResourceType } from '../../shared/resource-type'; * Normalized abstract class for a configuration object */ @inheritSerialization(NormalizedObject) -export abstract class NormalizedConfigObject implements CacheableObject, TypedObject { +export abstract class NormalizedConfigObject implements CacheableObject { /** * The name for this configuration diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 2ca5af0294..ef6f508226 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -1,14 +1,13 @@ -import { - ModuleWithProviders, - NgModule, - Optional, - SkipSelf -} from '@angular/core'; +import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core'; import { CommonModule } from '@angular/common'; import { StoreModule } from '@ngrx/store'; import { EffectsModule } from '@ngrx/effects'; -import { DynamicFormLayoutService, DynamicFormService, DynamicFormValidationService } from '@ng-dynamic-forms/core'; +import { + DynamicFormLayoutService, + DynamicFormService, + DynamicFormValidationService +} from '@ng-dynamic-forms/core'; import { coreEffects } from './core.effects'; import { coreReducers } from './core.reducers'; @@ -80,6 +79,27 @@ import { DSOChangeAnalyzer } from './data/dso-change-analyzer.service'; import { ObjectUpdatesService } from './data/object-updates/object-updates.service'; import { DefaultChangeAnalyzer } from './data/default-change-analyzer.service'; import { SearchService } from '../+search-page/search-service/search.service'; +import { NormalizedCollection } from './cache/models/normalized-collection.model'; +import { NormalizedCommunity } from './cache/models/normalized-community.model'; +import { NormalizedDSpaceObject } from './cache/models/normalized-dspace-object.model'; +import { NormalizedBitstream } from './cache/models/normalized-bitstream.model'; +import { NormalizedBundle } from './cache/models/normalized-bundle.model'; +import { NormalizedBitstreamFormat } from './cache/models/normalized-bitstream-format.model'; +import { NormalizedItem } from './cache/models/normalized-item.model'; +import { NormalizedEPerson } from './eperson/models/normalized-eperson.model'; +import { NormalizedGroup } from './eperson/models/normalized-group.model'; +import { NormalizedResourcePolicy } from './cache/models/normalized-resource-policy.model'; +import { NormalizedMetadataSchema } from './metadata/normalized-metadata-schema.model'; +import { NormalizedMetadataField } from './metadata/normalized-metadata-field.model'; +import { NormalizedLicense } from './cache/models/normalized-license.model'; +import { NormalizedWorkflowItem } from './submission/models/normalized-workflowitem.model'; +import { NormalizedWorkspaceItem } from './submission/models/normalized-workspaceitem.model'; +import { NormalizedSubmissionDefinitionsModel } from './config/models/normalized-config-submission-definitions.model'; +import { NormalizedSubmissionFormsModel } from './config/models/normalized-config-submission-forms.model'; +import { NormalizedSubmissionSectionModel } from './config/models/normalized-config-submission-section.model'; +import { NormalizedAuthStatus } from './auth/models/normalized-auth-status.model'; +import { NormalizedAuthorityValue } from './integration/models/normalized-authority-value.model'; +import { BrowseEntry } from './shared/browse-entry.model'; const IMPORTS = [ CommonModule, @@ -87,13 +107,9 @@ const IMPORTS = [ EffectsModule.forFeature(coreEffects) ]; -const DECLARATIONS = [ +const DECLARATIONS = []; -]; - -const EXPORTS = [ - -]; +const EXPORTS = []; const PROVIDERS = [ ApiService, @@ -169,9 +185,37 @@ const PROVIDERS = [ multi: true }, NotificationsService, - { provide: NativeWindowService, useFactory: NativeWindowFactory } + { provide: NativeWindowService, useFactory: NativeWindowFactory }, ]; +/** + * Declaration needed to make sure all decorator functions are called in time + */ +export const normalizedModels = + [ + NormalizedDSpaceObject, + NormalizedBundle, + NormalizedBitstream, + NormalizedBitstreamFormat, + NormalizedItem, + NormalizedCollection, + NormalizedCommunity, + NormalizedEPerson, + NormalizedGroup, + NormalizedResourcePolicy, + NormalizedMetadataSchema, + NormalizedMetadataField, + NormalizedLicense, + NormalizedWorkflowItem, + NormalizedWorkspaceItem, + NormalizedSubmissionDefinitionsModel, + NormalizedSubmissionFormsModel, + NormalizedSubmissionSectionModel, + NormalizedAuthStatus, + NormalizedAuthorityValue, + BrowseEntry + ]; + @NgModule({ imports: [ ...IMPORTS @@ -186,8 +230,8 @@ const PROVIDERS = [ ...PROVIDERS ] }) -export class CoreModule { +export class CoreModule { static forRoot(): ModuleWithProviders { return { ngModule: CoreModule, @@ -197,10 +241,9 @@ export class CoreModule { }; } - constructor( @Optional() @SkipSelf() parentModule: CoreModule) { + constructor(@Optional() @SkipSelf() parentModule: CoreModule) { if (isNotEmpty(parentModule)) { throw new Error('CoreModule is already loaded. Import it in the AppModule only'); } } - } diff --git a/src/app/core/data/data.service.ts b/src/app/core/data/data.service.ts index fc4da69a5c..7176756ed9 100644 --- a/src/app/core/data/data.service.ts +++ b/src/app/core/data/data.service.ts @@ -31,12 +31,12 @@ import { configureRequest, getResponseFromEntry } from '../shared/operators'; import { ErrorResponse, RestResponse } from '../cache/response.models'; import { NotificationOptions } from '../../shared/notifications/models/notification-options.model'; import { DSpaceRESTv2Serializer } from '../dspace-rest-v2/dspace-rest-v2.serializer'; -import { NormalizedObjectFactory } from '../cache/models/normalized-object-factory'; import { CacheableObject } from '../cache/object-cache.reducer'; import { RequestEntry } from './request.reducer'; import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service'; import { ChangeAnalyzer } from './change-analyzer'; import { RestRequestMethod } from './rest-request-method'; +import { getNormalizedConstructorByType } from '../shared/resource-type.decorator'; export abstract class DataService { protected abstract requestService: RequestService; @@ -243,7 +243,7 @@ export abstract class DataService { ); const normalizedObject: NormalizedObject = this.dataBuildService.normalize(dso); - const serializedDso = new DSpaceRESTv2Serializer(NormalizedObjectFactory.getConstructor(dso.type)).serialize(normalizedObject); + const serializedDso = new DSpaceRESTv2Serializer(getNormalizedConstructorByType(dso.type)).serialize(normalizedObject); const request$ = endpoint$.pipe( take(1), diff --git a/src/app/core/data/metadata-schema-data.service.ts b/src/app/core/data/metadata-schema-data.service.ts index 1d2bf3b221..33cf0f8c2e 100644 --- a/src/app/core/data/metadata-schema-data.service.ts +++ b/src/app/core/data/metadata-schema-data.service.ts @@ -9,11 +9,11 @@ import { RequestService } from './request.service'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { FindAllOptions } from './request.models'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { MetadataSchema } from '../metadata/metadataschema.model'; import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service'; import { HttpClient } from '@angular/common/http'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { DefaultChangeAnalyzer } from './default-change-analyzer.service'; +import { MetadataSchema } from '../metadata/metadata-schema.model'; /** * A service responsible for fetching/sending data from/to the REST API on the metadataschemas endpoint diff --git a/src/app/core/data/metadataschema-parsing.service.ts b/src/app/core/data/metadataschema-parsing.service.ts index f76d6ed2e3..3e9fd257bb 100644 --- a/src/app/core/data/metadataschema-parsing.service.ts +++ b/src/app/core/data/metadataschema-parsing.service.ts @@ -1,10 +1,10 @@ -import { MetadataSchema } from '../metadata/metadataschema.model'; import { DSpaceRESTv2Serializer } from '../dspace-rest-v2/dspace-rest-v2.serializer'; import { DSpaceRESTV2Response } from '../dspace-rest-v2/dspace-rest-v2-response.model'; import { RestRequest } from './request.models'; import { ResponseParsingService } from './parsing.service'; import { Injectable } from '@angular/core'; import { MetadataschemaSuccessResponse, RestResponse } from '../cache/response.models'; +import { MetadataSchema } from '../metadata/metadata-schema.model'; @Injectable() export class MetadataschemaParsingService implements ResponseParsingService { diff --git a/src/app/core/data/request.effects.ts b/src/app/core/data/request.effects.ts index 5e7bec698b..c85c9a9ff1 100644 --- a/src/app/core/data/request.effects.ts +++ b/src/app/core/data/request.effects.ts @@ -17,10 +17,10 @@ import { RequestError, RestRequest } from './request.models'; import { RequestEntry } from './request.reducer'; import { RequestService } from './request.service'; import { DSpaceRESTv2Serializer } from '../dspace-rest-v2/dspace-rest-v2.serializer'; -import { NormalizedObjectFactory } from '../cache/models/normalized-object-factory'; import { catchError, filter, flatMap, map, take, tap } from 'rxjs/operators'; import { ErrorResponse, RestResponse } from '../cache/response.models'; import { StoreActionTypes } from '../../store.actions'; +import { getNormalizedConstructorByType } from '../shared/resource-type.decorator'; export const addToResponseCacheAndCompleteAction = (request: RestRequest, envConfig: GlobalConfig) => (source: Observable): Observable => @@ -45,7 +45,7 @@ export class RequestEffects { flatMap((request: RestRequest) => { let body; if (isNotEmpty(request.body)) { - const serializer = new DSpaceRESTv2Serializer(NormalizedObjectFactory.getConstructor(request.body.type)); + const serializer = new DSpaceRESTv2Serializer(getNormalizedConstructorByType(request.body.type)); body = serializer.serialize(request.body); } return this.restApi.request(request.method, request.href, body, request.options).pipe( diff --git a/src/app/core/metadata/metadata-field.model.ts b/src/app/core/metadata/metadata-field.model.ts index f773ff8b49..a79e63cd14 100644 --- a/src/app/core/metadata/metadata-field.model.ts +++ b/src/app/core/metadata/metadata-field.model.ts @@ -1,20 +1,52 @@ import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; import { isNotEmpty } from '../../shared/empty.util'; import { MetadataSchema } from './metadata-schema.model'; +import { ResourceType } from '../shared/resource-type'; +/** + * Class the represents a metadata field + */ export class MetadataField implements ListableObject { + + /** + * The identifier of this metadata field + */ id: number; + /** + * The self link of this metadata field + */ self: string; + /** + * The element of this metadata field + */ element: string; + /** + * The qualifier of this metadata field + */ qualifier: string; + /** + * The scope note of this metadata field + */ scopeNote: string; + /** + * The metadata schema object of this metadata field + */ schema: MetadataSchema; + /** + * The resource type of this metadata field + */ + type: ResourceType; + + /** + * Method to print this metadata field as a string + * @param separator The separator between the schema, element and qualifier in the string + */ toString(separator: string = '.'): string { let key = this.schema.prefix + separator + this.element; if (isNotEmpty(this.qualifier)) { diff --git a/src/app/core/metadata/metadata-schema.model.ts b/src/app/core/metadata/metadata-schema.model.ts index d141f56e2c..5d3ce4988b 100644 --- a/src/app/core/metadata/metadata-schema.model.ts +++ b/src/app/core/metadata/metadata-schema.model.ts @@ -1,11 +1,32 @@ import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; +import { ResourceType } from '../shared/resource-type'; +/** + * Class that represents a metadata schema + */ export class MetadataSchema implements ListableObject { + /** + * The unique identifier for this metadata schema + */ id: number; + /** + * The REST link to itself + */ self: string; + /** + * A unique prefix that defines this schema + */ prefix: string; + /** + * The namespace of this metadata schema + */ namespace: string; + + /** + * The resource type of this metadata schema + */ + type: ResourceType; } diff --git a/src/app/core/metadata/normalized-metadata-field.model.ts b/src/app/core/metadata/normalized-metadata-field.model.ts index 29a3376532..ba9e5b3b2a 100644 --- a/src/app/core/metadata/normalized-metadata-field.model.ts +++ b/src/app/core/metadata/normalized-metadata-field.model.ts @@ -6,25 +6,53 @@ import { MetadataField } from './metadata-field.model'; import { NormalizedObject } from '../cache/models/normalized-object.model'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; +/** + * Class the represents a normalized metadata field + */ @mapsTo(MetadataField) @resourceType(ResourceType.MetadataField) export class NormalizedMetadataField extends NormalizedObject implements ListableObject { + + /** + * The identifier of this normalized metadata field + */ @autoserialize id: number; + /** + * The self link of this normalized metadata field + */ @autoserialize self: string; + /** + * The element of this normalized metadata field + */ @autoserialize element: string; + /** + * The qualifier of this normalized metadata field + */ @autoserialize qualifier: string; + /** + * The scope note of this normalized metadata field + */ @autoserialize scopeNote: string; + /** + * The link to the metadata schema of this normalized metadata field + */ @deserialize @relationship(ResourceType.MetadataSchema) schema: string; + + /** + * The resource type of this normalized metadata field + */ + @autoserialize + type: ResourceType; } diff --git a/src/app/core/metadata/normalized-metadata-schema.model.ts b/src/app/core/metadata/normalized-metadata-schema.model.ts index aa6eb6a50a..b1ea78b225 100644 --- a/src/app/core/metadata/normalized-metadata-schema.model.ts +++ b/src/app/core/metadata/normalized-metadata-schema.model.ts @@ -35,4 +35,10 @@ export class NormalizedMetadataSchema extends NormalizedObject i */ @autoserialize namespace: string; + + /** + * The resource type of this metadata schema + */ + @autoserialize + type: ResourceType; } diff --git a/src/app/core/registry/registry-metadatafields-response.model.ts b/src/app/core/registry/registry-metadatafields-response.model.ts index 19ec537dfb..f4b6f46d17 100644 --- a/src/app/core/registry/registry-metadatafields-response.model.ts +++ b/src/app/core/registry/registry-metadatafields-response.model.ts @@ -1,14 +1,26 @@ import { PageInfo } from '../shared/page-info.model'; import { autoserialize, autoserializeAs } from 'cerialize'; -import { MetadataField } from '../metadata/metadatafield.model'; +import { MetadataField } from '../metadata/metadata-field.model'; +/** + * Class that represents a response with a registry's metadata fields + */ export class RegistryMetadatafieldsResponse { + /** + * List of metadata fields in the response + */ @autoserializeAs(MetadataField) metadatafields: MetadataField[]; + /** + * Page info of this response + */ @autoserialize page: PageInfo; + /** + * The REST link to this response + */ @autoserialize self: string; } diff --git a/src/app/core/registry/registry.service.spec.ts b/src/app/core/registry/registry.service.spec.ts index 8274ceef60..5517b41ed0 100644 --- a/src/app/core/registry/registry.service.spec.ts +++ b/src/app/core/registry/registry.service.spec.ts @@ -39,8 +39,9 @@ import { MetadataRegistrySelectFieldAction, MetadataRegistrySelectSchemaAction } from '../../+admin/admin-registries/metadata-registry/metadata-registry.actions'; -import { MetadataSchema } from '../metadata/metadataschema.model'; -import { MetadataField } from '../metadata/metadatafield.model'; +import { ResourceType } from '../shared/resource-type'; +import { MetadataSchema } from '../metadata/metadata-schema.model'; +import { MetadataField } from '../metadata/metadata-field.model'; @Component({ template: '' }) class DummyComponent { @@ -59,13 +60,15 @@ describe('RegistryService', () => { id: 1, self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadataschemas/1', prefix: 'dc', - namespace: 'http://dublincore.org/documents/dcmi-terms/' - }, + namespace: 'http://dublincore.org/documents/dcmi-terms/', + type: ResourceType.MetadataSchema +}, { id: 2, self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadataschemas/2', prefix: 'mock', - namespace: 'http://dspace.org/mockschema' + namespace: 'http://dspace.org/mockschema', + type: ResourceType.MetadataSchema } ]; const mockFieldsList = [ @@ -75,7 +78,8 @@ describe('RegistryService', () => { element: 'contributor', qualifier: 'advisor', scopeNote: null, - schema: mockSchemasList[0] + schema: mockSchemasList[0], + type: ResourceType.MetadataField }, { id: 2, @@ -83,7 +87,8 @@ describe('RegistryService', () => { element: 'contributor', qualifier: 'author', scopeNote: null, - schema: mockSchemasList[0] + schema: mockSchemasList[0], + type: ResourceType.MetadataField }, { id: 3, @@ -91,7 +96,8 @@ describe('RegistryService', () => { element: 'contributor', qualifier: 'editor', scopeNote: 'test scope note', - schema: mockSchemasList[1] + schema: mockSchemasList[1], + type: ResourceType.MetadataField }, { id: 4, @@ -99,7 +105,8 @@ describe('RegistryService', () => { element: 'contributor', qualifier: 'illustrator', scopeNote: null, - schema: mockSchemasList[1] + schema: mockSchemasList[1], + type: ResourceType.MetadataField } ]; diff --git a/src/app/core/registry/registry.service.ts b/src/app/core/registry/registry.service.ts index 137b4c3a87..eb556f1db3 100644 --- a/src/app/core/registry/registry.service.ts +++ b/src/app/core/registry/registry.service.ts @@ -3,8 +3,6 @@ import { Injectable } from '@angular/core'; import { RemoteData } from '../data/remote-data'; import { PaginatedList } from '../data/paginated-list'; import { PageInfo } from '../shared/page-info.model'; -import { MetadataSchema } from '../metadata/metadataschema.model'; -import { MetadataField } from '../metadata/metadatafield.model'; import { BitstreamFormat } from './mock-bitstream-format.model'; import { CreateMetadataFieldRequest, @@ -56,7 +54,6 @@ import { } from '../../+admin/admin-registries/metadata-registry/metadata-registry.actions'; import { distinctUntilChanged, flatMap, map, switchMap, take, tap } from 'rxjs/operators'; import { DSpaceRESTv2Serializer } from '../dspace-rest-v2/dspace-rest-v2.serializer'; -import { NormalizedObjectFactory } from '../cache/models/normalized-object-factory'; import { ResourceType } from '../shared/resource-type'; import { NormalizedMetadataSchema } from '../metadata/normalized-metadata-schema.model'; import { NotificationsService } from '../../shared/notifications/notifications.service'; @@ -64,6 +61,9 @@ import { NotificationOptions } from '../../shared/notifications/models/notificat import { HttpOptions } from '../dspace-rest-v2/dspace-rest-v2.service'; import { HttpHeaders } from '@angular/common/http'; import { TranslateService } from '@ngx-translate/core'; +import { MetadataSchema } from '../metadata/metadata-schema.model'; +import { MetadataField } from '../metadata/metadata-field.model'; +import { getNormalizedConstructorByType } from '../shared/resource-type.decorator'; const metadataRegistryStateSelector = (state: AppState) => state.metadataRegistry; const editMetadataSchemaSelector = createSelector(metadataRegistryStateSelector, (metadataState: MetadataRegistryState) => metadataState.editSchema); @@ -71,6 +71,9 @@ const selectedMetadataSchemasSelector = createSelector(metadataRegistryStateSele const editMetadataFieldSelector = createSelector(metadataRegistryStateSelector, (metadataState: MetadataRegistryState) => metadataState.editField); const selectedMetadataFieldsSelector = createSelector(metadataRegistryStateSelector, (metadataState: MetadataRegistryState) => metadataState.selectedFields); +/** + * Service for registry related CRUD actions such as metadata schema, metadata field and bitstream format + */ @Injectable() export class RegistryService { @@ -87,6 +90,10 @@ export class RegistryService { } + /** + * Retrieves all metadata schemas + * @param pagination The pagination info used to retrieve the schemas + */ public getMetadataSchemas(pagination: PaginationComponentOptions): Observable>> { const requestObs = this.getMetadataSchemasRequestObs(pagination); @@ -117,6 +124,10 @@ export class RegistryService { return this.rdb.toRemoteDataObservable(requestEntryObs, payloadObs); } + /** + * Retrieves a metadata schema by its name + * @param schemaName The name of the schema to find + */ public getMetadataSchemaByName(schemaName: string): Observable> { // Temporary pagination to get ALL metadataschemas until there's a rest api endpoint for fetching a specific schema const pagination: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { @@ -142,6 +153,11 @@ export class RegistryService { return this.rdb.toRemoteDataObservable(requestEntryObs, metadataschemaObs); } + /** + * retrieves all metadata fields that belong to a certain metadata schema + * @param schema The schema to filter by + * @param pagination The pagination info used to retrieve the fields + */ public getMetadataFieldsBySchema(schema: MetadataSchema, pagination: PaginationComponentOptions): Observable>> { const requestObs = this.getMetadataFieldsBySchemaRequestObs(pagination, schema); @@ -215,6 +231,10 @@ export class RegistryService { return this.rdb.toRemoteDataObservable(requestEntryObs, payloadObs); } + /** + * Retrieves all bitstream formats + * @param pagination The pagination info used to retrieve the bitstream formats + */ public getBitstreamFormats(pagination: PaginationComponentOptions): Observable>> { const requestObs = this.getBitstreamFormatsRequestObs(pagination); @@ -245,7 +265,7 @@ export class RegistryService { return this.rdb.toRemoteDataObservable(requestEntryObs, payloadObs); } - public getMetadataSchemasRequestObs(pagination: PaginationComponentOptions): Observable { + private getMetadataSchemasRequestObs(pagination: PaginationComponentOptions): Observable { return this.halService.getEndpoint(this.metadataSchemasPath).pipe( map((url: string) => { const args: string[] = []; @@ -327,58 +347,101 @@ export class RegistryService { ); } + /** + * Method to start editing a metadata schema, dispatches an edit schema action + * @param schema The schema that's being edited + */ public editMetadataSchema(schema: MetadataSchema) { this.store.dispatch(new MetadataRegistryEditSchemaAction(schema)); } + /** + * Method to cancel editing a metadata schema, dispatches a cancel schema action + */ public cancelEditMetadataSchema() { this.store.dispatch(new MetadataRegistryCancelSchemaAction()); } + /** + * Method to retrieve the metadata schema that are currently being edited + */ public getActiveMetadataSchema(): Observable { return this.store.pipe(select(editMetadataSchemaSelector)); } + /** + * Method to select a metadata schema, dispatches a select schema action + * @param schema The schema that's being selected + */ public selectMetadataSchema(schema: MetadataSchema) { this.store.dispatch(new MetadataRegistrySelectSchemaAction(schema)) } + /** + * Method to deselect a metadata schema, dispatches a deselect schema action + * @param schema The schema that's it being deselected + */ public deselectMetadataSchema(schema: MetadataSchema) { this.store.dispatch(new MetadataRegistryDeselectSchemaAction(schema)) } + /** + * Method to deselect all currently selected metadata schema, dispatches a deselect all schema action + */ public deselectAllMetadataSchema() { this.store.dispatch(new MetadataRegistryDeselectAllSchemaAction()) } + /** + * Method to retrieve the metadata schemas that are currently selected + */ public getSelectedMetadataSchemas(): Observable { return this.store.pipe(select(selectedMetadataSchemasSelector)); } - + /** + * Method to start editing a metadata field, dispatches an edit field action + * @param field The field that's being edited + */ public editMetadataField(field: MetadataField) { this.store.dispatch(new MetadataRegistryEditFieldAction(field)); } + /** + * Method to cancel editing a metadata field, dispatches a cancel field action + */ public cancelEditMetadataField() { this.store.dispatch(new MetadataRegistryCancelFieldAction()); } - + /** + * Method to retrieve the metadata field that are currently being edited + */ public getActiveMetadataField(): Observable { return this.store.pipe(select(editMetadataFieldSelector)); } - + /** + * Method to select a metadata field, dispatches a select field action + * @param field The field that's being selected + */ public selectMetadataField(field: MetadataField) { this.store.dispatch(new MetadataRegistrySelectFieldAction(field)) } - + /** + * Method to deselect a metadata field, dispatches a deselect field action + * @param field The field that's it being deselected + */ public deselectMetadataField(field: MetadataField) { this.store.dispatch(new MetadataRegistryDeselectFieldAction(field)) } - + /** + * Method to deselect all currently selected metadata fields, dispatches a deselect all field action + */ public deselectAllMetadataField() { this.store.dispatch(new MetadataRegistryDeselectAllFieldAction()) } + /** + * Method to retrieve the metadata fields that are currently selected + */ public getSelectedMetadataFields(): Observable { return this.store.pipe(select(selectedMetadataFieldsSelector)); } @@ -400,7 +463,7 @@ export class RegistryService { distinctUntilChanged() ); - const serializedSchema = new DSpaceRESTv2Serializer(NormalizedObjectFactory.getConstructor(ResourceType.MetadataSchema)).serialize(schema as NormalizedMetadataSchema); + const serializedSchema = new DSpaceRESTv2Serializer(getNormalizedConstructorByType(ResourceType.MetadataSchema)).serialize(schema as NormalizedMetadataSchema); const request$ = endpoint$.pipe( take(1), @@ -444,10 +507,17 @@ export class RegistryService { ); } + /** + * Method to delete a metadata schema + * @param id The id of the metadata schema to delete + */ public deleteMetadataSchema(id: number): Observable { return this.delete(this.metadataSchemasPath, id); } + /** + * Method that clears a cached metadata schema request and returns its REST url + */ public clearMetadataSchemaRequests(): Observable { return this.halService.getEndpoint(this.metadataSchemasPath).pipe( tap((href: string) => this.requestService.removeByHrefSubstring(href)) @@ -514,10 +584,16 @@ export class RegistryService { ); } + /** + * Method to delete a metadata field + * @param id The id of the metadata field to delete + */ public deleteMetadataField(id: number): Observable { return this.delete(this.metadataFieldsPath, id); } - + /** + * Method that clears a cached metadata field request and returns its REST url + */ public clearMetadataFieldRequests(): Observable { return this.halService.getEndpoint(this.metadataFieldsPath).pipe( tap((href: string) => this.requestService.removeByHrefSubstring(href)) diff --git a/src/app/core/shared/bitstream-format.model.ts b/src/app/core/shared/bitstream-format.model.ts index c46df1724d..a532ea9e75 100644 --- a/src/app/core/shared/bitstream-format.model.ts +++ b/src/app/core/shared/bitstream-format.model.ts @@ -5,7 +5,7 @@ import { ResourceType } from './resource-type'; /** * Model class for a Bitstream Format */ -export class BitstreamFormat implements CacheableObject, TypedObject { +export class BitstreamFormat implements CacheableObject { /** * Short description of this Bitstream Format diff --git a/src/app/core/shared/browse-entry.model.ts b/src/app/core/shared/browse-entry.model.ts index 6f018cedde..3dbba0cdb8 100644 --- a/src/app/core/shared/browse-entry.model.ts +++ b/src/app/core/shared/browse-entry.model.ts @@ -2,24 +2,41 @@ import { autoserialize, autoserializeAs } from 'cerialize'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; import { ResourceType } from './resource-type'; import { resourceType } from './resource-type.decorator'; -import { CacheableObject, TypedObject } from '../cache/object-cache.reducer'; +import { TypedObject } from '../cache/object-cache.reducer'; +/** + * Class object representing a browse entry + * This class is not normalized because browse entries do not have self links + */ @resourceType(ResourceType.BrowseEntry) export class BrowseEntry implements ListableObject, TypedObject { - + /** + * The resource type of this browse entry + */ @autoserialize type: ResourceType; + /** + * The authority string of this browse entry + */ @autoserialize authority: string; + /** + * The value of this browse entry + */ @autoserialize value: string; + /** + * The language of the value of this browse entry + */ @autoserializeAs('valueLang') language: string; + /** + * The count of this browse entry + */ @autoserialize count: number; - } diff --git a/src/app/core/shared/dspace-object.model.ts b/src/app/core/shared/dspace-object.model.ts index 422e215c90..4aa0ba9695 100644 --- a/src/app/core/shared/dspace-object.model.ts +++ b/src/app/core/shared/dspace-object.model.ts @@ -11,7 +11,7 @@ import { ListableObject } from '../../shared/object-collection/shared/listable-o /** * An abstract model class for a DSpaceObject. */ -export class DSpaceObject implements CacheableObject, ListableObject, TypedObject { +export class DSpaceObject implements CacheableObject, ListableObject { private _name: string; diff --git a/src/app/core/shared/resource-policy.model.ts b/src/app/core/shared/resource-policy.model.ts index 21dcd44b01..950d7b92d7 100644 --- a/src/app/core/shared/resource-policy.model.ts +++ b/src/app/core/shared/resource-policy.model.ts @@ -1,12 +1,11 @@ -import { CacheableObject, TypedObject } from '../cache/object-cache.reducer'; +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, TypedObject { +export class ResourcePolicy implements CacheableObject { /** * The action that is allowed by this Resource Policy */ diff --git a/src/app/core/shared/resource-type.decorator.ts b/src/app/core/shared/resource-type.decorator.ts index 28b2c7cefe..76c7f34057 100644 --- a/src/app/core/shared/resource-type.decorator.ts +++ b/src/app/core/shared/resource-type.decorator.ts @@ -1,19 +1,27 @@ -import { CacheableObject, TypedObject } from '../cache/object-cache.reducer'; +import { TypedObject } from '../cache/object-cache.reducer'; import { GenericConstructor } from './generic-constructor'; import { ResourceType } from './resource-type'; const resourceTypeForObjectMap = new Map(); -export function resourceType(...resourceType: ResourceType[]) { +/** + * Decorator function to map resource types to their matching normalized model class constructor + * @param type The resource type used as a key in the map + */ +export function resourceType(...type: ResourceType[]) { return function decorator(objectConstructor: GenericConstructor) { if (!objectConstructor) { return; } - resourceType.forEach((rt: string) => resourceTypeForObjectMap.set(rt, objectConstructor) + type.forEach((rt: string) => resourceTypeForObjectMap.set(rt, objectConstructor) ) }; } -export function getNormalizedConstructorByType(resourceType: ResourceType) { - return resourceTypeForObjectMap.get(resourceType); +/** + * Method to retrieve the normalized model class constructor based on a resource type + * @param type The resource type to look for + */ +export function getNormalizedConstructorByType(type: ResourceType) { + return resourceTypeForObjectMap.get(type); } diff --git a/src/app/core/submission/submission-response-parsing.service.ts b/src/app/core/submission/submission-response-parsing.service.ts index 494e4db46b..deb8a814ce 100644 --- a/src/app/core/submission/submission-response-parsing.service.ts +++ b/src/app/core/submission/submission-response-parsing.service.ts @@ -10,7 +10,6 @@ import { BaseResponseParsingService } from '../data/base-response-parsing.servic import { GLOBAL_CONFIG } from '../../../config'; import { GlobalConfig } from '../../../config/global-config.interface'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { SubmissionResourceType } from './submission-resource-type'; import { NormalizedWorkspaceItem } from './models/normalized-workspaceitem.model'; import { NormalizedWorkflowItem } from './models/normalized-workflowitem.model'; import { FormFieldMetadataValueObject } from '../../shared/form/builder/models/form-field-metadata-value.model'; diff --git a/src/app/core/submission/workspaceitem-data.service.ts b/src/app/core/submission/workspaceitem-data.service.ts index 3bb3eb1ee8..de671d57c7 100644 --- a/src/app/core/submission/workspaceitem-data.service.ts +++ b/src/app/core/submission/workspaceitem-data.service.ts @@ -6,24 +6,24 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv import { CoreState } from '../core.reducers'; import { DataService } from '../data/data.service'; import { RequestService } from '../data/request.service'; -import { Workspaceitem } from './models/workspaceitem.model'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { FindAllOptions } from '../data/request.models'; import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { ObjectCacheService } from '../cache/object-cache.service'; import { DSOChangeAnalyzer } from '../data/dso-change-analyzer.service'; +import { WorkspaceItem } from './models/workspaceitem.model'; /** * A service that provides methods to make REST requests with workspaceitems endpoint. */ @Injectable() -export class WorkspaceitemDataService extends DataService { +export class WorkspaceitemDataService extends DataService { protected linkPath = 'workspaceitems'; protected forceBypassCache = true; constructor( - protected comparator: DSOChangeAnalyzer, + protected comparator: DSOChangeAnalyzer, protected dataBuildService: NormalizedObjectBuildService, protected halService: HALEndpointService, protected http: HttpClient, diff --git a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts index be3e6b5c8c..dfa1c58f9b 100644 --- a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts +++ b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts @@ -6,13 +6,13 @@ import { first } from 'rxjs/operators'; import { SectionsService } from '../../sections/sections.service'; import { hasValue, isEmpty, isNotEmpty } from '../../../shared/empty.util'; -import { Workspaceitem } from '../../../core/submission/models/workspaceitem.model'; import { normalizeSectionData } from '../../../core/submission/submission-response-parsing.service'; import { SubmissionService } from '../../submission.service'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { UploaderOptions } from '../../../shared/uploader/uploader-options.model'; import parseSectionErrors from '../../utils/parseSectionErrors'; import { SubmissionJsonPatchOperationsService } from '../../../core/submission/submission-json-patch-operations.service'; +import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model'; /** * This component represents the drop zone that provides to add files to the submission. @@ -119,7 +119,7 @@ export class SubmissionUploadFilesComponent implements OnChanges { * @param workspaceitem * The submission object retrieved from REST */ - public onCompleteItem(workspaceitem: Workspaceitem) { + public onCompleteItem(workspaceitem: WorkspaceItem) { // Checks if upload section is enabled so do upload this.subs.push( this.uploadEnabled diff --git a/src/modules/app/browser-app.module.ts b/src/modules/app/browser-app.module.ts index b20894880b..ee826c680d 100644 --- a/src/modules/app/browser-app.module.ts +++ b/src/modules/app/browser-app.module.ts @@ -20,7 +20,6 @@ import { CookieService } from '../../app/shared/services/cookie.service'; import { AuthService } from '../../app/core/auth/auth.service'; import { Angulartics2Module } from 'angulartics2'; import { Angulartics2GoogleAnalytics } from 'angulartics2/ga'; -import { ServerSubmissionService } from '../../app/submission/server-submission.service'; import { SubmissionService } from '../../app/submission/submission.service'; export const REQ_KEY = makeStateKey('req'); From a0a0830e5f7fc1d1e18bde4cdb836ece40581fb6 Mon Sep 17 00:00:00 2001 From: lotte Date: Fri, 24 May 2019 16:57:38 +0200 Subject: [PATCH 05/38] 61949: merged master, resolving conflicts --- .../search-configuration.service.ts | 2 +- .../models/items/normalized-item-type.model.ts | 2 ++ .../normalized-relationship-type.model.ts | 2 ++ .../items/normalized-relationship.model.ts | 2 ++ src/app/core/cache/response.models.ts | 4 +--- .../core/data/base-response-parsing.service.ts | 1 + .../normalized-claimed-task-object.model.ts | 4 +++- .../normalized-pool-task-object.model.ts | 4 +++- .../models/normalized-task-object.model.ts | 2 +- src/app/core/tasks/models/task-object.model.ts | 4 ++-- .../tasks/task-response-parsing.service.ts | 2 -- .../claimed-task-actions.component.spec.ts | 4 ++-- .../claimed-task-actions.component.ts | 12 ++++++------ .../mydspace-actions-service.factory.ts | 8 ++++---- .../pool-task-actions.component.spec.ts | 4 ++-- .../pool-task/pool-task-actions.component.ts | 12 ++++++------ .../workflowitem-actions.component.spec.ts | 10 +++++----- .../workflowitem-actions.component.ts | 18 +++++++++--------- .../workspaceitem-actions.component.spec.ts | 6 +++--- .../workspaceitem-actions.component.ts | 14 +++++++------- .../my-dspace-item-status.component.spec.ts | 4 ++-- .../item-submitter.component.spec.ts | 4 ++-- .../item-submitter.component.ts | 8 ++++---- .../workflowitem-my-dspace-result.model.ts | 8 ++++---- .../workspaceitem-my-dspace-result.model.ts | 8 ++++---- ...ace-result-detail-element.component.spec.ts | 4 ++-- ...y-dspace-result-detail-element.component.ts | 12 ++++++------ ...ace-result-detail-element.component.spec.ts | 4 ++-- ...my-dspace-result-detail-lement.component.ts | 14 ++++++-------- ...ace-result-detail-element.component.spec.ts | 4 ++-- ...y-dspace-result-detail-element.component.ts | 6 +++--- ...ace-result-detail-element.component.spec.ts | 4 ++-- ...y-dspace-result-detail-element.component.ts | 9 +++++---- ...space-result-list-element.component.spec.ts | 3 +-- ...-my-dspace-result-list-element.component.ts | 12 ++++++------ ...space-result-list-element.component.spec.ts | 4 ++-- ...-my-dspace-result-list-element.component.ts | 12 ++++++------ ...space-result-list-element.component.spec.ts | 4 ++-- ...-my-dspace-result-list-element.component.ts | 6 +++--- ...space-result-list-element.component.spec.ts | 4 ++-- ...-my-dspace-result-list-element.component.ts | 4 ++-- 41 files changed, 130 insertions(+), 125 deletions(-) diff --git a/src/app/+search-page/search-service/search-configuration.service.ts b/src/app/+search-page/search-service/search-configuration.service.ts index 39acd19ccd..aaec928958 100644 --- a/src/app/+search-page/search-service/search-configuration.service.ts +++ b/src/app/+search-page/search-service/search-configuration.service.ts @@ -277,7 +277,7 @@ export class SearchConfigurationService implements OnDestroy { } /** - * Make sure to unsubscribe from all existing subscription to prevent memory leaks + * Make sure to unsubscribe from all existing subscription to prevent memory leaksNormalizedRelationship */ ngOnDestroy(): void { this.subs.forEach((sub) => { diff --git a/src/app/core/cache/models/items/normalized-item-type.model.ts b/src/app/core/cache/models/items/normalized-item-type.model.ts index ed38d80a4b..ffc1e0fa1f 100644 --- a/src/app/core/cache/models/items/normalized-item-type.model.ts +++ b/src/app/core/cache/models/items/normalized-item-type.model.ts @@ -4,11 +4,13 @@ import { ResourceType } from '../../../shared/resource-type'; import { mapsTo } from '../../builders/build-decorators'; import { NormalizedObject } from '../normalized-object.model'; import { IDToUUIDSerializer } from '../../id-to-uuid-serializer'; +import { resourceType } from '../../../shared/resource-type.decorator'; /** * Normalized model class for a DSpace ItemType */ @mapsTo(ItemType) +@resourceType(ResourceType.ItemType) @inheritSerialization(NormalizedObject) export class NormalizedItemType extends NormalizedObject { diff --git a/src/app/core/cache/models/items/normalized-relationship-type.model.ts b/src/app/core/cache/models/items/normalized-relationship-type.model.ts index d201fb2746..326527aaf4 100644 --- a/src/app/core/cache/models/items/normalized-relationship-type.model.ts +++ b/src/app/core/cache/models/items/normalized-relationship-type.model.ts @@ -5,11 +5,13 @@ import { mapsTo, relationship } from '../../builders/build-decorators'; import { NormalizedDSpaceObject } from '../normalized-dspace-object.model'; import { NormalizedObject } from '../normalized-object.model'; import { IDToUUIDSerializer } from '../../id-to-uuid-serializer'; +import { resourceType } from '../../../shared/resource-type.decorator'; /** * Normalized model class for a DSpace RelationshipType */ @mapsTo(RelationshipType) +@resourceType(ResourceType.RelationshipType) @inheritSerialization(NormalizedDSpaceObject) export class NormalizedRelationshipType extends NormalizedObject { diff --git a/src/app/core/cache/models/items/normalized-relationship.model.ts b/src/app/core/cache/models/items/normalized-relationship.model.ts index b908426361..a923c36a38 100644 --- a/src/app/core/cache/models/items/normalized-relationship.model.ts +++ b/src/app/core/cache/models/items/normalized-relationship.model.ts @@ -4,11 +4,13 @@ import { ResourceType } from '../../../shared/resource-type'; 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.decorator'; /** * Normalized model class for a DSpace Relationship */ @mapsTo(Relationship) +@resourceType(ResourceType.Relationship) @inheritSerialization(NormalizedObject) export class NormalizedRelationship extends NormalizedObject { diff --git a/src/app/core/cache/response.models.ts b/src/app/core/cache/response.models.ts index 2f652d91a2..03233e616b 100644 --- a/src/app/core/cache/response.models.ts +++ b/src/app/core/cache/response.models.ts @@ -8,14 +8,12 @@ import { IntegrationModel } from '../integration/models/integration.model'; import { RegistryMetadataschemasResponse } from '../registry/registry-metadataschemas-response.model'; import { RegistryMetadatafieldsResponse } from '../registry/registry-metadatafields-response.model'; import { RegistryBitstreamformatsResponse } from '../registry/registry-bitstreamformats-response.model'; -import { MetadataSchema } from '../metadata/metadataschema.model'; -import { MetadataField } from '../metadata/metadatafield.model'; import { PaginatedList } from '../data/paginated-list'; import { SubmissionObject } from '../submission/models/submission-object.model'; import { DSpaceObject } from '../shared/dspace-object.model'; import { NormalizedAuthStatus } from '../auth/models/normalized-auth-status.model'; -import { MetadataField } from '../metadata/metadata-field.model'; import { MetadataSchema } from '../metadata/metadata-schema.model'; +import { MetadataField } from '../metadata/metadata-field.model'; /* tslint:disable:max-classes-per-file */ export class RestResponse { diff --git a/src/app/core/data/base-response-parsing.service.ts b/src/app/core/data/base-response-parsing.service.ts index cae59994b5..8235790c0c 100644 --- a/src/app/core/data/base-response-parsing.service.ts +++ b/src/app/core/data/base-response-parsing.service.ts @@ -8,6 +8,7 @@ import { GenericConstructor } from '../shared/generic-constructor'; import { PaginatedList } from './paginated-list'; import { isRestDataObject, isRestPaginatedList } from '../cache/builders/normalized-object-build.service'; import { getNormalizedConstructorByType } from '../shared/resource-type.decorator'; +import { ResourceType } from '../shared/resource-type'; /* tslint:disable:max-classes-per-file */ export abstract class BaseResponseParsingService { diff --git a/src/app/core/tasks/models/normalized-claimed-task-object.model.ts b/src/app/core/tasks/models/normalized-claimed-task-object.model.ts index c2c3f12bc4..b999c62888 100644 --- a/src/app/core/tasks/models/normalized-claimed-task-object.model.ts +++ b/src/app/core/tasks/models/normalized-claimed-task-object.model.ts @@ -3,11 +3,13 @@ import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { autoserialize, inheritSerialization } from 'cerialize'; import { ClaimedTask } from './claimed-task-object.model'; import { ResourceType } from '../../shared/resource-type'; +import { resourceType } from '../../shared/resource-type.decorator'; /** * A normalized model class for a ClaimedTask. */ @mapsTo(ClaimedTask) +@resourceType(ResourceType.ClaimedTask) @inheritSerialization(NormalizedTaskObject) export class NormalizedClaimedTask extends NormalizedTaskObject { @@ -33,7 +35,7 @@ export class NormalizedClaimedTask extends NormalizedTaskObject { * The workflowitem object whom this task is related */ @autoserialize - @relationship(ResourceType.Workflowitem, false) + @relationship(ResourceType.WorkflowItem, false) workflowitem: string; } diff --git a/src/app/core/tasks/models/normalized-pool-task-object.model.ts b/src/app/core/tasks/models/normalized-pool-task-object.model.ts index 22cda6ff9c..b1466def42 100644 --- a/src/app/core/tasks/models/normalized-pool-task-object.model.ts +++ b/src/app/core/tasks/models/normalized-pool-task-object.model.ts @@ -3,11 +3,13 @@ import { PoolTask } from './pool-task-object.model'; import { autoserialize, inheritSerialization } from 'cerialize'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { ResourceType } from '../../shared/resource-type'; +import { resourceType } from '../../shared/resource-type.decorator'; /** * A normalized model class for a PoolTask. */ @mapsTo(PoolTask) +@resourceType(ResourceType.PoolTask) @inheritSerialization(NormalizedTaskObject) export class NormalizedPoolTask extends NormalizedTaskObject { @@ -33,6 +35,6 @@ export class NormalizedPoolTask extends NormalizedTaskObject { * The workflowitem object whom this task is related */ @autoserialize - @relationship(ResourceType.Workflowitem, false) + @relationship(ResourceType.WorkflowItem, false) workflowitem: string; } diff --git a/src/app/core/tasks/models/normalized-task-object.model.ts b/src/app/core/tasks/models/normalized-task-object.model.ts index 52c274e3a8..31c9a9cad4 100644 --- a/src/app/core/tasks/models/normalized-task-object.model.ts +++ b/src/app/core/tasks/models/normalized-task-object.model.ts @@ -34,6 +34,6 @@ export abstract class NormalizedTaskObject extends Norma * The workflowitem object whom this task is related */ @autoserialize - @relationship(ResourceType.Workflowitem, false) + @relationship(ResourceType.WorkflowItem, false) workflowitem: string; } diff --git a/src/app/core/tasks/models/task-object.model.ts b/src/app/core/tasks/models/task-object.model.ts index 97a1c9f59e..d03b3651c0 100644 --- a/src/app/core/tasks/models/task-object.model.ts +++ b/src/app/core/tasks/models/task-object.model.ts @@ -4,7 +4,7 @@ import { CacheableObject } from '../../cache/object-cache.reducer'; import { DSpaceObject } from '../../shared/dspace-object.model'; import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model'; import { RemoteData } from '../../data/remote-data'; -import { Workflowitem } from '../../submission/models/workflowitem.model'; +import { WorkflowItem } from '../../submission/models/workflowitem.model'; /** * An abstract model class for a TaskObject. @@ -29,5 +29,5 @@ export class TaskObject extends DSpaceObject implements CacheableObject, Listabl /** * The workflowitem object whom this task is related */ - workflowitem: Observable> | Workflowitem; + workflowitem: Observable> | WorkflowItem; } diff --git a/src/app/core/tasks/task-response-parsing.service.ts b/src/app/core/tasks/task-response-parsing.service.ts index 7445f9d267..090b67ccbb 100644 --- a/src/app/core/tasks/task-response-parsing.service.ts +++ b/src/app/core/tasks/task-response-parsing.service.ts @@ -8,7 +8,6 @@ import { BaseResponseParsingService } from '../data/base-response-parsing.servic import { GLOBAL_CONFIG } from '../../../config'; import { GlobalConfig } from '../../../config/global-config.interface'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { NormalizedObjectFactory } from '../cache/models/normalized-object-factory'; import { ErrorResponse, RestResponse, TaskResponse } from '../cache/response.models'; /** @@ -17,7 +16,6 @@ import { ErrorResponse, RestResponse, TaskResponse } from '../cache/response.mod @Injectable() export class TaskResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - protected objectFactory = NormalizedObjectFactory; protected toCache = false; /** diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts index 4144cb3760..4944165e0a 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts @@ -16,7 +16,7 @@ import { Item } from '../../../core/shared/item.model'; import { ClaimedTaskDataService } from '../../../core/tasks/claimed-task-data.service'; import { ClaimedTaskActionsComponent } from './claimed-task-actions.component'; import { ClaimedTask } from '../../../core/tasks/models/claimed-task-object.model'; -import { Workflowitem } from '../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; let component: ClaimedTaskActionsComponent; let fixture: ComponentFixture; @@ -61,7 +61,7 @@ const item = Object.assign(new Item(), { } }); const rdItem = new RemoteData(false, false, true, null, item); -const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); mockObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem), id: '1234' }); diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts index 2a7669f5b1..5aa0cd72b5 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts @@ -9,7 +9,7 @@ import { ClaimedTaskDataService } from '../../../core/tasks/claimed-task-data.se import { ClaimedTask } from '../../../core/tasks/models/claimed-task-object.model'; import { ProcessTaskResponse } from '../../../core/tasks/models/process-task-response'; import { isNotUndefined } from '../../empty.util'; -import { Workflowitem } from '../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; import { RemoteData } from '../../../core/data/remote-data'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; import { ResourceType } from '../../../core/shared/resource-type'; @@ -33,7 +33,7 @@ export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent; + public workflowitem$: Observable; /** * A boolean representing if an approve operation is pending @@ -73,15 +73,15 @@ export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent>).pipe( - filter((rd: RemoteData) => ((!rd.isRequestPending) && isNotUndefined(rd.payload))), - map((rd: RemoteData) => rd.payload)); + this.workflowitem$ = (this.object.workflowitem as Observable>).pipe( + filter((rd: RemoteData) => ((!rd.isRequestPending) && isNotUndefined(rd.payload))), + map((rd: RemoteData) => rd.payload)); } /** diff --git a/src/app/shared/mydspace-actions/mydspace-actions-service.factory.ts b/src/app/shared/mydspace-actions/mydspace-actions-service.factory.ts index 7aa948f689..de19160265 100644 --- a/src/app/shared/mydspace-actions/mydspace-actions-service.factory.ts +++ b/src/app/shared/mydspace-actions/mydspace-actions-service.factory.ts @@ -3,7 +3,7 @@ import { ResourceType } from '../../core/shared/resource-type'; import { WorkspaceitemDataService } from '../../core/submission/workspaceitem-data.service'; import { ClaimedTaskDataService } from '../../core/tasks/claimed-task-data.service'; import { PoolTaskDataService } from '../../core/tasks/pool-task-data.service'; -import { WorkflowitemDataService } from '../../core/submission/workflowitem-data.service'; +import { WorkflowItemDataService } from '../../core/submission/workflowitem-data.service'; import { CacheableObject } from '../../core/cache/object-cache.reducer'; import { ItemDataService } from '../../core/data/item-data.service'; @@ -16,11 +16,11 @@ export class MydspaceActionsServiceFactory; @@ -59,7 +59,7 @@ const item = Object.assign(new Item(), { } }); const rdItem = new RemoteData(false, false, true, null, item); -const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); mockObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem), id: '1234' }); diff --git a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts index bd8f3f1a37..a143045334 100644 --- a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts @@ -5,7 +5,7 @@ import { BehaviorSubject, Observable } from 'rxjs'; import { filter, map } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; -import { Workflowitem } from '../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; import { ProcessTaskResponse } from '../../../core/tasks/models/process-task-response'; import { RemoteData } from '../../../core/data/remote-data'; import { PoolTask } from '../../../core/tasks/models/pool-task-object.model'; @@ -39,7 +39,7 @@ export class PoolTaskActionsComponent extends MyDSpaceActionsComponent; + public workflowitem$: Observable; /** * Initialize instance variables @@ -64,15 +64,15 @@ export class PoolTaskActionsComponent extends MyDSpaceActionsComponent>).pipe( - filter((rd: RemoteData) => ((!rd.isRequestPending) && isNotUndefined(rd.payload))), - map((rd: RemoteData) => rd.payload)); + this.workflowitem$ = (this.object.workflowitem as Observable>).pipe( + filter((rd: RemoteData) => ((!rd.isRequestPending) && isNotUndefined(rd.payload))), + map((rd: RemoteData) => rd.payload)); } /** diff --git a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts index 7533565afe..c8e4299f6d 100644 --- a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts @@ -9,16 +9,16 @@ import { MockTranslateLoader } from '../../mocks/mock-translate-loader'; import { RouterStub } from '../../testing/router-stub'; import { RemoteData } from '../../../core/data/remote-data'; import { Item } from '../../../core/shared/item.model'; -import { Workflowitem } from '../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; import { WorkflowitemActionsComponent } from './workflowitem-actions.component'; -import { WorkflowitemDataService } from '../../../core/submission/workflowitem-data.service'; +import { WorkflowItemDataService } from '../../../core/submission/workflowitem-data.service'; import { NotificationsService } from '../../notifications/notifications.service'; import { NotificationsServiceStub } from '../../testing/notifications-service-stub'; let component: WorkflowitemActionsComponent; let fixture: ComponentFixture; -let mockObject: Workflowitem; +let mockObject: WorkflowItem; const mockDataService = {}; @@ -52,7 +52,7 @@ const item = Object.assign(new Item(), { } }); const rd = new RemoteData(false, false, true, null, item); -mockObject = Object.assign(new Workflowitem(), { item: observableOf(rd), id: '1234', uuid: '1234' }); +mockObject = Object.assign(new WorkflowItem(), { item: observableOf(rd), id: '1234', uuid: '1234' }); describe('WorkflowitemActionsComponent', () => { beforeEach(async(() => { @@ -69,7 +69,7 @@ describe('WorkflowitemActionsComponent', () => { providers: [ { provide: Injector, useValue: {} }, { provide: Router, useValue: new RouterStub() }, - { provide: WorkflowitemDataService, useValue: mockDataService }, + { provide: WorkflowItemDataService, useValue: mockDataService }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts index a6304bf5d4..c26dfd9b5e 100644 --- a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts +++ b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts @@ -4,25 +4,25 @@ import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; -import { Workflowitem } from '../../../core/submission/models/workflowitem.model'; -import { WorkflowitemDataService } from '../../../core/submission/workflowitem-data.service'; +import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; +import { WorkflowItemDataService } from '../../../core/submission/workflowitem-data.service'; import { ResourceType } from '../../../core/shared/resource-type'; import { NotificationsService } from '../../notifications/notifications.service'; /** - * This component represents mydspace actions related to Workflowitem object. + * This component represents mydspace actions related to WorkflowItem object. */ @Component({ selector: 'ds-workflowitem-actions', styleUrls: ['./workflowitem-actions.component.scss'], templateUrl: './workflowitem-actions.component.html', }) -export class WorkflowitemActionsComponent extends MyDSpaceActionsComponent { +export class WorkflowitemActionsComponent extends MyDSpaceActionsComponent { /** - * The Workflowitem object + * The WorkflowItem object */ - @Input() object: Workflowitem; + @Input() object: WorkflowItem; /** * Initialize instance variables @@ -36,15 +36,15 @@ export class WorkflowitemActionsComponent extends MyDSpaceActionsComponent; -let mockObject: Workspaceitem; +let mockObject: WorkspaceItem; let notificationsServiceStub: NotificationsServiceStub; const mockDataService = jasmine.createSpyObj('WorkspaceitemDataService', { @@ -57,7 +57,7 @@ const item = Object.assign(new Item(), { } }); const rd = new RemoteData(false, false, true, null, item); -mockObject = Object.assign(new Workspaceitem(), { item: observableOf(rd), id: '1234', uuid: '1234' }); +mockObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd), id: '1234', uuid: '1234' }); describe('WorkspaceitemActionsComponent', () => { beforeEach(async(() => { diff --git a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts index cea4c3746e..041270ec4a 100644 --- a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts +++ b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts @@ -5,26 +5,26 @@ import { BehaviorSubject } from 'rxjs'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; -import { Workspaceitem } from '../../../core/submission/models/workspaceitem.model'; +import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; import { WorkspaceitemDataService } from '../../../core/submission/workspaceitem-data.service'; import { ResourceType } from '../../../core/shared/resource-type'; import { NotificationsService } from '../../notifications/notifications.service'; /** - * This component represents mydspace actions related to Workspaceitem object. + * This component represents mydspace actions related to WorkspaceItem object. */ @Component({ selector: 'ds-workspaceitem-actions', styleUrls: ['./workspaceitem-actions.component.scss'], templateUrl: './workspaceitem-actions.component.html', }) -export class WorkspaceitemActionsComponent extends MyDSpaceActionsComponent { +export class WorkspaceitemActionsComponent extends MyDSpaceActionsComponent { /** * The workspaceitem object */ - @Input() object: Workspaceitem; + @Input() object: WorkspaceItem; /** * A boolean representing if a delete operation is pending @@ -46,7 +46,7 @@ export class WorkspaceitemActionsComponent extends MyDSpaceActionsComponent; let mockResultObject: PoolTask; const rdSumbitter = new RemoteData(false, false, true, null, EPersonMock); -const workflowitem = Object.assign(new Workflowitem(), { submitter: observableOf(rdSumbitter) }); +const workflowitem = Object.assign(new WorkflowItem(), { submitter: observableOf(rdSumbitter) }); const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); mockResultObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); diff --git a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts index 77460a3674..6a2805574c 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts @@ -7,7 +7,7 @@ import { cold } from 'jasmine-marbles'; import { RemoteData } from '../../../../core/data/remote-data'; import { ItemSubmitterComponent } from './item-submitter.component'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; import { EPersonMock } from '../../../testing/eperson-mock'; import { MockTranslateLoader } from '../../../mocks/mock-translate-loader'; @@ -21,7 +21,7 @@ const compIndex = 1; let mockResultObject: PoolTask; const rdSumbitter = new RemoteData(false, false, true, null, EPersonMock); -const workflowitem = Object.assign(new Workflowitem(), { submitter: observableOf(rdSumbitter) }); +const workflowitem = Object.assign(new WorkflowItem(), { submitter: observableOf(rdSumbitter) }); const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); mockResultObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); diff --git a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts index f752fa6f04..01c0dd9f35 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts @@ -6,7 +6,7 @@ import { filter, find, flatMap, map } from 'rxjs/operators'; import { EPerson } from '../../../../core/eperson/models/eperson.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { isNotEmpty, isNotUndefined } from '../../../empty.util'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; /** * This component represents a badge with submitter information. @@ -32,9 +32,9 @@ export class ItemSubmitterComponent implements OnInit { * Initialize submitter object */ ngOnInit() { - this.submitter$ = (this.object.workflowitem as Observable>).pipe( - filter((rd: RemoteData) => (rd.hasSucceeded && isNotUndefined(rd.payload))), - flatMap((rd: RemoteData) => rd.payload.submitter as Observable>), + this.submitter$ = (this.object.workflowitem as Observable>).pipe( + filter((rd: RemoteData) => (rd.hasSucceeded && isNotUndefined(rd.payload))), + flatMap((rd: RemoteData) => rd.payload.submitter as Observable>), find((rd: RemoteData) => rd.hasSucceeded && isNotEmpty(rd.payload)), map((rd: RemoteData) => rd.payload)); } diff --git a/src/app/shared/object-collection/shared/workflowitem-my-dspace-result.model.ts b/src/app/shared/object-collection/shared/workflowitem-my-dspace-result.model.ts index 89f6f351ad..d91c03b549 100644 --- a/src/app/shared/object-collection/shared/workflowitem-my-dspace-result.model.ts +++ b/src/app/shared/object-collection/shared/workflowitem-my-dspace-result.model.ts @@ -1,11 +1,11 @@ -import { Workflowitem } from '../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; import { SearchResult } from '../../../+search-page/search-result.model'; import { MyDSpaceConfigurationValueType } from '../../../+my-dspace-page/my-dspace-configuration-value-type'; import { searchResultFor } from '../../../+search-page/search-service/search-result-element-decorator'; /** - * Represents a search result object of a Workflowitem object + * Represents a search result object of a WorkflowItem object */ -@searchResultFor(Workflowitem, MyDSpaceConfigurationValueType.Workspace) -export class WorkflowitemMyDSpaceResult extends SearchResult { +@searchResultFor(WorkflowItem, MyDSpaceConfigurationValueType.Workspace) +export class WorkflowitemMyDSpaceResult extends SearchResult { } diff --git a/src/app/shared/object-collection/shared/workspaceitem-my-dspace-result.model.ts b/src/app/shared/object-collection/shared/workspaceitem-my-dspace-result.model.ts index 20474c9ad3..b7bd5e31d6 100644 --- a/src/app/shared/object-collection/shared/workspaceitem-my-dspace-result.model.ts +++ b/src/app/shared/object-collection/shared/workspaceitem-my-dspace-result.model.ts @@ -1,11 +1,11 @@ -import { Workspaceitem } from '../../../core/submission/models/workspaceitem.model'; +import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model'; import { MyDSpaceConfigurationValueType } from '../../../+my-dspace-page/my-dspace-configuration-value-type'; import { searchResultFor } from '../../../+search-page/search-service/search-result-element-decorator'; import { SearchResult } from '../../../+search-page/search-result.model'; /** - * Represents a search result object of a Workspaceitem object + * Represents a search result object of a WorkspaceItem object */ -@searchResultFor(Workspaceitem, MyDSpaceConfigurationValueType.Workspace) -export class WorkspaceitemMyDSpaceResult extends SearchResult { +@searchResultFor(WorkspaceItem, MyDSpaceConfigurationValueType.Workspace) +export class WorkspaceitemMyDSpaceResult extends SearchResult { } diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.spec.ts index d3307721ff..ac435ac997 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.spec.ts @@ -10,7 +10,7 @@ import { ClaimedTaskMyDSpaceResult } from '../../../object-collection/shared/cla import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; let component: ClaimedMyDSpaceResultDetailElementComponent; let fixture: ComponentFixture; @@ -50,7 +50,7 @@ const item = Object.assign(new Item(), { } }); const rdItem = new RemoteData(false, false, true, null, item); -const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) }); diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.ts index 5f7b0aab55..581d52c05f 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.ts @@ -8,7 +8,7 @@ import { RemoteData } from '../../../../core/data/remote-data'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { isNotUndefined } from '../../../empty.util'; import { ListableObject } from '../../../object-collection/shared/listable-object.model'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model'; import { ClaimedTaskMyDSpaceResult } from '../../../object-collection/shared/claimed-task-my-dspace-result.model'; import { MyDSpaceResultDetailElementComponent } from '../my-dspace-result-detail-element.component'; @@ -41,7 +41,7 @@ export class ClaimedMyDSpaceResultDetailElementComponent extends MyDSpaceResultD /** * The workflowitem object that belonging to the result object */ - public workflowitem: Workflowitem; + public workflowitem: WorkflowItem; constructor(@Inject('objectElementProvider') public listable: ListableObject) { super(listable); @@ -51,16 +51,16 @@ export class ClaimedMyDSpaceResultDetailElementComponent extends MyDSpaceResultD * Initialize all instance variables */ ngOnInit() { - this.initWorkflowItem(this.dso.workflowitem as Observable>); + this.initWorkflowItem(this.dso.workflowitem as Observable>); } /** * Retrieve workflowitem from result object */ - initWorkflowItem(wfi$: Observable>) { + initWorkflowItem(wfi$: Observable>) { wfi$.pipe( - find((rd: RemoteData) => (rd.hasSucceeded && isNotUndefined(rd.payload))) - ).subscribe((rd: RemoteData) => { + find((rd: RemoteData) => (rd.hasSucceeded && isNotUndefined(rd.payload))) + ).subscribe((rd: RemoteData) => { this.workflowitem = rd.payload; }); } diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.spec.ts index 0eea01aa1c..c001f11fb3 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.spec.ts @@ -10,7 +10,7 @@ import { PoolTaskMyDSpaceResult } from '../../../object-collection/shared/pool-t import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; let component: PoolMyDSpaceResultDetailElementComponent; let fixture: ComponentFixture; @@ -50,7 +50,7 @@ const item = Object.assign(new Item(), { } }); const rdItem = new RemoteData(false, false, true, null, item); -const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); mockResultObject.indexableObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-lement.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-lement.component.ts index ef7bcadebf..0b5b6c6524 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-lement.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-lement.component.ts @@ -2,18 +2,16 @@ import { Component, Inject } from '@angular/core'; import { Observable } from 'rxjs'; import { find } from 'rxjs/operators'; - -import { ViewMode } from '../../../../core/shared/view-mode.model'; import { renderElementsFor } from '../../../object-collection/shared/dso-element-decorator'; import { RemoteData } from '../../../../core/data/remote-data'; import { isNotUndefined } from '../../../empty.util'; import { ListableObject } from '../../../object-collection/shared/listable-object.model'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; import { PoolTaskMyDSpaceResult } from '../../../object-collection/shared/pool-task-my-dspace-result.model'; import { MyDSpaceResultDetailElementComponent } from '../my-dspace-result-detail-element.component'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; import { SetViewMode } from '../../../view-mode'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; /** * This component renders pool task object for the mydspace result in the detail view. @@ -41,7 +39,7 @@ export class PoolMyDSpaceResultDetailElementComponent extends MyDSpaceResultDeta /** * The workflowitem object that belonging to the result object */ - public workflowitem: Workflowitem; + public workflowitem: WorkflowItem; constructor(@Inject('objectElementProvider') public listable: ListableObject) { super(listable); @@ -51,16 +49,16 @@ export class PoolMyDSpaceResultDetailElementComponent extends MyDSpaceResultDeta * Initialize all instance variables */ ngOnInit() { - this.initWorkflowItem(this.dso.workflowitem as Observable>); + this.initWorkflowItem(this.dso.workflowitem as Observable>); } /** * Retrieve workflowitem from result object */ - initWorkflowItem(wfi$: Observable>) { + initWorkflowItem(wfi$: Observable>) { wfi$.pipe( - find((rd: RemoteData) => (rd.hasSucceeded && isNotUndefined(rd.payload))) - ).subscribe((rd: RemoteData) => { + find((rd: RemoteData) => (rd.hasSucceeded && isNotUndefined(rd.payload))) + ).subscribe((rd: RemoteData) => { this.workflowitem = rd.payload; }); } diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.spec.ts index f8bdbf9fd6..214b9afb4a 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.spec.ts @@ -7,7 +7,7 @@ import { of as observableOf } from 'rxjs'; import { Item } from '../../../../core/shared/item.model'; import { WorkflowitemMyDSpaceResultDetailElementComponent } from './workflowitem-my-dspace-result-detail-element.component'; import { WorkflowitemMyDSpaceResult } from '../../../object-collection/shared/workflowitem-my-dspace-result.model'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; @@ -49,7 +49,7 @@ const item = Object.assign(new Item(), { } }); const rd = new RemoteData(false, false, true, null, item); -mockResultObject.indexableObject = Object.assign(new Workflowitem(), { item: observableOf(rd) }); +mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: observableOf(rd) }); describe('WorkflowitemMyDSpaceResultDetailElementComponent', () => { beforeEach(async(() => { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.ts index 1c4b0c668f..c28f044e6e 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.ts @@ -5,7 +5,7 @@ import { ViewMode } from '../../../../core/shared/view-mode.model'; import { Item } from '../../../../core/shared/item.model'; import { ListableObject } from '../../../object-collection/shared/listable-object.model'; import { WorkflowitemMyDSpaceResult } from '../../../object-collection/shared/workflowitem-my-dspace-result.model'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { MyDSpaceResultDetailElementComponent } from '../my-dspace-result-detail-element.component'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; import { Observable } from 'rxjs/internal/Observable'; @@ -24,8 +24,8 @@ import { SetViewMode } from '../../../view-mode'; }) @renderElementsFor(WorkflowitemMyDSpaceResult, SetViewMode.Detail) -@renderElementsFor(Workflowitem, SetViewMode.Detail) -export class WorkflowitemMyDSpaceResultDetailElementComponent extends MyDSpaceResultDetailElementComponent { +@renderElementsFor(WorkflowItem, SetViewMode.Detail) +export class WorkflowitemMyDSpaceResultDetailElementComponent extends MyDSpaceResultDetailElementComponent { /** * The item object that belonging to the result object diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.spec.ts index af67bf53ea..e2a0fbdb33 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.spec.ts @@ -7,7 +7,7 @@ import { of as observableOf } from 'rxjs'; import { Item } from '../../../../core/shared/item.model'; import { WorkspaceitemMyDSpaceResultDetailElementComponent } from './workspaceitem-my-dspace-result-detail-element.component'; import { WorkspaceitemMyDSpaceResult } from '../../../object-collection/shared/workspaceitem-my-dspace-result.model'; -import { Workspaceitem } from '../../../../core/submission/models/workspaceitem.model'; +import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; @@ -49,7 +49,7 @@ const item = Object.assign(new Item(), { } }); const rd = new RemoteData(false, false, true, null, item); -mockResultObject.indexableObject = Object.assign(new Workspaceitem(), { item: observableOf(rd) }); +mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd) }); describe('WorkspaceitemMyDSpaceResultDetailElementComponent', () => { beforeEach(async(() => { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.ts index 390db7ec28..af735ecb1e 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.ts @@ -4,8 +4,9 @@ import { Observable } from 'rxjs'; import { find } from 'rxjs/operators'; import { renderElementsFor } from '../../../object-collection/shared/dso-element-decorator'; -import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { Workspaceitem } from '../../../../core/submission/models/workspaceitem.model'; +import { + WorkspaceItem +} from '../../../../core/submission/models/workspaceitem.model'; import { WorkspaceitemMyDSpaceResult } from '../../../object-collection/shared/workspaceitem-my-dspace-result.model'; import { Item } from '../../../../core/shared/item.model'; import { RemoteData } from '../../../../core/data/remote-data'; @@ -25,8 +26,8 @@ import { SetViewMode } from '../../../view-mode'; }) @renderElementsFor(WorkspaceitemMyDSpaceResult, SetViewMode.Detail) -@renderElementsFor(Workspaceitem, SetViewMode.Detail) -export class WorkspaceitemMyDSpaceResultDetailElementComponent extends MyDSpaceResultDetailElementComponent { +@renderElementsFor(WorkspaceItem, SetViewMode.Detail) +export class WorkspaceitemMyDSpaceResultDetailElementComponent extends MyDSpaceResultDetailElementComponent { /** * The item object that belonging to the result object diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts index 7c30b2ef8c..974879e1a7 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts @@ -10,7 +10,6 @@ import { ClaimedTaskMyDSpaceResult } from '../../../object-collection/shared/cla import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; let component: ClaimedMyDSpaceResultListElementComponent; let fixture: ComponentFixture; @@ -50,7 +49,7 @@ const item = Object.assign(new Item(), { } }); const rdItem = new RemoteData(false, false, true, null, item); -const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) }); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.ts index 0725f98897..3423df7009 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.ts @@ -9,7 +9,7 @@ import { MyDSpaceResultListElementComponent, } from '../my-dspace-result-list-el import { ViewMode } from '../../../../core/shared/view-mode.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { isNotUndefined } from '../../../empty.util'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model'; import { ClaimedTaskMyDSpaceResult } from '../../../object-collection/shared/claimed-task-my-dspace-result.model'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; @@ -42,22 +42,22 @@ export class ClaimedMyDSpaceResultListElementComponent extends MyDSpaceResultLis /** * The workflowitem object that belonging to the result object */ - public workflowitem: Workflowitem; + public workflowitem: WorkflowItem; /** * Initialize all instance variables */ ngOnInit() { - this.initWorkflowItem(this.dso.workflowitem as Observable>); + this.initWorkflowItem(this.dso.workflowitem as Observable>); } /** * Retrieve workflowitem from result object */ - initWorkflowItem(wfi$: Observable>) { + initWorkflowItem(wfi$: Observable>) { wfi$.pipe( - find((rd: RemoteData) => (rd.hasSucceeded && isNotUndefined(rd.payload))) - ).subscribe((rd: RemoteData) => { + find((rd: RemoteData) => (rd.hasSucceeded && isNotUndefined(rd.payload))) + ).subscribe((rd: RemoteData) => { this.workflowitem = rd.payload; }); } diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.spec.ts index 36eb8f253a..a514a0a544 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.spec.ts @@ -10,7 +10,7 @@ import { PoolTaskMyDSpaceResult } from '../../../object-collection/shared/pool-t import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; let component: PoolMyDSpaceResultListElementComponent; let fixture: ComponentFixture; @@ -50,7 +50,7 @@ const item = Object.assign(new Item(), { } }); const rdItem = new RemoteData(false, false, true, null, item); -const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); mockResultObject.indexableObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.ts index 2d78a7e2e8..0b60c60dc1 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.ts @@ -9,7 +9,7 @@ import { ViewMode } from '../../../../core/shared/view-mode.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { isNotUndefined } from '../../../empty.util'; import { ListableObject } from '../../../object-collection/shared/listable-object.model'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; import { PoolTaskMyDSpaceResult } from '../../../object-collection/shared/pool-task-my-dspace-result.model'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; @@ -41,7 +41,7 @@ export class PoolMyDSpaceResultListElementComponent extends MyDSpaceResultListEl /** * The workflowitem object that belonging to the result object */ - public workflowitem: Workflowitem; + public workflowitem: WorkflowItem; constructor(@Inject('objectElementProvider') public listable: ListableObject, @Inject('indexElementProvider') public index: number) { @@ -52,16 +52,16 @@ export class PoolMyDSpaceResultListElementComponent extends MyDSpaceResultListEl * Initialize all instance variables */ ngOnInit() { - this.initWorkflowItem(this.dso.workflowitem as Observable>); + this.initWorkflowItem(this.dso.workflowitem as Observable>); } /** * Retrieve workflowitem from result object */ - initWorkflowItem(wfi$: Observable>) { + initWorkflowItem(wfi$: Observable>) { wfi$.pipe( - find((rd: RemoteData) => (rd.hasSucceeded && isNotUndefined(rd.payload))) - ).subscribe((rd: RemoteData) => { + find((rd: RemoteData) => (rd.hasSucceeded && isNotUndefined(rd.payload))) + ).subscribe((rd: RemoteData) => { this.workflowitem = rd.payload; }); } diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.spec.ts index 2bcd4d46b0..4120904e81 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.spec.ts @@ -7,7 +7,7 @@ import { of as observableOf } from 'rxjs'; import { Item } from '../../../../core/shared/item.model'; import { WorkflowitemMyDSpaceResultListElementComponent } from './workflowitem-my-dspace-result-list-element.component'; import { WorkflowitemMyDSpaceResult } from '../../../object-collection/shared/workflowitem-my-dspace-result.model'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; @@ -49,7 +49,7 @@ const item = Object.assign(new Item(), { } }); const rd = new RemoteData(false, false, true, null, item); -mockResultObject.indexableObject = Object.assign(new Workflowitem(), { item: observableOf(rd) }); +mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: observableOf(rd) }); describe('WorkflowitemMyDSpaceResultListElementComponent', () => { beforeEach(async(() => { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.ts index 9a5038225c..b5d11b8b13 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.ts @@ -9,7 +9,7 @@ import { ViewMode } from '../../../../core/shared/view-mode.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { isNotUndefined } from '../../../empty.util'; import { WorkflowitemMyDSpaceResult } from '../../../object-collection/shared/workflowitem-my-dspace-result.model'; -import { Workflowitem } from '../../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { Item } from '../../../../core/shared/item.model'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; import { SetViewMode } from '../../../view-mode'; @@ -24,8 +24,8 @@ import { SetViewMode } from '../../../view-mode'; }) @renderElementsFor(WorkflowitemMyDSpaceResult, SetViewMode.List) -@renderElementsFor(Workflowitem, SetViewMode.List) -export class WorkflowitemMyDSpaceResultListElementComponent extends MyDSpaceResultListElementComponent { +@renderElementsFor(WorkflowItem, SetViewMode.List) +export class WorkflowitemMyDSpaceResultListElementComponent extends MyDSpaceResultListElementComponent { /** * The item object that belonging to the result object diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.spec.ts index 789b69da1b..1b083e8139 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.spec.ts @@ -7,7 +7,7 @@ import { of as observableOf } from 'rxjs'; import { Item } from '../../../../core/shared/item.model'; import { WorkspaceitemMyDSpaceResultListElementComponent } from './workspaceitem-my-dspace-result-list-element.component'; import { WorkspaceitemMyDSpaceResult } from '../../../object-collection/shared/workspaceitem-my-dspace-result.model'; -import { Workspaceitem } from '../../../../core/submission/models/workspaceitem.model'; +import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; @@ -49,7 +49,7 @@ const item = Object.assign(new Item(), { } }); const rd = new RemoteData(false, false, true, null, item); -mockResultObject.indexableObject = Object.assign(new Workspaceitem(), { item: observableOf(rd) }); +mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd) }); describe('WorkspaceitemMyDSpaceResultListElementComponent', () => { beforeEach(async(() => { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.ts index 9ea647b4ba..118965c64a 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.ts @@ -6,7 +6,7 @@ import { find } from 'rxjs/operators'; import { renderElementsFor } from '../../../object-collection/shared/dso-element-decorator'; import { MyDSpaceResultListElementComponent, } from '../my-dspace-result-list-element.component'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { Workspaceitem } from '../../../../core/submission/models/workspaceitem.model'; +import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model'; import { WorkspaceitemMyDSpaceResult } from '../../../object-collection/shared/workspaceitem-my-dspace-result.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { isNotUndefined } from '../../../empty.util'; @@ -24,7 +24,7 @@ import { SetViewMode } from '../../../view-mode'; }) @renderElementsFor(WorkspaceitemMyDSpaceResult, SetViewMode.List) -export class WorkspaceitemMyDSpaceResultListElementComponent extends MyDSpaceResultListElementComponent { +export class WorkspaceitemMyDSpaceResultListElementComponent extends MyDSpaceResultListElementComponent { /** * The item object that belonging to the result object From 35f73708efc80976148b9ef246ff59460a5518c3 Mon Sep 17 00:00:00 2001 From: lotte Date: Mon, 27 May 2019 15:09:51 +0200 Subject: [PATCH 06/38] fixed issues after merging --- .../auth-response-parsing.service.spec.ts | 166 +++++++++--------- src/app/core/core.module.ts | 14 +- .../normalized-claimed-task-object.model.ts | 14 ++ .../normalized-pool-task-object.model.ts | 7 + .../models/normalized-task-object.model.ts | 14 ++ .../core/tasks/models/task-object.model.ts | 12 ++ ...pace-result-list-element.component.spec.ts | 1 + 7 files changed, 148 insertions(+), 80 deletions(-) diff --git a/src/app/core/auth/auth-response-parsing.service.spec.ts b/src/app/core/auth/auth-response-parsing.service.spec.ts index 0b2c32fc04..112d60b8d2 100644 --- a/src/app/core/auth/auth-response-parsing.service.spec.ts +++ b/src/app/core/auth/auth-response-parsing.service.spec.ts @@ -35,95 +35,103 @@ describe('AuthResponseParsingService', () => { }); describe('parse', () => { - const validRequest = new AuthPostRequest( - '69f375b5-19f4-4453-8c7a-7dc5c55aafbb', - 'https://rest.api/dspace-spring-rest/api/authn/login', - 'password=test&user=myself@testshib.org'); + let validRequest; + let validRequest2; + let validResponse; + let validResponse1; + let validResponse2; + beforeEach(() => { - const validRequest2 = new AuthGetRequest( - '69f375b5-19f4-4453-8c7a-7dc5c55aafbb', - 'https://rest.api/dspace-spring-rest/api/authn/status'); + validRequest = new AuthPostRequest( + '69f375b5-19f4-4453-8c7a-7dc5c55aafbb', + 'https://rest.api/dspace-spring-rest/api/authn/login', + 'password=test&user=myself@testshib.org'); - const validResponse = { - payload: { - authenticated: true, - id: null, - okay: true, - token: { - accessToken: 'eyJhbGciOiJIUzI1NiJ9.eyJlaWQiOiI0ZGM3MGFiNS1jZDczLTQ5MmYtYjAwNy0zMTc5ZDJkOTI5NmIiLCJzZyI6W10sImV4cCI6MTUyNjMxODMyMn0.ASmvcbJFBfzhN7D5ncloWnaVZr5dLtgTuOgHaCKiimc', - expires: 1526318322000 - }, - } as AuthStatus, - statusCode: 200, - statusText: '200' - }; + validRequest2 = new AuthGetRequest( + '69f375b5-19f4-4453-8c7a-7dc5c55aafbb', + 'https://rest.api/dspace-spring-rest/api/authn/status'); - const validResponse1 = { - payload: {}, - statusCode: 404, - statusText: '404' - }; + validResponse = { + payload: { + authenticated: true, + id: null, + okay: true, + token: { + accessToken: 'eyJhbGciOiJIUzI1NiJ9.eyJlaWQiOiI0ZGM3MGFiNS1jZDczLTQ5MmYtYjAwNy0zMTc5ZDJkOTI5NmIiLCJzZyI6W10sImV4cCI6MTUyNjMxODMyMn0.ASmvcbJFBfzhN7D5ncloWnaVZr5dLtgTuOgHaCKiimc', + expires: 1526318322000 + }, + } as AuthStatus, + statusCode: 200, + statusText: '200' + }; - const validResponse2 = { - payload: { - authenticated: true, - id: null, - okay: true, - type: 'status', - _embedded: { - eperson: { - canLogIn: true, - email: 'myself@testshib.org', - groups: [], - handle: null, - id: '4dc70ab5-cd73-492f-b007-3179d2d9296b', - lastActive: '2018-05-14T17:03:31.277+0000', - metadata: { - 'eperson.firstname': [ - { - language: null, - value: 'User' + validResponse1 = { + payload: {}, + statusCode: 404, + statusText: '404' + }; + + validResponse2 = { + payload: { + authenticated: true, + id: null, + okay: true, + type: 'status', + _embedded: { + eperson: { + canLogIn: true, + email: 'myself@testshib.org', + groups: [], + handle: null, + id: '4dc70ab5-cd73-492f-b007-3179d2d9296b', + lastActive: '2018-05-14T17:03:31.277+0000', + metadata: { + 'eperson.firstname': [ + { + language: null, + value: 'User' + } + ], + 'eperson.lastname': [ + { + language: null, + value: 'Test' + } + ], + 'eperson.language': [ + { + language: null, + value: 'en' + } + ] + }, + name: 'User Test', + netid: 'myself@testshib.org', + requireCertificate: false, + selfRegistered: false, + type: 'eperson', + uuid: '4dc70ab5-cd73-492f-b007-3179d2d9296b', + _links: { + self: { + href: 'https://hasselt-dspace.dev01.4science.it/dspace-spring-rest/api/eperson/epersons/4dc70ab5-cd73-492f-b007-3179d2d9296b' } - ], - 'eperson.lastname': [ - { - language: null, - value: 'Test' - } - ], - 'eperson.language': [ - { - language: null, - value: 'en' - } - ] - }, - name: 'User Test', - netid: 'myself@testshib.org', - requireCertificate: false, - selfRegistered: false, - type: 'eperson', - uuid: '4dc70ab5-cd73-492f-b007-3179d2d9296b', - _links: { - self: { - href: 'https://hasselt-dspace.dev01.4science.it/dspace-spring-rest/api/eperson/epersons/4dc70ab5-cd73-492f-b007-3179d2d9296b' } } + }, + _links: { + eperson: { + href: 'https://hasselt-dspace.dev01.4science.it/dspace-spring-rest/api/eperson/epersons/4dc70ab5-cd73-492f-b007-3179d2d9296b' + }, + self: { + href: 'https://hasselt-dspace.dev01.4science.it/dspace-spring-rest/api/authn/status' + } } }, - _links: { - eperson: { - href: 'https://hasselt-dspace.dev01.4science.it/dspace-spring-rest/api/eperson/epersons/4dc70ab5-cd73-492f-b007-3179d2d9296b' - }, - self: { - href: 'https://hasselt-dspace.dev01.4science.it/dspace-spring-rest/api/authn/status' - } - } - }, - statusCode: 200, - statusText: '200' + statusCode: 200, + statusText: '200' - }; + }; + }); it('should return a AuthStatusResponse if data contains a valid AuthStatus object as payload', () => { const response = service.parse(validRequest, validResponse); diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index d4bda00a34..f0100c7c66 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -107,6 +107,12 @@ import { MyDSpaceResponseParsingService } from './data/mydspace-response-parsing import { ClaimedTaskDataService } from './tasks/claimed-task-data.service'; import { PoolTaskDataService } from './tasks/pool-task-data.service'; import { TaskResponseParsingService } from './tasks/task-response-parsing.service'; +import { NormalizedClaimedTask } from './tasks/models/normalized-claimed-task-object.model'; +import { NormalizedTaskObject } from './tasks/models/normalized-task-object.model'; +import { NormalizedPoolTask } from './tasks/models/normalized-pool-task-object.model'; +import { NormalizedRelationship } from './cache/models/items/normalized-relationship.model'; +import { NormalizedRelationshipType } from './cache/models/items/normalized-relationship-type.model'; +import { NormalizedItemType } from './cache/models/items/normalized-item-type.model'; const IMPORTS = [ CommonModule, @@ -227,7 +233,13 @@ export const normalizedModels = NormalizedSubmissionSectionModel, NormalizedAuthStatus, NormalizedAuthorityValue, - BrowseEntry + BrowseEntry, + NormalizedClaimedTask, + NormalizedTaskObject, + NormalizedPoolTask, + NormalizedRelationship, + NormalizedRelationshipType, + NormalizedItemType ]; @NgModule({ diff --git a/src/app/core/tasks/models/normalized-claimed-task-object.model.ts b/src/app/core/tasks/models/normalized-claimed-task-object.model.ts index b999c62888..8f9283277e 100644 --- a/src/app/core/tasks/models/normalized-claimed-task-object.model.ts +++ b/src/app/core/tasks/models/normalized-claimed-task-object.model.ts @@ -31,6 +31,20 @@ export class NormalizedClaimedTask extends NormalizedTaskObject { @autoserialize action: string; + /** + * The eperson object for this task + */ + @autoserialize + @relationship(ResourceType.EPerson, false) + eperson: string; + + /** + * The group object for this task + */ + @autoserialize + @relationship(ResourceType.Group, false) + group: string; + /** * The workflowitem object whom this task is related */ diff --git a/src/app/core/tasks/models/normalized-pool-task-object.model.ts b/src/app/core/tasks/models/normalized-pool-task-object.model.ts index b1466def42..06a2b3cacb 100644 --- a/src/app/core/tasks/models/normalized-pool-task-object.model.ts +++ b/src/app/core/tasks/models/normalized-pool-task-object.model.ts @@ -31,6 +31,13 @@ export class NormalizedPoolTask extends NormalizedTaskObject { @autoserialize action: string; + /** + * The group object for this task + */ + @autoserialize + @relationship(ResourceType.Group, false) + group: string; + /** * The workflowitem object whom this task is related */ diff --git a/src/app/core/tasks/models/normalized-task-object.model.ts b/src/app/core/tasks/models/normalized-task-object.model.ts index 31c9a9cad4..f45d8305b8 100644 --- a/src/app/core/tasks/models/normalized-task-object.model.ts +++ b/src/app/core/tasks/models/normalized-task-object.model.ts @@ -30,6 +30,20 @@ export abstract class NormalizedTaskObject extends Norma @autoserialize action: string; + /** + * The eperson object for this task + */ + @autoserialize + @relationship(ResourceType.EPerson, false) + eperson: string; + + /** + * The group object for this task + */ + @autoserialize + @relationship(ResourceType.Group, false) + group: string; + /** * The workflowitem object whom this task is related */ diff --git a/src/app/core/tasks/models/task-object.model.ts b/src/app/core/tasks/models/task-object.model.ts index d03b3651c0..de86874e0d 100644 --- a/src/app/core/tasks/models/task-object.model.ts +++ b/src/app/core/tasks/models/task-object.model.ts @@ -5,6 +5,8 @@ import { DSpaceObject } from '../../shared/dspace-object.model'; import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model'; import { RemoteData } from '../../data/remote-data'; import { WorkflowItem } from '../../submission/models/workflowitem.model'; +import { Group } from '../../eperson/models/group.model'; +import { EPerson } from '../../eperson/models/eperson.model'; /** * An abstract model class for a TaskObject. @@ -26,6 +28,16 @@ export class TaskObject extends DSpaceObject implements CacheableObject, Listabl */ action: string; + /** + * The group of this task + */ + eperson: Observable>; + + /** + * The group of this task + */ + group: Observable>; + /** * The workflowitem object whom this task is related */ diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts index 974879e1a7..d1900f603a 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts @@ -10,6 +10,7 @@ import { ClaimedTaskMyDSpaceResult } from '../../../object-collection/shared/cla import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; +import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; let component: ClaimedMyDSpaceResultListElementComponent; let fixture: ComponentFixture; From 81ba49f22043930684a094becc9aa2f798258534 Mon Sep 17 00:00:00 2001 From: lotte Date: Tue, 28 May 2019 14:58:10 +0200 Subject: [PATCH 07/38] Simplified and refactored manual creation of remote data objects for tests --- .../bitstream-formats.component.spec.ts | 3 +- .../metadata-registry.component.spec.ts | 3 +- .../metadata-schema.component.spec.ts | 7 +-- .../browse-by-date-page.component.spec.ts | 5 ++- .../browse-by-metadata-page.component.spec.ts | 5 ++- .../browse-by-title-page.component.spec.ts | 3 +- .../create-collection-page.guard.spec.ts | 12 ++--- .../create-community-page.guard.spec.ts | 12 ++--- ...-page-sub-community-list.component.spec.ts | 7 ++- .../edit-item-operators.spec.ts | 14 +++--- .../item-delete/item-delete.component.spec.ts | 3 +- .../edit-in-place-field.component.spec.ts | 3 +- .../item-metadata.component.spec.ts | 11 +++-- .../item-private.component.spec.ts | 3 +- .../item-public/item-public.component.spec.ts | 3 +- .../item-reinstate.component.spec.ts | 3 +- .../item-status/item-status.component.spec.ts | 3 +- .../item-withdraw.component.spec.ts | 3 +- ...tract-simple-item-action.component.spec.ts | 8 +++- .../collections/collections.component.spec.ts | 8 +++- .../full/full-item-page.component.spec.ts | 8 +++- .../item-page-field.component.spec.ts | 3 +- .../simple/item-page.component.spec.ts | 13 ++++-- .../journal-issue.component.spec.ts | 3 +- .../journal-volume.component.spec.ts | 3 +- .../journal/journal.component.spec.ts | 3 +- .../orgunit/orgunit.component.spec.ts | 3 +- .../person/person.component.spec.ts | 3 +- .../project/project.component.spec.ts | 3 +- .../publication/publication.component.spec.ts | 3 +- .../item-types/shared/item.component.spec.ts | 15 ++++--- .../related-items.component.spec.ts | 5 ++- .../my-dspace-page.component.spec.ts | 3 +- .../search-facet-filter.component.spec.ts | 3 +- .../search-range-filter.component.spec.ts | 3 +- .../search-page.component.spec.ts | 3 +- .../search-configuration.service.ts | 3 +- .../search-service/search.service.spec.ts | 3 +- .../remote-data-build.service.spec.ts | 5 ++- .../builders/remote-data-build.service.ts | 3 +- .../core/metadata/metadata.service.spec.ts | 9 +--- .../core/registry/registry.service.spec.ts | 3 +- src/app/core/shared/item.model.spec.ts | 20 +++------ src/app/core/shared/operators.spec.ts | 28 +++++++----- .../browse-by/browse-by.component.spec.ts | 3 +- .../create-comcol-page.component.spec.ts | 13 +++--- .../edit-comcol-page.component.spec.ts | 9 ++-- .../dso-selector.component.spec.ts | 3 +- ...llection-parent-selector.component.spec.ts | 3 +- ...ommunity-parent-selector.component.spec.ts | 3 +- ...ate-item-parent-selector.component.spec.ts | 3 +- ...o-selector-modal-wrapper.component.spec.ts | 3 +- ...edit-collection-selector.component.spec.ts | 3 +- .../edit-community-selector.component.spec.ts | 3 +- .../edit-item-selector.component.spec.ts | 3 +- .../item-type-switcher.component.spec.ts | 3 +- .../mocks/mock-remote-data-build.service.ts | 3 +- .../claimed-task-actions.component.spec.ts | 5 ++- .../pool-task-actions.component.spec.ts | 5 ++- .../workflowitem-actions.component.spec.ts | 3 +- .../workspaceitem-actions.component.spec.ts | 3 +- .../my-dspace-item-status.component.spec.ts | 5 ++- .../item-submitter.component.spec.ts | 5 ++- ...ce-result-detail-element.component.spec.ts | 5 ++- ...ce-result-detail-element.component.spec.ts | 5 ++- ...ce-result-detail-element.component.spec.ts | 3 +- ...ce-result-detail-element.component.spec.ts | 3 +- .../object-detail.component.spec.ts | 3 +- .../item-list-element.component.spec.ts | 3 +- ...arch-result-list-element.component.spec.ts | 3 +- ...pace-result-list-element.component.spec.ts | 5 ++- ...pace-result-list-element.component.spec.ts | 5 ++- ...pace-result-list-element.component.spec.ts | 3 +- ...pace-result-list-element.component.spec.ts | 3 +- .../testing/auth-request-service-stub.ts | 5 ++- src/app/shared/testing/auth-service-stub.ts | 3 +- src/app/shared/testing/utils.ts | 45 +++++++++++++++++++ .../edit/submission-edit.component.spec.ts | 23 +++------- ...bmission-form-collection.component.spec.ts | 20 ++++----- .../license/section-license.component.spec.ts | 29 ++++++------ .../upload/section-upload.component.spec.ts | 33 ++++---------- src/app/submission/submission.service.spec.ts | 42 ++++++++--------- src/app/submission/submission.service.ts | 31 +++++++------ 83 files changed, 363 insertions(+), 260 deletions(-) diff --git a/src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts b/src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts index b6e3b7e989..3a680c906b 100644 --- a/src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts +++ b/src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts @@ -13,6 +13,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe'; import { HostWindowService } from '../../../shared/host-window.service'; import { HostWindowServiceStub } from '../../../shared/testing/host-window-service-stub'; +import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils'; describe('BitstreamFormatsComponent', () => { let comp: BitstreamFormatsComponent; @@ -52,7 +53,7 @@ describe('BitstreamFormatsComponent', () => { extensions: null } ]; - const mockFormats = observableOf(new RemoteData(false, false, true, undefined, new PaginatedList(null, mockFormatsList))); + const mockFormats = createSuccessfulRemoteDataObject$(new PaginatedList(null, mockFormatsList)); const registryServiceStub = { getBitstreamFormats: () => mockFormats }; diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts b/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts index d641c97352..4a5e301921 100644 --- a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts +++ b/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts @@ -17,6 +17,7 @@ import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub'; import { RestResponse } from '../../../core/cache/response.models'; +import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils'; describe('MetadataRegistryComponent', () => { let comp: MetadataRegistryComponent; @@ -36,7 +37,7 @@ describe('MetadataRegistryComponent', () => { namespace: 'http://dspace.org/mockschema' } ]; - const mockSchemas = observableOf(new RemoteData(false, false, true, undefined, new PaginatedList(null, mockSchemasList))); + const mockSchemas = createSuccessfulRemoteDataObject$(new PaginatedList(null, mockSchemasList)); /* tslint:disable:no-empty */ const registryServiceStub = { getMetadataSchemas: () => mockSchemas, diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts b/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts index 9cec4475ea..e23a9691c4 100644 --- a/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts +++ b/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts @@ -21,6 +21,7 @@ import { NotificationsService } from '../../../shared/notifications/notification import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub'; import { RestResponse } from '../../../core/cache/response.models'; import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; +import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils'; describe('MetadataSchemaComponent', () => { let comp: MetadataSchemaComponent; @@ -74,12 +75,12 @@ describe('MetadataSchemaComponent', () => { schema: mockSchemasList[1] } ]; - const mockSchemas = observableOf(new RemoteData(false, false, true, undefined, new PaginatedList(null, mockSchemasList))); + const mockSchemas = createSuccessfulRemoteDataObject$(new PaginatedList(null, mockSchemasList)); /* tslint:disable:no-empty */ const registryServiceStub = { getMetadataSchemas: () => mockSchemas, - getMetadataFieldsBySchema: (schema: MetadataSchema) => observableOf(new RemoteData(false, false, true, undefined, new PaginatedList(null, mockFieldsList.filter((value) => value.schema === schema)))), - getMetadataSchemaByName: (schemaName: string) => observableOf(new RemoteData(false, false, true, undefined, mockSchemasList.filter((value) => value.prefix === schemaName)[0])), + getMetadataFieldsBySchema: (schema: MetadataSchema) => createSuccessfulRemoteDataObject$(new PaginatedList(null, mockFieldsList.filter((value) => value.schema === schema))), + getMetadataSchemaByName: (schemaName: string) => createSuccessfulRemoteDataObject$(mockSchemasList.filter((value) => value.prefix === schemaName)[0]), getActiveMetadataField: () => observableOf(undefined), getSelectedMetadataFields: () => observableOf([]), editMetadataField: (schema) => {}, diff --git a/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.spec.ts b/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.spec.ts index ccf7cde67b..78f5d52511 100644 --- a/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.spec.ts +++ b/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.spec.ts @@ -18,6 +18,7 @@ import { Item } from '../../core/shared/item.model'; import { ENV_CONFIG, GLOBAL_CONFIG } from '../../../config'; import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model'; import { toRemoteData } from '../+browse-by-metadata-page/browse-by-metadata-page.component.spec'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; describe('BrowseByDatePageComponent', () => { let comp: BrowseByDatePageComponent; @@ -48,11 +49,11 @@ describe('BrowseByDatePageComponent', () => { const mockBrowseService = { getBrowseEntriesFor: (options: BrowseEntrySearchOptions) => toRemoteData([]), getBrowseItemsFor: (value: string, options: BrowseEntrySearchOptions) => toRemoteData([firstItem]), - getFirstItemFor: () => observableOf(new RemoteData(false, false, true, undefined, firstItem)) + getFirstItemFor: () => createSuccessfulRemoteDataObject$(firstItem) }; const mockDsoService = { - findById: () => observableOf(new RemoteData(false, false, true, null, mockCommunity)) + findById: () => createSuccessfulRemoteDataObject$(mockCommunity) }; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { diff --git a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts b/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts index 26a4ff8fd5..4252503cc3 100644 --- a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts +++ b/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts @@ -21,6 +21,7 @@ import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.serv import { Community } from '../../core/shared/community.model'; import { MockRouter } from '../../shared/mocks/mock-router'; import { ResourceType } from '../../core/shared/resource-type'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; describe('BrowseByMetadataPageComponent', () => { let comp: BrowseByMetadataPageComponent; @@ -74,7 +75,7 @@ describe('BrowseByMetadataPageComponent', () => { }; const mockDsoService = { - findById: () => observableOf(new RemoteData(false, false, true, null, mockCommunity)) + findById: () => createSuccessfulRemoteDataObject$(mockCommunity) }; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { @@ -155,5 +156,5 @@ describe('BrowseByMetadataPageComponent', () => { }); export function toRemoteData(objects: any[]): Observable>> { - return observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), objects))); + return createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), objects)); } diff --git a/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.spec.ts b/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.spec.ts index 855101bb9d..3bc69e5fcb 100644 --- a/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.spec.ts +++ b/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.spec.ts @@ -17,6 +17,7 @@ import { RemoteData } from '../../core/data/remote-data'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { BrowseService } from '../../core/browse/browse.service'; import { MockRouter } from '../../shared/mocks/mock-router'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; describe('BrowseByTitlePageComponent', () => { let comp: BrowseByTitlePageComponent; @@ -52,7 +53,7 @@ describe('BrowseByTitlePageComponent', () => { }; const mockDsoService = { - findById: () => observableOf(new RemoteData(false, false, true, null, mockCommunity)) + findById: () => createSuccessfulRemoteDataObject$(mockCommunity) }; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { diff --git a/src/app/+collection-page/create-collection-page/create-collection-page.guard.spec.ts b/src/app/+collection-page/create-collection-page/create-collection-page.guard.spec.ts index 5d21ae36b3..a5618d76ed 100644 --- a/src/app/+collection-page/create-collection-page/create-collection-page.guard.spec.ts +++ b/src/app/+collection-page/create-collection-page/create-collection-page.guard.spec.ts @@ -1,9 +1,11 @@ import { CreateCollectionPageGuard } from './create-collection-page.guard'; import { MockRouter } from '../../shared/mocks/mock-router'; -import { RemoteData } from '../../core/data/remote-data'; import { Community } from '../../core/shared/community.model'; -import { of as observableOf } from 'rxjs'; import { first } from 'rxjs/operators'; +import { + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject$ +} from '../../shared/testing/utils'; describe('CreateCollectionPageGuard', () => { describe('canActivate', () => { @@ -15,11 +17,11 @@ describe('CreateCollectionPageGuard', () => { communityDataServiceStub = { findById: (id: string) => { if (id === 'valid-id') { - return observableOf(new RemoteData(false, false, true, null, new Community())); + return createSuccessfulRemoteDataObject$(new Community()); } else if (id === 'invalid-id') { - return observableOf(new RemoteData(false, false, true, null, undefined)); + return createSuccessfulRemoteDataObject$(undefined); } else if (id === 'error-id') { - return observableOf(new RemoteData(false, false, false, null, new Community())); + return createFailedRemoteDataObject$(new Community()); } } }; diff --git a/src/app/+community-page/create-community-page/create-community-page.guard.spec.ts b/src/app/+community-page/create-community-page/create-community-page.guard.spec.ts index 0cc7232871..c246f5e689 100644 --- a/src/app/+community-page/create-community-page/create-community-page.guard.spec.ts +++ b/src/app/+community-page/create-community-page/create-community-page.guard.spec.ts @@ -1,9 +1,11 @@ import { CreateCommunityPageGuard } from './create-community-page.guard'; import { MockRouter } from '../../shared/mocks/mock-router'; -import { RemoteData } from '../../core/data/remote-data'; import { Community } from '../../core/shared/community.model'; -import { of as observableOf } from 'rxjs'; import { first } from 'rxjs/operators'; +import { + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject$ +} from '../../shared/testing/utils'; describe('CreateCommunityPageGuard', () => { describe('canActivate', () => { @@ -15,11 +17,11 @@ describe('CreateCommunityPageGuard', () => { communityDataServiceStub = { findById: (id: string) => { if (id === 'valid-id') { - return observableOf(new RemoteData(false, false, true, null, new Community())); + return createSuccessfulRemoteDataObject$(new Community()); } else if (id === 'invalid-id') { - return observableOf(new RemoteData(false, false, true, null, undefined)); + return createSuccessfulRemoteDataObject$(undefined); } else if (id === 'error-id') { - return observableOf(new RemoteData(false, false, false, null, new Community())); + return createFailedRemoteDataObject$(new Community()); } } }; diff --git a/src/app/+community-page/sub-community-list/community-page-sub-community-list.component.spec.ts b/src/app/+community-page/sub-community-list/community-page-sub-community-list.component.spec.ts index 3e6190ae6d..2feaa3afa6 100644 --- a/src/app/+community-page/sub-community-list/community-page-sub-community-list.component.spec.ts +++ b/src/app/+community-page/sub-community-list/community-page-sub-community-list.component.spec.ts @@ -11,6 +11,7 @@ import {RouterTestingModule} from '@angular/router/testing'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {By} from '@angular/platform-browser'; import {of as observableOf, Observable } from 'rxjs'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; describe('SubCommunityList Component', () => { let comp: CommunityPageSubCommunityListComponent; @@ -40,8 +41,7 @@ describe('SubCommunityList Component', () => { { language: 'en_US', value: 'Test title' } ] }, - subcommunities: observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), []))) + subcommunities: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])) }); const mockCommunity = Object.assign(new Community(), { @@ -50,8 +50,7 @@ describe('SubCommunityList Component', () => { { language: 'en_US', value: 'Test title' } ] }, - subcommunities: observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), subcommunities))) + subcommunities: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), subcommunities)) }) ; diff --git a/src/app/+item-page/edit-item-page/edit-item-operators.spec.ts b/src/app/+item-page/edit-item-page/edit-item-operators.spec.ts index 8086a62b8f..ec087e3b1c 100644 --- a/src/app/+item-page/edit-item-page/edit-item-operators.spec.ts +++ b/src/app/+item-page/edit-item-page/edit-item-operators.spec.ts @@ -2,6 +2,10 @@ import {RemoteData} from '../../core/data/remote-data'; import {hot} from 'jasmine-marbles'; import {Item} from '../../core/shared/item.model'; import {findSuccessfulAccordingTo} from './edit-item-operators'; +import { + createFailedRemoteDataObject, + createSuccessfulRemoteDataObject +} from '../../shared/testing/utils'; describe('findSuccessfulAccordingTo', () => { let mockItem1; @@ -19,11 +23,11 @@ describe('findSuccessfulAccordingTo', () => { }); it('should return first successful RemoteData Observable that complies to predicate', () => { const testRD = { - a: new RemoteData(false, false, true, null, undefined), - b: new RemoteData(false, false, false, null, mockItem1), - c: new RemoteData(false, false, true, null, mockItem2), - d: new RemoteData(false, false, true, null, mockItem1), - e: new RemoteData(false, false, true, null, mockItem2), + a: createSuccessfulRemoteDataObject(undefined), + b: createFailedRemoteDataObject(mockItem1), + c: createSuccessfulRemoteDataObject(mockItem2), + d: createSuccessfulRemoteDataObject(mockItem1), + e: createSuccessfulRemoteDataObject(mockItem2), }; const source = hot('abcde', testRD); diff --git a/src/app/+item-page/edit-item-page/item-delete/item-delete.component.spec.ts b/src/app/+item-page/edit-item-page/item-delete/item-delete.component.spec.ts index 6d435c8de8..82d03f1f1b 100644 --- a/src/app/+item-page/edit-item-page/item-delete/item-delete.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-delete/item-delete.component.spec.ts @@ -17,6 +17,7 @@ import { By } from '@angular/platform-browser'; import { ItemDeleteComponent } from './item-delete.component'; import { getItemEditPath } from '../../item-page-routing.module'; import { RestResponse } from '../../../core/cache/response.models'; +import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils'; let comp: ItemDeleteComponent; let fixture: ComponentFixture; @@ -49,7 +50,7 @@ describe('ItemDeleteComponent', () => { routeStub = { data: observableOf({ - item: new RemoteData(false, false, true, null, mockItem) + item: createSuccessfulRemoteDataObject(mockItem) }) }; diff --git a/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts b/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts index bd1a4e5545..b8d122d4f6 100644 --- a/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts @@ -17,6 +17,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { MetadatumViewModel } from '../../../../core/shared/metadata.models'; import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; import { MetadataField } from '../../../../core/metadata/metadata-field.model'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; let comp: EditInPlaceFieldComponent; let fixture: ComponentFixture; @@ -59,7 +60,7 @@ describe('EditInPlaceFieldComponent', () => { paginatedMetadataFields = new PaginatedList(undefined, [mdField1, mdField2, mdField3]); metadataFieldService = jasmine.createSpyObj({ - queryMetadataFields: observableOf(new RemoteData(false, false, true, undefined, paginatedMetadataFields)), + queryMetadataFields: createSuccessfulRemoteDataObject$(paginatedMetadataFields), }); objectUpdatesService = jasmine.createSpyObj('objectUpdatesService', { diff --git a/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.spec.ts b/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.spec.ts index 90008f3d72..e51182e7b3 100644 --- a/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.spec.ts @@ -20,13 +20,16 @@ import { RouterStub } from '../../../shared/testing/router-stub'; import { GLOBAL_CONFIG } from '../../../../config'; import { Item } from '../../../core/shared/item.model'; import { FieldChangeType } from '../../../core/data/object-updates/object-updates.actions'; -import { RemoteData } from '../../../core/data/remote-data'; import { MetadatumViewModel } from '../../../core/shared/metadata.models'; import { RegistryService } from '../../../core/registry/registry.service'; import { PaginatedList } from '../../../core/data/paginated-list'; import { Metadata } from '../../../core/shared/metadata.utils'; import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; import { MetadataField } from '../../../core/metadata/metadata-field.model'; +import { + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$ +} from '../../../shared/testing/utils'; let comp: ItemMetadataComponent; let fixture: ComponentFixture; @@ -116,18 +119,18 @@ describe('ItemMetadataComponent', () => { ) ; itemService = jasmine.createSpyObj('itemService', { - update: observableOf(new RemoteData(false, false, true, undefined, item)), + update: createSuccessfulRemoteDataObject$(item), commitUpdates: {} }); routeStub = { parent: { - data: observableOf({ item: new RemoteData(false, false, true, null, item) }) + data: observableOf({ item: createSuccessfulRemoteDataObject(item) }) } }; paginatedMetadataFields = new PaginatedList(undefined, [mdField1, mdField2, mdField3]); metadataFieldService = jasmine.createSpyObj({ - getAllMetadataFields: observableOf(new RemoteData(false, false, true, undefined, paginatedMetadataFields)) + getAllMetadataFields:createSuccessfulRemoteDataObject$(paginatedMetadataFields) }); scheduler = getTestScheduler(); objectUpdatesService = jasmine.createSpyObj('objectUpdatesService', diff --git a/src/app/+item-page/edit-item-page/item-private/item-private.component.spec.ts b/src/app/+item-page/edit-item-page/item-private/item-private.component.spec.ts index 651bebde58..827a4bb55a 100644 --- a/src/app/+item-page/edit-item-page/item-private/item-private.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-private/item-private.component.spec.ts @@ -16,6 +16,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; import { ItemPrivateComponent } from './item-private.component'; import { RestResponse } from '../../../core/cache/response.models'; +import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils'; let comp: ItemPrivateComponent; let fixture: ComponentFixture; @@ -50,7 +51,7 @@ describe('ItemPrivateComponent', () => { routeStub = { data: observableOf({ - item: new RemoteData(false, false, true, null, { + item: createSuccessfulRemoteDataObject({ id: 'fake-id' }) }) diff --git a/src/app/+item-page/edit-item-page/item-public/item-public.component.spec.ts b/src/app/+item-page/edit-item-page/item-public/item-public.component.spec.ts index 7516a84265..9cd7508868 100644 --- a/src/app/+item-page/edit-item-page/item-public/item-public.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-public/item-public.component.spec.ts @@ -16,6 +16,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; import { ItemPublicComponent } from './item-public.component'; import { RestResponse } from '../../../core/cache/response.models'; +import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils'; let comp: ItemPublicComponent; let fixture: ComponentFixture; @@ -50,7 +51,7 @@ describe('ItemPublicComponent', () => { routeStub = { data: observableOf({ - item: new RemoteData(false, false, true, null, { + item: createSuccessfulRemoteDataObject({ id: 'fake-id' }) }) diff --git a/src/app/+item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts b/src/app/+item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts index f606fb4a83..8dfc403bd3 100644 --- a/src/app/+item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts @@ -16,6 +16,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; import { ItemReinstateComponent } from './item-reinstate.component'; import { RestResponse } from '../../../core/cache/response.models'; +import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils'; let comp: ItemReinstateComponent; let fixture: ComponentFixture; @@ -50,7 +51,7 @@ describe('ItemReinstateComponent', () => { routeStub = { data: observableOf({ - item: new RemoteData(false, false, true, null, { + item: createSuccessfulRemoteDataObject({ id: 'fake-id' }) }) diff --git a/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts b/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts index 00ea9b9f62..fac7dc86f6 100644 --- a/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts @@ -12,6 +12,7 @@ import { By } from '@angular/platform-browser'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { of as observableOf } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; +import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils'; describe('ItemStatusComponent', () => { let comp: ItemStatusComponent; @@ -27,7 +28,7 @@ describe('ItemStatusComponent', () => { const routeStub = { parent: { - data: observableOf({ item: new RemoteData(false, false, true, null, mockItem) }) + data: observableOf({ item: createSuccessfulRemoteDataObject(mockItem) }) } }; diff --git a/src/app/+item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts b/src/app/+item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts index ac49eee7e7..4c23a1d1e5 100644 --- a/src/app/+item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts @@ -16,6 +16,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ItemWithdrawComponent } from './item-withdraw.component'; import { By } from '@angular/platform-browser'; import { RestResponse } from '../../../core/cache/response.models'; +import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils'; let comp: ItemWithdrawComponent; let fixture: ComponentFixture; @@ -50,7 +51,7 @@ describe('ItemWithdrawComponent', () => { routeStub = { data: observableOf({ - item: new RemoteData(false, false, true, null, { + item: createSuccessfulRemoteDataObject({ id: 'fake-id' }) }) diff --git a/src/app/+item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts b/src/app/+item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts index 32acdef467..e4413e47c6 100644 --- a/src/app/+item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts +++ b/src/app/+item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts @@ -17,6 +17,10 @@ import { By } from '@angular/platform-browser'; import { of as observableOf } from 'rxjs'; import { getItemEditPath } from '../../item-page-routing.module'; import { RestResponse } from '../../../core/cache/response.models'; +import { + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$ +} from '../../../shared/testing/utils'; /** * Test component that implements the AbstractSimpleItemActionComponent used to test the @@ -65,12 +69,12 @@ describe('AbstractSimpleItemActionComponent', () => { }); mockItemDataService = jasmine.createSpyObj({ - findById: observableOf(new RemoteData(false, false, true, undefined, mockItem)) + findById: createSuccessfulRemoteDataObject$(mockItem) }); routeStub = { data: observableOf({ - item: new RemoteData(false, false, true, null, { + item: createSuccessfulRemoteDataObject({ id: 'fake-id' }) }) diff --git a/src/app/+item-page/field-components/collections/collections.component.spec.ts b/src/app/+item-page/field-components/collections/collections.component.spec.ts index 53fcded9e3..b53f499881 100644 --- a/src/app/+item-page/field-components/collections/collections.component.spec.ts +++ b/src/app/+item-page/field-components/collections/collections.component.spec.ts @@ -9,6 +9,10 @@ import { Item } from '../../../core/shared/item.model'; import { of as observableOf } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; import { TranslateModule } from '@ngx-translate/core'; +import { + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject$ +} from '../../../shared/testing/utils'; let collectionsComponent: CollectionsComponent; let fixture: ComponentFixture; @@ -24,8 +28,8 @@ const mockCollection1: Collection = Object.assign(new Collection(), { } }); -const succeededMockItem: Item = Object.assign(new Item(), {owningCollection: observableOf(new RemoteData(false, false, true, null, mockCollection1))}); -const failedMockItem: Item = Object.assign(new Item(), {owningCollection: observableOf(new RemoteData(false, false, false, null, mockCollection1))}); +const succeededMockItem: Item = Object.assign(new Item(), {owningCollection: createSuccessfulRemoteDataObject$(mockCollection1)}); +const failedMockItem: Item = Object.assign(new Item(), {owningCollection: createFailedRemoteDataObject$(mockCollection1)}); describe('CollectionsComponent', () => { beforeEach(async(() => { diff --git a/src/app/+item-page/full/full-item-page.component.spec.ts b/src/app/+item-page/full/full-item-page.component.spec.ts index 15dd001964..2f151b4997 100644 --- a/src/app/+item-page/full/full-item-page.component.spec.ts +++ b/src/app/+item-page/full/full-item-page.component.spec.ts @@ -17,9 +17,13 @@ import { RemoteData } from '../../core/data/remote-data'; import { of as observableOf } from 'rxjs'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { By } from '@angular/platform-browser'; +import { + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$ +} from '../../shared/testing/utils'; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: { 'dc.title': [ { @@ -30,7 +34,7 @@ const mockItem: Item = Object.assign(new Item(), { } }); const routeStub = Object.assign(new ActivatedRouteStub(), { - data: observableOf({ item: new RemoteData(false, false, true, null, mockItem) }) + data: observableOf({ item: createSuccessfulRemoteDataObject(mockItem) }) }); const metadataServiceStub = { /* tslint:disable:no-empty */ diff --git a/src/app/+item-page/simple/field-components/specific-field/item-page-field.component.spec.ts b/src/app/+item-page/simple/field-components/specific-field/item-page-field.component.spec.ts index ea6e722c66..1b7acb2e3b 100644 --- a/src/app/+item-page/simple/field-components/specific-field/item-page-field.component.spec.ts +++ b/src/app/+item-page/simple/field-components/specific-field/item-page-field.component.spec.ts @@ -11,6 +11,7 @@ import { ItemPageFieldComponent } from './item-page-field.component'; import { MetadataValuesComponent } from '../../../field-components/metadata-values/metadata-values.component'; import { of as observableOf } from 'rxjs'; import { MetadataMap, MetadataValue } from '../../../../core/shared/metadata.models'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; let comp: ItemPageFieldComponent; let fixture: ComponentFixture; @@ -52,7 +53,7 @@ describe('ItemPageFieldComponent', () => { export function mockItemWithMetadataFieldAndValue(field: string, value: string): Item { const item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: new MetadataMap() }); item.metadata[field] = [{ diff --git a/src/app/+item-page/simple/item-page.component.spec.ts b/src/app/+item-page/simple/item-page.component.spec.ts index e1202ab725..cd5c385671 100644 --- a/src/app/+item-page/simple/item-page.component.spec.ts +++ b/src/app/+item-page/simple/item-page.component.spec.ts @@ -16,9 +16,13 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { By } from '@angular/platform-browser'; import { createRelationshipsObservable } from './item-types/shared/item.component.spec'; import { of as observableOf } from 'rxjs'; +import { + createFailedRemoteDataObject$, createPendingRemoteDataObject$, createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$ +} from '../../shared/testing/utils'; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: [], relationships: createRelationshipsObservable() }); @@ -33,7 +37,7 @@ describe('ItemPageComponent', () => { /* tslint:enable:no-empty */ }; const mockRoute = Object.assign(new ActivatedRouteStub(), { - data: observableOf({ item: new RemoteData(false, false, true, null, mockItem) }) + data: observableOf({ item: createSuccessfulRemoteDataObject(mockItem) }) }); beforeEach(async(() => { @@ -66,7 +70,8 @@ describe('ItemPageComponent', () => { describe('when the item is loading', () => { beforeEach(() => { - comp.itemRD$ = observableOf(new RemoteData(true, true, true, null, undefined)); + comp.itemRD$ = createPendingRemoteDataObject$(undefined); + // comp.itemRD$ = observableOf(new RemoteData(true, true, true, null, undefined)); fixture.detectChanges(); }); @@ -78,7 +83,7 @@ describe('ItemPageComponent', () => { describe('when the item failed loading', () => { beforeEach(() => { - comp.itemRD$ = observableOf(new RemoteData(false, false, false, null, undefined)); + comp.itemRD$ = createFailedRemoteDataObject$(undefined); fixture.detectChanges(); }); diff --git a/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.spec.ts b/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.spec.ts index 24b18af96e..5ef92bc493 100644 --- a/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.spec.ts +++ b/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.spec.ts @@ -5,9 +5,10 @@ import { PageInfo } from '../../../../core/shared/page-info.model'; import { createRelationshipsObservable, getItemPageFieldsTest } from '../shared/item.component.spec'; import { JournalIssueComponent } from './journal-issue.component'; import { of as observableOf } from 'rxjs'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: { 'journalissue.identifier.number': [ { diff --git a/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.spec.ts b/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.spec.ts index a6f32e9b5f..75157a0865 100644 --- a/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.spec.ts +++ b/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.spec.ts @@ -5,9 +5,10 @@ import { PageInfo } from '../../../../core/shared/page-info.model'; import { createRelationshipsObservable, getItemPageFieldsTest } from '../shared/item.component.spec'; import { JournalVolumeComponent } from './journal-volume.component'; import { of as observableOf } from 'rxjs'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: { 'journalvolume.identifier.volume': [ { diff --git a/src/app/+item-page/simple/item-types/journal/journal.component.spec.ts b/src/app/+item-page/simple/item-types/journal/journal.component.spec.ts index 08e8859b35..a494364c8b 100644 --- a/src/app/+item-page/simple/item-types/journal/journal.component.spec.ts +++ b/src/app/+item-page/simple/item-types/journal/journal.component.spec.ts @@ -15,12 +15,13 @@ import { PageInfo } from '../../../../core/shared/page-info.model'; import { isNotEmpty } from '../../../../shared/empty.util'; import { JournalComponent } from './journal.component'; import { of as observableOf } from 'rxjs'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; let comp: JournalComponent; let fixture: ComponentFixture; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: { 'journal.identifier.issn': [ { diff --git a/src/app/+item-page/simple/item-types/orgunit/orgunit.component.spec.ts b/src/app/+item-page/simple/item-types/orgunit/orgunit.component.spec.ts index fa5396fb3d..acb73ff685 100644 --- a/src/app/+item-page/simple/item-types/orgunit/orgunit.component.spec.ts +++ b/src/app/+item-page/simple/item-types/orgunit/orgunit.component.spec.ts @@ -5,9 +5,10 @@ import { PageInfo } from '../../../../core/shared/page-info.model'; import { createRelationshipsObservable, getItemPageFieldsTest } from '../shared/item.component.spec'; import { OrgunitComponent } from './orgunit.component'; import { of as observableOf } from 'rxjs'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: { 'orgunit.identifier.dateestablished': [ { diff --git a/src/app/+item-page/simple/item-types/person/person.component.spec.ts b/src/app/+item-page/simple/item-types/person/person.component.spec.ts index cf0d5c197d..5051e047e6 100644 --- a/src/app/+item-page/simple/item-types/person/person.component.spec.ts +++ b/src/app/+item-page/simple/item-types/person/person.component.spec.ts @@ -5,9 +5,10 @@ import { PageInfo } from '../../../../core/shared/page-info.model'; import { createRelationshipsObservable, getItemPageFieldsTest } from '../shared/item.component.spec'; import { PersonComponent } from './person.component'; import { of as observableOf } from 'rxjs'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: { 'person.identifier.email': [ { diff --git a/src/app/+item-page/simple/item-types/project/project.component.spec.ts b/src/app/+item-page/simple/item-types/project/project.component.spec.ts index 9b54ff9a41..dae1226caf 100644 --- a/src/app/+item-page/simple/item-types/project/project.component.spec.ts +++ b/src/app/+item-page/simple/item-types/project/project.component.spec.ts @@ -5,9 +5,10 @@ import { PageInfo } from '../../../../core/shared/page-info.model'; import { createRelationshipsObservable, getItemPageFieldsTest } from '../shared/item.component.spec'; import { ProjectComponent } from './project.component'; import { of as observableOf } from 'rxjs'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: { 'project.identifier.status': [ { diff --git a/src/app/+item-page/simple/item-types/publication/publication.component.spec.ts b/src/app/+item-page/simple/item-types/publication/publication.component.spec.ts index 48a7a05f45..eac23a9748 100644 --- a/src/app/+item-page/simple/item-types/publication/publication.component.spec.ts +++ b/src/app/+item-page/simple/item-types/publication/publication.component.spec.ts @@ -17,9 +17,10 @@ import { createRelationshipsObservable } from '../shared/item.component.spec'; import { PublicationComponent } from './publication.component'; import { of as observableOf } from 'rxjs'; import { MetadataMap } from '../../../../core/shared/metadata.models'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: new MetadataMap(), relationships: createRelationshipsObservable() }); diff --git a/src/app/+item-page/simple/item-types/shared/item.component.spec.ts b/src/app/+item-page/simple/item-types/shared/item.component.spec.ts index a6b4dd801d..5604018b37 100644 --- a/src/app/+item-page/simple/item-types/shared/item.component.spec.ts +++ b/src/app/+item-page/simple/item-types/shared/item.component.spec.ts @@ -26,6 +26,7 @@ import { MetadatumRepresentation } from '../../../../core/shared/metadata-repres import { ItemMetadataRepresentation } from '../../../../core/shared/metadata-representation/item/item-metadata-representation.model'; import { MetadataMap, MetadataValue } from '../../../../core/shared/metadata.models'; import { compareArraysUsing, compareArraysUsingIds } from './item-relationships-utils'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; /** * Create a generic test for an item-page-fields component using a mockItem and the type of component @@ -102,11 +103,11 @@ export function containsFieldInput(fields: DebugElement[], metadataKey: string): } export function createRelationshipsObservable() { - return observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), [ + return createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [ Object.assign(new Relationship(), { - relationshipType: observableOf(new RemoteData(false, false, true, null, new RelationshipType())) + relationshipType: createSuccessfulRemoteDataObject$(new RelationshipType()) }) - ]))); + ])); } describe('ItemComponent', () => { const arr1 = [ @@ -323,15 +324,15 @@ describe('ItemComponent', () => { id: '1', uuid: '1', metadata: new MetadataMap(), - relationships: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), [ + relationships: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [ Object.assign(new Relationship(), { uuid: '123', id: '123', leftId: '1', rightId: '2', - relationshipType: observableOf(new RemoteData(false, false, true, null, new RelationshipType())) + relationshipType: createSuccessfulRemoteDataObject$(new RelationshipType()) }) - ]))) + ])) }); mockItem.metadata[metadataField] = [ { @@ -367,7 +368,7 @@ describe('ItemComponent', () => { const mockItemDataService = Object.assign({ findById: (id) => { if (id === relatedItem.id) { - return observableOf(new RemoteData(false, false, true, null, relatedItem)) + return createSuccessfulRemoteDataObject$(relatedItem) } } }) as ItemDataService; diff --git a/src/app/+item-page/simple/related-items/related-items.component.spec.ts b/src/app/+item-page/simple/related-items/related-items.component.spec.ts index ef42ab1098..1896f46015 100644 --- a/src/app/+item-page/simple/related-items/related-items.component.spec.ts +++ b/src/app/+item-page/simple/related-items/related-items.component.spec.ts @@ -8,14 +8,15 @@ import { PageInfo } from '../../../core/shared/page-info.model'; import { By } from '@angular/platform-browser'; import { createRelationshipsObservable } from '../item-types/shared/item.component.spec'; import { of as observableOf } from 'rxjs'; +import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils'; const mockItem1: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: [], relationships: createRelationshipsObservable() }); const mockItem2: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: [], relationships: createRelationshipsObservable() }); diff --git a/src/app/+my-dspace-page/my-dspace-page.component.spec.ts b/src/app/+my-dspace-page/my-dspace-page.component.spec.ts index 9658814a6a..34af21073f 100644 --- a/src/app/+my-dspace-page/my-dspace-page.component.spec.ts +++ b/src/app/+my-dspace-page/my-dspace-page.component.spec.ts @@ -29,6 +29,7 @@ import { RoleDirective } from '../shared/roles/role.directive'; import { RoleService } from '../core/roles/role.service'; import { MockRoleService } from '../shared/mocks/mock-role-service'; import { SearchFixedFilterService } from '../+search-page/search-filters/search-filter/search-fixed-filter.service'; +import { createSuccessfulRemoteDataObject$ } from '../shared/testing/utils'; describe('MyDSpacePageComponent', () => { let comp: MyDSpacePageComponent; @@ -46,7 +47,7 @@ describe('MyDSpacePageComponent', () => { pagination.currentPage = 1; pagination.pageSize = 10; const sort: SortOptions = new SortOptions('score', SortDirection.DESC); - const mockResults = observableOf(new RemoteData(false, false, true, null, ['test', 'data'])); + const mockResults = createSuccessfulRemoteDataObject$(['test', 'data']); const searchServiceStub = jasmine.createSpyObj('SearchService', { search: mockResults, getSearchLink: '/mydspace', diff --git a/src/app/+search-page/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts b/src/app/+search-page/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts index 5d8b51de96..af5ca68de1 100644 --- a/src/app/+search-page/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts +++ b/src/app/+search-page/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts @@ -20,6 +20,7 @@ import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-d import { SearchConfigurationServiceStub } from '../../../../shared/testing/search-configuration-service-stub'; import { SEARCH_CONFIG_SERVICE } from '../../../../+my-dspace-page/my-dspace-page.component'; import { tap } from 'rxjs/operators'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; describe('SearchFacetFilterComponent', () => { let comp: SearchFacetFilterComponent; @@ -61,7 +62,7 @@ describe('SearchFacetFilterComponent', () => { let router; const page = observableOf(0); - const mockValues = observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), values))); + const mockValues = createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), values)); beforeEach(async(() => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule], diff --git a/src/app/+search-page/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts b/src/app/+search-page/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts index 119f3f92a9..da86e3a759 100644 --- a/src/app/+search-page/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts +++ b/src/app/+search-page/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts @@ -20,6 +20,7 @@ import { RouteService } from '../../../../shared/services/route.service'; import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../+my-dspace-page/my-dspace-page.component'; import { SearchConfigurationServiceStub } from '../../../../shared/testing/search-configuration-service-stub'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils'; describe('SearchRangeFilterComponent', () => { let comp: SearchRangeFilterComponent; @@ -66,7 +67,7 @@ describe('SearchRangeFilterComponent', () => { let router; const page = observableOf(0); - const mockValues = observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), values))); + const mockValues = createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), values)); beforeEach(async(() => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule], diff --git a/src/app/+search-page/search-page.component.spec.ts b/src/app/+search-page/search-page.component.spec.ts index 88c7c693d3..fe4c301bd5 100644 --- a/src/app/+search-page/search-page.component.spec.ts +++ b/src/app/+search-page/search-page.component.spec.ts @@ -25,6 +25,7 @@ import { RouteService } from '../shared/services/route.service'; import { SearchConfigurationServiceStub } from '../shared/testing/search-configuration-service-stub'; import { PaginatedSearchOptions } from './paginated-search-options.model'; import { SearchFixedFilterService } from './search-filters/search-filter/search-fixed-filter.service'; +import { createSuccessfulRemoteDataObject$ } from '../shared/testing/utils'; let comp: SearchPageComponent; let fixture: ComponentFixture; @@ -41,7 +42,7 @@ pagination.id = 'search-results-pagination'; pagination.currentPage = 1; pagination.pageSize = 10; const sort: SortOptions = new SortOptions('score', SortDirection.DESC); -const mockResults = observableOf(new RemoteData(false, false, true, null, ['test', 'data'])); +const mockResults = createSuccessfulRemoteDataObject$(['test', 'data']); const searchServiceStub = jasmine.createSpyObj('SearchService', { search: mockResults, getSearchLink: '/search', diff --git a/src/app/+search-page/search-service/search-configuration.service.ts b/src/app/+search-page/search-service/search-configuration.service.ts index aaec928958..1c12fe5037 100644 --- a/src/app/+search-page/search-service/search-configuration.service.ts +++ b/src/app/+search-page/search-service/search-configuration.service.ts @@ -21,6 +21,7 @@ import { getSucceededRemoteData } from '../../core/shared/operators'; import { SearchFilter } from '../search-filter.model'; import { DSpaceObjectType } from '../../core/shared/dspace-object-type.model'; import { SearchFixedFilterService } from '../search-filters/search-filter/search-fixed-filter.service'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; /** * Service that performs all actions that have to do with the current search configuration @@ -271,7 +272,7 @@ export class SearchConfigurationService implements OnDestroy { scope: this.defaultScope, query: this.defaultQuery }); - this._defaults = observableOf(new RemoteData(false, false, true, null, options)); + this._defaults = createSuccessfulRemoteDataObject$(options); } return this._defaults; } diff --git a/src/app/+search-page/search-service/search.service.spec.ts b/src/app/+search-page/search-service/search.service.spec.ts index 9ec5bc35f2..4ae9876159 100644 --- a/src/app/+search-page/search-service/search.service.spec.ts +++ b/src/app/+search-page/search-service/search.service.spec.ts @@ -28,6 +28,7 @@ import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.serv import { map } from 'rxjs/operators'; import { RouteService } from '../../shared/services/route.service'; import { routeServiceStub } from '../../shared/testing/route-service-stub'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; @Component({ template: '' }) class DummyComponent { @@ -91,7 +92,7 @@ describe('SearchService', () => { ); }, aggregate: (input: Array>>): Observable> => { - return observableOf(new RemoteData(false, false, true, null, [])); + return createSuccessfulRemoteDataObject$([]); } }; diff --git a/src/app/core/cache/builders/remote-data-build.service.spec.ts b/src/app/core/cache/builders/remote-data-build.service.spec.ts index 272969050d..2f0e024521 100644 --- a/src/app/core/cache/builders/remote-data-build.service.spec.ts +++ b/src/app/core/cache/builders/remote-data-build.service.spec.ts @@ -4,6 +4,7 @@ import { PaginatedList } from '../../data/paginated-list'; import { PageInfo } from '../../shared/page-info.model'; import { RemoteData } from '../../data/remote-data'; import { of as observableOf } from 'rxjs'; +import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils'; const pageInfo = new PageInfo(); const array = [ @@ -29,8 +30,8 @@ const array = [ }) ]; const paginatedList = new PaginatedList(pageInfo, array); -const arrayRD = new RemoteData(false, false, true, undefined, array); -const paginatedListRD = new RemoteData(false, false, true, undefined, paginatedList); +const arrayRD = createSuccessfulRemoteDataObject(array); +const paginatedListRD = createSuccessfulRemoteDataObject(paginatedList); describe('RemoteDataBuildService', () => { let service: RemoteDataBuildService; diff --git a/src/app/core/cache/builders/remote-data-build.service.ts b/src/app/core/cache/builders/remote-data-build.service.ts index 8c706d46cd..85ba7636b6 100644 --- a/src/app/core/cache/builders/remote-data-build.service.ts +++ b/src/app/core/cache/builders/remote-data-build.service.ts @@ -22,6 +22,7 @@ import { getResourceLinksFromResponse } from '../../shared/operators'; import { CacheableObject, TypedObject } from '../object-cache.reducer'; +import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils'; @Injectable() export class RemoteDataBuildService { @@ -200,7 +201,7 @@ export class RemoteDataBuildService { aggregate(input: Array>>): Observable> { if (isEmpty(input)) { - return observableOf(new RemoteData(false, false, true, null, [])); + return createSuccessfulRemoteDataObject$([]); } return observableCombineLatest(...input).pipe( diff --git a/src/app/core/metadata/metadata.service.spec.ts b/src/app/core/metadata/metadata.service.spec.ts index cfb5a0751d..80ce33b370 100644 --- a/src/app/core/metadata/metadata.service.spec.ts +++ b/src/app/core/metadata/metadata.service.spec.ts @@ -38,6 +38,7 @@ import { EmptyError } from 'rxjs/internal-compatibility'; import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service'; import { DSOChangeAnalyzer } from '../data/dso-change-analyzer.service'; import { MetadataValue } from '../shared/metadata.models'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; /* tslint:disable:max-classes-per-file */ @Component({ @@ -206,13 +207,7 @@ describe('MetadataService', () => { }); const mockRemoteData = (mockItem: Item): Observable> => { - return observableOf(new RemoteData( - false, - false, - true, - undefined, - MockItem - )); + return createSuccessfulRemoteDataObject$(MockItem); }; const mockType = (mockItem: Item, type: string): Item => { diff --git a/src/app/core/registry/registry.service.spec.ts b/src/app/core/registry/registry.service.spec.ts index 5517b41ed0..d044633e85 100644 --- a/src/app/core/registry/registry.service.spec.ts +++ b/src/app/core/registry/registry.service.spec.ts @@ -42,6 +42,7 @@ import { import { ResourceType } from '../shared/resource-type'; import { MetadataSchema } from '../metadata/metadata-schema.model'; import { MetadataField } from '../metadata/metadata-field.model'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; @Component({ template: '' }) class DummyComponent { @@ -131,7 +132,7 @@ describe('RegistryService', () => { ); }, aggregate: (input: Array>>): Observable> => { - return observableOf(new RemoteData(false, false, true, null, [])); + return createSuccessfulRemoteDataObject$([]); } }; diff --git a/src/app/core/shared/item.model.spec.ts b/src/app/core/shared/item.model.spec.ts index 2e5388dc4d..101dc4986e 100644 --- a/src/app/core/shared/item.model.spec.ts +++ b/src/app/core/shared/item.model.spec.ts @@ -5,6 +5,7 @@ import { RemoteData } from '../data/remote-data'; import { Bitstream } from './bitstream.model'; import { isEmpty } from '../../shared/empty.util'; import { first, map } from 'rxjs/operators'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; describe('Item', () => { @@ -32,9 +33,9 @@ describe('Item', () => { content: bitstream2Path }]; - remoteDataThumbnail = createRemoteDataObject(thumbnail); - remoteDataFiles = createRemoteDataObject(bitstreams); - remoteDataAll = createRemoteDataObject([...bitstreams, thumbnail]); + remoteDataThumbnail = createSuccessfulRemoteDataObject$(thumbnail); + remoteDataFiles = createSuccessfulRemoteDataObject$(bitstreams); + remoteDataAll = createSuccessfulRemoteDataObject$([...bitstreams, thumbnail]); // Create Bundles @@ -100,15 +101,4 @@ describe('Item', () => { }); -}); - -function createRemoteDataObject(object: any) { - return observableOf(new RemoteData( - false, - false, - true, - undefined, - object - )); - -} +}); \ No newline at end of file diff --git a/src/app/core/shared/operators.spec.ts b/src/app/core/shared/operators.spec.ts index 564b0ff319..56b5d5db7e 100644 --- a/src/app/core/shared/operators.spec.ts +++ b/src/app/core/shared/operators.spec.ts @@ -18,6 +18,10 @@ import { import { RemoteData } from '../data/remote-data'; import { RemoteDataError } from '../data/remote-data-error'; import { of as observableOf } from 'rxjs'; +import { + createFailedRemoteDataObject, + createSuccessfulRemoteDataObject +} from '../../shared/testing/utils'; describe('Core Module - RxJS Operators', () => { let scheduler: TestScheduler; @@ -180,17 +184,17 @@ describe('Core Module - RxJS Operators', () => { describe('getSucceededRemoteData', () => { it('should return the first() hasSucceeded RemoteData Observable', () => { const testRD = { - a: new RemoteData(false, false, true, null, undefined), - b: new RemoteData(false, false, false, null, 'b'), + a: createSuccessfulRemoteDataObject(undefined), + b: createFailedRemoteDataObject( 'b'), c: new RemoteData(false, false, undefined, null, 'c'), - d: new RemoteData(false, false, true, null, 'd'), - e: new RemoteData(false, false, true, null, 'e'), + d: createSuccessfulRemoteDataObject('d'), + e: createSuccessfulRemoteDataObject('e'), }; const source = hot('abcde', testRD); const result = source.pipe(getSucceededRemoteData()); result.subscribe((value) => expect(value) - .toEqual(new RemoteData(false, false, true, null, 'd'))); + .toEqual(createSuccessfulRemoteDataObject('d'))); }); }); @@ -202,21 +206,21 @@ describe('Core Module - RxJS Operators', () => { }); it('should call navigateByUrl to a 404 page, when the remote data contains a 404 error', () => { - const testRD = new RemoteData(false, false, false, new RemoteDataError(404, 'Not Found', 'Object was not found'), undefined); + const testRD = createFailedRemoteDataObject(undefined, new RemoteDataError(404, 'Not Found', 'Object was not found')); observableOf(testRD).pipe(redirectToPageNotFoundOn404(router)).subscribe(); expect(router.navigateByUrl).toHaveBeenCalledWith('/404', { skipLocationChange: true }); }); it('should not call navigateByUrl to a 404 page, when the remote data contains another error than a 404', () => { - const testRD = new RemoteData(false, false, false, new RemoteDataError(500, 'Server Error', 'Something went wrong'), undefined); + const testRD = createFailedRemoteDataObject(undefined, new RemoteDataError(500, 'Server Error', 'Something went wrong')); observableOf(testRD).pipe(redirectToPageNotFoundOn404(router)).subscribe(); expect(router.navigateByUrl).not.toHaveBeenCalled(); }); it('should not call navigateByUrl to a 404 page, when the remote data contains no error', () => { - const testRD = new RemoteData(false, false, true, null, undefined); + const testRD = createSuccessfulRemoteDataObject(undefined); observableOf(testRD).pipe(redirectToPageNotFoundOn404(router)).subscribe(); expect(router.navigateByUrl).not.toHaveBeenCalled(); @@ -242,11 +246,11 @@ describe('Core Module - RxJS Operators', () => { describe('getAllSucceededRemoteData', () => { it('should return all hasSucceeded RemoteData Observables', () => { const testRD = { - a: new RemoteData(false, false, true, null, undefined), - b: new RemoteData(false, false, false, null, 'b'), + a: createSuccessfulRemoteDataObject(undefined), + b: createFailedRemoteDataObject('b'), c: new RemoteData(false, false, undefined, null, 'c'), - d: new RemoteData(false, false, true, null, 'd'), - e: new RemoteData(false, false, true, null, 'e'), + d: createSuccessfulRemoteDataObject('d'), + e: createSuccessfulRemoteDataObject('e'), }; const source = hot('abcde', testRD); const result = source.pipe(getAllSucceededRemoteData()); diff --git a/src/app/shared/browse-by/browse-by.component.spec.ts b/src/app/shared/browse-by/browse-by.component.spec.ts index bae345d009..5592b88c86 100644 --- a/src/app/shared/browse-by/browse-by.component.spec.ts +++ b/src/app/shared/browse-by/browse-by.component.spec.ts @@ -17,6 +17,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; +import { createSuccessfulRemoteDataObject$ } from '../testing/utils'; describe('BrowseByComponent', () => { let comp: BrowseByComponent; @@ -42,7 +43,7 @@ describe('BrowseByComponent', () => { ] }) ]; - const mockItemsRD$ = observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), mockItems))); + const mockItemsRD$ = createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), mockItems)); beforeEach(async(() => { TestBed.configureTestingModule({ diff --git a/src/app/shared/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts b/src/app/shared/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts index 4dad4a703f..08f15ad052 100644 --- a/src/app/shared/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts +++ b/src/app/shared/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts @@ -4,7 +4,6 @@ import { RouteService } from '../../services/route.service'; import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { RemoteData } from '../../../core/data/remote-data'; import { Community } from '../../../core/shared/community.model'; import { SharedModule } from '../../shared.module'; import { CommonModule } from '@angular/common'; @@ -13,6 +12,10 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { CreateComColPageComponent } from './create-comcol-page.component'; import { DataService } from '../../../core/data/data.service'; +import { + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject$ +} from '../../testing/utils'; describe('CreateComColPageComponent', () => { let comp: CreateComColPageComponent; @@ -46,14 +49,14 @@ describe('CreateComColPageComponent', () => { }); communityDataServiceStub = { - findById: (uuid) => observableOf(new RemoteData(false, false, true, null, Object.assign(new Community(), { + findById: (uuid) => createSuccessfulRemoteDataObject$(Object.assign(new Community(), { uuid: uuid, metadata: [{ key: 'dc.title', value: community.name }] - }))), - create: (com, uuid?) => observableOf(new RemoteData(false, false, true, undefined, newCommunity)) + })), + create: (com, uuid?) => createSuccessfulRemoteDataObject$(newCommunity) }; @@ -109,7 +112,7 @@ describe('CreateComColPageComponent', () => { it('should not navigate on failure', () => { spyOn(router, 'navigate'); - spyOn(dsoDataService, 'create').and.returnValue(observableOf(new RemoteData(true, true, false, undefined, newCommunity))); + spyOn(dsoDataService, 'create').and.returnValue(createFailedRemoteDataObject$(newCommunity)); comp.onSubmit(data); fixture.detectChanges(); expect(router.navigate).not.toHaveBeenCalled(); diff --git a/src/app/shared/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts b/src/app/shared/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts index 75b7fe40e7..03f751599f 100644 --- a/src/app/shared/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts +++ b/src/app/shared/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts @@ -3,7 +3,6 @@ import { CommunityDataService } from '../../../core/data/community-data.service' import { ActivatedRoute, Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { RemoteData } from '../../../core/data/remote-data'; import { Community } from '../../../core/shared/community.model'; import { SharedModule } from '../../shared.module'; import { CommonModule } from '@angular/common'; @@ -12,6 +11,10 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { EditComColPageComponent } from './edit-comcol-page.component'; import { DataService } from '../../../core/data/data.service'; +import { + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject$ +} from '../../testing/utils'; describe('EditComColPageComponent', () => { let comp: EditComColPageComponent; @@ -43,7 +46,7 @@ describe('EditComColPageComponent', () => { }); communityDataServiceStub = { - update: (com, uuid?) => observableOf(new RemoteData(false, false, true, undefined, newCommunity)) + update: (com, uuid?) => createSuccessfulRemoteDataObject$(newCommunity) }; @@ -97,7 +100,7 @@ describe('EditComColPageComponent', () => { it('should not navigate on failure', () => { spyOn(router, 'navigate'); - spyOn(dsoDataService, 'update').and.returnValue(observableOf(new RemoteData(true, true, false, undefined, newCommunity))); + spyOn(dsoDataService, 'update').and.returnValue(createFailedRemoteDataObject$(newCommunity)); comp.onSubmit(data); fixture.detectChanges(); expect(router.navigate).not.toHaveBeenCalled(); diff --git a/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts b/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts index 5ec553222b..54568a98d5 100644 --- a/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts +++ b/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts @@ -11,6 +11,7 @@ import { Item } from '../../../core/shared/item.model'; import { of as observableOf } from 'rxjs'; import { PaginatedList } from '../../../core/data/paginated-list'; import { MetadataValue } from '../../../core/shared/metadata.models'; +import { createSuccessfulRemoteDataObject$ } from '../../testing/utils'; describe('DSOSelectorComponent', () => { let component: DSOSelectorComponent; @@ -30,7 +31,7 @@ describe('DSOSelectorComponent', () => { searchResult.indexableObject = item; searchResult.hitHighlights = {}; const searchService = jasmine.createSpyObj('searchService', { - search: observableOf(new RemoteData(false, false, true, undefined, new PaginatedList(undefined, [searchResult]))) + search: createSuccessfulRemoteDataObject$(new PaginatedList(undefined, [searchResult])) }); beforeEach(async(() => { diff --git a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.spec.ts index 9efeddeeab..97957d5250 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.spec.ts @@ -10,6 +10,7 @@ import * as collectionRouter from '../../../../+collection-page/collection-page- import { Community } from '../../../../core/shared/community.model'; import { CreateCollectionParentSelectorComponent } from './create-collection-parent-selector.component'; import { MetadataValue } from '../../../../core/shared/metadata.models'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; describe('CreateCollectionParentSelectorComponent', () => { let component: CreateCollectionParentSelectorComponent; @@ -26,7 +27,7 @@ describe('CreateCollectionParentSelectorComponent', () => { })] }; const router = new RouterStub(); - const communityRD = new RemoteData(false, false, true, undefined, community); + const communityRD = createSuccessfulRemoteDataObject(community); const modalStub = jasmine.createSpyObj('modalStub', ['close']); const createPath = 'testCreatePath'; diff --git a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts index e1bb9c7997..4871d74b98 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts @@ -10,6 +10,7 @@ import * as communityRouter from '../../../../+community-page/community-page-rou import { Community } from '../../../../core/shared/community.model'; import { CreateCommunityParentSelectorComponent } from './create-community-parent-selector.component'; import { MetadataValue } from '../../../../core/shared/metadata.models'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; describe('CreateCommunityParentSelectorComponent', () => { let component: CreateCommunityParentSelectorComponent; @@ -20,7 +21,7 @@ describe('CreateCommunityParentSelectorComponent', () => { community.uuid = '1234-1234-1234-1234'; community.metadata = { 'dc.title': [Object.assign(new MetadataValue(), { value: 'Community title', language: undefined })] }; const router = new RouterStub(); - const communityRD = new RemoteData(false, false, true, undefined, community); + const communityRD = createSuccessfulRemoteDataObject(community); const modalStub = jasmine.createSpyObj('modalStub', ['close']); const createPath = 'testCreatePath'; diff --git a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.spec.ts index 19bb58eb5a..2c9b2499ab 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.spec.ts @@ -9,6 +9,7 @@ import { RouterStub } from '../../../testing/router-stub'; import { Collection } from '../../../../core/shared/collection.model'; import { CreateItemParentSelectorComponent } from './create-item-parent-selector.component'; import { MetadataValue } from '../../../../core/shared/metadata.models'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; describe('CreateItemParentSelectorComponent', () => { let component: CreateItemParentSelectorComponent; @@ -19,7 +20,7 @@ describe('CreateItemParentSelectorComponent', () => { collection.uuid = '1234-1234-1234-1234'; collection.metadata = { 'dc.title': [Object.assign(new MetadataValue(), { value: 'Collection title', language: undefined })] }; const router = new RouterStub(); - const collectionRD = new RemoteData(false, false, true, undefined, collection); + const collectionRD = createSuccessfulRemoteDataObject(collection); const modalStub = jasmine.createSpyObj('modalStub', ['close']); const createPath = 'testCreatePath'; diff --git a/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.spec.ts index 4ceaeccb3a..15f23d1fe6 100644 --- a/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.spec.ts @@ -14,6 +14,7 @@ import { By } from '@angular/platform-browser'; import { DSOSelectorComponent } from '../dso-selector/dso-selector.component'; import { MockComponent } from 'ng-mocks'; import { MetadataValue } from '../../../core/shared/metadata.models'; +import { createSuccessfulRemoteDataObject } from '../../testing/utils'; describe('DSOSelectorModalWrapperComponent', () => { let component: DSOSelectorModalWrapperComponent; @@ -29,7 +30,7 @@ describe('DSOSelectorModalWrapperComponent', () => { })] }; - const itemRD = new RemoteData(false, false, true, undefined, item); + const itemRD = createSuccessfulRemoteDataObject(item); const modalStub = jasmine.createSpyObj('modalStub', ['close']); beforeEach(async(() => { diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.spec.ts index 5e60348527..cbb8fb654e 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.spec.ts @@ -10,6 +10,7 @@ import * as collectionRouter from '../../../../+collection-page/collection-page- import { EditCollectionSelectorComponent } from './edit-collection-selector.component'; import { Collection } from '../../../../core/shared/collection.model'; import { MetadataValue } from '../../../../core/shared/metadata.models'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; describe('EditCollectionSelectorComponent', () => { let component: EditCollectionSelectorComponent; @@ -20,7 +21,7 @@ describe('EditCollectionSelectorComponent', () => { collection.uuid = '1234-1234-1234-1234'; collection.metadata = { 'dc.title': [Object.assign(new MetadataValue(), { value: 'Collection title', language: undefined })] }; const router = new RouterStub(); - const collectionRD = new RemoteData(false, false, true, undefined, collection); + const collectionRD = createSuccessfulRemoteDataObject(collection); const modalStub = jasmine.createSpyObj('modalStub', ['close']); const editPath = 'testEditPath'; diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.spec.ts index ac558a074a..46684e6cfb 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.spec.ts @@ -10,6 +10,7 @@ import * as communityRouter from '../../../../+community-page/community-page-rou import { EditCommunitySelectorComponent } from './edit-community-selector.component'; import { Community } from '../../../../core/shared/community.model'; import { MetadataValue } from '../../../../core/shared/metadata.models'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; describe('EditCommunitySelectorComponent', () => { let component: EditCommunitySelectorComponent; @@ -20,7 +21,7 @@ describe('EditCommunitySelectorComponent', () => { community.uuid = '1234-1234-1234-1234'; community.metadata = { 'dc.title': [Object.assign(new MetadataValue(), { value: 'Community title', language: undefined })] }; const router = new RouterStub(); - const communityRD = new RemoteData(false, false, true, undefined, community); + const communityRD = createSuccessfulRemoteDataObject(community); const modalStub = jasmine.createSpyObj('modalStub', ['close']); const editPath = 'testEditPath'; diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.spec.ts index 8ac04bb335..86066916a6 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.spec.ts @@ -10,6 +10,7 @@ import { RemoteData } from '../../../../core/data/remote-data'; import { RouterStub } from '../../../testing/router-stub'; import * as itemRouter from '../../../../+item-page/item-page-routing.module'; import { MetadataValue } from '../../../../core/shared/metadata.models'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; describe('EditItemSelectorComponent', () => { let component: EditItemSelectorComponent; @@ -20,7 +21,7 @@ describe('EditItemSelectorComponent', () => { item.uuid = '1234-1234-1234-1234'; item.metadata = { 'dc.title': [Object.assign(new MetadataValue(), { value: 'Item title', language: undefined })] }; const router = new RouterStub(); - const itemRD = new RemoteData(false, false, true, undefined, item); + const itemRD = createSuccessfulRemoteDataObject(item); const modalStub = jasmine.createSpyObj('modalStub', ['close']); const editPath = 'testEditPath'; diff --git a/src/app/shared/items/switcher/item-type-switcher.component.spec.ts b/src/app/shared/items/switcher/item-type-switcher.component.spec.ts index 3b13abf2ef..3f5b7c7f90 100644 --- a/src/app/shared/items/switcher/item-type-switcher.component.spec.ts +++ b/src/app/shared/items/switcher/item-type-switcher.component.spec.ts @@ -10,10 +10,11 @@ import * as decorator from '../item-type-decorator'; import { getComponentByItemType, ItemViewMode } from '../item-type-decorator'; import { ItemMetadataRepresentation } from '../../../core/shared/metadata-representation/item/item-metadata-representation.model'; import createSpy = jasmine.createSpy; +import { createSuccessfulRemoteDataObject$ } from '../../testing/utils'; const relationType = 'type'; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: { 'dc.title': [ { diff --git a/src/app/shared/mocks/mock-remote-data-build.service.ts b/src/app/shared/mocks/mock-remote-data-build.service.ts index 6a05c9bf36..888327bbda 100644 --- a/src/app/shared/mocks/mock-remote-data-build.service.ts +++ b/src/app/shared/mocks/mock-remote-data-build.service.ts @@ -5,6 +5,7 @@ import { RemoteData } from '../../core/data/remote-data'; import { RequestEntry } from '../../core/data/request.reducer'; import { hasValue } from '../empty.util'; import { NormalizedObject } from '../../core/cache/models/normalized-object.model'; +import { createSuccessfulRemoteDataObject$ } from '../testing/utils'; export function getMockRemoteDataBuildService(toRemoteDataObservable$?: Observable>): RemoteDataBuildService { return { @@ -18,7 +19,7 @@ export function getMockRemoteDataBuildService(toRemoteDataObservable$?: Observab } as RemoteData))) } }, - buildSingle: (href$: string | Observable) => observableOf(new RemoteData(false, false, true, undefined, {})), + buildSingle: (href$: string | Observable) => createSuccessfulRemoteDataObject$({}), build: (normalized: NormalizedObject) => Object.create({}) } as RemoteDataBuildService; diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts index 4944165e0a..ef083cfab9 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts @@ -17,6 +17,7 @@ import { ClaimedTaskDataService } from '../../../core/tasks/claimed-task-data.se import { ClaimedTaskActionsComponent } from './claimed-task-actions.component'; import { ClaimedTask } from '../../../core/tasks/models/claimed-task-object.model'; import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; +import { createSuccessfulRemoteDataObject } from '../../testing/utils'; let component: ClaimedTaskActionsComponent; let fixture: ComponentFixture; @@ -60,9 +61,9 @@ const item = Object.assign(new Item(), { ] } }); -const rdItem = new RemoteData(false, false, true, null, item); +const rdItem = createSuccessfulRemoteDataObject(item); const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem), id: '1234' }); describe('ClaimedTaskActionsComponent', () => { diff --git a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts index e76065878f..151f0383f4 100644 --- a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts @@ -17,6 +17,7 @@ import { PoolTaskDataService } from '../../../core/tasks/pool-task-data.service' import { PoolTaskActionsComponent } from './pool-task-actions.component'; import { PoolTask } from '../../../core/tasks/models/pool-task-object.model'; import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; +import { createSuccessfulRemoteDataObject } from '../../testing/utils'; let component: PoolTaskActionsComponent; let fixture: ComponentFixture; @@ -58,9 +59,9 @@ const item = Object.assign(new Item(), { ] } }); -const rdItem = new RemoteData(false, false, true, null, item); +const rdItem = createSuccessfulRemoteDataObject(item); const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem), id: '1234' }); describe('PoolTaskActionsComponent', () => { diff --git a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts index c8e4299f6d..e2f0e49104 100644 --- a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts @@ -14,6 +14,7 @@ import { WorkflowitemActionsComponent } from './workflowitem-actions.component'; import { WorkflowItemDataService } from '../../../core/submission/workflowitem-data.service'; import { NotificationsService } from '../../notifications/notifications.service'; import { NotificationsServiceStub } from '../../testing/notifications-service-stub'; +import { createSuccessfulRemoteDataObject } from '../../testing/utils'; let component: WorkflowitemActionsComponent; let fixture: ComponentFixture; @@ -51,7 +52,7 @@ const item = Object.assign(new Item(), { ] } }); -const rd = new RemoteData(false, false, true, null, item); +const rd = createSuccessfulRemoteDataObject(item); mockObject = Object.assign(new WorkflowItem(), { item: observableOf(rd), id: '1234', uuid: '1234' }); describe('WorkflowitemActionsComponent', () => { diff --git a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts index cc0eee7ede..507a466858 100644 --- a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts @@ -16,6 +16,7 @@ import { Item } from '../../../core/shared/item.model'; import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model'; import { WorkspaceitemActionsComponent } from './workspaceitem-actions.component'; import { WorkspaceitemDataService } from '../../../core/submission/workspaceitem-data.service'; +import { createSuccessfulRemoteDataObject } from '../../testing/utils'; let component: WorkspaceitemActionsComponent; let fixture: ComponentFixture; @@ -56,7 +57,7 @@ const item = Object.assign(new Item(), { ] } }); -const rd = new RemoteData(false, false, true, null, item); +const rd = createSuccessfulRemoteDataObject(item); mockObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd), id: '1234', uuid: '1234' }); describe('WorkspaceitemActionsComponent', () => { diff --git a/src/app/shared/object-collection/shared/mydspace-item-status/my-dspace-item-status.component.spec.ts b/src/app/shared/object-collection/shared/mydspace-item-status/my-dspace-item-status.component.spec.ts index 19efb3e702..712e478f86 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-status/my-dspace-item-status.component.spec.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-status/my-dspace-item-status.component.spec.ts @@ -13,15 +13,16 @@ import { MyDSpaceItemStatusComponent } from './my-dspace-item-status.component'; import { MyDspaceItemStatusType } from './my-dspace-item-status-type'; import { MockTranslateLoader } from '../../../mocks/mock-translate-loader'; import { By } from '@angular/platform-browser'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: MyDSpaceItemStatusComponent; let fixture: ComponentFixture; let mockResultObject: PoolTask; -const rdSumbitter = new RemoteData(false, false, true, null, EPersonMock); +const rdSumbitter = createSuccessfulRemoteDataObject(EPersonMock); const workflowitem = Object.assign(new WorkflowItem(), { submitter: observableOf(rdSumbitter) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockResultObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); describe('MyDSpaceItemStatusComponent', () => { diff --git a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts index 6a2805574c..0641a79378 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts @@ -12,6 +12,7 @@ import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; import { EPersonMock } from '../../../testing/eperson-mock'; import { MockTranslateLoader } from '../../../mocks/mock-translate-loader'; import { By } from '@angular/platform-browser'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: ItemSubmitterComponent; let fixture: ComponentFixture; @@ -20,9 +21,9 @@ const compIndex = 1; let mockResultObject: PoolTask; -const rdSumbitter = new RemoteData(false, false, true, null, EPersonMock); +const rdSumbitter = createSuccessfulRemoteDataObject(EPersonMock); const workflowitem = Object.assign(new WorkflowItem(), { submitter: observableOf(rdSumbitter) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockResultObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); describe('ItemSubmitterComponent', () => { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.spec.ts index ac435ac997..f57eb6420e 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.spec.ts @@ -11,6 +11,7 @@ import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.m import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: ClaimedMyDSpaceResultDetailElementComponent; let fixture: ComponentFixture; @@ -49,9 +50,9 @@ const item = Object.assign(new Item(), { ] } }); -const rdItem = new RemoteData(false, false, true, null, item); +const rdItem = createSuccessfulRemoteDataObject(item); const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) }); describe('ClaimedMyDSpaceResultDetailElementComponent', () => { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.spec.ts index c001f11fb3..a031ac3a49 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.spec.ts @@ -11,6 +11,7 @@ import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: PoolMyDSpaceResultDetailElementComponent; let fixture: ComponentFixture; @@ -49,9 +50,9 @@ const item = Object.assign(new Item(), { ] } }); -const rdItem = new RemoteData(false, false, true, null, item); +const rdItem = createSuccessfulRemoteDataObject(item); const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockResultObject.indexableObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); describe('PoolMyDSpaceResultDetailElementComponent', () => { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.spec.ts index 214b9afb4a..2a4b1321e2 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.spec.ts @@ -10,6 +10,7 @@ import { WorkflowitemMyDSpaceResult } from '../../../object-collection/shared/wo import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: WorkflowitemMyDSpaceResultDetailElementComponent; let fixture: ComponentFixture; @@ -48,7 +49,7 @@ const item = Object.assign(new Item(), { ] } }); -const rd = new RemoteData(false, false, true, null, item); +const rd = createSuccessfulRemoteDataObject(item); mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: observableOf(rd) }); describe('WorkflowitemMyDSpaceResultDetailElementComponent', () => { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.spec.ts index e2a0fbdb33..0e16b9c0f6 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.spec.ts @@ -10,6 +10,7 @@ import { WorkspaceitemMyDSpaceResult } from '../../../object-collection/shared/w import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: WorkspaceitemMyDSpaceResultDetailElementComponent; let fixture: ComponentFixture; @@ -48,7 +49,7 @@ const item = Object.assign(new Item(), { ] } }); -const rd = new RemoteData(false, false, true, null, item); +const rd = createSuccessfulRemoteDataObject(item); mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd) }); describe('WorkspaceitemMyDSpaceResultDetailElementComponent', () => { diff --git a/src/app/shared/object-detail/object-detail.component.spec.ts b/src/app/shared/object-detail/object-detail.component.spec.ts index 9b81f1019f..651e6a89a8 100644 --- a/src/app/shared/object-detail/object-detail.component.spec.ts +++ b/src/app/shared/object-detail/object-detail.component.spec.ts @@ -8,6 +8,7 @@ import { RemoteData } from '../../core/data/remote-data'; import { PaginatedList } from '../../core/data/paginated-list'; import { PageInfo } from '../../core/shared/page-info.model'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { createSuccessfulRemoteDataObject } from '../testing/utils'; describe('ObjectDetailComponent', () => { let comp: ObjectDetailComponent; @@ -27,7 +28,7 @@ describe('ObjectDetailComponent', () => { { ten: 10 } ]; const pageInfo = Object.assign(new PageInfo(), {elementsPerPage: 1, totalElements: 10, totalPages: 10, currentPage: 1}) - const mockRD = new RemoteData(false, false, true, null, new PaginatedList(pageInfo, testObjects)); + const mockRD = createSuccessfulRemoteDataObject(new PaginatedList(pageInfo, testObjects)); beforeEach(async(() => { TestBed.configureTestingModule({ diff --git a/src/app/shared/object-list/item-list-element/item-list-element.component.spec.ts b/src/app/shared/object-list/item-list-element/item-list-element.component.spec.ts index 11fdae7e6d..2c0c8b0aa2 100644 --- a/src/app/shared/object-list/item-list-element/item-list-element.component.spec.ts +++ b/src/app/shared/object-list/item-list-element/item-list-element.component.spec.ts @@ -8,9 +8,10 @@ import { PageInfo } from '../../../core/shared/page-info.model'; import { By } from '@angular/platform-browser'; import { createRelationshipsObservable } from '../../../+item-page/simple/item-types/shared/item.component.spec'; import { of as observableOf } from 'rxjs'; +import { createSuccessfulRemoteDataObject$ } from '../../testing/utils'; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: [], relationships: createRelationshipsObservable() }); diff --git a/src/app/shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component.spec.ts index f320ff2efc..9adf255523 100644 --- a/src/app/shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component.spec.ts @@ -12,9 +12,10 @@ import { ItemSearchResult } from '../../../object-collection/shared/item-search- import { createRelationshipsObservable } from '../../../../+item-page/simple/item-types/shared/item.component.spec'; import { of as observableOf } from 'rxjs'; import { MetadataMap } from '../../../../core/shared/metadata.models'; +import { createSuccessfulRemoteDataObject$ } from '../../../testing/utils'; const mockItem: Item = Object.assign(new Item(), { - bitstreams: observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))), + bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), metadata: [], relationships: createRelationshipsObservable() }); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts index d1900f603a..5815cd5401 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.spec.ts @@ -11,6 +11,7 @@ import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.m import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: ClaimedMyDSpaceResultListElementComponent; let fixture: ComponentFixture; @@ -49,9 +50,9 @@ const item = Object.assign(new Item(), { ] } }); -const rdItem = new RemoteData(false, false, true, null, item); +const rdItem = createSuccessfulRemoteDataObject(item); const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) }); describe('ClaimedMyDSpaceResultListElementComponent', () => { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.spec.ts index a514a0a544..22804a3a30 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.spec.ts @@ -11,6 +11,7 @@ import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: PoolMyDSpaceResultListElementComponent; let fixture: ComponentFixture; @@ -49,9 +50,9 @@ const item = Object.assign(new Item(), { ] } }); -const rdItem = new RemoteData(false, false, true, null, item); +const rdItem = createSuccessfulRemoteDataObject(item); const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockResultObject.indexableObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); describe('PoolMyDSpaceResultListElementComponent', () => { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.spec.ts index 4120904e81..ab472b4014 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.spec.ts @@ -10,6 +10,7 @@ import { WorkflowitemMyDSpaceResult } from '../../../object-collection/shared/wo import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: WorkflowitemMyDSpaceResultListElementComponent; let fixture: ComponentFixture; @@ -48,7 +49,7 @@ const item = Object.assign(new Item(), { ] } }); -const rd = new RemoteData(false, false, true, null, item); +const rd = createSuccessfulRemoteDataObject(item); mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: observableOf(rd) }); describe('WorkflowitemMyDSpaceResultListElementComponent', () => { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.spec.ts index 1b083e8139..a1c2472d27 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.spec.ts @@ -10,6 +10,7 @@ import { WorkspaceitemMyDSpaceResult } from '../../../object-collection/shared/w import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: WorkspaceitemMyDSpaceResultListElementComponent; let fixture: ComponentFixture; @@ -48,7 +49,7 @@ const item = Object.assign(new Item(), { ] } }); -const rd = new RemoteData(false, false, true, null, item); +const rd = createSuccessfulRemoteDataObject(item); mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd) }); describe('WorkspaceitemMyDSpaceResultListElementComponent', () => { diff --git a/src/app/shared/testing/auth-request-service-stub.ts b/src/app/shared/testing/auth-request-service-stub.ts index 7f4c171bff..82ce682a9b 100644 --- a/src/app/shared/testing/auth-request-service-stub.ts +++ b/src/app/shared/testing/auth-request-service-stub.ts @@ -6,6 +6,7 @@ import { EPerson } from '../../core/eperson/models/eperson.model'; import { isNotEmpty } from '../empty.util'; import { EPersonMock } from './eperson-mock'; import { RemoteData } from '../../core/data/remote-data'; +import { createSuccessfulRemoteDataObject$ } from './utils'; export class AuthRequestServiceStub { protected mockUser: EPerson = EPersonMock; @@ -27,7 +28,7 @@ export class AuthRequestServiceStub { if (this.validateToken(token)) { authStatusStub.authenticated = true; authStatusStub.token = this.mockTokenInfo; - authStatusStub.eperson = observableOf(new RemoteData(false, false, true, undefined, this.mockUser)); + authStatusStub.eperson = createSuccessfulRemoteDataObject$(this.mockUser); } else { authStatusStub.authenticated = false; } @@ -46,7 +47,7 @@ export class AuthRequestServiceStub { if (this.validateToken(token)) { authStatusStub.authenticated = true; authStatusStub.token = this.mockTokenInfo; - authStatusStub.eperson = observableOf(new RemoteData(false, false, true, undefined, this.mockUser)); + authStatusStub.eperson = createSuccessfulRemoteDataObject$(this.mockUser); } else { authStatusStub.authenticated = false; } diff --git a/src/app/shared/testing/auth-service-stub.ts b/src/app/shared/testing/auth-service-stub.ts index fa263da31f..a65923dcab 100644 --- a/src/app/shared/testing/auth-service-stub.ts +++ b/src/app/shared/testing/auth-service-stub.ts @@ -4,6 +4,7 @@ import { AuthTokenInfo } from '../../core/auth/models/auth-token-info.model'; import { EPersonMock } from './eperson-mock'; import { EPerson } from '../../core/eperson/models/eperson.model'; import { RemoteData } from '../../core/data/remote-data'; +import { createSuccessfulRemoteDataObject$ } from './utils'; export class AuthServiceStub { @@ -20,7 +21,7 @@ export class AuthServiceStub { authStatus.okay = true; authStatus.authenticated = true; authStatus.token = this.token; - authStatus.eperson = observableOf(new RemoteData(false, false, true, undefined, EPersonMock)); + authStatus.eperson = createSuccessfulRemoteDataObject$(EPersonMock); return observableOf(authStatus); } else { console.log('error'); diff --git a/src/app/shared/testing/utils.ts b/src/app/shared/testing/utils.ts index 770a554439..c372ea06a4 100644 --- a/src/app/shared/testing/utils.ts +++ b/src/app/shared/testing/utils.ts @@ -1,4 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { RemoteData } from '../../core/data/remote-data'; +import { Observable, of as observableOf } from 'rxjs'; +import { RemoteDataError } from '../../core/data/remote-data-error'; /** * Returns true if a Native Element has a specified css class. @@ -50,3 +53,45 @@ export function spyOnOperator(obj: any, prop: string): any { return spyOn(obj, prop); } + +export function createSuccessfulRemoteDataObject(object: T): RemoteData{ + return new RemoteData( + false, + false, + true, + undefined, + object + ); +} + +export function createSuccessfulRemoteDataObject$(object: T): Observable>{ + return observableOf(createSuccessfulRemoteDataObject(object)); +} + +export function createFailedRemoteDataObject(object?: T, error?: RemoteDataError): RemoteData{ + return new RemoteData( + false, + false, + false, + error, + object + ); +} + +export function createFailedRemoteDataObject$(object?: T, error?: RemoteDataError): Observable>{ + return observableOf(createFailedRemoteDataObject(object, error)); +} + +export function createPendingRemoteDataObject(object?: T): RemoteData{ + return new RemoteData( + true, + true, + true, + null, + object + ); +} + +export function createPendingRemoteDataObject$(object?: T): Observable>{ + return observableOf(createPendingRemoteDataObject(object)); +} \ No newline at end of file diff --git a/src/app/submission/edit/submission-edit.component.spec.ts b/src/app/submission/edit/submission-edit.component.spec.ts index 5c9a247aa2..115016d2fe 100644 --- a/src/app/submission/edit/submission-edit.component.spec.ts +++ b/src/app/submission/edit/submission-edit.component.spec.ts @@ -16,7 +16,7 @@ import { getMockTranslateService } from '../../shared/mocks/mock-translate.servi import { RouterStub } from '../../shared/testing/router-stub'; import { ActivatedRouteStub } from '../../shared/testing/active-router-stub'; import { mockSubmissionObject } from '../../shared/mocks/mock-submission'; -import { RemoteData } from '../../core/data/remote-data'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; describe('SubmissionEditComponent Component', () => { @@ -66,14 +66,9 @@ describe('SubmissionEditComponent Component', () => { it('should init properly when a valid SubmissionObject has been retrieved', fakeAsync(() => { route.testParams = { id: submissionId }; - submissionServiceStub.retrieveSubmission.and.returnValue(observableOf( - new RemoteData( - false, - false, - true, - null, - submissionObject) - )); + submissionServiceStub.retrieveSubmission.and.returnValue( + createSuccessfulRemoteDataObject$(submissionObject) + ); fixture.detectChanges(); @@ -88,14 +83,8 @@ describe('SubmissionEditComponent Component', () => { it('should redirect to mydspace when an empty SubmissionObject has been retrieved', fakeAsync(() => { route.testParams = { id: submissionId }; - submissionServiceStub.retrieveSubmission.and.returnValue(observableOf( - new RemoteData( - false, - false, - true, - null, - {}) - )); + submissionServiceStub.retrieveSubmission.and.returnValue(createSuccessfulRemoteDataObject$({}) + ); fixture.detectChanges(); diff --git a/src/app/submission/form/collection/submission-form-collection.component.spec.ts b/src/app/submission/form/collection/submission-form-collection.component.spec.ts index 679500a670..efbe2eccfe 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.spec.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.spec.ts @@ -23,7 +23,10 @@ import { RemoteData } from '../../../core/data/remote-data'; import { PaginatedList } from '../../../core/data/paginated-list'; import { PageInfo } from '../../../core/shared/page-info.model'; import { Collection } from '../../../core/shared/collection.model'; -import { createTestComponent } from '../../../shared/testing/utils'; +import { + createSuccessfulRemoteDataObject$, + createTestComponent +} from '../../../shared/testing/utils'; import { cold } from 'jasmine-marbles'; const subcommunities = [Object.assign(new Community(), { @@ -101,10 +104,8 @@ const mockCommunity = Object.assign(new Community(), { language: 'en_US', value: 'Community 1' }], - collections: observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), [mockCommunity1Collection1, mockCommunity1Collection2]))), - subcommunities: observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), subcommunities))), + collections: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [mockCommunity1Collection1, mockCommunity1Collection2])), //LOTTE + subcommunities: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), subcommunities)), }); const mockCommunity2 = Object.assign(new Community(), { @@ -116,14 +117,11 @@ const mockCommunity2 = Object.assign(new Community(), { language: 'en_US', value: 'Community 2' }], - collections: observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), [mockCommunity2Collection1, mockCommunity2Collection2]))), - subcommunities: observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), []))), + collections: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [mockCommunity2Collection1, mockCommunity2Collection2])), + subcommunities: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), }); -const mockCommunityList = observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), [mockCommunity, mockCommunity2]))); +const mockCommunityList = createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [mockCommunity, mockCommunity2])); const mockCollectionList = [ { diff --git a/src/app/submission/sections/license/section-license.component.spec.ts b/src/app/submission/sections/license/section-license.component.spec.ts index 6d8f82c0f8..a9a72f0a51 100644 --- a/src/app/submission/sections/license/section-license.component.spec.ts +++ b/src/app/submission/sections/license/section-license.component.spec.ts @@ -6,9 +6,13 @@ import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing' import { of as observableOf } from 'rxjs'; import { TranslateModule } from '@ngx-translate/core'; -import { DynamicCheckboxModel, DynamicFormControlEvent, DynamicFormControlEventType } from '@ng-dynamic-forms/core'; +import { + DynamicCheckboxModel, + DynamicFormControlEvent, + DynamicFormControlEventType +} from '@ng-dynamic-forms/core'; -import { createTestComponent } from '../../../shared/testing/utils'; +import { createSuccessfulRemoteDataObject$, createTestComponent } from '../../../shared/testing/utils'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub'; import { SubmissionService } from '../../submission.service'; @@ -109,8 +113,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => { language: 'en_US', value: 'Community 1-Collection 1' }], - license: observableOf(new RemoteData(false, false, true, - undefined, Object.assign(new License(), { text: licenseText }))) + license: createSuccessfulRemoteDataObject$(Object.assign(new License(), { text: licenseText })) }); beforeEach(async(() => { @@ -193,8 +196,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => { }); it('should init section properly', () => { - collectionDataService.findById.and.returnValue(observableOf(new RemoteData(false, false, true, - undefined, mockCollection))); + collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); sectionsServiceStub.getSectionErrors.and.returnValue(observableOf([])); sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); spyOn(compAsAny, 'getSectionStatus'); @@ -219,8 +221,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => { granted: true } as any; - collectionDataService.findById.and.returnValue(observableOf(new RemoteData(false, false, true, - undefined, mockCollection))); + collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); sectionsServiceStub.getSectionErrors.and.returnValue(observableOf([])); sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); spyOn(compAsAny, 'getSectionStatus'); @@ -239,8 +240,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => { }); it('should set section errors properly', () => { - collectionDataService.findById.and.returnValue(observableOf(new RemoteData(false, false, true, - undefined, mockCollection))); + collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); sectionsServiceStub.getSectionErrors.and.returnValue(observableOf(mockLicenseParsedErrors.license)); sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); @@ -259,8 +259,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => { granted: true } as any; - collectionDataService.findById.and.returnValue(observableOf(new RemoteData(false, false, true, - undefined, mockCollection))); + collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); sectionsServiceStub.getSectionErrors.and.returnValue(observableOf(mockLicenseParsedErrors.license)); sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); @@ -272,8 +271,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => { it('should have status true when checkbox is selected', () => { - collectionDataService.findById.and.returnValue(observableOf(new RemoteData(false, false, true, - undefined, mockCollection))); + collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); sectionsServiceStub.getSectionErrors.and.returnValue(observableOf([])); sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); @@ -289,8 +287,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => { it('should have status false when checkbox is not selected', () => { - collectionDataService.findById.and.returnValue(observableOf(new RemoteData(false, false, true, - undefined, mockCollection))); + collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); sectionsServiceStub.getSectionErrors.and.returnValue(observableOf([])); sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); diff --git a/src/app/submission/sections/upload/section-upload.component.spec.ts b/src/app/submission/sections/upload/section-upload.component.spec.ts index be8f096964..dfa9a35c92 100644 --- a/src/app/submission/sections/upload/section-upload.component.spec.ts +++ b/src/app/submission/sections/upload/section-upload.component.spec.ts @@ -4,7 +4,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { createTestComponent } from '../../../shared/testing/utils'; +import { createSuccessfulRemoteDataObject$, createTestComponent } from '../../../shared/testing/utils'; import { SubmissionService } from '../../submission.service'; import { SubmissionServiceStub } from '../../../shared/testing/submission-service-stub'; import { SectionsService } from '../sections.service'; @@ -30,7 +30,6 @@ import { GroupEpersonService } from '../../../core/eperson/group-eperson.service import { cold, hot } from 'jasmine-marbles'; import { Collection } from '../../../core/shared/collection.model'; import { ResourcePolicy } from '../../../core/shared/resource-policy.model'; -import { RemoteData } from '../../../core/data/remote-data'; import { ConfigData } from '../../../core/config/config-data'; import { PageInfo } from '../../../core/shared/page-info.model'; import { Group } from '../../../core/eperson/models/group.model'; @@ -180,24 +179,17 @@ describe('SubmissionSectionUploadComponent test suite', () => { submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState)); - collectionDataService.findById.and.returnValue(observableOf( - new RemoteData(false, false, true, - undefined, mockCollection))); + collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); - collectionDataService.findByHref.and.returnValue(observableOf( - new RemoteData(false, false, true, - undefined, mockDefaultAccessCondition) - )); + collectionDataService.findByHref.and.returnValue(createSuccessfulRemoteDataObject$(mockDefaultAccessCondition)); uploadsConfigService.getConfigByHref.and.returnValue(observableOf( new ConfigData(new PageInfo(), mockUploadConfigResponse as any) )); groupService.findById.and.returnValues( - observableOf(new RemoteData(false, false, true, - undefined, Object.assign(new Group(), mockGroup))), - observableOf(new RemoteData(false, false, true, - undefined, Object.assign(new Group(), mockGroup))) + createSuccessfulRemoteDataObject$(Object.assign(new Group(), mockGroup)), + createSuccessfulRemoteDataObject$(Object.assign(new Group(), mockGroup)) ); bitstreamService.getUploadedFileList.and.returnValue(observableOf([])); @@ -226,24 +218,17 @@ describe('SubmissionSectionUploadComponent test suite', () => { submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState)); - collectionDataService.findById.and.returnValue(observableOf( - new RemoteData(false, false, true, - undefined, mockCollection))); + collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); - collectionDataService.findByHref.and.returnValue(observableOf( - new RemoteData(false, false, true, - undefined, mockDefaultAccessCondition) - )); + collectionDataService.findByHref.and.returnValue(createSuccessfulRemoteDataObject$(mockDefaultAccessCondition)); uploadsConfigService.getConfigByHref.and.returnValue(observableOf( new ConfigData(new PageInfo(), mockUploadConfigResponse as any) )); groupService.findById.and.returnValues( - observableOf(new RemoteData(false, false, true, - undefined, Object.assign(new Group(), mockGroup))), - observableOf(new RemoteData(false, false, true, - undefined, Object.assign(new Group(), mockGroup))) + createSuccessfulRemoteDataObject$(Object.assign(new Group(), mockGroup)), + createSuccessfulRemoteDataObject$(Object.assign(new Group(), mockGroup)) ); bitstreamService.getUploadedFileList.and.returnValue(observableOf(mockUploadFiles)); diff --git a/src/app/submission/submission.service.spec.ts b/src/app/submission/submission.service.spec.ts index d764f09538..7906198702 100644 --- a/src/app/submission/submission.service.spec.ts +++ b/src/app/submission/submission.service.spec.ts @@ -18,7 +18,10 @@ import { MockActivatedRoute } from '../shared/mocks/mock-active-router'; import { GLOBAL_CONFIG } from '../../config'; import { HttpOptions } from '../core/dspace-rest-v2/dspace-rest-v2.service'; import { SubmissionScopeType } from '../core/submission/submission-scope-type'; -import { mockSubmissionDefinition, mockSubmissionRestResponse } from '../shared/mocks/mock-submission'; +import { + mockSubmissionDefinition, + mockSubmissionRestResponse +} from '../shared/mocks/mock-submission'; import { NotificationsService } from '../shared/notifications/notifications.service'; import { MockTranslateLoader } from '../shared/mocks/mock-translate-loader'; import { MOCK_SUBMISSION_CONFIG } from '../shared/testing/mock-submission-config'; @@ -37,6 +40,11 @@ import { import { RemoteData } from '../core/data/remote-data'; import { RemoteDataError } from '../core/data/remote-data-error'; import { throwError as observableThrowError } from 'rxjs/internal/observable/throwError'; +import { + createFailedRemoteDataObject, + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$ +} from '../shared/testing/utils'; describe('SubmissionService test suite', () => { const config = MOCK_SUBMISSION_CONFIG; @@ -344,7 +352,7 @@ describe('SubmissionService test suite', () => { beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ - StoreModule.forRoot({submissionReducers} as any), + StoreModule.forRoot({ submissionReducers } as any), TranslateModule.forRoot({ loader: { provide: TranslateLoader, @@ -353,10 +361,10 @@ describe('SubmissionService test suite', () => { }) ], providers: [ - {provide: GLOBAL_CONFIG, useValue: config}, - {provide: Router, useValue: router}, - {provide: SubmissionRestService, useValue: restService}, - {provide: ActivatedRoute, useValue: new MockActivatedRoute()}, + { provide: GLOBAL_CONFIG, useValue: config }, + { provide: Router, useValue: router }, + { provide: SubmissionRestService, useValue: restService }, + { provide: ActivatedRoute, useValue: new MockActivatedRoute() }, NotificationsService, RouteService, SubmissionService, @@ -482,7 +490,7 @@ describe('SubmissionService test suite', () => { })); const result = service.getSubmissionObject('826'); - const expected = cold('b', {b: subState.objects[826]}); + const expected = cold('b', { b: subState.objects[826] }); expect(result).toBeObservable(expected); }); @@ -495,7 +503,7 @@ describe('SubmissionService test suite', () => { })); const result = service.getActiveSectionId('826'); - const expected = cold('b', {b: 'keyinformation'}); + const expected = cold('b', { b: 'keyinformation' }); expect(result).toBeObservable(expected); @@ -747,7 +755,7 @@ describe('SubmissionService test suite', () => { describe('isSubmissionLoading', () => { it('should return true/false when section is loading/not loading', () => { - const spy = spyOn(service, 'getSubmissionObject').and.returnValue(observableOf({isLoading: true})); + const spy = spyOn(service, 'getSubmissionObject').and.returnValue(observableOf({ isLoading: true })); let expected = cold('(b|)', { b: true @@ -755,7 +763,7 @@ describe('SubmissionService test suite', () => { expect(service.isSubmissionLoading(submissionId)).toBeObservable(expected); - spy.and.returnValue(observableOf({isLoading: false})); + spy.and.returnValue(observableOf({ isLoading: false })); expected = cold('(b|)', { b: false @@ -841,11 +849,7 @@ describe('SubmissionService test suite', () => { const result = service.retrieveSubmission('826'); const expected = cold('(b|)', { - b: new RemoteData( - false, - false, - true, - null, + b: createSuccessfulRemoteDataObject( mockSubmissionRestResponse[0]) }); @@ -862,12 +866,8 @@ describe('SubmissionService test suite', () => { ); service.retrieveSubmission('826').subscribe((r) => { - expect(r).toEqual(new RemoteData( - false, - false, - false, - new RemoteDataError(500, 'Internal Server Error', 'Error message'), - null + expect(r).toEqual(createFailedRemoteDataObject(null, + new RemoteDataError(500, 'Internal Server Error', 'Error message') )) }); }); diff --git a/src/app/submission/submission.service.ts b/src/app/submission/submission.service.ts index 82185a8eae..386fa7efae 100644 --- a/src/app/submission/submission.service.ts +++ b/src/app/submission/submission.service.ts @@ -3,7 +3,15 @@ import { HttpHeaders } from '@angular/common/http'; import { Router } from '@angular/router'; import { Observable, of as observableOf, Subscription, timer as observableTimer } from 'rxjs'; -import { catchError, distinctUntilChanged, filter, find, first, map, startWith } from 'rxjs/operators'; +import { + catchError, + distinctUntilChanged, + filter, + find, + first, + map, + startWith +} from 'rxjs/operators'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; @@ -43,6 +51,11 @@ import { WorkspaceitemSectionsObject } from '../core/submission/models/workspace import { RemoteData } from '../core/data/remote-data'; import { ErrorResponse } from '../core/cache/response.models'; import { RemoteDataError } from '../core/data/remote-data-error'; +import { + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$ +} from '../shared/testing/utils'; /** * A service that provides methods used in submission process. @@ -495,20 +508,12 @@ export class SubmissionService { retrieveSubmission(submissionId): Observable> { return this.restService.getDataById(this.getSubmissionObjectLinkName(), submissionId).pipe( find((submissionObjects: SubmissionObject[]) => isNotUndefined(submissionObjects)), - map((submissionObjects: SubmissionObject[]) => new RemoteData( - false, - false, - true, - null, + map((submissionObjects: SubmissionObject[]) => createSuccessfulRemoteDataObject( submissionObjects[0])), catchError((errorResponse: ErrorResponse) => { - return observableOf(new RemoteData( - false, - false, - false, - new RemoteDataError(errorResponse.statusCode, errorResponse.statusText, errorResponse.errorMessage), - null - )) + return createFailedRemoteDataObject$(null, + new RemoteDataError(errorResponse.statusCode, errorResponse.statusText, errorResponse.errorMessage) + ) }) ); } From 898795fba18509a175adacb19616e0cad9093840 Mon Sep 17 00:00:00 2001 From: lotte Date: Tue, 28 May 2019 14:58:35 +0200 Subject: [PATCH 08/38] Solved issue where edit metadata page broke --- .../registry/registry-metadatafields-response.model.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/core/registry/registry-metadatafields-response.model.ts b/src/app/core/registry/registry-metadatafields-response.model.ts index f4b6f46d17..9f0b836ba2 100644 --- a/src/app/core/registry/registry-metadatafields-response.model.ts +++ b/src/app/core/registry/registry-metadatafields-response.model.ts @@ -1,6 +1,8 @@ import { PageInfo } from '../shared/page-info.model'; -import { autoserialize, autoserializeAs } from 'cerialize'; +import { autoserialize, deserialize } from 'cerialize'; import { MetadataField } from '../metadata/metadata-field.model'; +import { relationship } from '../cache/builders/build-decorators'; +import { ResourceType } from '../shared/resource-type'; /** * Class that represents a response with a registry's metadata fields @@ -9,7 +11,8 @@ export class RegistryMetadatafieldsResponse { /** * List of metadata fields in the response */ - @autoserializeAs(MetadataField) + @deserialize + @relationship(ResourceType.MetadataField, true) metadatafields: MetadataField[]; /** From b846384ba730130117a286254f2f60a3cd60278f Mon Sep 17 00:00:00 2001 From: lotte Date: Wed, 29 May 2019 13:10:42 +0200 Subject: [PATCH 09/38] Added typedoc and remove unnecessary import statements --- src/app/core/shared/item.model.spec.ts | 6 +-- src/app/shared/testing/utils.ts | 42 +++++++++++++++---- ...bmission-form-collection.component.spec.ts | 25 ++++++++--- 3 files changed, 54 insertions(+), 19 deletions(-) diff --git a/src/app/core/shared/item.model.spec.ts b/src/app/core/shared/item.model.spec.ts index 101dc4986e..f20fb3299a 100644 --- a/src/app/core/shared/item.model.spec.ts +++ b/src/app/core/shared/item.model.spec.ts @@ -1,7 +1,6 @@ import { Observable, of as observableOf } from 'rxjs'; import { Item } from './item.model'; -import { RemoteData } from '../data/remote-data'; import { Bitstream } from './bitstream.model'; import { isEmpty } from '../../shared/empty.util'; import { first, map } from 'rxjs/operators'; @@ -38,7 +37,6 @@ describe('Item', () => { remoteDataAll = createSuccessfulRemoteDataObject$([...bitstreams, thumbnail]); // Create Bundles - const bundles = [ { @@ -52,7 +50,6 @@ describe('Item', () => { }]; item = Object.assign(new Item(), { bitstreams: remoteDataAll }); - }); it('should return the bitstreams related to this item with the specified bundle name', () => { @@ -100,5 +97,4 @@ describe('Item', () => { }); }); - -}); \ No newline at end of file +}); diff --git a/src/app/shared/testing/utils.ts b/src/app/shared/testing/utils.ts index c372ea06a4..4a551582ee 100644 --- a/src/app/shared/testing/utils.ts +++ b/src/app/shared/testing/utils.ts @@ -26,7 +26,7 @@ export const hasClass = (element: any, className: string): boolean => { */ export const createTestComponent = (html: string, type: { new(...args: any[]): T }): ComponentFixture => { TestBed.overrideComponent(type, { - set: {template: html} + set: { template: html } }); const fixture = TestBed.createComponent(type); @@ -54,7 +54,11 @@ export function spyOnOperator(obj: any, prop: string): any { return spyOn(obj, prop); } -export function createSuccessfulRemoteDataObject(object: T): RemoteData{ +/** + * Method to create a remote data object that has succeeded + * @param object The object to wrap + */ +export function createSuccessfulRemoteDataObject(object: T): RemoteData { return new RemoteData( false, false, @@ -64,11 +68,20 @@ export function createSuccessfulRemoteDataObject(object: T): RemoteData{ ); } -export function createSuccessfulRemoteDataObject$(object: T): Observable>{ +/** + * Method to create a remote data object that has succeeded, wrapped in an observable + * @param object The object to wrap + */ +export function createSuccessfulRemoteDataObject$(object: T): Observable> { return observableOf(createSuccessfulRemoteDataObject(object)); } -export function createFailedRemoteDataObject(object?: T, error?: RemoteDataError): RemoteData{ +/** + * Method to create a remote data object that has failed + * @param object The object to wrap + * @param error The RemoteDataError that caused the failure + */ +export function createFailedRemoteDataObject(object?: T, error?: RemoteDataError): RemoteData { return new RemoteData( false, false, @@ -78,11 +91,20 @@ export function createFailedRemoteDataObject(object?: T, error?: RemoteDataEr ); } -export function createFailedRemoteDataObject$(object?: T, error?: RemoteDataError): Observable>{ +/** + * Method to create a remote data object that has failed, wrapped in an observable + * @param object The object to wrap + * @param error The RemoteDataError that caused the failure + */ +export function createFailedRemoteDataObject$(object?: T, error?: RemoteDataError): Observable> { return observableOf(createFailedRemoteDataObject(object, error)); } -export function createPendingRemoteDataObject(object?: T): RemoteData{ +/** + * Method to create a remote data object that is still pending + * @param object The object to wrap + */ +export function createPendingRemoteDataObject(object?: T): RemoteData { return new RemoteData( true, true, @@ -92,6 +114,10 @@ export function createPendingRemoteDataObject(object?: T): RemoteData{ ); } -export function createPendingRemoteDataObject$(object?: T): Observable>{ +/** + * Method to create a remote data object that is still pending, wrapped in an observable + * @param object The object to wrap + */ +export function createPendingRemoteDataObject$(object?: T): Observable> { return observableOf(createPendingRemoteDataObject(object)); -} \ No newline at end of file +} diff --git a/src/app/submission/form/collection/submission-form-collection.component.spec.ts b/src/app/submission/form/collection/submission-form-collection.component.spec.ts index efbe2eccfe..3daedbee14 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.spec.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.spec.ts @@ -1,4 +1,10 @@ -import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, DebugElement, SimpleChange } from '@angular/core'; +import { + ChangeDetectorRef, + Component, + CUSTOM_ELEMENTS_SCHEMA, + DebugElement, + SimpleChange +} from '@angular/core'; import { async, ComponentFixture, fakeAsync, inject, TestBed, tick } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @@ -10,7 +16,10 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; import { SubmissionServiceStub } from '../../../shared/testing/submission-service-stub'; -import { mockSubmissionId, mockSubmissionRestResponse } from '../../../shared/mocks/mock-submission'; +import { + mockSubmissionId, + mockSubmissionRestResponse +} from '../../../shared/mocks/mock-submission'; import { SubmissionService } from '../../submission.service'; import { SubmissionFormCollectionComponent } from './submission-form-collection.component'; import { CommunityDataService } from '../../../core/data/community-data.service'; @@ -19,7 +28,6 @@ import { SubmissionJsonPatchOperationsServiceStub } from '../../../shared/testin import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { Community } from '../../../core/shared/community.model'; -import { RemoteData } from '../../../core/data/remote-data'; import { PaginatedList } from '../../../core/data/paginated-list'; import { PageInfo } from '../../../core/shared/page-info.model'; import { Collection } from '../../../core/shared/collection.model'; @@ -104,7 +112,7 @@ const mockCommunity = Object.assign(new Community(), { language: 'en_US', value: 'Community 1' }], - collections: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [mockCommunity1Collection1, mockCommunity1Collection2])), //LOTTE + collections: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [mockCommunity1Collection1, mockCommunity1Collection2])), subcommunities: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), subcommunities)), }); @@ -212,7 +220,10 @@ describe('SubmissionFormCollectionComponent Component', () => { TestComponent ], providers: [ - { provide: SubmissionJsonPatchOperationsService, useClass: SubmissionJsonPatchOperationsServiceStub }, + { + provide: SubmissionJsonPatchOperationsService, + useClass: SubmissionJsonPatchOperationsServiceStub + }, { provide: SubmissionService, useClass: SubmissionServiceStub }, { provide: CommunityDataService, useValue: communityDataService }, { provide: JsonPatchOperationsBuilder, useValue: jsonPatchOpBuilder }, @@ -426,6 +437,8 @@ class TestComponent { definitionId = 'traditional'; submissionId = mockSubmissionId; - onCollectionChange = () => { return; } + onCollectionChange = () => { + return; + } } From 99b43e0a4e5a28c04d49ca4248a63efc871f9641 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 4 Jun 2019 15:47:28 +0000 Subject: [PATCH 10/38] Bump pem from 1.12.3 to 1.13.2 Bumps [pem](https://github.com/Dexus/pem) from 1.12.3 to 1.13.2. - [Release notes](https://github.com/Dexus/pem/releases) - [Changelog](https://github.com/Dexus/pem/blob/master/CHANGELOG.md) - [Commits](https://github.com/Dexus/pem/compare/v1.12.3...v1.13.2) --- package.json | 2 +- yarn.lock | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 7755f3d3d0..21326c4341 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "ngx-moment": "^3.1.0", "ngx-pagination": "3.0.3", "nouislider": "^11.0.0", - "pem": "1.12.3", + "pem": "1.13.2", "reflect-metadata": "0.1.12", "rxjs": "6.2.2", "rxjs-spy": "^7.5.1", diff --git a/yarn.lock b/yarn.lock index 9a4f96e805..76845fa03e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3420,6 +3420,11 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" +es6-promisify@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-6.0.1.tgz#6edaa45f3bd570ffe08febce66f7116be4b1cdb6" + integrity sha512-J3ZkwbEnnO+fGAKrjVpeUAnZshAdfZvbhQpqfIH9kSAspReRC4nJnu8ewm55b4y9ElyeuhCTzJD0XiH8Tsbhlw== + es6-symbol@^3.1.1, es6-symbol@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" @@ -7537,15 +7542,15 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" -pem@1.12.3: - version "1.12.3" - resolved "https://registry.yarnpkg.com/pem/-/pem-1.12.3.tgz#b1fb5c8b79da8d18146c27fee79b0d4ddf9905b3" - integrity sha512-hT7GwvQL35+0iqgYUl8vn5I5pAVR0HcJas07TXL8bNaR4c5kAFRquk4ZqQk1F9YMcQOr6WjGdY5OnDC0RBnzig== +pem@1.13.2: + version "1.13.2" + resolved "https://registry.yarnpkg.com/pem/-/pem-1.13.2.tgz#7b68acbb590fdc13772bca487983cb84cd7b443e" + integrity sha512-MPJWuEb/r6AG+GpZi2JnfNtGAZDeL/8+ERKwXEWRuST5i+4lq/Uy36B352OWIUSPQGH+HR1HEDcIDi+8cKxXNg== dependencies: + es6-promisify "^6.0.0" md5 "^2.2.1" os-tmpdir "^1.0.1" - safe-buffer "^5.1.1" - which "^1.2.4" + which "^1.3.1" pend@~1.2.0: version "1.2.0" @@ -11174,7 +11179,7 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@1, which@^1.1.1, which@^1.2.1, which@^1.2.10, which@^1.2.4, which@^1.2.9: +which@1, which@^1.1.1, which@^1.2.1, which@^1.2.10, which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== From 072537968fbcc969044bffeb39542ed2cce3fcb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 6 Jun 2019 04:38:52 +0000 Subject: [PATCH 11/38] Bump js-yaml from 3.12.0 to 3.13.1 Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.0 to 3.13.1. - [Release notes](https://github.com/nodeca/js-yaml/releases) - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/3.12.0...3.13.1) Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9a4f96e805..e6d843a6f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5546,18 +5546,10 @@ js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@3.x, js-yaml@^3.6.1, js-yaml@^3.7.0, js-yaml@^3.9.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" - integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@^3.12.0: - version "3.12.2" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.2.tgz#ef1d067c5a9d9cb65bd72f285b5d8105c77f14fc" - integrity sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q== +js-yaml@3.x, js-yaml@^3.12.0, js-yaml@^3.6.1, js-yaml@^3.7.0, js-yaml@^3.9.0: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== dependencies: argparse "^1.0.7" esprima "^4.0.0" From 0040ff2920b2a887cf0068ed0c44d14d77468dc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 6 Jun 2019 09:40:03 +0000 Subject: [PATCH 12/38] Bump handlebars from 4.0.11 to 4.1.2 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.0.11 to 4.1.2. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.0.11...v4.1.2) Signed-off-by: dependabot[bot] --- yarn.lock | 114 +++++++++++------------------------------------------- 1 file changed, 22 insertions(+), 92 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9a4f96e805..e30d7f725e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -755,15 +755,6 @@ ajv@~6.4.0: json-schema-traverse "^0.3.0" uri-js "^3.0.2" -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - integrity sha1-DNkKVhCT810KmSVsIrcGlDP60Rc= - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - alphanum-sort@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" @@ -1107,7 +1098,7 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== -async@1.x, async@^1.4.0, async@^1.5.2: +async@1.x, async@^1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= @@ -1797,7 +1788,7 @@ camelcase-keys@^2.0.0: camelcase "^2.0.0" map-obj "^1.0.0" -camelcase@^1.0.2, camelcase@^1.2.1: +camelcase@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" integrity sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk= @@ -1857,14 +1848,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - integrity sha1-qg0yYptu6XIgBBHL1EYckHvCt60= - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - cerialize@0.1.18: version "0.1.18" resolved "https://registry.yarnpkg.com/cerialize/-/cerialize-0.1.18.tgz#d0f4f1b61cec7e4ed16a3eda0cac2bc99787414d" @@ -2017,15 +2000,6 @@ cli-width@^2.0.0: resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - integrity sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE= - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" @@ -2202,7 +2176,7 @@ commander@2.17.x, commander@~2.17.1: resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== -commander@^2.12.1, commander@^2.18.0: +commander@^2.12.1, commander@^2.18.0, commander@~2.20.0: version "2.20.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== @@ -2874,7 +2848,7 @@ debug@^3.1.0, debug@~3.1.0: dependencies: ms "2.0.0" -decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: +decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= @@ -4429,15 +4403,15 @@ handle-thing@^1.2.5: integrity sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ= handlebars@^4.0.1, handlebars@^4.0.6: - version "4.0.11" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" - integrity sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw= + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== dependencies: - async "^1.4.0" + neo-async "^2.6.0" optimist "^0.6.1" - source-map "^0.4.4" + source-map "^0.6.1" optionalDependencies: - uglify-js "^2.6" + uglify-js "^3.1.4" har-schema@^2.0.0: version "2.0.0" @@ -5857,11 +5831,6 @@ latest-version@^3.0.0: dependencies: package-json "^4.0.0" -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= - lazystream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" @@ -6231,11 +6200,6 @@ long@^3.2.0: resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= -longest@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc= - loose-envify@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -6710,10 +6674,10 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== -neo-async@^2.5.0: - version "2.5.2" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.2.tgz#489105ce7bc54e709d736b195f82135048c50fcc" - integrity sha512-vdqTKI9GBIYcAEbFAcpKPErKINfPF5zIuz3/niBfq8WUZjpT2tytLlFVrBgWdOtqI4uaA/Rb6No0hux39XXDuw== +neo-async@^2.5.0, neo-async@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" + integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== next-tick@1: version "1.0.0" @@ -9126,13 +9090,6 @@ rgba-regex@^1.0.0: resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3" integrity sha1-QzdOLiyglosO8VI0YLfXMP8i7rM= -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - integrity sha1-YTObci/mo1FWiSENJOFMlhSGE+8= - dependencies: - align-text "^0.1.1" - rimraf@2, rimraf@2.6.2, rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" @@ -9764,14 +9721,14 @@ source-map@^0.1.38: dependencies: amdefine ">=0.0.4" -source-map@^0.4.2, source-map@^0.4.4: +source-map@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" integrity sha1-66T12pwNyZneaAMti092FzZSA2s= dependencies: amdefine ">=0.0.4" -source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: +source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= @@ -10570,20 +10527,13 @@ uglify-js@3.4.x: commander "~2.17.1" source-map "~0.6.1" -uglify-js@^2.6: - version "2.8.29" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - integrity sha1-KcVzMUgFe7Th913zW3qcty5qWd0= +uglify-js@^3.1.4: + version "3.6.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5" + integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg== dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" - -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - integrity sha1-bgkk1r2mta/jSeOabWMoUKD4grc= + commander "~2.20.0" + source-map "~0.6.1" uglifyjs-webpack-plugin@^1.2.4: version "1.3.0" @@ -11195,16 +11145,6 @@ widest-line@^2.0.0: dependencies: string-width "^2.1.1" -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - integrity sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0= - -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8= - wordwrap@^1.0.0, wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" @@ -11369,16 +11309,6 @@ yargs@^7.0.0: y18n "^3.2.1" yargs-parser "^5.0.0" -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - integrity sha1-9+572FfdfB0tOMDnTvvWgdFDH9E= - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" - yauzl@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005" From cc7374351dc384424b37e597d2dedb0e1239ccae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 7 Jun 2019 21:31:28 +0000 Subject: [PATCH 13/38] Bump ecstatic from 3.2.2 to 3.3.2 Bumps [ecstatic](https://github.com/jfhbrook/node-ecstatic) from 3.2.2 to 3.3.2. - [Release notes](https://github.com/jfhbrook/node-ecstatic/releases) - [Changelog](https://github.com/jfhbrook/node-ecstatic/blob/3.3.2/CHANGELOG.md) - [Commits](https://github.com/jfhbrook/node-ecstatic/compare/3.2.2...3.3.2) Signed-off-by: dependabot[bot] --- yarn.lock | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9a4f96e805..c14e1e7516 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3198,9 +3198,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" ecstatic@^3.0.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/ecstatic/-/ecstatic-3.2.2.tgz#4cc37c80ea88c021ca7cde66a15606ceaa9348e7" - integrity sha512-khJlPch7aw/Gx+cKabpt0l2kVychBpGuwVKVMb8rhui00kHWwETDN000Z2CxJl1XaZI4xEkoPD/uezmP28c0/Q== + version "3.3.2" + resolved "https://registry.yarnpkg.com/ecstatic/-/ecstatic-3.3.2.tgz#6d1dd49814d00594682c652adb66076a69d46c48" + integrity sha512-fLf9l1hnwrHI2xn9mEDT7KIi22UDqA2jaCwyCbSUJh9a1V+LEUSL/JO/6TIz/QyuBURWUHrFL5Kg2TtO1bkkog== dependencies: he "^1.1.1" mime "^1.6.0" @@ -4578,11 +4578,16 @@ hawk@~6.0.2: hoek "4.x.x" sntp "2.x.x" -he@1.1.x, he@^1.1.1: +he@1.1.x: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= +he@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + hex-color-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" From f980b55c1cc7977f92121c65811f12e50a19bf12 Mon Sep 17 00:00:00 2001 From: lotte Date: Mon, 24 Jun 2019 16:29:54 +0200 Subject: [PATCH 14/38] refactored resource type and type mapping --- .../collection-form.component.ts | 11 ++--- .../community-form.component.ts | 4 +- .../search-results.component.spec.ts | 4 +- .../search-service/search.service.ts | 6 +-- src/app/core/auth/models/auth-status.model.ts | 8 +--- .../models/normalized-auth-status.model.ts | 5 +-- .../core/cache/builders/build-decorators.ts | 33 ++++++++++++--- .../normalized-object-build.service.ts | 5 +-- .../items/normalized-item-type.model.ts | 6 +-- .../normalized-relationship-type.model.ts | 11 +++-- .../items/normalized-relationship.model.ts | 8 ++-- .../normalized-bitstream-format.model.ts | 4 -- .../models/normalized-bitstream.model.ts | 14 +++---- .../cache/models/normalized-bundle.model.ts | 8 ++-- .../models/normalized-collection.model.ts | 24 +++++++---- .../models/normalized-community.model.ts | 19 +++++---- .../models/normalized-dspace-object.model.ts | 9 ++-- .../cache/models/normalized-item.model.ts | 16 ++++--- .../cache/models/normalized-license.model.ts | 2 - .../cache/models/normalized-object.model.ts | 7 ---- .../normalized-resource-policy.model.ts | 3 -- .../core/cache/models/support-level.model.ts | 2 +- .../core/cache/object-cache.reducer.spec.ts | 12 +++--- src/app/core/cache/object-cache.reducer.ts | 6 +-- .../core/cache/object-cache.service.spec.ts | 6 +-- src/app/core/cache/object-cache.service.ts | 4 +- .../config-submission-definition.model.ts | 19 +++++++++ .../config-submission-definitions.model.ts | 18 ++------ .../models/config-submission-form.model.ts | 22 ++++++++++ .../models/config-submission-forms.model.ts | 19 ++------- .../models/config-submission-section.model.ts | 2 + .../config-submission-sections.model.ts | 6 +++ ...ized-config-submission-definition.model.ts | 28 +++++++++++++ ...zed-config-submission-definitions.model.ts | 23 ++-------- ...normalized-config-submission-form.model.ts | 18 ++++++++ ...ormalized-config-submission-forms.model.ts | 19 +++------ ...malized-config-submission-section.model.ts | 4 -- ...alized-config-submission-sections.model.ts | 18 ++++++++ .../data/base-response-parsing.service.ts | 6 +-- src/app/core/data/data.service.ts | 4 +- src/app/core/data/request.effects.ts | 4 +- src/app/core/eperson/models/eperson.model.ts | 2 + src/app/core/eperson/models/group.model.ts | 2 + .../models/normalized-eperson.model.ts | 7 +--- .../eperson/models/normalized-group.model.ts | 5 +-- .../integration-response-parsing.service.ts | 9 +--- .../integration/models/authority.value.ts | 2 + .../normalized-authority-value.model.ts | 3 -- src/app/core/metadata/metadata-field.model.ts | 1 + .../core/metadata/metadata-schema.model.ts | 2 + .../normalized-metadata-field.model.ts | 5 +-- .../normalized-metadata-schema.model.ts | 2 - .../registry-metadatafields-response.model.ts | 8 ++-- .../core/registry/registry.service.spec.ts | 12 +++--- src/app/core/registry/registry.service.ts | 4 +- src/app/core/shared/bitstream-format.model.ts | 2 + src/app/core/shared/bitstream.model.ts | 3 +- src/app/core/shared/browse-entry.model.ts | 15 +------ src/app/core/shared/bundle.model.ts | 3 ++ src/app/core/shared/collection.model.ts | 3 +- src/app/core/shared/community.model.ts | 2 + src/app/core/shared/dspace-object.model.ts | 23 +++++----- .../item-relationships/item-type.model.ts | 2 + .../relationship-type.model.ts | 2 + .../item-relationships/relationship.model.ts | 2 + src/app/core/shared/item.model.ts | 2 + src/app/core/shared/license.model.ts | 2 + .../shared/normalized-browse-entry.model.ts | 42 +++++++++++++++++++ src/app/core/shared/resource-policy.model.ts | 2 + .../core/shared/resource-type.decorator.ts | 27 ------------ src/app/core/shared/resource-type.ts | 39 ++++------------- .../models/normalized-workflowitem.model.ts | 19 ++++++--- .../models/normalized-workspaceitem.model.ts | 15 +++---- .../submission/models/workflowitem.model.ts | 2 + .../submission/models/workspaceitem.model.ts | 2 + .../submission/submission-resource-type.ts | 21 ---------- .../tasks/models/claimed-task-object.model.ts | 3 +- .../normalized-claimed-task-object.model.ts | 13 +++--- .../normalized-pool-task-object.model.ts | 10 ++--- .../models/normalized-task-object.model.ts | 12 +++--- .../tasks/models/pool-task-object.model.ts | 3 +- .../core/tasks/models/task-object.model.ts | 2 + src/app/shared/alert/alert.component.spec.ts | 2 +- .../comcol-form/comcol-form.component.spec.ts | 2 +- .../comcol-form/comcol-form.component.ts | 4 +- .../delete-comcol-page.component.ts | 4 +- .../dso-selector.component.spec.ts | 2 +- .../dynamic-relation-group.model.ts | 2 +- .../form/builder/models/form-field.model.ts | 2 +- .../parsers/relation-group-field-parser.ts | 2 +- src/app/shared/mocks/mock-form-models.ts | 2 +- .../claimed-task-actions.component.spec.ts | 2 +- .../claimed-task-actions.component.ts | 2 +- .../item/item-actions.component.ts | 3 +- .../mydspace-actions-service.factory.ts | 36 ---------------- .../mydspace-actions/mydspace-actions.ts | 5 +-- .../pool-task/pool-task-actions.component.ts | 2 +- .../workflowitem-actions.component.ts | 3 +- .../workspaceitem-actions.component.ts | 2 +- .../notifications.reducers.spec.ts | 2 +- .../search-form/search-form.component.spec.ts | 4 +- 101 files changed, 440 insertions(+), 427 deletions(-) create mode 100644 src/app/core/config/models/config-submission-definition.model.ts create mode 100644 src/app/core/config/models/config-submission-form.model.ts create mode 100644 src/app/core/config/models/config-submission-sections.model.ts create mode 100644 src/app/core/config/models/normalized-config-submission-definition.model.ts create mode 100644 src/app/core/config/models/normalized-config-submission-form.model.ts create mode 100644 src/app/core/config/models/normalized-config-submission-sections.model.ts create mode 100644 src/app/core/shared/normalized-browse-entry.model.ts delete mode 100644 src/app/core/shared/resource-type.decorator.ts delete mode 100644 src/app/core/submission/submission-resource-type.ts delete mode 100644 src/app/shared/mydspace-actions/mydspace-actions-service.factory.ts diff --git a/src/app/+collection-page/collection-form/collection-form.component.ts b/src/app/+collection-page/collection-form/collection-form.component.ts index 22f2f1271d..21b494f41f 100644 --- a/src/app/+collection-page/collection-form/collection-form.component.ts +++ b/src/app/+collection-page/collection-form/collection-form.component.ts @@ -1,12 +1,9 @@ import { Component, Input } from '@angular/core'; -import { - DynamicInputModel, - DynamicTextAreaModel -} from '@ng-dynamic-forms/core'; +import { DynamicInputModel, DynamicTextAreaModel } from '@ng-dynamic-forms/core'; import { DynamicFormControlModel } from '@ng-dynamic-forms/core/src/model/dynamic-form-control.model'; -import { ResourceType } from '../../core/shared/resource-type'; import { Collection } from '../../core/shared/collection.model'; import { ComColFormComponent } from '../../shared/comcol-forms/comcol-form/comcol-form.component'; +import { NormalizedCollection } from '../../core/cache/models/normalized-collection.model'; /** * Form used for creating and editing collections @@ -23,9 +20,9 @@ export class CollectionFormComponent extends ComColFormComponent { @Input() dso: Collection = new Collection(); /** - * @type {ResourceType.Collection} This is a collection-type form + * @type {Collection.type} This is a collection-type form */ - protected type = ResourceType.Collection; + protected type = Collection.type; /** * The dynamic form fields used for creating/editing a collection diff --git a/src/app/+community-page/community-form/community-form.component.ts b/src/app/+community-page/community-form/community-form.component.ts index 9ae6f0955d..17d601e251 100644 --- a/src/app/+community-page/community-form/community-form.component.ts +++ b/src/app/+community-page/community-form/community-form.component.ts @@ -20,9 +20,9 @@ export class CommunityFormComponent extends ComColFormComponent { @Input() dso: Community = new Community(); /** - * @type {ResourceType.Community} This is a community-type form + * @type {Community.type} This is a community-type form */ - protected type = ResourceType.Community; + protected type = Community.type; /** * The dynamic form fields used for creating/editing a community diff --git a/src/app/+search-page/search-results/search-results.component.spec.ts b/src/app/+search-page/search-results/search-results.component.spec.ts index 518829e69f..6eb48bb037 100644 --- a/src/app/+search-page/search-results/search-results.component.spec.ts +++ b/src/app/+search-page/search-results/search-results.component.spec.ts @@ -114,7 +114,7 @@ export const objects = [ self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/communities/7669c72a-3f2a-451f-a3b9-9210e7a4c02f', id: '7669c72a-3f2a-451f-a3b9-9210e7a4c02f', uuid: '7669c72a-3f2a-451f-a3b9-9210e7a4c02f', - type: ResourceType.Community, + type: Community.type, metadata: { 'dc.description': [ { @@ -168,7 +168,7 @@ export const objects = [ self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/communities/9076bd16-e69a-48d6-9e41-0238cb40d863', id: '9076bd16-e69a-48d6-9e41-0238cb40d863', uuid: '9076bd16-e69a-48d6-9e41-0238cb40d863', - type: ResourceType.Community, + type: Community.type, metadata: { 'dc.description': [ { diff --git a/src/app/+search-page/search-service/search.service.ts b/src/app/+search-page/search-service/search.service.ts index 598657a1b2..0646c2c089 100644 --- a/src/app/+search-page/search-service/search.service.ts +++ b/src/app/+search-page/search-service/search.service.ts @@ -1,6 +1,6 @@ import { combineLatest as observableCombineLatest, Observable, of as observableOf } from 'rxjs'; import { Injectable, OnDestroy } from '@angular/core'; -import { NavigationExtras, PRIMARY_OUTLET, Router, UrlSegmentGroup } from '@angular/router'; +import { NavigationExtras, Router } from '@angular/router'; import { first, map, switchMap } from 'rxjs/operators'; import { RemoteDataBuildService } from '../../core/cache/builders/remote-data-build.service'; import { @@ -40,7 +40,6 @@ import { PaginatedSearchOptions } from '../paginated-search-options.model'; import { Community } from '../../core/shared/community.model'; import { CommunityDataService } from '../../core/data/community-data.service'; import { ViewMode } from '../../core/shared/view-mode.model'; -import { ResourceType } from '../../core/shared/resource-type'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { RouteService } from '../../shared/services/route.service'; @@ -296,7 +295,8 @@ export class SearchService implements OnDestroy { const scopeObject: Observable> = this.dspaceObjectService.findById(scopeId).pipe(getSucceededRemoteData()); const scopeList: Observable = scopeObject.pipe( switchMap((dsoRD: RemoteData) => { - if (dsoRD.payload.type === ResourceType.Community) { + console.log((dsoRD.payload as any).type); + if ((dsoRD.payload as any).type === Community.type) { const community: Community = dsoRD.payload as Community; return observableCombineLatest(community.subcommunities, community.collections).pipe( map(([subCommunities, collections]) => { diff --git a/src/app/core/auth/models/auth-status.model.ts b/src/app/core/auth/models/auth-status.model.ts index 5349a574af..e0d568397a 100644 --- a/src/app/core/auth/models/auth-status.model.ts +++ b/src/app/core/auth/models/auth-status.model.ts @@ -10,6 +10,8 @@ import { ResourceType } from '../../shared/resource-type'; * Object that represents the authenticated status of a user */ export class AuthStatus implements CacheableObject { + static type = new ResourceType('status'); + /** * The unique identifier of this auth status */ @@ -49,10 +51,4 @@ export class AuthStatus implements CacheableObject { * The self link of this auth status' REST object */ self: string; - - /** - * The resource object of this auth status - */ - type: ResourceType; - } diff --git a/src/app/core/auth/models/normalized-auth-status.model.ts b/src/app/core/auth/models/normalized-auth-status.model.ts index 7693e330a2..3dc723f97b 100644 --- a/src/app/core/auth/models/normalized-auth-status.model.ts +++ b/src/app/core/auth/models/normalized-auth-status.model.ts @@ -4,11 +4,10 @@ import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { ResourceType } from '../../shared/resource-type'; import { NormalizedObject } from '../../cache/models/normalized-object.model'; import { IDToUUIDSerializer } from '../../cache/id-to-uuid-serializer'; -import { resourceType } from '../../shared/resource-type.decorator'; +import { EPerson } from '../../eperson/models/eperson.model'; @mapsTo(AuthStatus) @inheritSerialization(NormalizedObject) -@resourceType(ResourceType.AuthStatus) export class NormalizedAuthStatus extends NormalizedObject { /** * The unique identifier of this auth status @@ -37,7 +36,7 @@ export class NormalizedAuthStatus extends NormalizedObject { /** * The self link to the eperson of this auth status */ - @relationship(ResourceType.EPerson, false) + @relationship(EPerson, false) @autoserialize eperson: string; diff --git a/src/app/core/cache/builders/build-decorators.ts b/src/app/core/cache/builders/build-decorators.ts index 937fb37cd3..27d299c528 100644 --- a/src/app/core/cache/builders/build-decorators.ts +++ b/src/app/core/cache/builders/build-decorators.ts @@ -1,23 +1,42 @@ import 'reflect-metadata'; import { GenericConstructor } from '../../shared/generic-constructor'; -import { CacheableObject } from '../object-cache.reducer'; +import { CacheableObject, TypedObject } from '../object-cache.reducer'; import { ResourceType } from '../../shared/resource-type'; const mapsToMetadataKey = Symbol('mapsTo'); const relationshipKey = Symbol('relationship'); const relationshipMap = new Map(); +const typeMap = new Map(); -export function mapsTo(value: GenericConstructor) { - return Reflect.metadata(mapsToMetadataKey, value); + +export function mapsTo(value: GenericConstructor) { + return function decorator(objectConstructor: GenericConstructor) { + Reflect.defineMetadata(mapsToMetadataKey, value, objectConstructor); + mapsToType((value as any).type, objectConstructor); + } +} + +function mapsToType(value: ResourceType, objectConstructor: GenericConstructor) { + if (!objectConstructor || !value) { + return; + } + typeMap.set(value.value, objectConstructor); } export function getMapsTo(target: any) { return Reflect.getOwnMetadata(mapsToMetadataKey, target); } -export function relationship(value: ResourceType, isList: boolean = false): any { +export function getMapsToType(type: string | ResourceType) { + if (typeof(type) === 'object') { + type = (type as ResourceType).value; + } + return typeMap.get(type); +} + +export function relationship(value: GenericConstructor, isList: boolean = false): any { return function r(target: any, propertyKey: string, descriptor: PropertyDescriptor) { if (!target || !propertyKey) { return; @@ -28,8 +47,10 @@ export function relationship(value: ResourceType, isList: boolean = false): any metaDataList.push(propertyKey); } relationshipMap.set(target.constructor, metaDataList); - - return Reflect.metadata(relationshipKey, { resourceType: value, isList }).apply(this, arguments); + return Reflect.metadata(relationshipKey, { + resourceType: (value as any).type.value, + isList + }).apply(this, arguments); }; } diff --git a/src/app/core/cache/builders/normalized-object-build.service.ts b/src/app/core/cache/builders/normalized-object-build.service.ts index 357ae71872..936548cdd4 100644 --- a/src/app/core/cache/builders/normalized-object-build.service.ts +++ b/src/app/core/cache/builders/normalized-object-build.service.ts @@ -1,9 +1,8 @@ import { Injectable } from '@angular/core'; import { NormalizedObject } from '../models/normalized-object.model'; -import { getRelationships } from './build-decorators'; +import { getMapsToType, getRelationships } from './build-decorators'; import { hasValue, isNotEmpty } from '../../../shared/empty.util'; import { TypedObject } from '../object-cache.reducer'; -import { getNormalizedConstructorByType } from '../../shared/resource-type.decorator'; /** * Return true if halObj has a value for `_links.self` @@ -36,7 +35,7 @@ export class NormalizedObjectBuildService { * @param {TDomain} domainModel a domain model */ normalize(domainModel: T): NormalizedObject { - const normalizedConstructor = getNormalizedConstructorByType(domainModel.type); + const normalizedConstructor = getMapsToType((domainModel as any).type); const relationships = getRelationships(normalizedConstructor) || []; const normalizedModel = Object.assign({}, domainModel) as any; diff --git a/src/app/core/cache/models/items/normalized-item-type.model.ts b/src/app/core/cache/models/items/normalized-item-type.model.ts index ffc1e0fa1f..fdb3b9e455 100644 --- a/src/app/core/cache/models/items/normalized-item-type.model.ts +++ b/src/app/core/cache/models/items/normalized-item-type.model.ts @@ -1,19 +1,15 @@ import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize'; import { ItemType } from '../../../shared/item-relationships/item-type.model'; -import { ResourceType } from '../../../shared/resource-type'; import { mapsTo } from '../../builders/build-decorators'; import { NormalizedObject } from '../normalized-object.model'; import { IDToUUIDSerializer } from '../../id-to-uuid-serializer'; -import { resourceType } from '../../../shared/resource-type.decorator'; /** * Normalized model class for a DSpace ItemType */ @mapsTo(ItemType) -@resourceType(ResourceType.ItemType) @inheritSerialization(NormalizedObject) export class NormalizedItemType extends NormalizedObject { - /** * The label that describes the ResourceType of the Item */ @@ -29,6 +25,6 @@ export class NormalizedItemType extends NormalizedObject { /** * The universally unique identifier of this ItemType */ - @autoserializeAs(new IDToUUIDSerializer(ResourceType.ItemType), 'id') + @autoserializeAs(new IDToUUIDSerializer(ItemType.type.value), 'id') uuid: string; } diff --git a/src/app/core/cache/models/items/normalized-relationship-type.model.ts b/src/app/core/cache/models/items/normalized-relationship-type.model.ts index 326527aaf4..f0f75a03c2 100644 --- a/src/app/core/cache/models/items/normalized-relationship-type.model.ts +++ b/src/app/core/cache/models/items/normalized-relationship-type.model.ts @@ -5,16 +5,15 @@ import { mapsTo, relationship } from '../../builders/build-decorators'; import { NormalizedDSpaceObject } from '../normalized-dspace-object.model'; import { NormalizedObject } from '../normalized-object.model'; import { IDToUUIDSerializer } from '../../id-to-uuid-serializer'; -import { resourceType } from '../../../shared/resource-type.decorator'; +import { NormalizedItemType } from './normalized-item-type.model'; +import { ItemType } from '../../../shared/item-relationships/item-type.model'; /** * Normalized model class for a DSpace RelationshipType */ @mapsTo(RelationshipType) -@resourceType(ResourceType.RelationshipType) @inheritSerialization(NormalizedDSpaceObject) export class NormalizedRelationshipType extends NormalizedObject { - /** * The identifier of this RelationshipType */ @@ -61,19 +60,19 @@ export class NormalizedRelationshipType extends NormalizedObject { @@ -48,12 +48,12 @@ export class NormalizedRelationship extends NormalizedObject { * The type of Relationship */ @autoserialize - @relationship(ResourceType.RelationshipType, false) + @relationship(RelationshipType, false) relationshipType: string; /** * The universally unique identifier of this Relationship */ - @autoserializeAs(new IDToUUIDSerializer(ResourceType.Relationship), 'id') + @autoserializeAs(new IDToUUIDSerializer(Relationship.type.value), 'id') uuid: string; } diff --git a/src/app/core/cache/models/normalized-bitstream-format.model.ts b/src/app/core/cache/models/normalized-bitstream-format.model.ts index 66fbd84176..5ee135b530 100644 --- a/src/app/core/cache/models/normalized-bitstream-format.model.ts +++ b/src/app/core/cache/models/normalized-bitstream-format.model.ts @@ -5,17 +5,13 @@ import { mapsTo } from '../builders/build-decorators'; import { IDToUUIDSerializer } from '../id-to-uuid-serializer'; import { NormalizedObject } from './normalized-object.model'; import { SupportLevel } from './support-level.model'; -import { resourceType } from '../../shared/resource-type.decorator'; -import { ResourceType } from '../../shared/resource-type'; /** * Normalized model class for a Bitstream Format */ @mapsTo(BitstreamFormat) @inheritSerialization(NormalizedObject) -@resourceType(ResourceType.BitstreamFormat) export class NormalizedBitstreamFormat extends NormalizedObject { - /** * Short description of this Bitstream Format */ diff --git a/src/app/core/cache/models/normalized-bitstream.model.ts b/src/app/core/cache/models/normalized-bitstream.model.ts index c2042878da..a9e389fd41 100644 --- a/src/app/core/cache/models/normalized-bitstream.model.ts +++ b/src/app/core/cache/models/normalized-bitstream.model.ts @@ -1,19 +1,17 @@ -import { inheritSerialization, autoserialize } from 'cerialize'; +import { autoserialize, inheritSerialization } from 'cerialize'; import { NormalizedDSpaceObject } from './normalized-dspace-object.model'; import { Bitstream } from '../../shared/bitstream.model'; import { mapsTo, relationship } from '../builders/build-decorators'; -import { ResourceType } from '../../shared/resource-type'; -import { resourceType } from '../../shared/resource-type.decorator'; +import { Item } from '../../shared/item.model'; +import { BitstreamFormat } from '../../shared/bitstream-format.model'; /** * Normalized model class for a DSpace Bitstream */ @mapsTo(Bitstream) @inheritSerialization(NormalizedDSpaceObject) -@resourceType(ResourceType.Bitstream) export class NormalizedBitstream extends NormalizedDSpaceObject { - /** * The size of this bitstream in bytes */ @@ -30,7 +28,7 @@ export class NormalizedBitstream extends NormalizedDSpaceObject { * The format of this Bitstream */ @autoserialize - @relationship(ResourceType.BitstreamFormat, false) + @relationship(BitstreamFormat, false) format: string; /** @@ -43,14 +41,14 @@ export class NormalizedBitstream extends NormalizedDSpaceObject { * An array of Bundles that are direct parents of this Bitstream */ @autoserialize - @relationship(ResourceType.Item, true) + @relationship(Item, true) parents: string[]; /** * The Bundle that owns this Bitstream */ @autoserialize - @relationship(ResourceType.Item, false) + @relationship(Item, false) owner: string; /** diff --git a/src/app/core/cache/models/normalized-bundle.model.ts b/src/app/core/cache/models/normalized-bundle.model.ts index c77a1d027f..3f4e28bca5 100644 --- a/src/app/core/cache/models/normalized-bundle.model.ts +++ b/src/app/core/cache/models/normalized-bundle.model.ts @@ -3,21 +3,19 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { NormalizedDSpaceObject } from './normalized-dspace-object.model'; import { Bundle } from '../../shared/bundle.model'; import { mapsTo, relationship } from '../builders/build-decorators'; -import { ResourceType } from '../../shared/resource-type'; -import { resourceType } from '../../shared/resource-type.decorator'; +import { Bitstream } from '../../shared/bitstream.model'; /** * Normalized model class for a DSpace Bundle */ @mapsTo(Bundle) @inheritSerialization(NormalizedDSpaceObject) -@resourceType(ResourceType.Bundle) export class NormalizedBundle extends NormalizedDSpaceObject { /** * The primary bitstream of this Bundle */ @autoserialize - @relationship(ResourceType.Bitstream, false) + @relationship(Bitstream, false) primaryBitstream: string; /** @@ -34,7 +32,7 @@ export class NormalizedBundle extends NormalizedDSpaceObject { * List of Bitstreams that are part of this Bundle */ @autoserialize - @relationship(ResourceType.Bitstream, true) + @relationship(Bitstream, true) bitstreams: string[]; } diff --git a/src/app/core/cache/models/normalized-collection.model.ts b/src/app/core/cache/models/normalized-collection.model.ts index e726a967e7..9b3419675a 100644 --- a/src/app/core/cache/models/normalized-collection.model.ts +++ b/src/app/core/cache/models/normalized-collection.model.ts @@ -3,15 +3,21 @@ import { autoserialize, deserialize, inheritSerialization } from 'cerialize'; import { NormalizedDSpaceObject } from './normalized-dspace-object.model'; import { Collection } from '../../shared/collection.model'; import { mapsTo, relationship } from '../builders/build-decorators'; -import { ResourceType } from '../../shared/resource-type'; -import { resourceType } from '../../shared/resource-type.decorator'; +import { NormalizedResourcePolicy } from './normalized-resource-policy.model'; +import { NormalizedBitstream } from './normalized-bitstream.model'; +import { NormalizedCommunity } from './normalized-community.model'; +import { NormalizedItem } from './normalized-item.model'; +import { License } from '../../shared/license.model'; +import { ResourcePolicy } from '../../shared/resource-policy.model'; +import { Bitstream } from '../../shared/bitstream.model'; +import { Community } from '../../shared/community.model'; +import { Item } from '../../shared/item.model'; /** * Normalized model class for a DSpace Collection */ @mapsTo(Collection) @inheritSerialization(NormalizedDSpaceObject) -@resourceType(ResourceType.Collection) export class NormalizedCollection extends NormalizedDSpaceObject { /** @@ -24,42 +30,42 @@ export class NormalizedCollection extends NormalizedDSpaceObject { * The Bitstream that represents the license of this Collection */ @autoserialize - @relationship(ResourceType.License, false) + @relationship(License, false) license: string; /** * The Bitstream that represents the default Access Conditions of this Collection */ @autoserialize - @relationship(ResourceType.ResourcePolicy, false) + @relationship(ResourcePolicy, false) defaultAccessConditions: string; /** * The Bitstream that represents the logo of this Collection */ @deserialize - @relationship(ResourceType.Bitstream, false) + @relationship(Bitstream, false) logo: string; /** * An array of Communities that are direct parents of this Collection */ @deserialize - @relationship(ResourceType.Community, true) + @relationship(Community, true) parents: string[]; /** * The Community that owns this Collection */ @deserialize - @relationship(ResourceType.Community, false) + @relationship(Community, false) owner: string; /** * List of Items that are part of (not necessarily owned by) this Collection */ @deserialize - @relationship(ResourceType.Item, true) + @relationship(Item, true) items: string[]; } diff --git a/src/app/core/cache/models/normalized-community.model.ts b/src/app/core/cache/models/normalized-community.model.ts index 85dce37e82..173760ca72 100644 --- a/src/app/core/cache/models/normalized-community.model.ts +++ b/src/app/core/cache/models/normalized-community.model.ts @@ -1,19 +1,20 @@ -import { autoserialize, deserialize, inheritSerialization, serialize } from 'cerialize'; +import { autoserialize, deserialize, 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'; -import { resourceType } from '../../shared/resource-type.decorator'; +import { NormalizedBitstream } from './normalized-bitstream.model'; +import { NormalizedCollection } from './normalized-collection.model'; +import { Bitstream } from '../../shared/bitstream.model'; +import { Collection } from '../../shared/collection.model'; /** * Normalized model class for a DSpace Community */ @mapsTo(Community) @inheritSerialization(NormalizedDSpaceObject) -@resourceType(ResourceType.Community) export class NormalizedCommunity extends NormalizedDSpaceObject { - /** * A string representing the unique handle of this Community */ @@ -24,32 +25,32 @@ export class NormalizedCommunity extends NormalizedDSpaceObject { * The Bitstream that represents the logo of this Community */ @deserialize - @relationship(ResourceType.Bitstream, false) + @relationship(Bitstream, false) logo: string; /** * An array of Communities that are direct parents of this Community */ @deserialize - @relationship(ResourceType.Community, true) + @relationship(Community, true) parents: string[]; /** * The Community that owns this Community */ @deserialize - @relationship(ResourceType.Community, false) + @relationship(Community, false) owner: string; /** * List of Collections that are owned by this Community */ @deserialize - @relationship(ResourceType.Collection, true) + @relationship(Collection, true) collections: string[]; @deserialize - @relationship(ResourceType.Community, true) + @relationship(Community, true) subcommunities: string[]; } diff --git a/src/app/core/cache/models/normalized-dspace-object.model.ts b/src/app/core/cache/models/normalized-dspace-object.model.ts index 65da89a4eb..3c43dd85dc 100644 --- a/src/app/core/cache/models/normalized-dspace-object.model.ts +++ b/src/app/core/cache/models/normalized-dspace-object.model.ts @@ -1,17 +1,14 @@ -import { autoserializeAs, deserializeAs } from 'cerialize'; +import { autoserializeAs, deserializeAs, autoserialize } from 'cerialize'; import { DSpaceObject } from '../../shared/dspace-object.model'; import { MetadataMap, MetadataMapSerializer } from '../../shared/metadata.models'; -import { ResourceType } from '../../shared/resource-type'; import { mapsTo } from '../builders/build-decorators'; import { NormalizedObject } from './normalized-object.model'; -import { resourceType } from '../../shared/resource-type.decorator'; import { TypedObject } from '../object-cache.reducer'; /** * An model class for a DSpaceObject. */ @mapsTo(DSpaceObject) -@resourceType(ResourceType.DSpaceObject) export class NormalizedDSpaceObject extends NormalizedObject implements TypedObject { /** @@ -41,8 +38,8 @@ export class NormalizedDSpaceObject extends NormalizedOb /** * A string representing the kind of DSpaceObject, e.g. community, item, … */ - @autoserializeAs(ResourceType) - type: ResourceType; + @autoserialize + type: string; /** * All metadata of this DSpaceObject diff --git a/src/app/core/cache/models/normalized-item.model.ts b/src/app/core/cache/models/normalized-item.model.ts index 0ce2874f0b..4afceb7612 100644 --- a/src/app/core/cache/models/normalized-item.model.ts +++ b/src/app/core/cache/models/normalized-item.model.ts @@ -4,14 +4,18 @@ import { NormalizedDSpaceObject } from './normalized-dspace-object.model'; import { Item } from '../../shared/item.model'; import { mapsTo, relationship } from '../builders/build-decorators'; import { ResourceType } from '../../shared/resource-type'; -import { resourceType } from '../../shared/resource-type.decorator'; +import { NormalizedCollection } from './normalized-collection.model'; +import { NormalizedBitstream } from './normalized-bitstream.model'; +import { NormalizedRelationship } from './items/normalized-relationship.model'; +import { Collection } from '../../shared/collection.model'; +import { Bitstream } from '../../shared/bitstream.model'; +import { Relationship } from '../../shared/item-relationships/relationship.model'; /** * Normalized model class for a DSpace Item */ @mapsTo(Item) @inheritSerialization(NormalizedDSpaceObject) -@resourceType(ResourceType.Item) export class NormalizedItem extends NormalizedDSpaceObject { /** @@ -48,25 +52,25 @@ export class NormalizedItem extends NormalizedDSpaceObject { * An array of Collections that are direct parents of this Item */ @deserialize - @relationship(ResourceType.Collection, true) + @relationship(Collection, true) parents: string[]; /** * The Collection that owns this Item */ @deserialize - @relationship(ResourceType.Collection, false) + @relationship(Collection, false) owningCollection: string; /** * List of Bitstreams that are owned by this Item */ @deserialize - @relationship(ResourceType.Bitstream, true) + @relationship(Bitstream, true) bitstreams: string[]; @autoserialize - @relationship(ResourceType.Relationship, true) + @relationship(Relationship, true) relationships: string[]; } diff --git a/src/app/core/cache/models/normalized-license.model.ts b/src/app/core/cache/models/normalized-license.model.ts index 105a0f288e..c86d43b961 100644 --- a/src/app/core/cache/models/normalized-license.model.ts +++ b/src/app/core/cache/models/normalized-license.model.ts @@ -2,7 +2,6 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { mapsTo } from '../builders/build-decorators'; import { NormalizedDSpaceObject } from './normalized-dspace-object.model'; import { License } from '../../shared/license.model'; -import { resourceType } from '../../shared/resource-type.decorator'; import { ResourceType } from '../../shared/resource-type'; /** @@ -10,7 +9,6 @@ import { ResourceType } from '../../shared/resource-type'; */ @mapsTo(License) @inheritSerialization(NormalizedDSpaceObject) -@resourceType(ResourceType.License) export class NormalizedLicense extends NormalizedDSpaceObject { /** diff --git a/src/app/core/cache/models/normalized-object.model.ts b/src/app/core/cache/models/normalized-object.model.ts index ee758d984d..28cb8494ef 100644 --- a/src/app/core/cache/models/normalized-object.model.ts +++ b/src/app/core/cache/models/normalized-object.model.ts @@ -5,19 +5,12 @@ import { ResourceType } from '../../shared/resource-type'; * An abstract model class for a NormalizedObject. */ export abstract class NormalizedObject implements CacheableObject { - /** * The link to the rest endpoint where this object can be found */ @autoserialize self: string; - /** - * A string representing the kind of DSpaceObject, e.g. community, item, … - */ - @autoserialize - type: ResourceType; - @autoserialize _links: { [name: string]: string diff --git a/src/app/core/cache/models/normalized-resource-policy.model.ts b/src/app/core/cache/models/normalized-resource-policy.model.ts index 2f779d0773..9a9841fe97 100644 --- a/src/app/core/cache/models/normalized-resource-policy.model.ts +++ b/src/app/core/cache/models/normalized-resource-policy.model.ts @@ -5,7 +5,6 @@ import { mapsTo } from '../builders/build-decorators'; import { NormalizedObject } from './normalized-object.model'; import { IDToUUIDSerializer } from '../id-to-uuid-serializer'; import { ActionType } from './action-type.model'; -import { resourceType } from '../../shared/resource-type.decorator'; import { ResourceType } from '../../shared/resource-type'; /** @@ -13,9 +12,7 @@ import { ResourceType } from '../../shared/resource-type'; */ @mapsTo(ResourcePolicy) @inheritSerialization(NormalizedObject) -@resourceType(ResourceType.ResourcePolicy) export class NormalizedResourcePolicy extends NormalizedObject { - /** * The action that is allowed by this Resource Policy */ diff --git a/src/app/core/cache/models/support-level.model.ts b/src/app/core/cache/models/support-level.model.ts index 30f759d55f..103ff2c626 100644 --- a/src/app/core/cache/models/support-level.model.ts +++ b/src/app/core/cache/models/support-level.model.ts @@ -8,7 +8,7 @@ export enum SupportLevel { Unknown = 0, /** - * Unknown for Bitstream Formats that are known to the system, but not fully supported + * Known for Bitstream Formats that are known to the system, but not fully supported */ Known = 1, diff --git a/src/app/core/cache/object-cache.reducer.spec.ts b/src/app/core/cache/object-cache.reducer.spec.ts index 4d4f5c745b..a65e63ab86 100644 --- a/src/app/core/cache/object-cache.reducer.spec.ts +++ b/src/app/core/cache/object-cache.reducer.spec.ts @@ -9,7 +9,7 @@ import { ResetObjectCacheTimestampsAction } from './object-cache.actions'; import { Operation } from 'fast-json-patch'; -import { ResourceType } from '../shared/resource-type'; +import { Item } from '../shared/item.model'; class NullAction extends RemoveFromObjectCacheAction { type = null; @@ -29,7 +29,7 @@ describe('objectCacheReducer', () => { const testState = { [selfLink1]: { data: { - type: ResourceType.Item, + type: Item.type, self: selfLink1, foo: 'bar' }, @@ -41,7 +41,7 @@ describe('objectCacheReducer', () => { }, [selfLink2]: { data: { - type: ResourceType.Item, + type: Item.type, self: requestUUID2, foo: 'baz' }, @@ -70,7 +70,7 @@ describe('objectCacheReducer', () => { it('should add the payload to the cache in response to an ADD action', () => { const state = Object.create(null); - const objectToCache = { self: selfLink1, type: ResourceType.Item }; + const objectToCache = { self: selfLink1, type: Item.type }; const timeAdded = new Date().getTime(); const msToLive = 900000; const requestUUID = requestUUID1; @@ -87,7 +87,7 @@ describe('objectCacheReducer', () => { self: selfLink1, foo: 'baz', somethingElse: true, - type: ResourceType.Item + type: Item.type }; const timeAdded = new Date().getTime(); const msToLive = 900000; @@ -103,7 +103,7 @@ describe('objectCacheReducer', () => { it('should perform the ADD action without affecting the previous state', () => { const state = Object.create(null); - const objectToCache = { self: selfLink1, type: ResourceType.Item }; + const objectToCache = { self: selfLink1, type: Item.type }; const timeAdded = new Date().getTime(); const msToLive = 900000; const requestUUID = requestUUID1; diff --git a/src/app/core/cache/object-cache.reducer.ts b/src/app/core/cache/object-cache.reducer.ts index 9529fb2890..012d12b5f5 100644 --- a/src/app/core/cache/object-cache.reducer.ts +++ b/src/app/core/cache/object-cache.reducer.ts @@ -32,8 +32,8 @@ export interface Patch { operations: Operation[]; } -export interface TypedObject { - type: ResourceType; +export abstract class TypedObject { + static type: ResourceType; } /** @@ -41,7 +41,7 @@ export interface TypedObject { * * A cacheable object should have a self link */ -export interface CacheableObject extends TypedObject { +export class CacheableObject extends TypedObject { uuid?: string; self: string; // isNew: boolean; diff --git a/src/app/core/cache/object-cache.service.spec.ts b/src/app/core/cache/object-cache.service.spec.ts index 20e12108ad..39dc10de2c 100644 --- a/src/app/core/cache/object-cache.service.spec.ts +++ b/src/app/core/cache/object-cache.service.spec.ts @@ -10,13 +10,13 @@ import { RemoveFromObjectCacheAction } from './object-cache.actions'; import { CoreState } from '../core.reducers'; -import { ResourceType } from '../shared/resource-type'; import { NormalizedItem } from './models/normalized-item.model'; import { first } from 'rxjs/operators'; import { Operation } from 'fast-json-patch'; import { RestRequestMethod } from '../data/rest-request-method'; import { AddToSSBAction } from './server-sync-buffer.actions'; import { Patch } from './object-cache.reducer'; +import { Item } from '../shared/item.model'; describe('ObjectCacheService', () => { let service: ObjectCacheService; @@ -28,7 +28,7 @@ describe('ObjectCacheService', () => { const msToLive = 900000; let objectToCache = { self: selfLink, - type: ResourceType.Item + type: Item.type }; let cacheEntry; let invalidCacheEntry; @@ -37,7 +37,7 @@ describe('ObjectCacheService', () => { function init() { objectToCache = { self: selfLink, - type: ResourceType.Item + type: Item.type }; cacheEntry = { data: objectToCache, diff --git a/src/app/core/cache/object-cache.service.ts b/src/app/core/cache/object-cache.service.ts index 4b4eaca196..e18ff3b3a4 100644 --- a/src/app/core/cache/object-cache.service.ts +++ b/src/app/core/cache/object-cache.service.ts @@ -20,7 +20,7 @@ import { import { CacheableObject, ObjectCacheEntry, ObjectCacheState } from './object-cache.reducer'; import { AddToSSBAction } from './server-sync-buffer.actions'; -import { getNormalizedConstructorByType } from '../shared/resource-type.decorator'; +import { getMapsToType } from './builders/build-decorators'; /** * The base selector function to select the object cache in the store @@ -109,7 +109,7 @@ export class ObjectCacheService { } ), map((entry: ObjectCacheEntry) => { - const type: GenericConstructor> = getNormalizedConstructorByType(entry.data.type); + const type: GenericConstructor> = getMapsToType((entry.data as any).type); return Object.assign(new type(), entry.data) as NormalizedObject }) ); diff --git a/src/app/core/config/models/config-submission-definition.model.ts b/src/app/core/config/models/config-submission-definition.model.ts new file mode 100644 index 0000000000..f1799ebb63 --- /dev/null +++ b/src/app/core/config/models/config-submission-definition.model.ts @@ -0,0 +1,19 @@ +import { ConfigObject } from './config.model'; +import { SubmissionSectionModel } from './config-submission-section.model'; +import { PaginatedList } from '../../data/paginated-list'; +import { ResourceType } from '../../shared/resource-type'; + +export class SubmissionDefinitionModel extends ConfigObject { + static type = new ResourceType('submissiondefinition'); + + /** + * A boolean representing if this submission definition is the default or not + */ + isDefault: boolean; + + /** + * A list of SubmissionSectionModel that are present in this submission definition + */ + sections: PaginatedList; + +} diff --git a/src/app/core/config/models/config-submission-definitions.model.ts b/src/app/core/config/models/config-submission-definitions.model.ts index 8bbbc90056..d9892f542f 100644 --- a/src/app/core/config/models/config-submission-definitions.model.ts +++ b/src/app/core/config/models/config-submission-definitions.model.ts @@ -1,17 +1,7 @@ -import { ConfigObject } from './config.model'; -import { SubmissionSectionModel } from './config-submission-section.model'; -import { PaginatedList } from '../../data/paginated-list'; +import { SubmissionDefinitionModel } from './config-submission-definition.model'; +import { ResourceType } from '../../shared/resource-type'; -export class SubmissionDefinitionsModel extends ConfigObject { - - /** - * A boolean representing if this submission definition is the default or not - */ - isDefault: boolean; - - /** - * A list of SubmissionSectionModel that are present in this submission definition - */ - sections: PaginatedList; +export class SubmissionDefinitionsModel extends SubmissionDefinitionModel { + static type = new ResourceType('submissiondefinitions'); } diff --git a/src/app/core/config/models/config-submission-form.model.ts b/src/app/core/config/models/config-submission-form.model.ts new file mode 100644 index 0000000000..a65d285c95 --- /dev/null +++ b/src/app/core/config/models/config-submission-form.model.ts @@ -0,0 +1,22 @@ +import { ConfigObject } from './config.model'; +import { FormFieldModel } from '../../../shared/form/builder/models/form-field.model'; +import { ResourceType } from '../../shared/resource-type'; + +/** + * An interface that define a form row and its properties. + */ +export interface FormRowModel { + fields: FormFieldModel[]; +} + +/** + * A model class for a NormalizedObject. + */ +export class SubmissionFormModel extends ConfigObject { + static type = new ResourceType('submissionform'); + + /** + * An array of [FormRowModel] that are present in this form + */ + rows: FormRowModel[]; +} diff --git a/src/app/core/config/models/config-submission-forms.model.ts b/src/app/core/config/models/config-submission-forms.model.ts index ee0962f0e9..017d7d68cc 100644 --- a/src/app/core/config/models/config-submission-forms.model.ts +++ b/src/app/core/config/models/config-submission-forms.model.ts @@ -1,20 +1,9 @@ -import { ConfigObject } from './config.model'; -import { FormFieldModel } from '../../../shared/form/builder/models/form-field.model'; - -/** - * An interface that define a form row and its properties. - */ -export interface FormRowModel { - fields: FormFieldModel[]; -} +import { SubmissionFormModel } from './config-submission-form.model'; +import { ResourceType } from '../../shared/resource-type'; /** * A model class for a NormalizedObject. */ -export class SubmissionFormsModel extends ConfigObject { - - /** - * An array of [FormRowModel] that are present in this form - */ - rows: FormRowModel[]; +export class SubmissionFormsModel extends SubmissionFormModel { + static type = new ResourceType('submissionforms'); } diff --git a/src/app/core/config/models/config-submission-section.model.ts b/src/app/core/config/models/config-submission-section.model.ts index 377a8869e1..4c560fa631 100644 --- a/src/app/core/config/models/config-submission-section.model.ts +++ b/src/app/core/config/models/config-submission-section.model.ts @@ -1,5 +1,6 @@ import { ConfigObject } from './config.model'; import { SectionsType } from '../../../submission/sections/sections-type'; +import { ResourceType } from '../../shared/resource-type'; /** * An interface that define section visibility and its properties. @@ -10,6 +11,7 @@ export interface SubmissionSectionVisibility { } export class SubmissionSectionModel extends ConfigObject { + static type = new ResourceType('submissionsection'); /** * The header for this section diff --git a/src/app/core/config/models/config-submission-sections.model.ts b/src/app/core/config/models/config-submission-sections.model.ts new file mode 100644 index 0000000000..ae7b133391 --- /dev/null +++ b/src/app/core/config/models/config-submission-sections.model.ts @@ -0,0 +1,6 @@ +import { SubmissionSectionModel } from './config-submission-section.model'; +import { ResourceType } from '../../shared/resource-type'; + +export class SubmissionSectionsModel extends SubmissionSectionModel { + static type = new ResourceType('submissionsections'); +} diff --git a/src/app/core/config/models/normalized-config-submission-definition.model.ts b/src/app/core/config/models/normalized-config-submission-definition.model.ts new file mode 100644 index 0000000000..cb56e01acf --- /dev/null +++ b/src/app/core/config/models/normalized-config-submission-definition.model.ts @@ -0,0 +1,28 @@ +import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize'; +import { SubmissionSectionModel } from './config-submission-section.model'; +import { PaginatedList } from '../../data/paginated-list'; +import { NormalizedConfigObject } from './normalized-config.model'; +import { SubmissionDefinitionsModel } from './config-submission-definitions.model'; +import { mapsTo } from '../../cache/builders/build-decorators'; +import { SubmissionDefinitionModel } from './config-submission-definition.model'; + +/** + * Normalized class for the configuration describing the submission + */ +@mapsTo(SubmissionDefinitionModel) +@inheritSerialization(NormalizedConfigObject) +export class NormalizedSubmissionDefinitionModel extends NormalizedConfigObject { + + /** + * A boolean representing if this submission definition is the default or not + */ + @autoserialize + isDefault: boolean; + + /** + * A list of SubmissionSectionModel that are present in this submission definition + */ + @autoserializeAs(SubmissionSectionModel) + sections: PaginatedList; + +} diff --git a/src/app/core/config/models/normalized-config-submission-definitions.model.ts b/src/app/core/config/models/normalized-config-submission-definitions.model.ts index 87df838378..4c52d96458 100644 --- a/src/app/core/config/models/normalized-config-submission-definitions.model.ts +++ b/src/app/core/config/models/normalized-config-submission-definitions.model.ts @@ -1,30 +1,13 @@ -import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize'; -import { SubmissionSectionModel } from './config-submission-section.model'; -import { PaginatedList } from '../../data/paginated-list'; +import { inheritSerialization } from 'cerialize'; import { NormalizedConfigObject } from './normalized-config.model'; import { SubmissionDefinitionsModel } from './config-submission-definitions.model'; -import { resourceType } from '../../shared/resource-type.decorator'; -import { ResourceType } from '../../shared/resource-type'; import { mapsTo } from '../../cache/builders/build-decorators'; +import { NormalizedSubmissionDefinitionModel } from './normalized-config-submission-definition.model'; /** * Normalized class for the configuration describing the submission */ @mapsTo(SubmissionDefinitionsModel) @inheritSerialization(NormalizedConfigObject) -@resourceType(ResourceType.SubmissionDefinitions, ResourceType.SubmissionDefinition) -export class NormalizedSubmissionDefinitionsModel extends NormalizedConfigObject { - - /** - * A boolean representing if this submission definition is the default or not - */ - @autoserialize - isDefault: boolean; - - /** - * A list of SubmissionSectionModel that are present in this submission definition - */ - @autoserializeAs(SubmissionSectionModel) - sections: PaginatedList; - +export class NormalizedSubmissionDefinitionsModel extends NormalizedSubmissionDefinitionModel { } diff --git a/src/app/core/config/models/normalized-config-submission-form.model.ts b/src/app/core/config/models/normalized-config-submission-form.model.ts new file mode 100644 index 0000000000..afdfef4818 --- /dev/null +++ b/src/app/core/config/models/normalized-config-submission-form.model.ts @@ -0,0 +1,18 @@ +import { autoserialize, inheritSerialization } from 'cerialize'; +import { NormalizedConfigObject } from './normalized-config.model'; +import { mapsTo } from '../../cache/builders/build-decorators'; +import { FormRowModel, SubmissionFormModel } from './config-submission-form.model'; + +/** + * Normalized class for the configuration describing the submission form + */ +@mapsTo(SubmissionFormModel) +@inheritSerialization(NormalizedConfigObject) +export class NormalizedSubmissionFormModel extends NormalizedConfigObject { + + /** + * An array of [FormRowModel] that are present in this form + */ + @autoserialize + rows: FormRowModel[]; +} diff --git a/src/app/core/config/models/normalized-config-submission-forms.model.ts b/src/app/core/config/models/normalized-config-submission-forms.model.ts index 2856fe46fc..c040a94587 100644 --- a/src/app/core/config/models/normalized-config-submission-forms.model.ts +++ b/src/app/core/config/models/normalized-config-submission-forms.model.ts @@ -1,21 +1,12 @@ -import { autoserialize, inheritSerialization } from 'cerialize'; -import { NormalizedConfigObject } from './normalized-config.model'; -import { FormRowModel, SubmissionFormsModel } from './config-submission-forms.model'; -import { resourceType } from '../../shared/resource-type.decorator'; -import { ResourceType } from '../../shared/resource-type'; +import { inheritSerialization } from 'cerialize'; import { mapsTo } from '../../cache/builders/build-decorators'; +import { SubmissionFormsModel } from './config-submission-forms.model'; +import { NormalizedSubmissionFormModel } from './normalized-config-submission-form.model'; /** * Normalized class for the configuration describing the submission form */ @mapsTo(SubmissionFormsModel) -@inheritSerialization(NormalizedConfigObject) -@resourceType(ResourceType.SubmissionForm, ResourceType.SubmissionForms) -export class NormalizedSubmissionFormsModel extends NormalizedConfigObject { - - /** - * An array of [FormRowModel] that are present in this form - */ - @autoserialize - rows: FormRowModel[]; +@inheritSerialization(NormalizedSubmissionFormModel) +export class NormalizedSubmissionFormsModel extends NormalizedSubmissionFormModel { } diff --git a/src/app/core/config/models/normalized-config-submission-section.model.ts b/src/app/core/config/models/normalized-config-submission-section.model.ts index 3f9bca8b7b..364a981060 100644 --- a/src/app/core/config/models/normalized-config-submission-section.model.ts +++ b/src/app/core/config/models/normalized-config-submission-section.model.ts @@ -1,21 +1,17 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { SectionsType } from '../../../submission/sections/sections-type'; import { NormalizedConfigObject } from './normalized-config.model'; -import { SubmissionFormsModel } from './config-submission-forms.model'; import { SubmissionSectionModel, SubmissionSectionVisibility } from './config-submission-section.model'; import { mapsTo } from '../../cache/builders/build-decorators'; -import { resourceType } from '../../shared/resource-type.decorator'; -import { ResourceType } from '../../shared/resource-type'; /** * Normalized class for the configuration describing the submission section */ @mapsTo(SubmissionSectionModel) @inheritSerialization(NormalizedConfigObject) -@resourceType(ResourceType.SubmissionSection, ResourceType.SubmissionSections) export class NormalizedSubmissionSectionModel extends NormalizedConfigObject { /** diff --git a/src/app/core/config/models/normalized-config-submission-sections.model.ts b/src/app/core/config/models/normalized-config-submission-sections.model.ts new file mode 100644 index 0000000000..fb1e4c671a --- /dev/null +++ b/src/app/core/config/models/normalized-config-submission-sections.model.ts @@ -0,0 +1,18 @@ +import { autoserialize, inheritSerialization } from 'cerialize'; +import { SectionsType } from '../../../submission/sections/sections-type'; +import { NormalizedConfigObject } from './normalized-config.model'; +import { + SubmissionSectionModel, + SubmissionSectionVisibility +} from './config-submission-section.model'; +import { mapsTo } from '../../cache/builders/build-decorators'; +import { SubmissionSectionsModel } from './config-submission-sections.model'; +import { NormalizedSubmissionSectionModel } from './normalized-config-submission-section.model'; + +/** + * Normalized class for the configuration describing the submission section + */ +@mapsTo(SubmissionSectionsModel) +@inheritSerialization(NormalizedSubmissionSectionModel) +export class NormalizedSubmissionSectionsModel extends NormalizedSubmissionSectionModel { +} diff --git a/src/app/core/data/base-response-parsing.service.ts b/src/app/core/data/base-response-parsing.service.ts index 8235790c0c..0ed5dc363c 100644 --- a/src/app/core/data/base-response-parsing.service.ts +++ b/src/app/core/data/base-response-parsing.service.ts @@ -7,8 +7,8 @@ import { GlobalConfig } from '../../../config/global-config.interface'; import { GenericConstructor } from '../shared/generic-constructor'; import { PaginatedList } from './paginated-list'; import { isRestDataObject, isRestPaginatedList } from '../cache/builders/normalized-object-build.service'; -import { getNormalizedConstructorByType } from '../shared/resource-type.decorator'; import { ResourceType } from '../shared/resource-type'; +import { getMapsToType } from '../cache/builders/build-decorators'; /* tslint:disable:max-classes-per-file */ export abstract class BaseResponseParsingService { @@ -84,9 +84,9 @@ export abstract class BaseResponseParsingService { } protected deserialize(obj): any { - const type: ResourceType = obj.type; + const type: string = obj.type; if (hasValue(type)) { - const normObjConstructor = getNormalizedConstructorByType(type) as GenericConstructor; + const normObjConstructor = getMapsToType(type) as GenericConstructor; if (hasValue(normObjConstructor)) { const serializer = new DSpaceRESTv2Serializer(normObjConstructor); diff --git a/src/app/core/data/data.service.ts b/src/app/core/data/data.service.ts index 7176756ed9..ad0db51980 100644 --- a/src/app/core/data/data.service.ts +++ b/src/app/core/data/data.service.ts @@ -36,7 +36,7 @@ import { RequestEntry } from './request.reducer'; import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service'; import { ChangeAnalyzer } from './change-analyzer'; import { RestRequestMethod } from './rest-request-method'; -import { getNormalizedConstructorByType } from '../shared/resource-type.decorator'; +import { getMapsToType } from '../cache/builders/build-decorators'; export abstract class DataService { protected abstract requestService: RequestService; @@ -243,7 +243,7 @@ export abstract class DataService { ); const normalizedObject: NormalizedObject = this.dataBuildService.normalize(dso); - const serializedDso = new DSpaceRESTv2Serializer(getNormalizedConstructorByType(dso.type)).serialize(normalizedObject); + const serializedDso = new DSpaceRESTv2Serializer(getMapsToType((dso as any).type)).serialize(normalizedObject); const request$ = endpoint$.pipe( take(1), diff --git a/src/app/core/data/request.effects.ts b/src/app/core/data/request.effects.ts index c85c9a9ff1..9ef85bfe8b 100644 --- a/src/app/core/data/request.effects.ts +++ b/src/app/core/data/request.effects.ts @@ -20,7 +20,7 @@ import { DSpaceRESTv2Serializer } from '../dspace-rest-v2/dspace-rest-v2.seriali import { catchError, filter, flatMap, map, take, tap } from 'rxjs/operators'; import { ErrorResponse, RestResponse } from '../cache/response.models'; import { StoreActionTypes } from '../../store.actions'; -import { getNormalizedConstructorByType } from '../shared/resource-type.decorator'; +import { getMapsToType } from '../cache/builders/build-decorators'; export const addToResponseCacheAndCompleteAction = (request: RestRequest, envConfig: GlobalConfig) => (source: Observable): Observable => @@ -45,7 +45,7 @@ export class RequestEffects { flatMap((request: RestRequest) => { let body; if (isNotEmpty(request.body)) { - const serializer = new DSpaceRESTv2Serializer(getNormalizedConstructorByType(request.body.type)); + const serializer = new DSpaceRESTv2Serializer(getMapsToType(request.body.type)); body = serializer.serialize(request.body); } return this.restApi.request(request.method, request.href, body, request.options).pipe( diff --git a/src/app/core/eperson/models/eperson.model.ts b/src/app/core/eperson/models/eperson.model.ts index f8c11c1201..d99a059e8b 100644 --- a/src/app/core/eperson/models/eperson.model.ts +++ b/src/app/core/eperson/models/eperson.model.ts @@ -4,8 +4,10 @@ import { DSpaceObject } from '../../shared/dspace-object.model'; import { Group } from './group.model'; import { RemoteData } from '../../data/remote-data'; import { PaginatedList } from '../../data/paginated-list'; +import { ResourceType } from '../../shared/resource-type'; export class EPerson extends DSpaceObject { + static type = new ResourceType('eperson'); /** * A string representing the unique handle of this Collection diff --git a/src/app/core/eperson/models/group.model.ts b/src/app/core/eperson/models/group.model.ts index 91ce5d90f3..9c14c20de7 100644 --- a/src/app/core/eperson/models/group.model.ts +++ b/src/app/core/eperson/models/group.model.ts @@ -3,8 +3,10 @@ import { Observable } from 'rxjs'; import { DSpaceObject } from '../../shared/dspace-object.model'; import { PaginatedList } from '../../data/paginated-list'; import { RemoteData } from '../../data/remote-data'; +import { ResourceType } from '../../shared/resource-type'; export class Group extends DSpaceObject { + static type = new ResourceType('group'); /** * List of Groups that this Group belong to diff --git a/src/app/core/eperson/models/normalized-eperson.model.ts b/src/app/core/eperson/models/normalized-eperson.model.ts index 01d9ef3681..bf644a83ef 100644 --- a/src/app/core/eperson/models/normalized-eperson.model.ts +++ b/src/app/core/eperson/models/normalized-eperson.model.ts @@ -5,14 +5,11 @@ import { ListableObject } from '../../../shared/object-collection/shared/listabl import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-object.model'; import { EPerson } from './eperson.model'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; -import { ResourceType } from '../../shared/resource-type'; -import { resourceType } from '../../shared/resource-type.decorator'; +import { Group } from './group.model'; @mapsTo(EPerson) @inheritSerialization(NormalizedDSpaceObject) -@resourceType(ResourceType.EPerson) export class NormalizedEPerson extends NormalizedDSpaceObject implements CacheableObject, ListableObject { - /** * A string representing the unique handle of this EPerson */ @@ -23,7 +20,7 @@ export class NormalizedEPerson extends NormalizedDSpaceObject implement * List of Groups that this EPerson belong to */ @deserialize - @relationship(ResourceType.Group, true) + @relationship(Group, true) groups: string[]; /** diff --git a/src/app/core/eperson/models/normalized-group.model.ts b/src/app/core/eperson/models/normalized-group.model.ts index 776f248127..329ffb8adf 100644 --- a/src/app/core/eperson/models/normalized-group.model.ts +++ b/src/app/core/eperson/models/normalized-group.model.ts @@ -5,19 +5,16 @@ import { ListableObject } from '../../../shared/object-collection/shared/listabl import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-object.model'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { Group } from './group.model'; -import { ResourceType } from '../../shared/resource-type'; -import { resourceType } from '../../shared/resource-type.decorator'; @mapsTo(Group) @inheritSerialization(NormalizedDSpaceObject) -@resourceType(ResourceType.Group) export class NormalizedGroup extends NormalizedDSpaceObject implements CacheableObject, ListableObject { /** * List of Groups that this Group belong to */ @deserialize - @relationship(ResourceType.Group, true) + @relationship(Group, true) groups: string[]; /** diff --git a/src/app/core/integration/integration-response-parsing.service.ts b/src/app/core/integration/integration-response-parsing.service.ts index 9793a69218..a98d206402 100644 --- a/src/app/core/integration/integration-response-parsing.service.ts +++ b/src/app/core/integration/integration-response-parsing.service.ts @@ -2,11 +2,7 @@ import { Inject, Injectable } from '@angular/core'; import { RestRequest } from '../data/request.models'; import { ResponseParsingService } from '../data/parsing.service'; import { DSpaceRESTV2Response } from '../dspace-rest-v2/dspace-rest-v2-response.model'; -import { - ErrorResponse, - IntegrationSuccessResponse, - RestResponse -} from '../cache/response.models'; +import { ErrorResponse, IntegrationSuccessResponse, RestResponse } from '../cache/response.models'; import { isNotEmpty } from '../../shared/empty.util'; import { BaseResponseParsingService } from '../data/base-response-parsing.service'; @@ -16,7 +12,6 @@ import { ObjectCacheService } from '../cache/object-cache.service'; import { IntegrationModel } from './models/integration.model'; import { AuthorityValue } from './models/authority.value'; import { PaginatedList } from '../data/paginated-list'; -import { ResourceType } from '../shared/resource-type'; @Injectable() export class IntegrationResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { @@ -47,7 +42,7 @@ export class IntegrationResponseParsingService extends BaseResponseParsingServic protected processResponse(data: PaginatedList): any { const returnList = Array.of(); data.page.forEach((item, index) => { - if (item.type === ResourceType.Authority) { + if (item.type === AuthorityValue.type) { data.page[index] = Object.assign(new AuthorityValue(), item); } }); diff --git a/src/app/core/integration/models/authority.value.ts b/src/app/core/integration/models/authority.value.ts index 31cb0a5787..4c6a7c01cb 100644 --- a/src/app/core/integration/models/authority.value.ts +++ b/src/app/core/integration/models/authority.value.ts @@ -3,11 +3,13 @@ import { isNotEmpty } from '../../../shared/empty.util'; import { PLACEHOLDER_PARENT_METADATA } from '../../../shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model'; import { OtherInformation } from '../../../shared/form/builder/models/form-field-metadata-value.model'; import { MetadataValueInterface } from '../../shared/metadata.models'; +import { ResourceType } from '../../shared/resource-type'; /** * Class representing an authority object */ export class AuthorityValue extends IntegrationModel implements MetadataValueInterface { + static type = new ResourceType('authority'); /** * The identifier of this authority diff --git a/src/app/core/integration/models/normalized-authority-value.model.ts b/src/app/core/integration/models/normalized-authority-value.model.ts index 6e6c7ee798..5ebb61281d 100644 --- a/src/app/core/integration/models/normalized-authority-value.model.ts +++ b/src/app/core/integration/models/normalized-authority-value.model.ts @@ -2,15 +2,12 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { IntegrationModel } from './integration.model'; import { mapsTo } from '../../cache/builders/build-decorators'; import { AuthorityValue } from './authority.value'; -import { resourceType } from '../../shared/resource-type.decorator'; -import { ResourceType } from '../../shared/resource-type'; /** * Normalized model class for an Authority Value */ @mapsTo(AuthorityValue) @inheritSerialization(IntegrationModel) -@resourceType(ResourceType.Authority) export class NormalizedAuthorityValue extends IntegrationModel { @autoserialize diff --git a/src/app/core/metadata/metadata-field.model.ts b/src/app/core/metadata/metadata-field.model.ts index a79e63cd14..5e20d3f40e 100644 --- a/src/app/core/metadata/metadata-field.model.ts +++ b/src/app/core/metadata/metadata-field.model.ts @@ -7,6 +7,7 @@ import { ResourceType } from '../shared/resource-type'; * Class the represents a metadata field */ export class MetadataField implements ListableObject { + static type = new ResourceType('metadatafield'); /** * The identifier of this metadata field diff --git a/src/app/core/metadata/metadata-schema.model.ts b/src/app/core/metadata/metadata-schema.model.ts index 5d3ce4988b..206cf081ba 100644 --- a/src/app/core/metadata/metadata-schema.model.ts +++ b/src/app/core/metadata/metadata-schema.model.ts @@ -5,6 +5,8 @@ import { ResourceType } from '../shared/resource-type'; * Class that represents a metadata schema */ export class MetadataSchema implements ListableObject { + static type = new ResourceType('metadataschema'); + /** * The unique identifier for this metadata schema */ diff --git a/src/app/core/metadata/normalized-metadata-field.model.ts b/src/app/core/metadata/normalized-metadata-field.model.ts index ba9e5b3b2a..484cbe5066 100644 --- a/src/app/core/metadata/normalized-metadata-field.model.ts +++ b/src/app/core/metadata/normalized-metadata-field.model.ts @@ -1,16 +1,15 @@ import { autoserialize, deserialize } from 'cerialize'; import { mapsTo, relationship } from '../cache/builders/build-decorators'; import { ResourceType } from '../shared/resource-type'; -import { resourceType } from '../shared/resource-type.decorator'; import { MetadataField } from './metadata-field.model'; import { NormalizedObject } from '../cache/models/normalized-object.model'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; +import { MetadataSchema } from './metadata-schema.model'; /** * Class the represents a normalized metadata field */ @mapsTo(MetadataField) -@resourceType(ResourceType.MetadataField) export class NormalizedMetadataField extends NormalizedObject implements ListableObject { /** @@ -47,7 +46,7 @@ export class NormalizedMetadataField extends NormalizedObject imp * The link to the metadata schema of this normalized metadata field */ @deserialize - @relationship(ResourceType.MetadataSchema) + @relationship(MetadataSchema) schema: string; /** diff --git a/src/app/core/metadata/normalized-metadata-schema.model.ts b/src/app/core/metadata/normalized-metadata-schema.model.ts index b1ea78b225..d846b828b9 100644 --- a/src/app/core/metadata/normalized-metadata-schema.model.ts +++ b/src/app/core/metadata/normalized-metadata-schema.model.ts @@ -2,7 +2,6 @@ import { autoserialize } from 'cerialize'; import { NormalizedObject } from '../cache/models/normalized-object.model'; import { mapsTo } from '../cache/builders/build-decorators'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; -import { resourceType } from '../shared/resource-type.decorator'; import { ResourceType } from '../shared/resource-type'; import { MetadataSchema } from './metadata-schema.model'; @@ -10,7 +9,6 @@ import { MetadataSchema } from './metadata-schema.model'; * Normalized class for a DSpace MetadataSchema */ @mapsTo(MetadataSchema) -@resourceType(ResourceType.MetadataSchema) export class NormalizedMetadataSchema extends NormalizedObject implements ListableObject { /** * The unique identifier for this schema diff --git a/src/app/core/registry/registry-metadatafields-response.model.ts b/src/app/core/registry/registry-metadatafields-response.model.ts index 9f0b836ba2..984603e42e 100644 --- a/src/app/core/registry/registry-metadatafields-response.model.ts +++ b/src/app/core/registry/registry-metadatafields-response.model.ts @@ -1,18 +1,20 @@ import { PageInfo } from '../shared/page-info.model'; import { autoserialize, deserialize } from 'cerialize'; -import { MetadataField } from '../metadata/metadata-field.model'; -import { relationship } from '../cache/builders/build-decorators'; import { ResourceType } from '../shared/resource-type'; +import { relationship } from '../cache/builders/build-decorators'; +import { NormalizedMetadataField } from '../metadata/normalized-metadata-field.model'; +import { MetadataField } from '../metadata/metadata-field.model'; /** * Class that represents a response with a registry's metadata fields */ export class RegistryMetadatafieldsResponse { + static type = new ResourceType('metadatafield'); /** * List of metadata fields in the response */ @deserialize - @relationship(ResourceType.MetadataField, true) + @relationship(MetadataField, true) metadatafields: MetadataField[]; /** diff --git a/src/app/core/registry/registry.service.spec.ts b/src/app/core/registry/registry.service.spec.ts index d044633e85..47e306d624 100644 --- a/src/app/core/registry/registry.service.spec.ts +++ b/src/app/core/registry/registry.service.spec.ts @@ -62,14 +62,14 @@ describe('RegistryService', () => { self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadataschemas/1', prefix: 'dc', namespace: 'http://dublincore.org/documents/dcmi-terms/', - type: ResourceType.MetadataSchema + type: MetadataSchema.type }, { id: 2, self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadataschemas/2', prefix: 'mock', namespace: 'http://dspace.org/mockschema', - type: ResourceType.MetadataSchema + type: MetadataSchema.type } ]; const mockFieldsList = [ @@ -80,7 +80,7 @@ describe('RegistryService', () => { qualifier: 'advisor', scopeNote: null, schema: mockSchemasList[0], - type: ResourceType.MetadataField + type: MetadataField.type }, { id: 2, @@ -89,7 +89,7 @@ describe('RegistryService', () => { qualifier: 'author', scopeNote: null, schema: mockSchemasList[0], - type: ResourceType.MetadataField + type: MetadataField.type }, { id: 3, @@ -98,7 +98,7 @@ describe('RegistryService', () => { qualifier: 'editor', scopeNote: 'test scope note', schema: mockSchemasList[1], - type: ResourceType.MetadataField + type: MetadataField.type }, { id: 4, @@ -107,7 +107,7 @@ describe('RegistryService', () => { qualifier: 'illustrator', scopeNote: null, schema: mockSchemasList[1], - type: ResourceType.MetadataField + type: MetadataField.type } ]; diff --git a/src/app/core/registry/registry.service.ts b/src/app/core/registry/registry.service.ts index eb556f1db3..d816c5eab8 100644 --- a/src/app/core/registry/registry.service.ts +++ b/src/app/core/registry/registry.service.ts @@ -63,7 +63,7 @@ import { HttpHeaders } from '@angular/common/http'; import { TranslateService } from '@ngx-translate/core'; import { MetadataSchema } from '../metadata/metadata-schema.model'; import { MetadataField } from '../metadata/metadata-field.model'; -import { getNormalizedConstructorByType } from '../shared/resource-type.decorator'; +import { getMapsToType } from '../cache/builders/build-decorators'; const metadataRegistryStateSelector = (state: AppState) => state.metadataRegistry; const editMetadataSchemaSelector = createSelector(metadataRegistryStateSelector, (metadataState: MetadataRegistryState) => metadataState.editSchema); @@ -463,7 +463,7 @@ export class RegistryService { distinctUntilChanged() ); - const serializedSchema = new DSpaceRESTv2Serializer(getNormalizedConstructorByType(ResourceType.MetadataSchema)).serialize(schema as NormalizedMetadataSchema); + const serializedSchema = new DSpaceRESTv2Serializer(getMapsToType(MetadataSchema.type)).serialize(schema as NormalizedMetadataSchema); const request$ = endpoint$.pipe( take(1), diff --git a/src/app/core/shared/bitstream-format.model.ts b/src/app/core/shared/bitstream-format.model.ts index a532ea9e75..5509b37041 100644 --- a/src/app/core/shared/bitstream-format.model.ts +++ b/src/app/core/shared/bitstream-format.model.ts @@ -6,7 +6,9 @@ import { ResourceType } from './resource-type'; * Model class for a Bitstream Format */ export class BitstreamFormat implements CacheableObject { + static type = new ResourceType('bitstreamformat'); + bitstreamformat /** * Short description of this Bitstream Format */ diff --git a/src/app/core/shared/bitstream.model.ts b/src/app/core/shared/bitstream.model.ts index 794282e867..887f7d0843 100644 --- a/src/app/core/shared/bitstream.model.ts +++ b/src/app/core/shared/bitstream.model.ts @@ -3,8 +3,10 @@ import { RemoteData } from '../data/remote-data'; import { Item } from './item.model'; import { BitstreamFormat } from './bitstream-format.model'; import { Observable } from 'rxjs'; +import { ResourceType } from './resource-type'; export class Bitstream extends DSpaceObject { + static type = new ResourceType('bitstream'); /** * The size of this bitstream in bytes @@ -40,5 +42,4 @@ export class Bitstream extends DSpaceObject { * The URL to retrieve this Bitstream's file */ content: string; - } diff --git a/src/app/core/shared/browse-entry.model.ts b/src/app/core/shared/browse-entry.model.ts index 3dbba0cdb8..d5d4093c81 100644 --- a/src/app/core/shared/browse-entry.model.ts +++ b/src/app/core/shared/browse-entry.model.ts @@ -1,42 +1,31 @@ -import { autoserialize, autoserializeAs } from 'cerialize'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; -import { ResourceType } from './resource-type'; -import { resourceType } from './resource-type.decorator'; import { TypedObject } from '../cache/object-cache.reducer'; +import { ResourceType } from './resource-type'; /** * Class object representing a browse entry * This class is not normalized because browse entries do not have self links */ -@resourceType(ResourceType.BrowseEntry) export class BrowseEntry implements ListableObject, TypedObject { - /** - * The resource type of this browse entry - */ - @autoserialize - type: ResourceType; + static type = new ResourceType('browseEntry'); /** * The authority string of this browse entry */ - @autoserialize authority: string; /** * The value of this browse entry */ - @autoserialize value: string; /** * The language of the value of this browse entry */ - @autoserializeAs('valueLang') language: string; /** * The count of this browse entry */ - @autoserialize count: number; } diff --git a/src/app/core/shared/bundle.model.ts b/src/app/core/shared/bundle.model.ts index 3f5b5df877..9b00f6efa0 100644 --- a/src/app/core/shared/bundle.model.ts +++ b/src/app/core/shared/bundle.model.ts @@ -3,8 +3,11 @@ import { Bitstream } from './bitstream.model'; import { Item } from './item.model'; import { RemoteData } from '../data/remote-data'; import { Observable } from 'rxjs'; +import { ResourceType } from './resource-type'; export class Bundle extends DSpaceObject { + static type = new ResourceType('bundle'); + /** * The primary bitstream of this Bundle */ diff --git a/src/app/core/shared/collection.model.ts b/src/app/core/shared/collection.model.ts index 0471d1fbbb..642fe50736 100644 --- a/src/app/core/shared/collection.model.ts +++ b/src/app/core/shared/collection.model.ts @@ -6,8 +6,10 @@ import { Observable } from 'rxjs'; import { License } from './license.model'; import { ResourcePolicy } from './resource-policy.model'; import { PaginatedList } from '../data/paginated-list'; +import { ResourceType } from './resource-type'; export class Collection extends DSpaceObject { + static type = new ResourceType('collection'); /** * A string representing the unique handle of this Collection @@ -80,5 +82,4 @@ export class Collection extends DSpaceObject { owner: Observable>; items: Observable>; - } diff --git a/src/app/core/shared/community.model.ts b/src/app/core/shared/community.model.ts index c4e703fd7f..b61ddfd7f9 100644 --- a/src/app/core/shared/community.model.ts +++ b/src/app/core/shared/community.model.ts @@ -4,8 +4,10 @@ import { Collection } from './collection.model'; import { RemoteData } from '../data/remote-data'; import { Observable } from 'rxjs'; import { PaginatedList } from '../data/paginated-list'; +import { ResourceType } from './resource-type'; export class Community extends DSpaceObject { + static type = new ResourceType('community'); /** * A string representing the unique handle of this Community diff --git a/src/app/core/shared/dspace-object.model.ts b/src/app/core/shared/dspace-object.model.ts index fb42edd126..26f76c5ce2 100644 --- a/src/app/core/shared/dspace-object.model.ts +++ b/src/app/core/shared/dspace-object.model.ts @@ -1,18 +1,26 @@ import { Observable } from 'rxjs'; -import { MetadataMap, MetadataValue, MetadataValueFilter, MetadatumViewModel } from './metadata.models'; +import { + MetadataMap, + MetadataValue, + MetadataValueFilter, + MetadatumViewModel +} from './metadata.models'; import { Metadata } from './metadata.utils'; -import { isUndefined } from '../../shared/empty.util'; -import { CacheableObject, TypedObject } from '../cache/object-cache.reducer'; +import { hasNoValue, isUndefined } from '../../shared/empty.util'; +import { CacheableObject } from '../cache/object-cache.reducer'; import { RemoteData } from '../data/remote-data'; -import { ResourceType } from './resource-type'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; -import { hasNoValue } from '../../shared/empty.util'; +import { ResourceType } from './resource-type'; /** * An abstract model class for a DSpaceObject. */ export class DSpaceObject implements CacheableObject, ListableObject { + /** + * A string representing the kind of DSpaceObject, e.g. community, item, … + */ + static type = new ResourceType('dspaceobject'); private _name: string; @@ -28,11 +36,6 @@ export class DSpaceObject implements CacheableObject, ListableObject { */ uuid: string; - /** - * A string representing the kind of DSpaceObject, e.g. community, item, … - */ - type: ResourceType; - /** * The name for this DSpaceObject */ diff --git a/src/app/core/shared/item-relationships/item-type.model.ts b/src/app/core/shared/item-relationships/item-type.model.ts index e4f98ab653..a0e5adda91 100644 --- a/src/app/core/shared/item-relationships/item-type.model.ts +++ b/src/app/core/shared/item-relationships/item-type.model.ts @@ -5,6 +5,8 @@ import { ResourceType } from '../resource-type'; * Describes a type of Item */ export class ItemType implements CacheableObject { + static type = new ResourceType('entitytype'); + /** * The identifier of this ItemType */ diff --git a/src/app/core/shared/item-relationships/relationship-type.model.ts b/src/app/core/shared/item-relationships/relationship-type.model.ts index 404d8cdb4b..a8e24cc012 100644 --- a/src/app/core/shared/item-relationships/relationship-type.model.ts +++ b/src/app/core/shared/item-relationships/relationship-type.model.ts @@ -8,6 +8,8 @@ import { ItemType } from './item-type.model'; * Describes a type of Relationship between multiple possible Items */ export class RelationshipType implements CacheableObject { + static type = new ResourceType('relationshiptype'); + /** * The link to the rest endpoint where this object can be found */ diff --git a/src/app/core/shared/item-relationships/relationship.model.ts b/src/app/core/shared/item-relationships/relationship.model.ts index df8f04cd8a..bd83c43029 100644 --- a/src/app/core/shared/item-relationships/relationship.model.ts +++ b/src/app/core/shared/item-relationships/relationship.model.ts @@ -8,6 +8,8 @@ import { RelationshipType } from './relationship-type.model'; * Describes a Relationship between two Items */ export class Relationship implements CacheableObject { + static type = new ResourceType('relationship'); + /** * The link to the rest endpoint where this object can be found */ diff --git a/src/app/core/shared/item.model.ts b/src/app/core/shared/item.model.ts index 839103b9f5..515ea3cd69 100644 --- a/src/app/core/shared/item.model.ts +++ b/src/app/core/shared/item.model.ts @@ -8,8 +8,10 @@ import { Bitstream } from './bitstream.model'; import { hasValue, isNotEmpty, isNotUndefined } from '../../shared/empty.util'; import { PaginatedList } from '../data/paginated-list'; import { Relationship } from './item-relationships/relationship.model'; +import { ResourceType } from './resource-type'; export class Item extends DSpaceObject { + static type = new ResourceType('item'); /** * A string representing the unique handle of this Item diff --git a/src/app/core/shared/license.model.ts b/src/app/core/shared/license.model.ts index a04422242a..fa49e1f430 100644 --- a/src/app/core/shared/license.model.ts +++ b/src/app/core/shared/license.model.ts @@ -1,6 +1,8 @@ import { DSpaceObject } from './dspace-object.model'; +import { ResourceType } from './resource-type'; export class License extends DSpaceObject { + static type = new ResourceType('license'); /** * Is the license custom? diff --git a/src/app/core/shared/normalized-browse-entry.model.ts b/src/app/core/shared/normalized-browse-entry.model.ts new file mode 100644 index 0000000000..42a8fc2178 --- /dev/null +++ b/src/app/core/shared/normalized-browse-entry.model.ts @@ -0,0 +1,42 @@ +import { autoserialize, autoserializeAs } from 'cerialize'; +import { ResourceType } from './resource-type'; +import { BrowseEntry } from './browse-entry.model'; +import { NormalizedObject } from '../cache/models/normalized-object.model'; +import { mapsTo } from '../cache/builders/build-decorators'; + +/** + * Class object representing a browse entry + * This class is not normalized because browse entries do not have self links + */ +@mapsTo(BrowseEntry) +export class NormalizedBrowseEntry extends NormalizedObject { + /** + * The resource type of this browse entry + */ + @autoserialize + type: ResourceType; + + /** + * The authority string of this browse entry + */ + @autoserialize + authority: string; + + /** + * The value of this browse entry + */ + @autoserialize + value: string; + + /** + * The language of the value of this browse entry + */ + @autoserializeAs('valueLang') + language: string; + + /** + * The count of this browse entry + */ + @autoserialize + count: number; +} diff --git a/src/app/core/shared/resource-policy.model.ts b/src/app/core/shared/resource-policy.model.ts index 950d7b92d7..7397076416 100644 --- a/src/app/core/shared/resource-policy.model.ts +++ b/src/app/core/shared/resource-policy.model.ts @@ -6,6 +6,8 @@ import { ActionType } from '../cache/models/action-type.model'; * Model class for a Resource Policy */ export class ResourcePolicy implements CacheableObject { + static type = new ResourceType('resourcePolicy'); + /** * The action that is allowed by this Resource Policy */ diff --git a/src/app/core/shared/resource-type.decorator.ts b/src/app/core/shared/resource-type.decorator.ts deleted file mode 100644 index 76c7f34057..0000000000 --- a/src/app/core/shared/resource-type.decorator.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { TypedObject } from '../cache/object-cache.reducer'; -import { GenericConstructor } from './generic-constructor'; -import { ResourceType } from './resource-type'; - -const resourceTypeForObjectMap = new Map(); - -/** - * Decorator function to map resource types to their matching normalized model class constructor - * @param type The resource type used as a key in the map - */ -export function resourceType(...type: ResourceType[]) { - return function decorator(objectConstructor: GenericConstructor) { - if (!objectConstructor) { - return; - } - type.forEach((rt: string) => resourceTypeForObjectMap.set(rt, objectConstructor) - ) - }; -} - -/** - * Method to retrieve the normalized model class constructor based on a resource type - * @param type The resource type to look for - */ -export function getNormalizedConstructorByType(type: ResourceType) { - return resourceTypeForObjectMap.get(type); -} diff --git a/src/app/core/shared/resource-type.ts b/src/app/core/shared/resource-type.ts index 5839e14084..5cdc6e57df 100644 --- a/src/app/core/shared/resource-type.ts +++ b/src/app/core/shared/resource-type.ts @@ -1,31 +1,10 @@ -export enum ResourceType { - DSpaceObject = 'dspaceobject', - Bundle = 'bundle', - Bitstream = 'bitstream', - BitstreamFormat = 'bitstreamformat', - Item = 'item', - Collection = 'collection', - Community = 'community', - EPerson = 'eperson', - Group = 'group', - ResourcePolicy = 'resourcePolicy', - MetadataSchema = 'metadataschema', - MetadataField = 'metadatafield', - Relationship = 'relationship', - RelationshipType = 'relationshiptype', - ItemType = 'entitytype', - License = 'license', - WorkflowItem = 'workflowitem', - WorkspaceItem = 'workspaceitem', - SubmissionDefinitions = 'submissiondefinitions', - SubmissionDefinition = 'submissiondefinition', - SubmissionForm = 'submissionform', - SubmissionForms = 'submissionforms', - SubmissionSections = 'submissionsections', - SubmissionSection = 'submissionsection', - AuthStatus = 'status', - Authority = 'authority', - BrowseEntry = 'browseEntry', - ClaimedTask = 'claimedtask', - PoolTask = 'pooltask' +export class ResourceType { + constructor(public value: string) { + } + // SubmissionDefinitions = 'submissiondefinitions', + // SubmissionDefinition = 'submissiondefinition', + // SubmissionForm = 'submissionform', + // SubmissionForms = 'submissionforms', + // SubmissionSections = 'submissionsections', + // SubmissionSection = 'submissionsection', } diff --git a/src/app/core/submission/models/normalized-workflowitem.model.ts b/src/app/core/submission/models/normalized-workflowitem.model.ts index 354b8e7c06..1f984f29d4 100644 --- a/src/app/core/submission/models/normalized-workflowitem.model.ts +++ b/src/app/core/submission/models/normalized-workflowitem.model.ts @@ -4,42 +4,49 @@ import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { WorkflowItem } from './workflowitem.model'; import { NormalizedSubmissionObject } from './normalized-submission-object.model'; import { ResourceType } from '../../shared/resource-type'; -import { resourceType } from '../../shared/resource-type.decorator'; +import { NormalizedItem } from '../../cache/models/normalized-item.model'; +import { NormalizedCollection } from '../../cache/models/normalized-collection.model'; +import { NormalizedEPerson } from '../../eperson/models/normalized-eperson.model'; +import { NormalizedSubmissionDefinitionsModel } from '../../config/models/normalized-config-submission-definitions.model'; +import { Collection } from '../../shared/collection.model'; +import { Item } from '../../shared/item.model'; +import { SubmissionDefinitionsModel } from '../../config/models/config-submission-definitions.model'; +import { EPerson } from '../../eperson/models/eperson.model'; /** * An model class for a NormalizedWorkflowItem. */ @mapsTo(WorkflowItem) @inheritSerialization(NormalizedSubmissionObject) -@resourceType(ResourceType.WorkflowItem) export class NormalizedWorkflowItem extends NormalizedSubmissionObject { + static type = new ResourceType('workflowitem'); /** * The collection this workflowitem belonging to */ @autoserialize - @relationship(ResourceType.Collection, false) + @relationship(Collection, false) collection: string; /** * The item created with this workflowitem */ @autoserialize - @relationship(ResourceType.Item, false) + @relationship(Item, false) item: string; /** * The configuration object that define this workflowitem */ @autoserialize - @relationship(ResourceType.SubmissionDefinition, false) + @relationship(SubmissionDefinitionsModel, false) submissionDefinition: string; /** * The EPerson who submit this workflowitem */ @autoserialize - @relationship(ResourceType.EPerson, false) + @relationship(EPerson, false) submitter: string; } diff --git a/src/app/core/submission/models/normalized-workspaceitem.model.ts b/src/app/core/submission/models/normalized-workspaceitem.model.ts index a381aac00b..6fac3401e2 100644 --- a/src/app/core/submission/models/normalized-workspaceitem.model.ts +++ b/src/app/core/submission/models/normalized-workspaceitem.model.ts @@ -4,9 +4,11 @@ import { WorkspaceItem } from './workspaceitem.model'; import { NormalizedSubmissionObject } from './normalized-submission-object.model'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-object.model'; -import { ResourceType } from '../../shared/resource-type'; import { WorkflowItem } from './workflowitem.model'; -import { resourceType } from '../../shared/resource-type.decorator'; +import { Item } from '../../shared/item.model'; +import { Collection } from '../../shared/collection.model'; +import { SubmissionDefinitionModel } from '../../config/models/config-submission-definition.model'; +import { EPerson } from '../../eperson/models/eperson.model'; /** * An model class for a NormalizedWorkspaceItem. @@ -14,34 +16,33 @@ import { resourceType } from '../../shared/resource-type.decorator'; @mapsTo(WorkspaceItem) @inheritSerialization(NormalizedDSpaceObject) @inheritSerialization(NormalizedSubmissionObject) -@resourceType(ResourceType.WorkspaceItem) export class NormalizedWorkspaceItem extends NormalizedSubmissionObject { /** * The collection this workspaceitem belonging to */ @autoserialize - @relationship(ResourceType.Collection, false) + @relationship(Collection, false) collection: string; /** * The item created with this workspaceitem */ @autoserialize - @relationship(ResourceType.Item, false) + @relationship(Item, false) item: string; /** * The configuration object that define this workspaceitem */ @autoserialize - @relationship(ResourceType.SubmissionDefinition, false) + @relationship(SubmissionDefinitionModel, false) submissionDefinition: string; /** * The EPerson who submit this workspaceitem */ @autoserialize - @relationship(ResourceType.EPerson, false) + @relationship(EPerson, false) submitter: string; } diff --git a/src/app/core/submission/models/workflowitem.model.ts b/src/app/core/submission/models/workflowitem.model.ts index 4a1666fdef..4cfc4d7fa1 100644 --- a/src/app/core/submission/models/workflowitem.model.ts +++ b/src/app/core/submission/models/workflowitem.model.ts @@ -1,7 +1,9 @@ import { WorkspaceItem } from './workspaceitem.model'; +import { ResourceType } from '../../shared/resource-type'; /** * A model class for a WorkflowItem. */ export class WorkflowItem extends WorkspaceItem { + static type = new ResourceType('workflowitem'); } diff --git a/src/app/core/submission/models/workspaceitem.model.ts b/src/app/core/submission/models/workspaceitem.model.ts index 136ca346c1..c4bb5b7520 100644 --- a/src/app/core/submission/models/workspaceitem.model.ts +++ b/src/app/core/submission/models/workspaceitem.model.ts @@ -1,8 +1,10 @@ import { SubmissionObject } from './submission-object.model'; +import { ResourceType } from '../../shared/resource-type'; /** * A model class for a WorkspaceItem. */ export class WorkspaceItem extends SubmissionObject { + static type = new ResourceType('workspaceitem'); } diff --git a/src/app/core/submission/submission-resource-type.ts b/src/app/core/submission/submission-resource-type.ts deleted file mode 100644 index f5b8e2c423..0000000000 --- a/src/app/core/submission/submission-resource-type.ts +++ /dev/null @@ -1,21 +0,0 @@ -export enum SubmissionResourceType { - Bundle = 'bundle', - Bitstream = 'bitstream', - BitstreamFormat = 'bitstreamformat', - Item = 'item', - Collection = 'collection', - Community = 'community', - ResourcePolicy = 'resourcePolicy', - License = 'license', - EPerson = 'eperson', - Group = 'group', - WorkspaceItem = 'workspaceitem', - WorkflowItem = 'workflowitem', - SubmissionDefinitions = 'submissiondefinitions', - SubmissionDefinition = 'submissiondefinition', - SubmissionForm = 'submissionform', - SubmissionForms = 'submissionforms', - SubmissionSections = 'submissionsections', - SubmissionSection = 'submissionsection', - Authority = 'authority' -} diff --git a/src/app/core/tasks/models/claimed-task-object.model.ts b/src/app/core/tasks/models/claimed-task-object.model.ts index 212e75ed95..2f427f586f 100644 --- a/src/app/core/tasks/models/claimed-task-object.model.ts +++ b/src/app/core/tasks/models/claimed-task-object.model.ts @@ -1,8 +1,9 @@ import { TaskObject } from './task-object.model'; +import { ResourceType } from '../../shared/resource-type'; /** * A model class for a ClaimedTask. */ export class ClaimedTask extends TaskObject { - + static type = new ResourceType('claimedtask'); } diff --git a/src/app/core/tasks/models/normalized-claimed-task-object.model.ts b/src/app/core/tasks/models/normalized-claimed-task-object.model.ts index 8f9283277e..d43a277f02 100644 --- a/src/app/core/tasks/models/normalized-claimed-task-object.model.ts +++ b/src/app/core/tasks/models/normalized-claimed-task-object.model.ts @@ -2,17 +2,16 @@ import { NormalizedTaskObject } from './normalized-task-object.model'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { autoserialize, inheritSerialization } from 'cerialize'; import { ClaimedTask } from './claimed-task-object.model'; -import { ResourceType } from '../../shared/resource-type'; -import { resourceType } from '../../shared/resource-type.decorator'; +import { EPerson } from '../../eperson/models/eperson.model'; +import { Group } from '../../eperson/models/group.model'; +import { WorkflowItem } from '../../submission/models/workflowitem.model'; /** * A normalized model class for a ClaimedTask. */ @mapsTo(ClaimedTask) -@resourceType(ResourceType.ClaimedTask) @inheritSerialization(NormalizedTaskObject) export class NormalizedClaimedTask extends NormalizedTaskObject { - /** * The task identifier */ @@ -35,21 +34,21 @@ export class NormalizedClaimedTask extends NormalizedTaskObject { * The eperson object for this task */ @autoserialize - @relationship(ResourceType.EPerson, false) + @relationship(EPerson, false) eperson: string; /** * The group object for this task */ @autoserialize - @relationship(ResourceType.Group, false) + @relationship(Group, false) group: string; /** * The workflowitem object whom this task is related */ @autoserialize - @relationship(ResourceType.WorkflowItem, false) + @relationship(WorkflowItem, false) workflowitem: string; } diff --git a/src/app/core/tasks/models/normalized-pool-task-object.model.ts b/src/app/core/tasks/models/normalized-pool-task-object.model.ts index 06a2b3cacb..bfc782f182 100644 --- a/src/app/core/tasks/models/normalized-pool-task-object.model.ts +++ b/src/app/core/tasks/models/normalized-pool-task-object.model.ts @@ -2,17 +2,15 @@ import { NormalizedTaskObject } from './normalized-task-object.model'; import { PoolTask } from './pool-task-object.model'; import { autoserialize, inheritSerialization } from 'cerialize'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; -import { ResourceType } from '../../shared/resource-type'; -import { resourceType } from '../../shared/resource-type.decorator'; +import { Group } from '../../eperson/models/group.model'; +import { WorkflowItem } from '../../submission/models/workflowitem.model'; /** * A normalized model class for a PoolTask. */ @mapsTo(PoolTask) -@resourceType(ResourceType.PoolTask) @inheritSerialization(NormalizedTaskObject) export class NormalizedPoolTask extends NormalizedTaskObject { - /** * The task identifier */ @@ -35,13 +33,13 @@ export class NormalizedPoolTask extends NormalizedTaskObject { * The group object for this task */ @autoserialize - @relationship(ResourceType.Group, false) + @relationship(Group, false) group: string; /** * The workflowitem object whom this task is related */ @autoserialize - @relationship(ResourceType.WorkflowItem, false) + @relationship(WorkflowItem, false) workflowitem: string; } diff --git a/src/app/core/tasks/models/normalized-task-object.model.ts b/src/app/core/tasks/models/normalized-task-object.model.ts index f45d8305b8..2c96b95393 100644 --- a/src/app/core/tasks/models/normalized-task-object.model.ts +++ b/src/app/core/tasks/models/normalized-task-object.model.ts @@ -1,16 +1,18 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; -import { ResourceType } from '../../shared/resource-type'; import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-object.model'; import { TaskObject } from './task-object.model'; import { DSpaceObject } from '../../shared/dspace-object.model'; +import { Group } from '../../eperson/models/group.model'; +import { EPerson } from '../../eperson/models/eperson.model'; +import { WorkflowItem } from '../../submission/models/workflowitem.model'; /** * An abstract normalized model class for a TaskObject. */ @mapsTo(TaskObject) @inheritSerialization(NormalizedDSpaceObject) -export abstract class NormalizedTaskObject extends NormalizedDSpaceObject { +export class NormalizedTaskObject extends NormalizedDSpaceObject { /** * The task identifier @@ -34,20 +36,20 @@ export abstract class NormalizedTaskObject extends Norma * The eperson object for this task */ @autoserialize - @relationship(ResourceType.EPerson, false) + @relationship(EPerson, false) eperson: string; /** * The group object for this task */ @autoserialize - @relationship(ResourceType.Group, false) + @relationship(Group, false) group: string; /** * The workflowitem object whom this task is related */ @autoserialize - @relationship(ResourceType.WorkflowItem, false) + @relationship(WorkflowItem, false) workflowitem: string; } diff --git a/src/app/core/tasks/models/pool-task-object.model.ts b/src/app/core/tasks/models/pool-task-object.model.ts index 8d98d3e1a5..876b62373d 100644 --- a/src/app/core/tasks/models/pool-task-object.model.ts +++ b/src/app/core/tasks/models/pool-task-object.model.ts @@ -1,8 +1,9 @@ import { TaskObject } from './task-object.model'; +import { ResourceType } from '../../shared/resource-type'; /** * A model class for a PoolTask. */ export class PoolTask extends TaskObject { - + static type = new ResourceType('pooltask'); } diff --git a/src/app/core/tasks/models/task-object.model.ts b/src/app/core/tasks/models/task-object.model.ts index de86874e0d..14dbbd7301 100644 --- a/src/app/core/tasks/models/task-object.model.ts +++ b/src/app/core/tasks/models/task-object.model.ts @@ -7,11 +7,13 @@ import { RemoteData } from '../../data/remote-data'; import { WorkflowItem } from '../../submission/models/workflowitem.model'; import { Group } from '../../eperson/models/group.model'; import { EPerson } from '../../eperson/models/eperson.model'; +import { ResourceType } from '../../shared/resource-type'; /** * An abstract model class for a TaskObject. */ export class TaskObject extends DSpaceObject implements CacheableObject, ListableObject { + static type = new ResourceType('taskobject'); /** * The task identifier diff --git a/src/app/shared/alert/alert.component.spec.ts b/src/app/shared/alert/alert.component.spec.ts index e235e27b28..33f48c08ee 100644 --- a/src/app/shared/alert/alert.component.spec.ts +++ b/src/app/shared/alert/alert.component.spec.ts @@ -66,7 +66,7 @@ describe('AlertComponent test suite', () => { compAsAny = comp; comp.content = 'test alert'; comp.dismissible = true; - comp.type = AlertType.Info; + comp.value = AlertType.Info; fixture.detectChanges(); }); diff --git a/src/app/shared/comcol-forms/comcol-form/comcol-form.component.spec.ts b/src/app/shared/comcol-forms/comcol-form/comcol-form.component.spec.ts index 3f52f0e46a..1b44970402 100644 --- a/src/app/shared/comcol-forms/comcol-form/comcol-form.component.spec.ts +++ b/src/app/shared/comcol-forms/comcol-form/comcol-form.component.spec.ts @@ -103,7 +103,7 @@ describe('ComColFormComponent', () => { ...randomMD, ...abstractMD }, - type: ResourceType.Community + type: Community.type }, ) ); diff --git a/src/app/shared/comcol-forms/comcol-form/comcol-form.component.ts b/src/app/shared/comcol-forms/comcol-form/comcol-form.component.ts index e24676a646..6a96892b06 100644 --- a/src/app/shared/comcol-forms/comcol-form/comcol-form.component.ts +++ b/src/app/shared/comcol-forms/comcol-form/comcol-form.component.ts @@ -10,7 +10,7 @@ import { TranslateService } from '@ngx-translate/core'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { MetadataMap, MetadataValue } from '../../../core/shared/metadata.models'; import { isNotEmpty } from '../../empty.util'; -import { ResourceType } from '../../../core/shared/resource-type'; +import { Community } from '../../../core/shared/community.model'; /** * A form for creating and editing Communities or Collections @@ -99,7 +99,7 @@ export class ComColFormComponent implements OnInit { ...this.dso.metadata, ...formMetadata }, - type: ResourceType.Community + type: Community.type }); this.submitForm.emit(updatedDSO); } diff --git a/src/app/shared/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts b/src/app/shared/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts index e2e73bae14..57c860e04f 100644 --- a/src/app/shared/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts +++ b/src/app/shared/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts @@ -47,10 +47,10 @@ export class DeleteComColPageComponent implements .pipe(first()) .subscribe((success: boolean) => { if (success) { - const successMessage = this.translate.instant(dso.type + '.delete.notification.success'); + const successMessage = this.translate.instant((dso as any).type + '.delete.notification.success'); this.notifications.success(successMessage) } else { - const errorMessage = this.translate.instant(dso.type + '.delete.notification.fail'); + const errorMessage = this.translate.instant((dso as any).type + '.delete.notification.fail'); this.notifications.error(errorMessage) } this.router.navigate(['/']); diff --git a/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts b/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts index 54568a98d5..e33d5d9ba1 100644 --- a/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts +++ b/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts @@ -51,7 +51,7 @@ describe('DSOSelectorComponent', () => { component = fixture.componentInstance; debugElement = fixture.debugElement; component.currentDSOId = currentDSOId; - component.type = type; + component.value = type; fixture.detectChanges(); }); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model.ts index 7a357dfc31..e6d2b95afc 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model.ts @@ -1,7 +1,7 @@ import { DynamicFormControlLayout, serializable } from '@ng-dynamic-forms/core'; -import { FormRowModel } from '../../../../../../core/config/models/config-submission-forms.model'; import { DsDynamicInputModel, DsDynamicInputModelConfig } from '../ds-dynamic-input.model'; import { isEmpty, isNull } from '../../../../../empty.util'; +import { FormRowModel } from '../../../../../../core/config/models/config-submission-form.model'; export const DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP = 'RELATION'; export const PLACEHOLDER_PARENT_METADATA = '#PLACEHOLDER_PARENT_METADATA_VALUE#'; diff --git a/src/app/shared/form/builder/models/form-field.model.ts b/src/app/shared/form/builder/models/form-field.model.ts index 439bf89f8f..39f2d6b9f8 100644 --- a/src/app/shared/form/builder/models/form-field.model.ts +++ b/src/app/shared/form/builder/models/form-field.model.ts @@ -1,7 +1,7 @@ import { autoserialize } from 'cerialize'; -import { FormRowModel } from '../../../../core/config/models/config-submission-forms.model'; import { LanguageCode } from './form-field-language-value.model'; import { FormFieldMetadataValueObject } from './form-field-metadata-value.model'; +import { FormRowModel } from '../../../../core/config/models/config-submission-form.model'; export class FormFieldModel { diff --git a/src/app/shared/form/builder/parsers/relation-group-field-parser.ts b/src/app/shared/form/builder/parsers/relation-group-field-parser.ts index ca0469ef1a..b3f6e749f3 100644 --- a/src/app/shared/form/builder/parsers/relation-group-field-parser.ts +++ b/src/app/shared/form/builder/parsers/relation-group-field-parser.ts @@ -3,12 +3,12 @@ import { FormFieldMetadataValueObject } from '../models/form-field-metadata-valu import { FormFieldModel } from '../models/form-field.model'; import { isNotEmpty } from '../../../empty.util'; -import { FormRowModel } from '../../../../core/config/models/config-submission-forms.model'; import { DynamicRelationGroupModel, DynamicRelationGroupModelConfig, PLACEHOLDER_PARENT_METADATA } from '../ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model'; +import { FormRowModel } from '../../../../core/config/models/config-submission-form.model'; export class RelationGroupFieldParser extends FieldParser { diff --git a/src/app/shared/mocks/mock-form-models.ts b/src/app/shared/mocks/mock-form-models.ts index 5851da94be..f2fc38c420 100644 --- a/src/app/shared/mocks/mock-form-models.ts +++ b/src/app/shared/mocks/mock-form-models.ts @@ -5,7 +5,6 @@ import { DynamicRowArrayModelConfig } from '../form/builder/ds-dynamic-form-ui/models/ds-dynamic-row-array-model'; import { DynamicSelectModel } from '@ng-dynamic-forms/core'; -import { FormRowModel } from '../../core/config/models/config-submission-forms.model'; import { SubmissionScopeType } from '../../core/submission/submission-scope-type'; import { DynamicRelationGroupModel } from '../form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model'; import { FormFieldModel } from '../form/builder/models/form-field.model'; @@ -13,6 +12,7 @@ import { AuthorityOptions } from '../../core/integration/models/authority-option import { AuthorityValue } from '../../core/integration/models/authority.value'; import { FormFieldMetadataValueObject } from '../form/builder/models/form-field-metadata-value.model'; import { DynamicRowGroupModel } from '../form/builder/ds-dynamic-form-ui/models/ds-dynamic-row-group-model'; +import { FormRowModel } from '../../core/config/models/config-submission-form.model'; export const qualdropSelectConfig = { name: 'dc.identifier_QUALDROP_METADATA', diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts index ef083cfab9..30f1d7775f 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts @@ -66,7 +66,7 @@ const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdIt const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem), id: '1234' }); -describe('ClaimedTaskActionsComponent', () => { +fdescribe('ClaimedTaskActionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts index 5aa0cd72b5..c37a7eb4db 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts @@ -62,7 +62,7 @@ export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent> { - public getConstructor(type: ResourceType): TService { - switch (type) { - case ResourceType.Item: { - return ItemDataService as any; - } - case ResourceType.WorkspaceItem: { - return WorkspaceitemDataService as any; - } - case ResourceType.WorkflowItem: { - return WorkflowItemDataService as any; - } - case ResourceType.ClaimedTask: { - return ClaimedTaskDataService as any; - } - case ResourceType.PoolTask: { - return PoolTaskDataService as any; - } - default: { - return undefined; - } - } - } -} diff --git a/src/app/shared/mydspace-actions/mydspace-actions.ts b/src/app/shared/mydspace-actions/mydspace-actions.ts index 8e465644c3..2e86726be7 100644 --- a/src/app/shared/mydspace-actions/mydspace-actions.ts +++ b/src/app/shared/mydspace-actions/mydspace-actions.ts @@ -3,7 +3,6 @@ import { Injector, Input } from '@angular/core'; import { find } from 'rxjs/operators'; -import { MydspaceActionsServiceFactory } from './mydspace-actions-service.factory'; import { RemoteData } from '../../core/data/remote-data'; import { DataService } from '../../core/data/data.service'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; @@ -11,6 +10,7 @@ import { ResourceType } from '../../core/shared/resource-type'; import { NotificationOptions } from '../notifications/models/notification-options.model'; import { NotificationsService } from '../notifications/notifications.service'; import { TranslateService } from '@ngx-translate/core'; +import { getMapsToType } from '../../core/cache/builders/build-decorators'; /** * Abstract class for all different representations of mydspace actions @@ -42,8 +42,7 @@ export abstract class MyDSpaceActionsComponent(); - this.objectDataService = injector.get(factory.getConstructor(objectType)); + this.objectDataService = injector.get(getMapsToType(objectType)); } /** diff --git a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts index a143045334..2e32541e09 100644 --- a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts @@ -53,7 +53,7 @@ export class PoolTaskActionsComponent extends MyDSpaceActionsComponent { cdr.detectChanges(); const action = new NewNotificationAction(notification); - action.type = 'NothingToDo, return only the state'; + action.value = 'NothingToDo, return only the state'; const lastState = notificationsReducer(stateBis, action); expect(lastState.length).toEqual(1); diff --git a/src/app/shared/search-form/search-form.component.spec.ts b/src/app/shared/search-form/search-form.component.spec.ts index a60aeb8054..fb632c533a 100644 --- a/src/app/shared/search-form/search-form.component.spec.ts +++ b/src/app/shared/search-form/search-form.component.spec.ts @@ -128,7 +128,7 @@ export const objects: DSpaceObject[] = [ self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/communities/7669c72a-3f2a-451f-a3b9-9210e7a4c02f', id: '7669c72a-3f2a-451f-a3b9-9210e7a4c02f', uuid: '7669c72a-3f2a-451f-a3b9-9210e7a4c02f', - type: ResourceType.Community, + type: Community.type, metadata: { 'dc.description': [ { @@ -182,7 +182,7 @@ export const objects: DSpaceObject[] = [ self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/communities/9076bd16-e69a-48d6-9e41-0238cb40d863', id: '9076bd16-e69a-48d6-9e41-0238cb40d863', uuid: '9076bd16-e69a-48d6-9e41-0238cb40d863', - type: ResourceType.Community, + type: Community.type, metadata: { 'dc.description': [ { From 4106e7cb2182b4b5582f103173b08ce1b9afdfea Mon Sep 17 00:00:00 2001 From: lotte Date: Tue, 25 Jun 2019 11:17:22 +0200 Subject: [PATCH 15/38] fixed remaining issues and tests --- .../search-service/search.service.ts | 3 +- .../config-response-parsing.service.spec.ts | 4 +- .../integration-response-parsing.service.ts | 2 +- .../dso-selector.component.spec.ts | 8 +--- .../claimed-task-actions.component.spec.ts | 6 +-- .../claimed-task-actions.component.ts | 1 - .../mydspace-actions-service.factory.ts | 41 +++++++++++++++++++ .../mydspace-actions/mydspace-actions.ts | 5 ++- .../pool-task-actions.component.spec.ts | 1 - .../pool-task/pool-task-actions.component.ts | 1 - 10 files changed, 53 insertions(+), 19 deletions(-) create mode 100644 src/app/shared/mydspace-actions/mydspace-actions-service.factory.ts diff --git a/src/app/+search-page/search-service/search.service.ts b/src/app/+search-page/search-service/search.service.ts index 0646c2c089..86611cc87b 100644 --- a/src/app/+search-page/search-service/search.service.ts +++ b/src/app/+search-page/search-service/search.service.ts @@ -295,8 +295,7 @@ export class SearchService implements OnDestroy { const scopeObject: Observable> = this.dspaceObjectService.findById(scopeId).pipe(getSucceededRemoteData()); const scopeList: Observable = scopeObject.pipe( switchMap((dsoRD: RemoteData) => { - console.log((dsoRD.payload as any).type); - if ((dsoRD.payload as any).type === Community.type) { + if ((dsoRD.payload as any).type === Community.type.value) { const community: Community = dsoRD.payload as Community; return observableCombineLatest(community.subcommunities, community.collections).pipe( map(([subCommunities, collections]) => { diff --git a/src/app/core/config/config-response-parsing.service.spec.ts b/src/app/core/config/config-response-parsing.service.spec.ts index 7c69f1bdb3..90dd1670b8 100644 --- a/src/app/core/config/config-response-parsing.service.spec.ts +++ b/src/app/core/config/config-response-parsing.service.spec.ts @@ -8,8 +8,8 @@ import { Store } from '@ngrx/store'; import { CoreState } from '../core.reducers'; import { PaginatedList } from '../data/paginated-list'; import { PageInfo } from '../shared/page-info.model'; -import { NormalizedSubmissionDefinitionsModel } from './models/normalized-config-submission-definitions.model'; import { NormalizedSubmissionSectionModel } from './models/normalized-config-submission-section.model'; +import { NormalizedSubmissionDefinitionModel } from './models/normalized-config-submission-definition.model'; describe('ConfigResponseParsingService', () => { let service: ConfigResponseParsingService; @@ -173,7 +173,7 @@ describe('ConfigResponseParsingService', () => { self: 'https://rest.api/config/submissiondefinitions/traditional/sections' }); const definitions = - Object.assign(new NormalizedSubmissionDefinitionsModel(), { + Object.assign(new NormalizedSubmissionDefinitionModel(), { isDefault: true, name: 'traditional', type: 'submissiondefinition', diff --git a/src/app/core/integration/integration-response-parsing.service.ts b/src/app/core/integration/integration-response-parsing.service.ts index a98d206402..8cc0f8d252 100644 --- a/src/app/core/integration/integration-response-parsing.service.ts +++ b/src/app/core/integration/integration-response-parsing.service.ts @@ -42,7 +42,7 @@ export class IntegrationResponseParsingService extends BaseResponseParsingServic protected processResponse(data: PaginatedList): any { const returnList = Array.of(); data.page.forEach((item, index) => { - if (item.type === AuthorityValue.type) { + if (item.type === AuthorityValue.type.value) { data.page[index] = Object.assign(new AuthorityValue(), item); } }); diff --git a/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts b/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts index e33d5d9ba1..234f13f4b1 100644 --- a/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts +++ b/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts @@ -5,10 +5,8 @@ import { DSOSelectorComponent } from './dso-selector.component'; import { SearchService } from '../../../+search-page/search-service/search.service'; import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model'; import { PaginatedSearchOptions } from '../../../+search-page/paginated-search-options.model'; -import { RemoteData } from '../../../core/data/remote-data'; import { ItemSearchResult } from '../../object-collection/shared/item-search-result.model'; import { Item } from '../../../core/shared/item.model'; -import { of as observableOf } from 'rxjs'; import { PaginatedList } from '../../../core/data/paginated-list'; import { MetadataValue } from '../../../core/shared/metadata.models'; import { createSuccessfulRemoteDataObject$ } from '../../testing/utils'; @@ -51,7 +49,7 @@ describe('DSOSelectorComponent', () => { component = fixture.componentInstance; debugElement = fixture.debugElement; component.currentDSOId = currentDSOId; - component.value = type; + component.type = type; fixture.detectChanges(); }); @@ -69,6 +67,4 @@ describe('DSOSelectorComponent', () => { expect(searchService.search).toHaveBeenCalledWith(searchOptions); }); - -}) -; +}); diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts index 30f1d7775f..5084b3e9fe 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts @@ -11,13 +11,13 @@ import { MockTranslateLoader } from '../../mocks/mock-translate-loader'; import { NotificationsService } from '../../notifications/notifications.service'; import { NotificationsServiceStub } from '../../testing/notifications-service-stub'; import { RouterStub } from '../../testing/router-stub'; -import { RemoteData } from '../../../core/data/remote-data'; import { Item } from '../../../core/shared/item.model'; import { ClaimedTaskDataService } from '../../../core/tasks/claimed-task-data.service'; import { ClaimedTaskActionsComponent } from './claimed-task-actions.component'; import { ClaimedTask } from '../../../core/tasks/models/claimed-task-object.model'; import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; import { createSuccessfulRemoteDataObject } from '../../testing/utils'; +import { CoreModule } from '../../../core/core.module'; let component: ClaimedTaskActionsComponent; let fixture: ComponentFixture; @@ -26,7 +26,7 @@ let mockObject: ClaimedTask; let notificationsServiceStub: NotificationsServiceStub; let router: RouterStub; -const mockDataService = jasmine.createSpyObj('PoolTaskDataService', { +const mockDataService = jasmine.createSpyObj('ClaimedTaskDataService', { approveTask: jasmine.createSpy('approveTask'), rejectTask: jasmine.createSpy('rejectTask'), returnToPoolTask: jasmine.createSpy('returnToPoolTask'), @@ -66,7 +66,7 @@ const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdIt const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem), id: '1234' }); -fdescribe('ClaimedTaskActionsComponent', () => { +describe('ClaimedTaskActionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts index c37a7eb4db..0ddb24ec2f 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts @@ -12,7 +12,6 @@ import { isNotUndefined } from '../../empty.util'; import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; import { RemoteData } from '../../../core/data/remote-data'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; -import { ResourceType } from '../../../core/shared/resource-type'; import { NotificationsService } from '../../notifications/notifications.service'; /** diff --git a/src/app/shared/mydspace-actions/mydspace-actions-service.factory.ts b/src/app/shared/mydspace-actions/mydspace-actions-service.factory.ts new file mode 100644 index 0000000000..48a0630778 --- /dev/null +++ b/src/app/shared/mydspace-actions/mydspace-actions-service.factory.ts @@ -0,0 +1,41 @@ +import { DataService } from '../../core/data/data.service'; +import { ResourceType } from '../../core/shared/resource-type'; +import { WorkspaceitemDataService } from '../../core/submission/workspaceitem-data.service'; +import { ClaimedTaskDataService } from '../../core/tasks/claimed-task-data.service'; +import { PoolTaskDataService } from '../../core/tasks/pool-task-data.service'; +import { WorkflowItemDataService } from '../../core/submission/workflowitem-data.service'; +import { CacheableObject } from '../../core/cache/object-cache.reducer'; +import { ItemDataService } from '../../core/data/item-data.service'; +import { Item } from '../../core/shared/item.model'; +import { PoolTask } from '../../core/tasks/models/pool-task-object.model'; +import { ClaimedTask } from '../../core/tasks/models/claimed-task-object.model'; +import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model'; +import { WorkflowItem } from '../../core/submission/models/workflowitem.model'; + +/** + * Class to return DataService for given ResourceType + */ +export class MydspaceActionsServiceFactory> { + public getConstructor(type: ResourceType): TService { + switch (type) { + case Item.type: { + return ItemDataService as any; + } + case WorkspaceItem.type: { + return WorkspaceitemDataService as any; + } + case WorkflowItem.type: { + return WorkflowItemDataService as any; + } + case ClaimedTask.type: { + return ClaimedTaskDataService as any; + } + case PoolTask.type: { + return PoolTaskDataService as any; + } + default: { + return undefined; + } + } + } +} diff --git a/src/app/shared/mydspace-actions/mydspace-actions.ts b/src/app/shared/mydspace-actions/mydspace-actions.ts index 2e86726be7..8e465644c3 100644 --- a/src/app/shared/mydspace-actions/mydspace-actions.ts +++ b/src/app/shared/mydspace-actions/mydspace-actions.ts @@ -3,6 +3,7 @@ import { Injector, Input } from '@angular/core'; import { find } from 'rxjs/operators'; +import { MydspaceActionsServiceFactory } from './mydspace-actions-service.factory'; import { RemoteData } from '../../core/data/remote-data'; import { DataService } from '../../core/data/data.service'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; @@ -10,7 +11,6 @@ import { ResourceType } from '../../core/shared/resource-type'; import { NotificationOptions } from '../notifications/models/notification-options.model'; import { NotificationsService } from '../notifications/notifications.service'; import { TranslateService } from '@ngx-translate/core'; -import { getMapsToType } from '../../core/cache/builders/build-decorators'; /** * Abstract class for all different representations of mydspace actions @@ -42,7 +42,8 @@ export abstract class MyDSpaceActionsComponent(); + this.objectDataService = injector.get(factory.getConstructor(objectType)); } /** diff --git a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts index 151f0383f4..c06cec3422 100644 --- a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts @@ -11,7 +11,6 @@ import { MockTranslateLoader } from '../../mocks/mock-translate-loader'; import { NotificationsService } from '../../notifications/notifications.service'; import { NotificationsServiceStub } from '../../testing/notifications-service-stub'; import { RouterStub } from '../../testing/router-stub'; -import { RemoteData } from '../../../core/data/remote-data'; import { Item } from '../../../core/shared/item.model'; import { PoolTaskDataService } from '../../../core/tasks/pool-task-data.service'; import { PoolTaskActionsComponent } from './pool-task-actions.component'; diff --git a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts index 2e32541e09..2124c0d9b6 100644 --- a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts @@ -12,7 +12,6 @@ import { PoolTask } from '../../../core/tasks/models/pool-task-object.model'; import { PoolTaskDataService } from '../../../core/tasks/pool-task-data.service'; import { isNotUndefined } from '../../empty.util'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; -import { ResourceType } from '../../../core/shared/resource-type'; import { NotificationsService } from '../../notifications/notifications.service'; /** From 78737ed1abeda58eec1c99633cb1cb263ccdeb87 Mon Sep 17 00:00:00 2001 From: lotte Date: Tue, 25 Jun 2019 11:26:40 +0200 Subject: [PATCH 16/38] resolved lint errors --- src/app/core/cache/builders/build-decorators.ts | 1 - src/app/core/cache/object-cache.reducer.ts | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/core/cache/builders/build-decorators.ts b/src/app/core/cache/builders/build-decorators.ts index 27d299c528..f6651f2607 100644 --- a/src/app/core/cache/builders/build-decorators.ts +++ b/src/app/core/cache/builders/build-decorators.ts @@ -10,7 +10,6 @@ const relationshipKey = Symbol('relationship'); const relationshipMap = new Map(); const typeMap = new Map(); - export function mapsTo(value: GenericConstructor) { return function decorator(objectConstructor: GenericConstructor) { Reflect.defineMetadata(mapsToMetadataKey, value, objectConstructor); diff --git a/src/app/core/cache/object-cache.reducer.ts b/src/app/core/cache/object-cache.reducer.ts index 012d12b5f5..f41151fd90 100644 --- a/src/app/core/cache/object-cache.reducer.ts +++ b/src/app/core/cache/object-cache.reducer.ts @@ -36,6 +36,7 @@ export abstract class TypedObject { static type: ResourceType; } +/* tslint:disable:max-classes-per-file */ /** * An interface to represent objects that can be cached * @@ -62,6 +63,7 @@ export class ObjectCacheEntry implements CacheEntry { patches: Patch[] = []; isDirty: boolean; } +/* tslint:enable:max-classes-per-file */ /** * The ObjectCache State From d20962e5cd997c4115444551c28a65def2adad5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2019 09:18:53 +0000 Subject: [PATCH 17/38] Bump lodash.mergewith from 4.6.1 to 4.6.2 Bumps [lodash.mergewith](https://github.com/lodash/lodash) from 4.6.1 to 4.6.2. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/commits) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9a4f96e805..f8a174e0a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6118,9 +6118,9 @@ lodash.memoize@^4.1.2: integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= lodash.mergewith@^4.6.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927" - integrity sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ== + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55" + integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ== lodash.restparam@^3.0.0: version "3.6.1" From a573c507b4a77094ee3cbd1bb90586eba6489f69 Mon Sep 17 00:00:00 2001 From: lotte Date: Thu, 11 Jul 2019 13:35:08 +0200 Subject: [PATCH 18/38] resolved prod build issues --- .../browse-by-metadata-page.component.spec.ts | 7 ++++--- src/app/shared/alert/alert.component.spec.ts | 2 +- .../dynamic-relation-group.component.spec.ts | 3 ++- src/app/shared/form/builder/form-builder.service.spec.ts | 2 +- src/app/shared/form/builder/parsers/row-parser.spec.ts | 2 +- .../shared/notifications/notifications.reducers.spec.ts | 2 +- .../sections/form/section-form.component.spec.ts | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts b/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts index 4252503cc3..927effd303 100644 --- a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts +++ b/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts @@ -22,6 +22,7 @@ import { Community } from '../../core/shared/community.model'; import { MockRouter } from '../../shared/mocks/mock-router'; import { ResourceType } from '../../core/shared/resource-type'; import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; +import { BrowseEntry } from '../../core/shared/browse-entry.model'; describe('BrowseByMetadataPageComponent', () => { let comp: BrowseByMetadataPageComponent; @@ -41,21 +42,21 @@ describe('BrowseByMetadataPageComponent', () => { const mockEntries = [ { - type: ResourceType.BrowseEntry, + type: BrowseEntry.type, authority: null, value: 'John Doe', language: 'en', count: 1 }, { - type: ResourceType.BrowseEntry, + type: BrowseEntry.type, authority: null, value: 'James Doe', language: 'en', count: 3 }, { - type: ResourceType.BrowseEntry, + type: BrowseEntry.type, authority: null, value: 'Fake subject', language: 'en', diff --git a/src/app/shared/alert/alert.component.spec.ts b/src/app/shared/alert/alert.component.spec.ts index 33f48c08ee..e235e27b28 100644 --- a/src/app/shared/alert/alert.component.spec.ts +++ b/src/app/shared/alert/alert.component.spec.ts @@ -66,7 +66,7 @@ describe('AlertComponent test suite', () => { compAsAny = comp; comp.content = 'test alert'; comp.dismissible = true; - comp.value = AlertType.Info; + comp.type = AlertType.Info; fixture.detectChanges(); }); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts index 200cc08aae..6d5839f867 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts @@ -8,7 +8,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { DsDynamicRelationGroupComponent } from './dynamic-relation-group.components'; import { DynamicRelationGroupModel, DynamicRelationGroupModelConfig } from './dynamic-relation-group.model'; -import { FormRowModel, SubmissionFormsModel } from '../../../../../../core/config/models/config-submission-forms.model'; +import { SubmissionFormsModel } from '../../../../../../core/config/models/config-submission-forms.model'; import { FormFieldModel } from '../../../models/form-field.model'; import { FormBuilderService } from '../../../form-builder.service'; import { FormService } from '../../../../form.service'; @@ -25,6 +25,7 @@ import { AuthorityServiceStub } from '../../../../../testing/authority-service-s import { MOCK_SUBMISSION_CONFIG } from '../../../../../testing/mock-submission-config'; import { Store, StoreModule } from '@ngrx/store'; import { MockStore } from '../../../../../testing/mock-store'; +import { FormRowModel } from '../../../../../../core/config/models/config-submission-form.model'; export let FORM_GROUP_TEST_MODEL_CONFIG; diff --git a/src/app/shared/form/builder/form-builder.service.spec.ts b/src/app/shared/form/builder/form-builder.service.spec.ts index b092b87a5a..58a1696a92 100644 --- a/src/app/shared/form/builder/form-builder.service.spec.ts +++ b/src/app/shared/form/builder/form-builder.service.spec.ts @@ -39,7 +39,6 @@ import { DynamicListRadioGroupModel } from './ds-dynamic-form-ui/models/list/dyn import { AuthorityOptions } from '../../../core/integration/models/authority-options.model'; import { FormFieldModel } from './models/form-field.model'; import { - FormRowModel, SubmissionFormsModel } from '../../../core/config/models/config-submission-forms.model'; import { FormBuilderService } from './form-builder.service'; @@ -49,6 +48,7 @@ import { FormFieldMetadataValueObject } from './models/form-field-metadata-value import { DynamicConcatModel } from './ds-dynamic-form-ui/models/ds-dynamic-concat.model'; import { DynamicLookupNameModel } from './ds-dynamic-form-ui/models/lookup/dynamic-lookup-name.model'; import { DynamicRowArrayModel } from './ds-dynamic-form-ui/models/ds-dynamic-row-array-model'; +import { FormRowModel } from '../../../core/config/models/config-submission-form.model'; describe('FormBuilderService test suite', () => { diff --git a/src/app/shared/form/builder/parsers/row-parser.spec.ts b/src/app/shared/form/builder/parsers/row-parser.spec.ts index 3f10b71279..58b1d1de99 100644 --- a/src/app/shared/form/builder/parsers/row-parser.spec.ts +++ b/src/app/shared/form/builder/parsers/row-parser.spec.ts @@ -1,8 +1,8 @@ import { FormFieldModel } from '../models/form-field.model'; -import { FormRowModel } from '../../../../core/config/models/config-submission-forms.model'; import { RowParser } from './row-parser'; import { DynamicRowGroupModel } from '../ds-dynamic-form-ui/models/ds-dynamic-row-group-model'; import { DynamicRowArrayModel } from '../ds-dynamic-form-ui/models/ds-dynamic-row-array-model'; +import { FormRowModel } from '../../../../core/config/models/config-submission-form.model'; describe('RowParser test suite', () => { diff --git a/src/app/shared/notifications/notifications.reducers.spec.ts b/src/app/shared/notifications/notifications.reducers.spec.ts index 96d97f3dd3..b54072925a 100644 --- a/src/app/shared/notifications/notifications.reducers.spec.ts +++ b/src/app/shared/notifications/notifications.reducers.spec.ts @@ -123,7 +123,7 @@ describe('Notifications reducer', () => { cdr.detectChanges(); const action = new NewNotificationAction(notification); - action.value = 'NothingToDo, return only the state'; + action.type = 'NothingToDo, return only the state'; const lastState = notificationsReducer(stateBis, action); expect(lastState.length).toEqual(1); diff --git a/src/app/submission/sections/form/section-form.component.spec.ts b/src/app/submission/sections/form/section-form.component.spec.ts index 477d42a0a1..eb56a92113 100644 --- a/src/app/submission/sections/form/section-form.component.spec.ts +++ b/src/app/submission/sections/form/section-form.component.spec.ts @@ -34,7 +34,6 @@ import { CommonModule } from '@angular/common'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormComponent } from '../../../shared/form/form.component'; import { FormFieldModel } from '../../../shared/form/builder/models/form-field.model'; -import { FormRowModel } from '../../../core/config/models/config-submission-forms.model'; import { ConfigData } from '../../../core/config/config-data'; import { PageInfo } from '../../../core/shared/page-info.model'; import { FormFieldMetadataValueObject } from '../../../shared/form/builder/models/form-field-metadata-value.model'; @@ -43,6 +42,7 @@ import { DsDynamicInputModel } from '../../../shared/form/builder/ds-dynamic-for import { SubmissionSectionError } from '../../objects/submission-objects.reducer'; import { DynamicFormControlEvent, DynamicFormControlEventType } from '@ng-dynamic-forms/core'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; +import { FormRowModel } from '../../../core/config/models/config-submission-form.model'; function getMockSubmissionFormsConfigService(): SubmissionFormsConfigService { return jasmine.createSpyObj('FormOperationsService', { From 67cee55754ab4cf11d42083a5085997077a7daa8 Mon Sep 17 00:00:00 2001 From: lotte Date: Thu, 11 Jul 2019 14:47:40 +0200 Subject: [PATCH 19/38] fixed bitstream format/metadataschema pages --- .../item-status/item-status.component.spec.ts | 1 - src/app/core/auth/models/normalized-auth-status.model.ts | 6 ------ src/app/core/config/models/config.model.ts | 5 ----- src/app/core/config/models/normalized-config.model.ts | 6 ------ src/app/core/metadata/metadata-field.model.ts | 5 ----- src/app/core/metadata/metadata-schema.model.ts | 5 ----- src/app/core/metadata/normalized-metadata-field.model.ts | 7 ------- src/app/core/metadata/normalized-metadata-schema.model.ts | 6 ------ .../registry/registry-bitstreamformats-response.model.ts | 6 ++++-- .../registry/registry-metadataschemas-response.model.ts | 6 ++++-- src/app/core/shared/bitstream-format.model.ts | 5 ----- src/app/core/shared/browse-definition.model.ts | 3 --- src/app/core/shared/item-relationships/item-type.model.ts | 5 ----- .../shared/item-relationships/relationship-type.model.ts | 5 ----- .../core/shared/item-relationships/relationship.model.ts | 5 ----- src/app/core/shared/normalized-browse-entry.model.ts | 6 ------ src/app/core/shared/resource-policy.model.ts | 5 ----- src/app/core/shared/resource-type.ts | 6 ------ 18 files changed, 8 insertions(+), 85 deletions(-) diff --git a/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts b/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts index fac7dc86f6..30f326bec4 100644 --- a/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts @@ -11,7 +11,6 @@ import { Item } from '../../../core/shared/item.model'; import { By } from '@angular/platform-browser'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { of as observableOf } from 'rxjs'; -import { RemoteData } from '../../../core/data/remote-data'; import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils'; describe('ItemStatusComponent', () => { diff --git a/src/app/core/auth/models/normalized-auth-status.model.ts b/src/app/core/auth/models/normalized-auth-status.model.ts index 3dc723f97b..da0b32fcfb 100644 --- a/src/app/core/auth/models/normalized-auth-status.model.ts +++ b/src/app/core/auth/models/normalized-auth-status.model.ts @@ -39,10 +39,4 @@ export class NormalizedAuthStatus extends NormalizedObject { @relationship(EPerson, false) @autoserialize eperson: string; - - /** - * The resource object of this auth status - */ - @autoserialize - type: ResourceType; } diff --git a/src/app/core/config/models/config.model.ts b/src/app/core/config/models/config.model.ts index 81f20a0b3c..20d67ec69d 100644 --- a/src/app/core/config/models/config.model.ts +++ b/src/app/core/config/models/config.model.ts @@ -8,11 +8,6 @@ export abstract class ConfigObject implements CacheableObject { */ public name: string; - /** - * A string representing the kind of config object - */ - public type: ResourceType; - /** * The links to all related resources returned by the rest api. */ diff --git a/src/app/core/config/models/normalized-config.model.ts b/src/app/core/config/models/normalized-config.model.ts index d10be2d1c3..1bf4ffb826 100644 --- a/src/app/core/config/models/normalized-config.model.ts +++ b/src/app/core/config/models/normalized-config.model.ts @@ -15,12 +15,6 @@ export abstract class NormalizedConfigObject implemen @autoserialize public name: string; - /** - * A string representing the kind of config object - */ - @autoserialize - public type: ResourceType; - /** * The links to all related resources returned by the rest api. */ diff --git a/src/app/core/metadata/metadata-field.model.ts b/src/app/core/metadata/metadata-field.model.ts index 5e20d3f40e..288934e52d 100644 --- a/src/app/core/metadata/metadata-field.model.ts +++ b/src/app/core/metadata/metadata-field.model.ts @@ -39,11 +39,6 @@ export class MetadataField implements ListableObject { */ schema: MetadataSchema; - /** - * The resource type of this metadata field - */ - type: ResourceType; - /** * Method to print this metadata field as a string * @param separator The separator between the schema, element and qualifier in the string diff --git a/src/app/core/metadata/metadata-schema.model.ts b/src/app/core/metadata/metadata-schema.model.ts index 206cf081ba..bc05e475cc 100644 --- a/src/app/core/metadata/metadata-schema.model.ts +++ b/src/app/core/metadata/metadata-schema.model.ts @@ -26,9 +26,4 @@ export class MetadataSchema implements ListableObject { * The namespace of this metadata schema */ namespace: string; - - /** - * The resource type of this metadata schema - */ - type: ResourceType; } diff --git a/src/app/core/metadata/normalized-metadata-field.model.ts b/src/app/core/metadata/normalized-metadata-field.model.ts index 484cbe5066..a844f7a394 100644 --- a/src/app/core/metadata/normalized-metadata-field.model.ts +++ b/src/app/core/metadata/normalized-metadata-field.model.ts @@ -1,6 +1,5 @@ import { autoserialize, deserialize } from 'cerialize'; import { mapsTo, relationship } from '../cache/builders/build-decorators'; -import { ResourceType } from '../shared/resource-type'; import { MetadataField } from './metadata-field.model'; import { NormalizedObject } from '../cache/models/normalized-object.model'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; @@ -48,10 +47,4 @@ export class NormalizedMetadataField extends NormalizedObject imp @deserialize @relationship(MetadataSchema) schema: string; - - /** - * The resource type of this normalized metadata field - */ - @autoserialize - type: ResourceType; } diff --git a/src/app/core/metadata/normalized-metadata-schema.model.ts b/src/app/core/metadata/normalized-metadata-schema.model.ts index d846b828b9..8d15ef2431 100644 --- a/src/app/core/metadata/normalized-metadata-schema.model.ts +++ b/src/app/core/metadata/normalized-metadata-schema.model.ts @@ -33,10 +33,4 @@ export class NormalizedMetadataSchema extends NormalizedObject i */ @autoserialize namespace: string; - - /** - * The resource type of this metadata schema - */ - @autoserialize - type: ResourceType; } diff --git a/src/app/core/registry/registry-bitstreamformats-response.model.ts b/src/app/core/registry/registry-bitstreamformats-response.model.ts index 81de379e9e..ddf926f3be 100644 --- a/src/app/core/registry/registry-bitstreamformats-response.model.ts +++ b/src/app/core/registry/registry-bitstreamformats-response.model.ts @@ -1,9 +1,11 @@ -import { autoserialize, autoserializeAs } from 'cerialize'; +import { autoserialize, deserialize } from 'cerialize'; import { PageInfo } from '../shared/page-info.model'; import { BitstreamFormat } from '../shared/bitstream-format.model'; +import { relationship } from '../cache/builders/build-decorators'; export class RegistryBitstreamformatsResponse { - @autoserializeAs(BitstreamFormat) + @deserialize + @relationship(BitstreamFormat, true) bitstreamformats: BitstreamFormat[]; @autoserialize diff --git a/src/app/core/registry/registry-metadataschemas-response.model.ts b/src/app/core/registry/registry-metadataschemas-response.model.ts index f27550bbe0..fc53b354a5 100644 --- a/src/app/core/registry/registry-metadataschemas-response.model.ts +++ b/src/app/core/registry/registry-metadataschemas-response.model.ts @@ -1,9 +1,11 @@ import { PageInfo } from '../shared/page-info.model'; -import { autoserialize, autoserializeAs } from 'cerialize'; +import { autoserialize, deserialize } from 'cerialize'; import { MetadataSchema } from '../metadata/metadata-schema.model'; +import { relationship } from '../cache/builders/build-decorators'; export class RegistryMetadataschemasResponse { - @autoserializeAs(MetadataSchema) + @deserialize + @relationship(MetadataSchema, true) metadataschemas: MetadataSchema[]; @autoserialize diff --git a/src/app/core/shared/bitstream-format.model.ts b/src/app/core/shared/bitstream-format.model.ts index 5509b37041..bf50cd832f 100644 --- a/src/app/core/shared/bitstream-format.model.ts +++ b/src/app/core/shared/bitstream-format.model.ts @@ -44,11 +44,6 @@ export class BitstreamFormat implements CacheableObject { */ self: string; - /** - * A ResourceType representing the kind of Object of this BitstreamFormat - */ - type: ResourceType; - /** * Universally unique identifier for this Bitstream Format */ diff --git a/src/app/core/shared/browse-definition.model.ts b/src/app/core/shared/browse-definition.model.ts index fe5fdd439b..fda6ebd3c1 100644 --- a/src/app/core/shared/browse-definition.model.ts +++ b/src/app/core/shared/browse-definition.model.ts @@ -16,9 +16,6 @@ export class BrowseDefinition implements TypedObject { @autoserializeAs('order') defaultSortOrder: string; - @autoserialize - type: ResourceType; - @autoserializeAs('metadata') metadataKeys: string[]; diff --git a/src/app/core/shared/item-relationships/item-type.model.ts b/src/app/core/shared/item-relationships/item-type.model.ts index a0e5adda91..2635f154a8 100644 --- a/src/app/core/shared/item-relationships/item-type.model.ts +++ b/src/app/core/shared/item-relationships/item-type.model.ts @@ -17,11 +17,6 @@ export class ItemType implements CacheableObject { */ self: string; - /** - * The type of Resource this is - */ - type: ResourceType; - /** * The universally unique identifier of this ItemType */ diff --git a/src/app/core/shared/item-relationships/relationship-type.model.ts b/src/app/core/shared/item-relationships/relationship-type.model.ts index a8e24cc012..98454bc000 100644 --- a/src/app/core/shared/item-relationships/relationship-type.model.ts +++ b/src/app/core/shared/item-relationships/relationship-type.model.ts @@ -15,11 +15,6 @@ export class RelationshipType implements CacheableObject { */ self: string; - /** - * The type of Resource this is - */ - type: ResourceType; - /** * The label that describes this RelationshipType */ diff --git a/src/app/core/shared/item-relationships/relationship.model.ts b/src/app/core/shared/item-relationships/relationship.model.ts index bd83c43029..8eb2fd27af 100644 --- a/src/app/core/shared/item-relationships/relationship.model.ts +++ b/src/app/core/shared/item-relationships/relationship.model.ts @@ -15,11 +15,6 @@ export class Relationship implements CacheableObject { */ self: string; - /** - * The type of Resource this is - */ - type: ResourceType; - /** * The universally unique identifier of this Relationship */ diff --git a/src/app/core/shared/normalized-browse-entry.model.ts b/src/app/core/shared/normalized-browse-entry.model.ts index 42a8fc2178..88e3842ce9 100644 --- a/src/app/core/shared/normalized-browse-entry.model.ts +++ b/src/app/core/shared/normalized-browse-entry.model.ts @@ -10,12 +10,6 @@ import { mapsTo } from '../cache/builders/build-decorators'; */ @mapsTo(BrowseEntry) export class NormalizedBrowseEntry extends NormalizedObject { - /** - * The resource type of this browse entry - */ - @autoserialize - type: ResourceType; - /** * The authority string of this browse entry */ diff --git a/src/app/core/shared/resource-policy.model.ts b/src/app/core/shared/resource-policy.model.ts index 7397076416..a80446a369 100644 --- a/src/app/core/shared/resource-policy.model.ts +++ b/src/app/core/shared/resource-policy.model.ts @@ -28,11 +28,6 @@ export class ResourcePolicy implements CacheableObject { */ self: string; - /** - * A ResourceType representing the kind of Object of this ResourcePolicy - */ - type: ResourceType; - /** * The universally unique identifier for this Resource Policy */ diff --git a/src/app/core/shared/resource-type.ts b/src/app/core/shared/resource-type.ts index 5cdc6e57df..61542a4b26 100644 --- a/src/app/core/shared/resource-type.ts +++ b/src/app/core/shared/resource-type.ts @@ -1,10 +1,4 @@ export class ResourceType { constructor(public value: string) { } - // SubmissionDefinitions = 'submissiondefinitions', - // SubmissionDefinition = 'submissiondefinition', - // SubmissionForm = 'submissionform', - // SubmissionForms = 'submissionforms', - // SubmissionSections = 'submissionsections', - // SubmissionSection = 'submissionsection', } From f91e52f1adc35acf9b2e6f307e57f0a8bfeb829f Mon Sep 17 00:00:00 2001 From: lotte Date: Mon, 15 Jul 2019 09:59:29 +0200 Subject: [PATCH 20/38] 61949: fixed bug with adding a new md field --- src/app/core/core.module.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index f0100c7c66..11152ee8a0 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -113,6 +113,7 @@ import { NormalizedPoolTask } from './tasks/models/normalized-pool-task-object.m import { NormalizedRelationship } from './cache/models/items/normalized-relationship.model'; import { NormalizedRelationshipType } from './cache/models/items/normalized-relationship-type.model'; import { NormalizedItemType } from './cache/models/items/normalized-item-type.model'; +import { MetadatafieldParsingService } from './data/metadatafield-parsing.service'; const IMPORTS = [ CommonModule, @@ -178,6 +179,7 @@ const PROVIDERS = [ AuthorityService, IntegrationResponseParsingService, MetadataschemaParsingService, + MetadatafieldParsingService, UploaderService, UUIDService, NotificationsService, From a185019da59bc61b72c605ad6cf44116dc6e1112 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Tue, 16 Jul 2019 15:38:51 +0200 Subject: [PATCH 21/38] 63724: new configuration based search-page component --- .../related-entities-search.component.html | 2 +- .../related-entities-search.component.spec.ts | 6 +- .../related-entities-search.component.ts | 4 +- ...onfiguration-search-page.component.spec.ts | 21 ++++++ .../configuration-search-page.component.ts | 71 +++++++++++++++++++ .../configuration-search-page.guard.ts | 22 ++++++ .../filtered-search-page.guard.ts | 22 ------ .../search-page-routing.module.ts | 6 +- .../+search-page/search-page.component.html | 2 +- src/app/+search-page/search-page.component.ts | 8 +-- src/app/+search-page/search-page.module.ts | 10 +-- .../search-results.component.html | 2 +- .../search-results.component.ts | 17 +---- .../search-configuration.service.ts | 13 ++-- .../search-result-element-decorator.ts | 4 +- 15 files changed, 148 insertions(+), 62 deletions(-) create mode 100644 src/app/+search-page/configuration-search-page.component.spec.ts create mode 100644 src/app/+search-page/configuration-search-page.component.ts create mode 100644 src/app/+search-page/configuration-search-page.guard.ts delete mode 100644 src/app/+search-page/filtered-search-page.guard.ts diff --git a/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.html b/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.html index 9ec082db73..c7e1f77264 100644 --- a/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.html +++ b/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.html @@ -1,6 +1,6 @@ diff --git a/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts b/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts index e76a9cf3d0..711e1b9d3d 100644 --- a/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts +++ b/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts @@ -47,9 +47,9 @@ describe('RelatedEntitiesSearchComponent', () => { expect(comp.fixedFilter).toEqual(mockFilter); }); - it('should create a fixedFilter$', () => { - comp.fixedFilter$.subscribe((fixedFilter) => { - expect(fixedFilter).toEqual(mockRelationEntityType); + it('should create a configuration$', () => { + comp.configuration$.subscribe((configuration) => { + expect(configuration).toEqual(mockRelationEntityType); }) }); diff --git a/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts b/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts index 672655a8b8..4c0b127925 100644 --- a/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts +++ b/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts @@ -47,7 +47,7 @@ export class RelatedEntitiesSearchComponent implements OnInit { @Input() sideBarWidth = 4; fixedFilter: string; - fixedFilter$: Observable; + configuration$: Observable; constructor(private fixedFilterService: SearchFixedFilterService) { } @@ -57,7 +57,7 @@ export class RelatedEntitiesSearchComponent implements OnInit { this.fixedFilter = this.fixedFilterService.getFilterByRelation(this.relationType, this.item.id); } if (isNotEmpty(this.relationEntityType)) { - this.fixedFilter$ = of(this.relationEntityType); + this.configuration$ = of(this.relationEntityType); } } diff --git a/src/app/+search-page/configuration-search-page.component.spec.ts b/src/app/+search-page/configuration-search-page.component.spec.ts new file mode 100644 index 0000000000..a18dd38f78 --- /dev/null +++ b/src/app/+search-page/configuration-search-page.component.spec.ts @@ -0,0 +1,21 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { configureSearchComponentTestingModule } from './search-page.component.spec'; +import { SearchConfigurationService } from './search-service/search-configuration.service'; +import { ConfigurationSearchPageComponent } from './configuration-search-page.component'; + +describe('ConfigurationSearchPageComponent', () => { + let comp: ConfigurationSearchPageComponent; + let fixture: ComponentFixture; + let searchConfigService: SearchConfigurationService; + + beforeEach(async(() => { + configureSearchComponentTestingModule(ConfigurationSearchPageComponent); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ConfigurationSearchPageComponent); + comp = fixture.componentInstance; + searchConfigService = (comp as any).searchConfigService; + fixture.detectChanges(); + }); +}); diff --git a/src/app/+search-page/configuration-search-page.component.ts b/src/app/+search-page/configuration-search-page.component.ts new file mode 100644 index 0000000000..85619e8f04 --- /dev/null +++ b/src/app/+search-page/configuration-search-page.component.ts @@ -0,0 +1,71 @@ +import { HostWindowService } from '../shared/host-window.service'; +import { SearchService } from './search-service/search.service'; +import { SearchSidebarService } from './search-sidebar/search-sidebar.service'; +import { SearchPageComponent } from './search-page.component'; +import { ChangeDetectionStrategy, Component, Inject, Input, OnInit } from '@angular/core'; +import { pushInOut } from '../shared/animations/push'; +import { RouteService } from '../shared/services/route.service'; +import { SearchConfigurationService } from './search-service/search-configuration.service'; +import { Observable } from 'rxjs'; +import { PaginatedSearchOptions } from './paginated-search-options.model'; +import { SEARCH_CONFIG_SERVICE } from '../+my-dspace-page/my-dspace-page.component'; +import { map } from 'rxjs/operators'; + +/** + * This component renders a search page using a configuration as input. + */ +@Component({ + selector: 'ds-configuration-search-page', + styleUrls: ['./search-page.component.scss'], + templateUrl: './search-page.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + animations: [pushInOut], + providers: [ + { + provide: SEARCH_CONFIG_SERVICE, + useClass: SearchConfigurationService + } + ] +}) + +export class ConfigurationSearchPageComponent extends SearchPageComponent implements OnInit { + /** + * The configuration to use for the search options + * If empty, the configuration will be determined by the route parameter called 'configuration' + */ + @Input() configuration: string; + + constructor(protected service: SearchService, + protected sidebarService: SearchSidebarService, + protected windowService: HostWindowService, + @Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService, + protected routeService: RouteService) { + super(service, sidebarService, windowService, searchConfigService, routeService); + } + + /** + * Listening to changes in the paginated search options + * If something changes, update the search results + * + * Listen to changes in the scope + * If something changes, update the list of scopes for the dropdown + */ + ngOnInit(): void { + super.ngOnInit(); + } + + /** + * Get the current paginated search options after updating the configuration using the configuration input + * This is to make sure the configuration is included in the paginated search options, as it is not part of any + * query or route parameters + * @returns {Observable} + */ + protected getSearchOptions(): Observable { + return this.searchConfigService.paginatedSearchOptions.pipe( + map((options: PaginatedSearchOptions) => { + const config = this.configuration || options.configuration; + return Object.assign(options, { configuration: config }); + }) + ); + } +} diff --git a/src/app/+search-page/configuration-search-page.guard.ts b/src/app/+search-page/configuration-search-page.guard.ts new file mode 100644 index 0000000000..c52a0a6d8e --- /dev/null +++ b/src/app/+search-page/configuration-search-page.guard.ts @@ -0,0 +1,22 @@ +import { Injectable } from '@angular/core'; +import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; +import { Observable } from 'rxjs'; + +@Injectable() +/** + * Assemble the correct i18n key for the configuration search page's title depending on the current route's configuration parameter. + * The format of the key will be "{configuration}.search.title" with: + * - configuration: The current configuration stored in route.params + */ +export class ConfigurationSearchPageGuard implements CanActivate { + canActivate( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot): Observable | Promise | boolean { + const configuration = route.params.configuration; + + const newTitle = configuration + '.search.title'; + + route.data = { title: newTitle }; + return true; + } +} diff --git a/src/app/+search-page/filtered-search-page.guard.ts b/src/app/+search-page/filtered-search-page.guard.ts deleted file mode 100644 index 6d41d4965d..0000000000 --- a/src/app/+search-page/filtered-search-page.guard.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Injectable } from '@angular/core'; -import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; -import { Observable } from 'rxjs'; - -@Injectable() -/** - * Assemble the correct i18n key for the filtered search page's title depending on the current route's filter parameter. - * The format of the key will be "{filter}.search.title" with: - * - filter: The current filter stored in route.params - */ -export class FilteredSearchPageGuard implements CanActivate { - canActivate( - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot): Observable | Promise | boolean { - const filter = route.params.filter; - - const newTitle = filter + '.search.title'; - - route.data = { title: newTitle }; - return true; - } -} diff --git a/src/app/+search-page/search-page-routing.module.ts b/src/app/+search-page/search-page-routing.module.ts index c3cf4e1343..d1ab02945e 100644 --- a/src/app/+search-page/search-page-routing.module.ts +++ b/src/app/+search-page/search-page-routing.module.ts @@ -2,14 +2,14 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { SearchPageComponent } from './search-page.component'; -import { FilteredSearchPageComponent } from './filtered-search-page.component'; -import { FilteredSearchPageGuard } from './filtered-search-page.guard'; +import { ConfigurationSearchPageGuard } from './configuration-search-page.guard'; +import { ConfigurationSearchPageComponent } from './configuration-search-page.component'; @NgModule({ imports: [ RouterModule.forChild([ { path: '', component: SearchPageComponent, data: { title: 'search.title' } }, - { path: ':filter', component: FilteredSearchPageComponent, canActivate: [FilteredSearchPageGuard]} + { path: ':configuration', component: ConfigurationSearchPageComponent, canActivate: [ConfigurationSearchPageGuard]} ]) ] }) diff --git a/src/app/+search-page/search-page.component.html b/src/app/+search-page/search-page.component.html index b4d8c70f11..ea04a2b04e 100644 --- a/src/app/+search-page/search-page.component.html +++ b/src/app/+search-page/search-page.component.html @@ -33,7 +33,7 @@ diff --git a/src/app/+search-page/search-page.component.ts b/src/app/+search-page/search-page.component.ts index f23bff96f3..03433d1da1 100644 --- a/src/app/+search-page/search-page.component.ts +++ b/src/app/+search-page/search-page.component.ts @@ -86,10 +86,10 @@ export class SearchPageComponent implements OnInit { sideBarWidth = 3; /** - * The currently applied filter (determines title of search) + * The currently applied configuration (determines title of search) */ @Input() - fixedFilter$: Observable; + configuration$: Observable; constructor(protected service: SearchService, protected sidebarService: SearchSidebarService, @@ -116,8 +116,8 @@ export class SearchPageComponent implements OnInit { this.scopeListRD$ = this.searchConfigService.getCurrentScope('').pipe( switchMap((scopeId) => this.service.getScopes(scopeId)) ); - if (!isNotEmpty(this.fixedFilter$)) { - this.fixedFilter$ = this.routeService.getRouteParameterValue('filter'); + if (!isNotEmpty(this.configuration$)) { + this.configuration$ = this.routeService.getRouteParameterValue('configuration'); } } diff --git a/src/app/+search-page/search-page.module.ts b/src/app/+search-page/search-page.module.ts index 65558eae17..d7d66d854c 100644 --- a/src/app/+search-page/search-page.module.ts +++ b/src/app/+search-page/search-page.module.ts @@ -17,9 +17,7 @@ import { SearchFiltersComponent } from './search-filters/search-filters.componen import { SearchFilterComponent } from './search-filters/search-filter/search-filter.component'; import { SearchFacetFilterComponent } from './search-filters/search-filter/search-facet-filter/search-facet-filter.component'; import { SearchFilterService } from './search-filters/search-filter/search-filter.service'; -import { FilteredSearchPageComponent } from './filtered-search-page.component'; import { SearchFixedFilterService } from './search-filters/search-filter/search-fixed-filter.service'; -import { FilteredSearchPageGuard } from './filtered-search-page.guard'; import { SearchLabelsComponent } from './search-labels/search-labels.component'; import { SearchRangeFilterComponent } from './search-filters/search-filter/search-range-filter/search-range-filter.component'; import { SearchTextFilterComponent } from './search-filters/search-filter/search-text-filter/search-text-filter.component'; @@ -32,6 +30,9 @@ import { SearchFacetSelectedOptionComponent } from './search-filters/search-filt import { SearchFacetRangeOptionComponent } from './search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component'; import { SearchSwitchConfigurationComponent } from './search-switch-configuration/search-switch-configuration.component'; import { SearchAuthorityFilterComponent } from './search-filters/search-filter/search-authority-filter/search-authority-filter.component'; +import { ConfigurationSearchPageComponent } from './configuration-search-page.component'; +import { ConfigurationSearchPageGuard } from './configuration-search-page.guard'; +import { FilteredSearchPageComponent } from './filtered-search-page.component'; const effects = [ SearchSidebarEffects @@ -60,7 +61,8 @@ const components = [ SearchFacetRangeOptionComponent, SearchSwitchConfigurationComponent, SearchAuthorityFilterComponent, - FilteredSearchPageComponent + FilteredSearchPageComponent, + ConfigurationSearchPageComponent ]; @NgModule({ @@ -76,7 +78,7 @@ const components = [ SearchSidebarService, SearchFilterService, SearchFixedFilterService, - FilteredSearchPageGuard, + ConfigurationSearchPageGuard, SearchFilterService, SearchConfigurationService ], diff --git a/src/app/+search-page/search-results/search-results.component.html b/src/app/+search-page/search-results/search-results.component.html index 824d531155..5a1e89858b 100644 --- a/src/app/+search-page/search-results/search-results.component.html +++ b/src/app/+search-page/search-results/search-results.component.html @@ -1,4 +1,4 @@ -

{{ getTitleKey() | translate }}

+

{{ (configuration ? configuration + '.search.results.head' : 'search.results.head') | translate }}

} Emits the current configuration string */ getCurrentConfiguration(defaultConfiguration: string) { - return this.routeService.getQueryParameterValue('configuration').pipe(map((configuration) => { - return configuration || defaultConfiguration; - })); + return observableCombineLatest( + this.routeService.getQueryParameterValue('configuration').pipe(startWith(undefined)), + this.routeService.getRouteParameterValue('configuration').pipe(startWith(undefined)) + ).pipe( + map(([queryConfig, routeConfig]) => { + return queryConfig || routeConfig || defaultConfiguration; + }) + ); } /** diff --git a/src/app/+search-page/search-service/search-result-element-decorator.ts b/src/app/+search-page/search-service/search-result-element-decorator.ts index 59446480a3..e804a5d8ee 100644 --- a/src/app/+search-page/search-service/search-result-element-decorator.ts +++ b/src/app/+search-page/search-service/search-result-element-decorator.ts @@ -1,6 +1,6 @@ import { GenericConstructor } from '../../core/shared/generic-constructor'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; -import { isNull } from '../../shared/empty.util'; +import { hasNoValue, isNull } from '../../shared/empty.util'; /** * Contains the mapping between a search result component and a DSpaceObject @@ -34,7 +34,7 @@ export function searchResultFor(domainConstructor: GenericConstructor, configuration: string = null) { - if (isNull(configuration) || configuration === 'default') { + if (isNull(configuration) || configuration === 'default' || hasNoValue(searchResultMap.get(configuration))) { return searchResultMap.get(domainConstructor); } else { return searchResultMap.get(configuration).get(domainConstructor); From 651b4100dd4a582822493be1b44b4e51c7e02e38 Mon Sep 17 00:00:00 2001 From: lotte Date: Wed, 17 Jul 2019 13:47:59 +0200 Subject: [PATCH 22/38] solved issue with submission --- src/app/core/cache/models/normalized-object.model.ts | 8 +++++++- .../core/config/models/config-submission-uploads.model.ts | 3 ++- .../models/normalized-config-submission-uploads.model.ts | 2 ++ src/app/core/core.module.ts | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/core/cache/models/normalized-object.model.ts b/src/app/core/cache/models/normalized-object.model.ts index 28cb8494ef..bb5f192a7a 100644 --- a/src/app/core/cache/models/normalized-object.model.ts +++ b/src/app/core/cache/models/normalized-object.model.ts @@ -14,5 +14,11 @@ export abstract class NormalizedObject implements Cacheab @autoserialize _links: { [name: string]: string - } + }; + + /** + * A string representing the kind of object + */ + @autoserialize + type: string; } diff --git a/src/app/core/config/models/config-submission-uploads.model.ts b/src/app/core/config/models/config-submission-uploads.model.ts index 8bb9ba7f1e..812a590041 100644 --- a/src/app/core/config/models/config-submission-uploads.model.ts +++ b/src/app/core/config/models/config-submission-uploads.model.ts @@ -1,9 +1,10 @@ import { ConfigObject } from './config.model'; import { AccessConditionOption } from './config-access-condition-option.model'; import { SubmissionFormsModel } from './config-submission-forms.model'; +import { ResourceType } from '../../shared/resource-type'; export class SubmissionUploadsModel extends ConfigObject { - + static type = new ResourceType('submissionupload'); /** * A list of available bitstream access conditions */ diff --git a/src/app/core/config/models/normalized-config-submission-uploads.model.ts b/src/app/core/config/models/normalized-config-submission-uploads.model.ts index e49171d6a7..7a21c15912 100644 --- a/src/app/core/config/models/normalized-config-submission-uploads.model.ts +++ b/src/app/core/config/models/normalized-config-submission-uploads.model.ts @@ -3,10 +3,12 @@ import { AccessConditionOption } from './config-access-condition-option.model'; import { SubmissionFormsModel } from './config-submission-forms.model'; import { NormalizedConfigObject } from './normalized-config.model'; import { SubmissionUploadsModel } from './config-submission-uploads.model'; +import { mapsTo } from '../../cache/builders/build-decorators'; /** * Normalized class for the configuration describing the submission upload section */ +@mapsTo(SubmissionUploadsModel) @inheritSerialization(NormalizedConfigObject) export class NormalizedSubmissionUploadsModel extends NormalizedConfigObject { diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 11152ee8a0..8d0fcc2910 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -114,6 +114,7 @@ import { NormalizedRelationship } from './cache/models/items/normalized-relation import { NormalizedRelationshipType } from './cache/models/items/normalized-relationship-type.model'; import { NormalizedItemType } from './cache/models/items/normalized-item-type.model'; import { MetadatafieldParsingService } from './data/metadatafield-parsing.service'; +import { NormalizedSubmissionUploadsModel } from './config/models/normalized-config-submission-uploads.model'; const IMPORTS = [ CommonModule, @@ -233,6 +234,7 @@ export const normalizedModels = NormalizedSubmissionDefinitionsModel, NormalizedSubmissionFormsModel, NormalizedSubmissionSectionModel, + NormalizedSubmissionUploadsModel, NormalizedAuthStatus, NormalizedAuthorityValue, BrowseEntry, From 96f68695b0bedd9eab7cea9f3f4df52994e16ba0 Mon Sep 17 00:00:00 2001 From: lotte Date: Wed, 17 Jul 2019 14:09:50 +0200 Subject: [PATCH 23/38] Changed href to routerLink on edit item status page --- .../edit-item-page/item-status/item-status.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/+item-page/edit-item-page/item-status/item-status.component.html b/src/app/+item-page/edit-item-page/item-status/item-status.component.html index e60fa0490d..83662c9d7c 100644 --- a/src/app/+item-page/edit-item-page/item-status/item-status.component.html +++ b/src/app/+item-page/edit-item-page/item-status/item-status.component.html @@ -12,7 +12,7 @@ {{'item.edit.tabs.status.labels.itemPage' | translate}}:
From aff3f3df0378fd2317ece5c8a9aede41d56f4c35 Mon Sep 17 00:00:00 2001 From: lotte Date: Thu, 18 Jul 2019 16:28:07 +0200 Subject: [PATCH 24/38] solved issues with browse pages --- .../simple/item-types/shared/item.component.spec.ts | 2 +- src/app/+search-page/normalized-search-result.model.ts | 4 +++- .../core/auth/models/normalized-auth-status.model.ts | 1 - src/app/core/browse/browse.service.ts | 10 ++++++---- .../models/items/normalized-relationship-type.model.ts | 1 - .../models/items/normalized-relationship.model.ts | 7 +++---- src/app/core/cache/models/normalized-license.model.ts | 1 - .../cache/models/normalized-resource-policy.model.ts | 1 - src/app/core/core.module.ts | 6 ++++-- .../data/browse-entries-response-parsing.service.ts | 10 +++------- .../core/data/browse-response-parsing.service.spec.ts | 3 --- .../core/metadata/normalized-metadata-field.model.ts | 3 ++- .../core/metadata/normalized-metadata-schema.model.ts | 4 ++-- src/app/core/shared/browse-definition.model.ts | 2 ++ src/app/core/shared/normalized-browse-entry.model.ts | 4 ++-- .../submission-form-collection.component.spec.ts | 3 +-- 16 files changed, 29 insertions(+), 33 deletions(-) diff --git a/src/app/+item-page/simple/item-types/shared/item.component.spec.ts b/src/app/+item-page/simple/item-types/shared/item.component.spec.ts index 8e1025a091..2901d24b2c 100644 --- a/src/app/+item-page/simple/item-types/shared/item.component.spec.ts +++ b/src/app/+item-page/simple/item-types/shared/item.component.spec.ts @@ -342,7 +342,7 @@ describe('ItemComponent', () => { id: '123', leftItem: createSuccessfulRemoteDataObject$(mockItem), rightItem: createSuccessfulRemoteDataObject$(relatedItem), - relationshipType: createSuccessfulRemoteDataObject$new RelationshipType()) + relationshipType: createSuccessfulRemoteDataObject$(new RelationshipType()) }) ])); mockItem.metadata[metadataField] = [ diff --git a/src/app/+search-page/normalized-search-result.model.ts b/src/app/+search-page/normalized-search-result.model.ts index 32f3217b54..abb5f21250 100644 --- a/src/app/+search-page/normalized-search-result.model.ts +++ b/src/app/+search-page/normalized-search-result.model.ts @@ -1,10 +1,12 @@ -import { autoserialize, autoserializeAs } from 'cerialize'; +import { autoserialize, inheritSerialization } from 'cerialize'; import { MetadataMap } from '../core/shared/metadata.models'; import { ListableObject } from '../shared/object-collection/shared/listable-object.model'; +import { NormalizedObject } from '../core/cache/models/normalized-object.model'; /** * Represents a normalized version of a search result object of a certain DSpaceObject */ +@inheritSerialization(NormalizedObject) export class NormalizedSearchResult implements ListableObject { /** * The UUID of the DSpaceObject that was found diff --git a/src/app/core/auth/models/normalized-auth-status.model.ts b/src/app/core/auth/models/normalized-auth-status.model.ts index da0b32fcfb..3892bee408 100644 --- a/src/app/core/auth/models/normalized-auth-status.model.ts +++ b/src/app/core/auth/models/normalized-auth-status.model.ts @@ -1,7 +1,6 @@ import { AuthStatus } from './auth-status.model'; import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; -import { ResourceType } from '../../shared/resource-type'; import { NormalizedObject } from '../../cache/models/normalized-object.model'; import { IDToUUIDSerializer } from '../../cache/id-to-uuid-serializer'; import { EPerson } from '../../eperson/models/eperson.model'; diff --git a/src/app/core/browse/browse.service.ts b/src/app/core/browse/browse.service.ts index bf368e37ce..eb494d7bdb 100644 --- a/src/app/core/browse/browse.service.ts +++ b/src/app/core/browse/browse.service.ts @@ -1,8 +1,9 @@ import { Injectable } from '@angular/core'; import { Observable, of as observableOf } from 'rxjs'; -import { distinctUntilChanged, map, startWith, take } from 'rxjs/operators'; +import { distinctUntilChanged, map, startWith } from 'rxjs/operators'; import { - ensureArrayHasValue, hasValue, + ensureArrayHasValue, + hasValue, hasValueOperator, isEmpty, isNotEmpty, @@ -23,7 +24,9 @@ import { BrowseEntry } from '../shared/browse-entry.model'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { configureRequest, - filterSuccessfulResponses, getBrowseDefinitionLinks, getFirstOccurrence, + filterSuccessfulResponses, + getBrowseDefinitionLinks, + getFirstOccurrence, getRemoteDataPayload, getRequestFromRequestHref } from '../shared/operators'; @@ -32,7 +35,6 @@ import { Item } from '../shared/item.model'; import { DSpaceObject } from '../shared/dspace-object.model'; import { BrowseEntrySearchOptions } from './browse-entry-search-options.model'; import { GenericSuccessResponse } from '../cache/response.models'; -import { RequestEntry } from '../data/request.reducer'; /** * The service handling all browse requests diff --git a/src/app/core/cache/models/items/normalized-relationship-type.model.ts b/src/app/core/cache/models/items/normalized-relationship-type.model.ts index f0f75a03c2..800b27cd7e 100644 --- a/src/app/core/cache/models/items/normalized-relationship-type.model.ts +++ b/src/app/core/cache/models/items/normalized-relationship-type.model.ts @@ -5,7 +5,6 @@ import { mapsTo, relationship } from '../../builders/build-decorators'; import { NormalizedDSpaceObject } from '../normalized-dspace-object.model'; import { NormalizedObject } from '../normalized-object.model'; import { IDToUUIDSerializer } from '../../id-to-uuid-serializer'; -import { NormalizedItemType } from './normalized-item-type.model'; import { ItemType } from '../../../shared/item-relationships/item-type.model'; /** diff --git a/src/app/core/cache/models/items/normalized-relationship.model.ts b/src/app/core/cache/models/items/normalized-relationship.model.ts index d9322581c3..0930134b18 100644 --- a/src/app/core/cache/models/items/normalized-relationship.model.ts +++ b/src/app/core/cache/models/items/normalized-relationship.model.ts @@ -1,11 +1,10 @@ import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize'; import { Relationship } from '../../../shared/item-relationships/relationship.model'; -import { ResourceType } from '../../../shared/resource-type'; import { mapsTo, relationship } from '../../builders/build-decorators'; import { NormalizedObject } from '../normalized-object.model'; import { IDToUUIDSerializer } from '../../id-to-uuid-serializer'; -import { NormalizedRelationshipType } from './normalized-relationship-type.model'; import { RelationshipType } from '../../../shared/item-relationships/relationship-type.model'; +import { Item } from '../../../shared/item.model'; /** * Normalized model class for a DSpace Relationship @@ -24,14 +23,14 @@ export class NormalizedRelationship extends NormalizedObject { * The item to the left of this relationship */ @autoserialize - @relationship(ResourceType.Item, false) + @relationship(Item, false) leftItem: string; /** * The item to the right of this relationship */ @autoserialize - @relationship(ResourceType.Item, false) + @relationship(Item, false) rightItem: string; /** diff --git a/src/app/core/cache/models/normalized-license.model.ts b/src/app/core/cache/models/normalized-license.model.ts index c86d43b961..02bd1808c8 100644 --- a/src/app/core/cache/models/normalized-license.model.ts +++ b/src/app/core/cache/models/normalized-license.model.ts @@ -2,7 +2,6 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { mapsTo } from '../builders/build-decorators'; import { NormalizedDSpaceObject } from './normalized-dspace-object.model'; import { License } from '../../shared/license.model'; -import { ResourceType } from '../../shared/resource-type'; /** * Normalized model class for a Collection License diff --git a/src/app/core/cache/models/normalized-resource-policy.model.ts b/src/app/core/cache/models/normalized-resource-policy.model.ts index 9a9841fe97..cd25a0af05 100644 --- a/src/app/core/cache/models/normalized-resource-policy.model.ts +++ b/src/app/core/cache/models/normalized-resource-policy.model.ts @@ -5,7 +5,6 @@ import { mapsTo } from '../builders/build-decorators'; import { NormalizedObject } from './normalized-object.model'; import { IDToUUIDSerializer } from '../id-to-uuid-serializer'; import { ActionType } from './action-type.model'; -import { ResourceType } from '../../shared/resource-type'; /** * Normalized model class for a Resource Policy diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 8d0fcc2910..b9ba9f5576 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -100,7 +100,6 @@ import { NormalizedSubmissionFormsModel } from './config/models/normalized-confi import { NormalizedSubmissionSectionModel } from './config/models/normalized-config-submission-section.model'; import { NormalizedAuthStatus } from './auth/models/normalized-auth-status.model'; import { NormalizedAuthorityValue } from './integration/models/normalized-authority-value.model'; -import { BrowseEntry } from './shared/browse-entry.model'; import { RoleService } from './roles/role.service'; import { MyDSpaceGuard } from '../+my-dspace-page/my-dspace.guard'; import { MyDSpaceResponseParsingService } from './data/mydspace-response-parsing.service'; @@ -115,6 +114,8 @@ import { NormalizedRelationshipType } from './cache/models/items/normalized-rela import { NormalizedItemType } from './cache/models/items/normalized-item-type.model'; import { MetadatafieldParsingService } from './data/metadatafield-parsing.service'; import { NormalizedSubmissionUploadsModel } from './config/models/normalized-config-submission-uploads.model'; +import { NormalizedBrowseEntry } from './shared/normalized-browse-entry.model'; +import { BrowseDefinition } from './shared/browse-definition.model'; const IMPORTS = [ CommonModule, @@ -237,7 +238,8 @@ export const normalizedModels = NormalizedSubmissionUploadsModel, NormalizedAuthStatus, NormalizedAuthorityValue, - BrowseEntry, + NormalizedBrowseEntry, + BrowseDefinition, NormalizedClaimedTask, NormalizedTaskObject, NormalizedPoolTask, diff --git a/src/app/core/data/browse-entries-response-parsing.service.ts b/src/app/core/data/browse-entries-response-parsing.service.ts index 5e6a9acaca..a2f5f21312 100644 --- a/src/app/core/data/browse-entries-response-parsing.service.ts +++ b/src/app/core/data/browse-entries-response-parsing.service.ts @@ -3,17 +3,13 @@ import { GLOBAL_CONFIG } from '../../../config'; import { GlobalConfig } from '../../../config/global-config.interface'; import { isNotEmpty } from '../../shared/empty.util'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { - ErrorResponse, - GenericSuccessResponse, - RestResponse -} from '../cache/response.models'; +import { ErrorResponse, GenericSuccessResponse, RestResponse } from '../cache/response.models'; import { DSpaceRESTV2Response } from '../dspace-rest-v2/dspace-rest-v2-response.model'; import { DSpaceRESTv2Serializer } from '../dspace-rest-v2/dspace-rest-v2.serializer'; -import { BrowseEntry } from '../shared/browse-entry.model'; import { BaseResponseParsingService } from './base-response-parsing.service'; import { ResponseParsingService } from './parsing.service'; import { RestRequest } from './request.models'; +import { NormalizedBrowseEntry } from '../shared/normalized-browse-entry.model'; @Injectable() export class BrowseEntriesResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { @@ -30,7 +26,7 @@ export class BrowseEntriesResponseParsingService extends BaseResponseParsingServ if (isNotEmpty(data.payload)) { let browseEntries = []; if (isNotEmpty(data.payload._embedded) && Array.isArray(data.payload._embedded[Object.keys(data.payload._embedded)[0]])) { - const serializer = new DSpaceRESTv2Serializer(BrowseEntry); + const serializer = new DSpaceRESTv2Serializer(NormalizedBrowseEntry); browseEntries = serializer.deserializeArray(data.payload._embedded[Object.keys(data.payload._embedded)[0]]); } return new GenericSuccessResponse(browseEntries, data.statusCode, data.statusText, this.processPageInfo(data.payload)); diff --git a/src/app/core/data/browse-response-parsing.service.spec.ts b/src/app/core/data/browse-response-parsing.service.spec.ts index c1b0566e0b..8d0fe7cd41 100644 --- a/src/app/core/data/browse-response-parsing.service.spec.ts +++ b/src/app/core/data/browse-response-parsing.service.spec.ts @@ -113,7 +113,6 @@ describe('BrowseResponseParsingService', () => { } ], defaultSortOrder: 'ASC', - type: 'browse', metadataKeys: [ 'dc.date.issued' ], @@ -139,7 +138,6 @@ describe('BrowseResponseParsingService', () => { } ], defaultSortOrder: 'ASC', - type: 'browse', metadataKeys: [ 'dc.contributor.*', 'dc.creator' @@ -173,6 +171,5 @@ describe('BrowseResponseParsingService', () => { const response = service.parse(validRequest, validResponse); expect((response as GenericSuccessResponse).payload).toEqual(definitions); }); - }); }); diff --git a/src/app/core/metadata/normalized-metadata-field.model.ts b/src/app/core/metadata/normalized-metadata-field.model.ts index a844f7a394..c6b2ee32f8 100644 --- a/src/app/core/metadata/normalized-metadata-field.model.ts +++ b/src/app/core/metadata/normalized-metadata-field.model.ts @@ -1,4 +1,4 @@ -import { autoserialize, deserialize } from 'cerialize'; +import { autoserialize, deserialize, inheritSerialization } from 'cerialize'; import { mapsTo, relationship } from '../cache/builders/build-decorators'; import { MetadataField } from './metadata-field.model'; import { NormalizedObject } from '../cache/models/normalized-object.model'; @@ -9,6 +9,7 @@ import { MetadataSchema } from './metadata-schema.model'; * Class the represents a normalized metadata field */ @mapsTo(MetadataField) +@inheritSerialization(NormalizedObject) export class NormalizedMetadataField extends NormalizedObject implements ListableObject { /** diff --git a/src/app/core/metadata/normalized-metadata-schema.model.ts b/src/app/core/metadata/normalized-metadata-schema.model.ts index 8d15ef2431..47c7233d81 100644 --- a/src/app/core/metadata/normalized-metadata-schema.model.ts +++ b/src/app/core/metadata/normalized-metadata-schema.model.ts @@ -1,14 +1,14 @@ -import { autoserialize } from 'cerialize'; +import { autoserialize, inheritSerialization } from 'cerialize'; import { NormalizedObject } from '../cache/models/normalized-object.model'; import { mapsTo } from '../cache/builders/build-decorators'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; -import { ResourceType } from '../shared/resource-type'; import { MetadataSchema } from './metadata-schema.model'; /** * Normalized class for a DSpace MetadataSchema */ @mapsTo(MetadataSchema) +@inheritSerialization(NormalizedObject) export class NormalizedMetadataSchema extends NormalizedObject implements ListableObject { /** * The unique identifier for this schema diff --git a/src/app/core/shared/browse-definition.model.ts b/src/app/core/shared/browse-definition.model.ts index fda6ebd3c1..9fafe7e321 100644 --- a/src/app/core/shared/browse-definition.model.ts +++ b/src/app/core/shared/browse-definition.model.ts @@ -4,6 +4,8 @@ import { ResourceType } from './resource-type'; import { TypedObject } from '../cache/object-cache.reducer'; export class BrowseDefinition implements TypedObject { + static type = new ResourceType('browse'); + @autoserialize id: string; diff --git a/src/app/core/shared/normalized-browse-entry.model.ts b/src/app/core/shared/normalized-browse-entry.model.ts index 88e3842ce9..949758cb67 100644 --- a/src/app/core/shared/normalized-browse-entry.model.ts +++ b/src/app/core/shared/normalized-browse-entry.model.ts @@ -1,5 +1,4 @@ -import { autoserialize, autoserializeAs } from 'cerialize'; -import { ResourceType } from './resource-type'; +import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize'; import { BrowseEntry } from './browse-entry.model'; import { NormalizedObject } from '../cache/models/normalized-object.model'; import { mapsTo } from '../cache/builders/build-decorators'; @@ -9,6 +8,7 @@ import { mapsTo } from '../cache/builders/build-decorators'; * This class is not normalized because browse entries do not have self links */ @mapsTo(BrowseEntry) +@inheritSerialization(NormalizedObject) export class NormalizedBrowseEntry extends NormalizedObject { /** * The authority string of this browse entry diff --git a/src/app/submission/form/collection/submission-form-collection.component.spec.ts b/src/app/submission/form/collection/submission-form-collection.component.spec.ts index dff503ff5a..93f185af10 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.spec.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.spec.ts @@ -27,17 +27,16 @@ import { SubmissionJsonPatchOperationsService } from '../../../core/submission/s import { SubmissionJsonPatchOperationsServiceStub } from '../../../shared/testing/submission-json-patch-operations-service-stub'; import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; -import { Community } from '../../../core/shared/community.model'; import { PaginatedList } from '../../../core/data/paginated-list'; import { PageInfo } from '../../../core/shared/page-info.model'; import { Collection } from '../../../core/shared/collection.model'; import { - createSuccessfulRemoteDataObject$, createTestComponent } from '../../../shared/testing/utils'; import { cold } from 'jasmine-marbles'; import { SearchResult } from '../../../+search-page/search-result.model'; import { SearchService } from '../../../+search-page/search-service/search.service'; +import { RemoteData } from '../../../core/data/remote-data'; const mockCommunity1Collection1 = Object.assign(new Collection(), { name: 'Community 1-Collection 1', From ac5c7d5230e501a7ed467a927f0b0f77abc37b98 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Wed, 24 Jul 2019 17:17:02 +0200 Subject: [PATCH 25/38] 63934: Edit item search.resourceid query by default --- .../modal-wrappers/dso-selector-modal-wrapper.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html b/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html index 88f4a6f917..1181e097eb 100644 --- a/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html +++ b/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html @@ -5,6 +5,6 @@
- \ No newline at end of file + From b0cf35e4223920c611b2e683a9279fdd74bf995d Mon Sep 17 00:00:00 2001 From: Lotte Hofstede Date: Thu, 25 Jul 2019 11:55:55 +0200 Subject: [PATCH 26/38] added missing typedoc --- .../search-configuration.service.ts | 2 +- .../core/cache/builders/build-decorators.ts | 19 +++++++++++++++++++ .../config-submission-definition.model.ts | 3 +++ src/app/core/shared/resource-type.ts | 3 +++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/app/+search-page/search-service/search-configuration.service.ts b/src/app/+search-page/search-service/search-configuration.service.ts index 5520b2c5aa..e55363f1f5 100644 --- a/src/app/+search-page/search-service/search-configuration.service.ts +++ b/src/app/+search-page/search-service/search-configuration.service.ts @@ -276,7 +276,7 @@ export class SearchConfigurationService implements OnDestroy { } /** - * Make sure to unsubscribe from all existing subscription to prevent memory leaksNormalizedRelationship + * Make sure to unsubscribe from all existing subscription to prevent memory leaks */ ngOnDestroy(): void { this.subs.forEach((sub) => { diff --git a/src/app/core/cache/builders/build-decorators.ts b/src/app/core/cache/builders/build-decorators.ts index f6651f2607..070f63be86 100644 --- a/src/app/core/cache/builders/build-decorators.ts +++ b/src/app/core/cache/builders/build-decorators.ts @@ -10,6 +10,11 @@ const relationshipKey = Symbol('relationship'); const relationshipMap = new Map(); const typeMap = new Map(); +/** + * Decorator function to map a normalized class to it's not-normalized counter part class + * It will also maps a type to the matching class + * @param value The not-normalized class to map to + */ export function mapsTo(value: GenericConstructor) { return function decorator(objectConstructor: GenericConstructor) { Reflect.defineMetadata(mapsToMetadataKey, value, objectConstructor); @@ -17,6 +22,12 @@ export function mapsTo(value: GenericConstructor) { } } + +/** + * Maps a type to the matching class + * @param value The resourse type + * @param objectConstructor The class to map to + */ function mapsToType(value: ResourceType, objectConstructor: GenericConstructor) { if (!objectConstructor || !value) { return; @@ -24,10 +35,18 @@ function mapsToType(value: ResourceType, objectConstructor: GenericConstructor Date: Thu, 25 Jul 2019 13:18:15 +0200 Subject: [PATCH 27/38] fixed lint issue --- src/app/core/cache/builders/build-decorators.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/core/cache/builders/build-decorators.ts b/src/app/core/cache/builders/build-decorators.ts index 070f63be86..0bfb5f0321 100644 --- a/src/app/core/cache/builders/build-decorators.ts +++ b/src/app/core/cache/builders/build-decorators.ts @@ -22,7 +22,6 @@ export function mapsTo(value: GenericConstructor) { } } - /** * Maps a type to the matching class * @param value The resourse type From 64a60f561e88c3f120eea8ed81f1db9851d21331 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Fri, 26 Jul 2019 11:09:06 +0200 Subject: [PATCH 28/38] flatten i18n files --- resources/i18n/cs.json | 422 ++++------ resources/i18n/de.json | 422 ++++------ resources/i18n/en.json | 1773 +++++++++++++++------------------------- resources/i18n/nl.json | 422 ++++------ 4 files changed, 1100 insertions(+), 1939 deletions(-) diff --git a/resources/i18n/cs.json b/resources/i18n/cs.json index 1fdd02401b..d658030b6b 100644 --- a/resources/i18n/cs.json +++ b/resources/i18n/cs.json @@ -1,277 +1,149 @@ { - "footer": { - "copyright": "copyright © 2002-{{ year }}", - "link.dspace": "software DSpace", - "link.duraspace": "DuraSpace" - }, - "collection": { - "page": { - "news": "Novinky", - "license": "Licence", - "browse": { - "recent": { - "head": "Poslední příspěvky" - } - } - } - }, - "community": { - "page": { - "news": "Novinky", - "license": "Licence" - }, - "sub-collection-list": { - "head": "Kolekce v této komunitě" - } - }, - "item": { - "page": { - "author": "Autor", - "abstract": "Abstract", - "date": "Datum", - "uri": "URI", - "files": "Soubory", - "collections": "Kolekce", - "filesection": { - "download": "Stáhnout", - "name": "Název:", - "format": "Formát:", - "size": "Velikost:", - "description": "Popis:" - }, - "link": { - "simple": "Minimální záznam", - "full": "Úplný záznam" - } - } - }, - "nav": { - "home": "Domů", - "login": "Přihlásit se", - "logout": "Odhlásit se" - }, - "pagination": { - "results-per-page": "Výsledků na stránku", - "sort-direction": "Seřazení", - "showing": { - "label": "Zobrazují se záznamy ", - "detail": "{{ range }} z {{ total }}" - } - }, - "sorting": { - "score": { - "DESC": "Relevance" - }, - "dc.title": { - "ASC": "Název vzestupně", - "DESC": "Název sestupně" - } - }, - "title": "DSpace", - "404": { - "help": "Nepodařilo se najít stránku, kterou hledáte. Je možné, že stránka byla přesunuta nebo smazána. Pomocí tlačítka níže můžete přejít na domovskou stránku. ", - "page-not-found": "stránka nenalezena", - "link": { - "home-page": "Přejít na domovskou stránku" - } - }, - "home": { - "title": "DSpace Angular :: Domů", - "description": "", - "top-level-communities": { - "head": "Komunity v DSpace", - "help": "Vybráním komunity můžete prohlížet její kolekce." - } - }, - "search": { - "title": "DSpace Angular :: Hledat", - "description": "", - "form": { - "search": "Hledat", - "search_dspace": "Hledat v DSpace" - }, - "results": { - "head": "Výsledky hledání", - "no-results": "Nebyli nalezeny žádné výsledky" - }, - "sidebar": { - "close": "Zpět na výsledky", - "open": "Vyhledávací nástroje", - "results": "výsledky", - "filters": { - "title": "Filtry" - }, - "settings": { - "title": "Nastavení", - "sort-by": "Řadit dle", - "rpp": "Výsledků na stránku" - } - }, - "view-switch": { - "show-list": "Zobrazit seznam", - "show-grid": "Zobrazit mřížku" - }, - "filters": { - "head": "Filtry", - "reset": "Obnovit filtry", - "applied": { - "f.author": "Autor", - "f.dateIssued.min": "Od data", - "f.dateIssued.max": "Do data", - "f.subject": "Předmět", - "f.has_content_in_original_bundle": "Má soubory" - }, - "filter": { - "show-more": "Zobrazit více", - "show-less": "Sbalit", - "author": { - "placeholder": "Jméno autora", - "head": "Autor" - }, - "scope": { - "placeholder": "Filtr rozsahu", - "head": "Rozsah" - }, - "subject": { - "placeholder": "Předmět", - "head": "Předmět" - }, - "dateIssued": { - "max": { - "placeholder": "Datum od" - }, - "min": { - "placeholder": "Datum do" - }, - "head": "Datum" - }, - "has_content_in_original_bundle": { - "head": "Má soubory" - } - } - } - }, - "browse": { - "title": "Prohlížíte {{ collection }} dle {{ field }} {{ value }}" - }, - "admin": { - "registries": { - "metadata": { - "title": "DSpace Angular :: Registr metadat", - "head": "Registr metadat", - "description": "Registr metadat je seznam všech metadatových polí dostupných v repozitáři. Tyto pole mohou být rozdělena do více schémat. DSpace však vyžaduje použití schématu kvalifikový Dublin Core.", - "schemas": { - "table": { - "id": "ID", - "namespace": "Jmenný prostor", - "name": "Název" - }, - "no-items": "Žádná schémata metadat." - } - }, - "schema": { - "title": "DSpace Angular :: Registr schémat metadat", - "head": "Metadata Schema", - "description": "Toto je schéma metadat pro „{{namespace}}“.", - "fields": { - "head": "Pole schématu metadat", - "table": { - "field": "Pole", - "scopenote": "Poznámka o rozsahu" - }, - "no-items": "Žádná metadatová pole." - } - }, - "bitstream-formats": { - "title": "DSpace Angular :: Registr formátů souborů", - "head": "Registr formátů souborů", - "description": "Tento seznam formátů souborů poskytuje informace o známých formátech a o úrovni jejich podpory.", - "formats": { - "table": { - "name": "Název", - "mimetype": "Typ MIME", - "supportLevel": { - "head": "Úroveň podpory", - "0": "Neznámá", - "1": "Známá", - "2": "Podpora" - }, - "internal": "interní" - }, - "no-items": "Žádné formáty souborů." - } - } - } - }, - "loading": { - "default": "Načítá se...", - "top-level-communities": "Načítají se komunity nejvyšší úrovně...", - "community": "Načítá se komunita...", - "collection": "Načítá se kolekce...", - "sub-collections": "Načítají se subkolekce...", - "recent-submissions": "Načítají se poslední příspěvky...", - "item": "Načítá se záznam...", - "objects": "Načítá se...", - "search-results": "Načítají se výsledky hledání...", - "browse-by": "Načítají se záznamy..." - }, - "error": { - "default": "Chyba", - "top-level-communities": "Chyba během stahování komunit nejvyšší úrovně", - "community": "Chyba během stahování komunity", - "collection": "Chyba během stahování kolekce", - "sub-collections": "Chyba během stahování subkolekcí", - "recent-submissions": "Chyba během stahování posledních příspěvků", - "item": "Chyba během stahování záznamu", - "objects": "Chyba během stahování objektů", - "search-results": "Chyba během stahování výsledků hledání", - "browse-by": "Chyba během stahování záznamů", - "validation": { - "pattern": "Tento vstup je omezen dle vzoru: {{ pattern }}.", - "license": { - "notgranted": "Pro dokončení zaslání Musíte udělit licenci. Pokud v tuto chvíli tuto licenci nemůžete udělit, můžete svou práci uložit a později se k svému příspěveku vrátit nebo jej smazat." - } - } - }, - "form": { - "submit": "Odeslat", - "cancel": "Zrušit", - "search": "Hledat", - "remove": "Smazat", - "first-name": "Křestní jméno", - "last-name": "Příjmení", - "loading": "Načítá se...", - "no-results": "Nebyli nalezeny žádné výsledky", - "no-value": "Nebyla zadána hodnota", - "group-collapse": "Sbalit", - "group-expand": "Rozbalit", - "group-collapse-help": "Kliknutím sem sbalíte", - "group-expand-help": "Kliknutím sem rozbalíte a přidáte další prvky" - }, - "login": { - "title": "Přihlásit se", - "form": { - "header": "Prosím, přihlaste se do DSpace", - "email": "E-mailová adresa", - "forgot-password": "Zapomněli jste své heslo?", - "new-user": "Nový uživatel? Zaregistrujte se kliknutím sem.", - "password": "Heslo", - "submit": "Přihlásit se" - } - }, - "logout": { - "title": "Odhlásit se", - "form": { - "header": "Odhlásit se z DSpace", - "submit": "Odhlásit se" - } - }, - "auth": { - "messages": { - "expired": "Vaše relace vypršela. Prosím, znova se přihlaste." - }, - "errors": { - "invalid-user": "Neplatná e-mailová adresa nebo heslo." - } - } + "404.help": "Nepodařilo se najít stránku, kterou hledáte. Je možné, že stránka byla přesunuta nebo smazána. Pomocí tlačítka níže můžete přejít na domovskou stránku. ", + "404.link.home-page": "Přejít na domovskou stránku", + "404.page-not-found": "stránka nenalezena", + "admin.registries.bitstream-formats.description": "Tento seznam formátů souborů poskytuje informace o známých formátech a o úrovni jejich podpory.", + "admin.registries.bitstream-formats.formats.no-items": "Žádné formáty souborů.", + "admin.registries.bitstream-formats.formats.table.internal": "interní", + "admin.registries.bitstream-formats.formats.table.mimetype": "Typ MIME", + "admin.registries.bitstream-formats.formats.table.name": "Název", + "admin.registries.bitstream-formats.formats.table.supportLevel.0": "Neznámá", + "admin.registries.bitstream-formats.formats.table.supportLevel.1": "Známá", + "admin.registries.bitstream-formats.formats.table.supportLevel.2": "Podpora", + "admin.registries.bitstream-formats.formats.table.supportLevel.head": "Úroveň podpory", + "admin.registries.bitstream-formats.head": "Registr formátů souborů", + "admin.registries.bitstream-formats.title": "DSpace Angular :: Registr formátů souborů", + "admin.registries.metadata.description": "Registr metadat je seznam všech metadatových polí dostupných v repozitáři. Tyto pole mohou být rozdělena do více schémat. DSpace však vyžaduje použití schématu kvalifikový Dublin Core.", + "admin.registries.metadata.head": "Registr metadat", + "admin.registries.metadata.schemas.no-items": "Žádná schémata metadat.", + "admin.registries.metadata.schemas.table.id": "ID", + "admin.registries.metadata.schemas.table.name": "Název", + "admin.registries.metadata.schemas.table.namespace": "Jmenný prostor", + "admin.registries.metadata.title": "DSpace Angular :: Registr metadat", + "admin.registries.schema.description": "Toto je schéma metadat pro „{{namespace}}“.", + "admin.registries.schema.fields.head": "Pole schématu metadat", + "admin.registries.schema.fields.no-items": "Žádná metadatová pole.", + "admin.registries.schema.fields.table.field": "Pole", + "admin.registries.schema.fields.table.scopenote": "Poznámka o rozsahu", + "admin.registries.schema.head": "Metadata Schema", + "admin.registries.schema.title": "DSpace Angular :: Registr schémat metadat", + "auth.errors.invalid-user": "Neplatná e-mailová adresa nebo heslo.", + "auth.messages.expired": "Vaše relace vypršela. Prosím, znova se přihlaste.", + "browse.title": "Prohlížíte {{ collection }} dle {{ field }} {{ value }}", + "collection.page.browse.recent.head": "Poslední příspěvky", + "collection.page.license": "Licence", + "collection.page.news": "Novinky", + "community.page.license": "Licence", + "community.page.news": "Novinky", + "community.sub-collection-list.head": "Kolekce v této komunitě", + "error.browse-by": "Chyba během stahování záznamů", + "error.collection": "Chyba během stahování kolekce", + "error.community": "Chyba během stahování komunity", + "error.default": "Chyba", + "error.item": "Chyba během stahování záznamu", + "error.objects": "Chyba během stahování objektů", + "error.recent-submissions": "Chyba během stahování posledních příspěvků", + "error.search-results": "Chyba během stahování výsledků hledání", + "error.sub-collections": "Chyba během stahování subkolekcí", + "error.top-level-communities": "Chyba během stahování komunit nejvyšší úrovně", + "error.validation.license.notgranted": "Pro dokončení zaslání Musíte udělit licenci. Pokud v tuto chvíli tuto licenci nemůžete udělit, můžete svou práci uložit a později se k svému příspěveku vrátit nebo jej smazat.", + "error.validation.pattern": "Tento vstup je omezen dle vzoru: {{ pattern }}.", + "footer.copyright": "copyright © 2002-{{ year }}", + "footer.link.dspace": "software DSpace", + "footer.link.duraspace": "DuraSpace", + "form.cancel": "Zrušit", + "form.first-name": "Křestní jméno", + "form.group-collapse": "Sbalit", + "form.group-collapse-help": "Kliknutím sem sbalíte", + "form.group-expand": "Rozbalit", + "form.group-expand-help": "Kliknutím sem rozbalíte a přidáte další prvky", + "form.last-name": "Příjmení", + "form.loading": "Načítá se...", + "form.no-results": "Nebyli nalezeny žádné výsledky", + "form.no-value": "Nebyla zadána hodnota", + "form.remove": "Smazat", + "form.search": "Hledat", + "form.submit": "Odeslat", + "home.description": "", + "home.title": "DSpace Angular :: Domů", + "home.top-level-communities.head": "Komunity v DSpace", + "home.top-level-communities.help": "Vybráním komunity můžete prohlížet její kolekce.", + "item.page.abstract": "Abstract", + "item.page.author": "Autor", + "item.page.collections": "Kolekce", + "item.page.date": "Datum", + "item.page.files": "Soubory", + "item.page.filesection.description": "Popis:", + "item.page.filesection.download": "Stáhnout", + "item.page.filesection.format": "Formát:", + "item.page.filesection.name": "Název:", + "item.page.filesection.size": "Velikost:", + "item.page.link.full": "Úplný záznam", + "item.page.link.simple": "Minimální záznam", + "item.page.uri": "URI", + "loading.browse-by": "Načítají se záznamy...", + "loading.collection": "Načítá se kolekce...", + "loading.community": "Načítá se komunita...", + "loading.default": "Načítá se...", + "loading.item": "Načítá se záznam...", + "loading.objects": "Načítá se...", + "loading.recent-submissions": "Načítají se poslední příspěvky...", + "loading.search-results": "Načítají se výsledky hledání...", + "loading.sub-collections": "Načítají se subkolekce...", + "loading.top-level-communities": "Načítají se komunity nejvyšší úrovně...", + "login.form.email": "E-mailová adresa", + "login.form.forgot-password": "Zapomněli jste své heslo?", + "login.form.header": "Prosím, přihlaste se do DSpace", + "login.form.new-user": "Nový uživatel? Zaregistrujte se kliknutím sem.", + "login.form.password": "Heslo", + "login.form.submit": "Přihlásit se", + "login.title": "Přihlásit se", + "logout.form.header": "Odhlásit se z DSpace", + "logout.form.submit": "Odhlásit se", + "logout.title": "Odhlásit se", + "nav.home": "Domů", + "nav.login": "Přihlásit se", + "nav.logout": "Odhlásit se", + "pagination.results-per-page": "Výsledků na stránku", + "pagination.showing.detail": "{{ range }} z {{ total }}", + "pagination.showing.label": "Zobrazují se záznamy ", + "pagination.sort-direction": "Seřazení", + "search.description": "", + "search.filters.applied.f.author": "Autor", + "search.filters.applied.f.dateIssued.max": "Do data", + "search.filters.applied.f.dateIssued.min": "Od data", + "search.filters.applied.f.has_content_in_original_bundle": "Má soubory", + "search.filters.applied.f.subject": "Předmět", + "search.filters.filter.author.head": "Autor", + "search.filters.filter.author.placeholder": "Jméno autora", + "search.filters.filter.dateIssued.head": "Datum", + "search.filters.filter.dateIssued.max.placeholder": "Datum od", + "search.filters.filter.dateIssued.min.placeholder": "Datum do", + "search.filters.filter.has_content_in_original_bundle.head": "Má soubory", + "search.filters.filter.scope.head": "Rozsah", + "search.filters.filter.scope.placeholder": "Filtr rozsahu", + "search.filters.filter.show-less": "Sbalit", + "search.filters.filter.show-more": "Zobrazit více", + "search.filters.filter.subject.head": "Předmět", + "search.filters.filter.subject.placeholder": "Předmět", + "search.filters.head": "Filtry", + "search.filters.reset": "Obnovit filtry", + "search.form.search": "Hledat", + "search.form.search_dspace": "Hledat v DSpace", + "search.results.head": "Výsledky hledání", + "search.results.no-results": "Nebyli nalezeny žádné výsledky", + "search.sidebar.close": "Zpět na výsledky", + "search.sidebar.filters.title": "Filtry", + "search.sidebar.open": "Vyhledávací nástroje", + "search.sidebar.results": "výsledky", + "search.sidebar.settings.rpp": "Výsledků na stránku", + "search.sidebar.settings.sort-by": "Řadit dle", + "search.sidebar.settings.title": "Nastavení", + "search.title": "DSpace Angular :: Hledat", + "search.view-switch.show-grid": "Zobrazit mřížku", + "search.view-switch.show-list": "Zobrazit seznam", + "sorting.dc.title.ASC": "Název vzestupně", + "sorting.dc.title.DESC": "Název sestupně", + "sorting.score.DESC": "Relevance", + "title": "DSpace" } diff --git a/resources/i18n/de.json b/resources/i18n/de.json index d6b02ff533..d184e7d091 100644 --- a/resources/i18n/de.json +++ b/resources/i18n/de.json @@ -1,277 +1,149 @@ { - "footer": { - "copyright": "Copyright © 2002-{{ year }}", - "link.dspace": "DSpace Software", - "link.duraspace": "DuraSpace" - }, - "collection": { - "page": { - "news": "Neuigkeiten", - "license": "Lizenz", - "browse": { - "recent": { - "head": "Aktuellste Veröffentlichungen" - } - } - } - }, - "community": { - "page": { - "news": "Neuigkeiten", - "license": "Lizenz" - }, - "sub-collection-list": { - "head": "Sammlungen in diesem Bereich" - } - }, - "item": { - "page": { - "author": "Autor", - "abstract": "Kurzfassung", - "date": "Datum", - "uri": "URI", - "files": "Dateien", - "collections": "Sammlungen", - "filesection": { - "download": "Herunterladen", - "name": "Name:", - "format": "Format:", - "size": "Größe:", - "description": "Beschreibung:" - }, - "link": { - "simple": "Kurzanzeige", - "full": "Vollanzeige" - } - } - }, - "nav": { - "home": "Zur Startseite", - "login": "Anmelden", - "logout": "Abmelden" - }, - "pagination": { - "results-per-page": "Ergebnisse pro Seite", - "sort-direction": "Sortiermöglichkeiten", - "showing": { - "label": "Anzeige der Treffer ", - "detail": "{{ range }} bis {{ total }}" - } - }, - "sorting": { - "score": { - "DESC": "Relevanz" - }, - "dc.title": { - "ASC": "Titel aufsteigend", - "DESC": "Titel absteigend" - } - }, - "title": "DSpace", - "404": { - "help": "Die Seite, die Sie aufrufen wollten, konnte nicht gefunden werden. Sie könnte verschoben oder gelöscht worden sein. Mit dem Link unten kommen Sie zurück zur Startseite. ", - "page-not-found": "Seite nicht gefunden", - "link": { - "home-page": "Zurück zur Startseite" - } - }, - "home": { - "title": "DSpace Angular :: Startseite", - "description": "", - "top-level-communities": { - "head": "Bereiche in DSpace", - "help": "Wählen Sie einen Bereich, um seine Sammlungen einzusehen." - } - }, - "search": { - "title": "DSpace Angular :: Suche", - "description": "", - "form": { - "search": "Suche", - "search_dspace": "DSpace durchsuchen" - }, - "results": { - "head": "Suchergebnisse", - "no-results": "Zu dieser Suche gibt es keine Treffer." - }, - "sidebar": { - "close": "Zurück zu den Ergebnissen", - "open": "Suchwerkzeuge", - "results": "Ergebnisse", - "filters": { - "title": "Filter" - }, - "settings": { - "title": "Einstellungen", - "sort-by": "Sortiere nach", - "rpp": "Treffer pro Seite" - } - }, - "view-switch": { - "show-list": "Zeige als Liste", - "show-grid": "Zeige als Raster" - }, - "filters": { - "head": "Filter", - "reset": "Filter zurücksetzen", - "applied": { - "f.author": "Autor", - "f.dateIssued.min": "Anfangsdatum", - "f.dateIssued.max": "Enddatum", - "f.subject": "Thema", - "f.has_content_in_original_bundle": "Besitzt Dateien" - }, - "filter": { - "show-more": "Zeige mehr", - "show-less": "Zeige weniger", - "author": { - "placeholder": "Autor", - "head": "Autor" - }, - "scope": { - "placeholder": "Bereichsfilter", - "head": "Bereich" - }, - "subject": { - "placeholder": "Schlagwort", - "head": "Schlagwort" - }, - "dateIssued": { - "max": { - "placeholder": "Frühestes Datum" - }, - "min": { - "placeholder": "Ältestes Datum" - }, - "head": "Datum" - }, - "has_content_in_original_bundle": { - "head": "Besitzt Dateien" - } - } - } - }, - "browse": { - "title": "Anzeige {{ collection }} nach {{ field }} {{ value }}" - }, - "admin": { - "registries": { - "metadata": { - "title": "DSpace Angular :: Metadatenreferenzliste", - "head": "Metadatenreferenzliste", - "description": "Die Metadatenreferenzliste beinhaltet alle Metadatenfelder, die zur Verfügung stehen. Die Felder können in unterschiedlichen Schemata enthalten sein. Nichtsdestotrotz benötigt DSpace mindestens qualifiziertes Dublin Core.", - "schemas": { - "table": { - "id": "ID", - "namespace": "Namensraum", - "name": "Name" - }, - "no-items": "Es gbit keine Metadatenschemata." - } - }, - "schema": { - "title": "DSpace Angular :: Referenzliste der Metadatenschemata", - "head": "Metadatenschemata", - "description": "Dies ist das Metadatenschema für \"{{namespace}}\".", - "fields": { - "head": "Felder in diesem Schema", - "table": { - "field": "Feld", - "scopenote": "Gültigkeitsbereich" - }, - "no-items": "Es gibt keine Felder in diesem Schema." - } - }, - "bitstream-formats": { - "title": "DSpace Angular :: Referenzliste der Dateiformate", - "head": "Referenzliste der Dateiformate", - "description": "Diese Liste enhtält die in diesem Repositorium zulässigen Dateiformate und den jeweiligen Unterstützungsgrad.", - "formats": { - "table": { - "name": "Name", - "mimetype": "MIME Type", - "supportLevel": { - "head": "Unterstützungsgrad", - "0": "Unbekannt", - "1": "Bekannt", - "2": "Unterstützt" - }, - "internal": "intern" - }, - "no-items": "Es gibt keine Formate in dieser Referenzliste." - } - } - } - }, - "loading": { - "default": "Am Laden ...", - "top-level-communities": "Die Hauptbereiche werden geladen ...", - "community": "Der Bereich wird geladen ...", - "collection": "Die Sammlung wird geladen ...", - "sub-collections": "Die untergeordneten Sammlungen werden geladen ...", - "recent-submissions": "Die aktuellsten Veröffentlichungen werden geladen ...", - "item": "Die Ressource wird geladen ...", - "objects": "Am Laden ...", - "search-results": "Die Suchergebnisse werden geladen ...", - "browse-by": "Die Ressourcen werden geladen ..." - }, - "error": { - "default": "Fehler", - "top-level-communities": "Fehler beim Laden der Hauptbereiche.", - "community": "Fehler beim Laden des Bereiches.", - "collection": "Fehler beim Laden der Sammlung.", - "sub-collections": "Fehler beim Laden der untergeordneten Sammlungen.", - "recent-submissions": "Fehler beim Laden der aktuellsten Veröffentlichungen.", - "item": "Fehler beim Laden der Ressource.", - "objects": "Fehler beim Laden der Objekte.", - "search-results": "Fehler beim Laden der Suchergebnisse.", - "browse-by": "Fehler beim Laden der Ressourcen", - "validation": { - "pattern": "Die Eingabe kann nur folgendes Muster haben: {{ pattern }}.", - "license": { - "notgranted": "Sie müssen der Lizenz zustimmen, um die Ressource einzureichen. Wenn dies zur Zeit nicht geht, können Sie die Einreichung speichern und später wiederaufnehmen oder löschen." - } - } - }, - "form": { - "submit": "Los", - "cancel": "Abbrechen", - "search": "Suchen", - "remove": "Löschen", - "first-name": "Vorname", - "last-name": "Nachname", - "loading": "Am Laden ...", - "no-results": "Keine Ergebnisse gefunden", - "no-value": "Kein Wert eingegeben", - "group-collapse": "Weniger", - "group-expand": "Mehr", - "group-collapse-help": "Hier klicken, um die Anzeige zu reduzieren", - "group-expand-help": "Hier klicken, um mehr Elemente anzuzeigen" - }, - "login": { - "title": "Einloggen", - "form": { - "header": "Bitte Loggen Sie sich ein.", - "email": "E-Mail-Adresse", - "forgot-password": "Haben Sie Ihr Passwort vergessen?", - "new-user": "Sind Sie neu hier? Klicken Sie hier, um sich zu registrieren.", - "password": "Passwort", - "submit": "Einloggen" - } - }, - "logout": { - "title": "Ausloggen", - "form": { - "header": "Ausloggen aus DSpace", - "submit": "Ausloggen" - } - }, - "auth": { - "messages": { - "expired": "Ihre Sitzung ist abgelaufen, bitte melden Sie sich erneut an." - }, - "errors": { - "invalid-user": "Ungültige E-Mail-Adresse oder Passwort." - } - } + "404.help": "Die Seite, die Sie aufrufen wollten, konnte nicht gefunden werden. Sie könnte verschoben oder gelöscht worden sein. Mit dem Link unten kommen Sie zurück zur Startseite. ", + "404.link.home-page": "Zurück zur Startseite", + "404.page-not-found": "Seite nicht gefunden", + "admin.registries.bitstream-formats.description": "Diese Liste enhtält die in diesem Repositorium zulässigen Dateiformate und den jeweiligen Unterstützungsgrad.", + "admin.registries.bitstream-formats.formats.no-items": "Es gibt keine Formate in dieser Referenzliste.", + "admin.registries.bitstream-formats.formats.table.internal": "intern", + "admin.registries.bitstream-formats.formats.table.mimetype": "MIME Type", + "admin.registries.bitstream-formats.formats.table.name": "Name", + "admin.registries.bitstream-formats.formats.table.supportLevel.0": "Unbekannt", + "admin.registries.bitstream-formats.formats.table.supportLevel.1": "Bekannt", + "admin.registries.bitstream-formats.formats.table.supportLevel.2": "Unterstützt", + "admin.registries.bitstream-formats.formats.table.supportLevel.head": "Unterstützungsgrad", + "admin.registries.bitstream-formats.head": "Referenzliste der Dateiformate", + "admin.registries.bitstream-formats.title": "DSpace Angular :: Referenzliste der Dateiformate", + "admin.registries.metadata.description": "Die Metadatenreferenzliste beinhaltet alle Metadatenfelder, die zur Verfügung stehen. Die Felder können in unterschiedlichen Schemata enthalten sein. Nichtsdestotrotz benötigt DSpace mindestens qualifiziertes Dublin Core.", + "admin.registries.metadata.head": "Metadatenreferenzliste", + "admin.registries.metadata.schemas.no-items": "Es gbit keine Metadatenschemata.", + "admin.registries.metadata.schemas.table.id": "ID", + "admin.registries.metadata.schemas.table.name": "Name", + "admin.registries.metadata.schemas.table.namespace": "Namensraum", + "admin.registries.metadata.title": "DSpace Angular :: Metadatenreferenzliste", + "admin.registries.schema.description": "Dies ist das Metadatenschema für \"{{namespace}}\".", + "admin.registries.schema.fields.head": "Felder in diesem Schema", + "admin.registries.schema.fields.no-items": "Es gibt keine Felder in diesem Schema.", + "admin.registries.schema.fields.table.field": "Feld", + "admin.registries.schema.fields.table.scopenote": "Gültigkeitsbereich", + "admin.registries.schema.head": "Metadatenschemata", + "admin.registries.schema.title": "DSpace Angular :: Referenzliste der Metadatenschemata", + "auth.errors.invalid-user": "Ungültige E-Mail-Adresse oder Passwort.", + "auth.messages.expired": "Ihre Sitzung ist abgelaufen, bitte melden Sie sich erneut an.", + "browse.title": "Anzeige {{ collection }} nach {{ field }} {{ value }}", + "collection.page.browse.recent.head": "Aktuellste Veröffentlichungen", + "collection.page.license": "Lizenz", + "collection.page.news": "Neuigkeiten", + "community.page.license": "Lizenz", + "community.page.news": "Neuigkeiten", + "community.sub-collection-list.head": "Sammlungen in diesem Bereich", + "error.browse-by": "Fehler beim Laden der Ressourcen", + "error.collection": "Fehler beim Laden der Sammlung.", + "error.community": "Fehler beim Laden des Bereiches.", + "error.default": "Fehler", + "error.item": "Fehler beim Laden der Ressource.", + "error.objects": "Fehler beim Laden der Objekte.", + "error.recent-submissions": "Fehler beim Laden der aktuellsten Veröffentlichungen.", + "error.search-results": "Fehler beim Laden der Suchergebnisse.", + "error.sub-collections": "Fehler beim Laden der untergeordneten Sammlungen.", + "error.top-level-communities": "Fehler beim Laden der Hauptbereiche.", + "error.validation.license.notgranted": "Sie müssen der Lizenz zustimmen, um die Ressource einzureichen. Wenn dies zur Zeit nicht geht, können Sie die Einreichung speichern und später wiederaufnehmen oder löschen.", + "error.validation.pattern": "Die Eingabe kann nur folgendes Muster haben: {{ pattern }}.", + "footer.copyright": "Copyright © 2002-{{ year }}", + "footer.link.dspace": "DSpace Software", + "footer.link.duraspace": "DuraSpace", + "form.cancel": "Abbrechen", + "form.first-name": "Vorname", + "form.group-collapse": "Weniger", + "form.group-collapse-help": "Hier klicken, um die Anzeige zu reduzieren", + "form.group-expand": "Mehr", + "form.group-expand-help": "Hier klicken, um mehr Elemente anzuzeigen", + "form.last-name": "Nachname", + "form.loading": "Am Laden ...", + "form.no-results": "Keine Ergebnisse gefunden", + "form.no-value": "Kein Wert eingegeben", + "form.remove": "Löschen", + "form.search": "Suchen", + "form.submit": "Los", + "home.description": "", + "home.title": "DSpace Angular :: Startseite", + "home.top-level-communities.head": "Bereiche in DSpace", + "home.top-level-communities.help": "Wählen Sie einen Bereich, um seine Sammlungen einzusehen.", + "item.page.abstract": "Kurzfassung", + "item.page.author": "Autor", + "item.page.collections": "Sammlungen", + "item.page.date": "Datum", + "item.page.files": "Dateien", + "item.page.filesection.description": "Beschreibung:", + "item.page.filesection.download": "Herunterladen", + "item.page.filesection.format": "Format:", + "item.page.filesection.name": "Name:", + "item.page.filesection.size": "Größe:", + "item.page.link.full": "Vollanzeige", + "item.page.link.simple": "Kurzanzeige", + "item.page.uri": "URI", + "loading.browse-by": "Die Ressourcen werden geladen ...", + "loading.collection": "Die Sammlung wird geladen ...", + "loading.community": "Der Bereich wird geladen ...", + "loading.default": "Am Laden ...", + "loading.item": "Die Ressource wird geladen ...", + "loading.objects": "Am Laden ...", + "loading.recent-submissions": "Die aktuellsten Veröffentlichungen werden geladen ...", + "loading.search-results": "Die Suchergebnisse werden geladen ...", + "loading.sub-collections": "Die untergeordneten Sammlungen werden geladen ...", + "loading.top-level-communities": "Die Hauptbereiche werden geladen ...", + "login.form.email": "E-Mail-Adresse", + "login.form.forgot-password": "Haben Sie Ihr Passwort vergessen?", + "login.form.header": "Bitte Loggen Sie sich ein.", + "login.form.new-user": "Sind Sie neu hier? Klicken Sie hier, um sich zu registrieren.", + "login.form.password": "Passwort", + "login.form.submit": "Einloggen", + "login.title": "Einloggen", + "logout.form.header": "Ausloggen aus DSpace", + "logout.form.submit": "Ausloggen", + "logout.title": "Ausloggen", + "nav.home": "Zur Startseite", + "nav.login": "Anmelden", + "nav.logout": "Abmelden", + "pagination.results-per-page": "Ergebnisse pro Seite", + "pagination.showing.detail": "{{ range }} bis {{ total }}", + "pagination.showing.label": "Anzeige der Treffer ", + "pagination.sort-direction": "Sortiermöglichkeiten", + "search.description": "", + "search.filters.applied.f.author": "Autor", + "search.filters.applied.f.dateIssued.max": "Enddatum", + "search.filters.applied.f.dateIssued.min": "Anfangsdatum", + "search.filters.applied.f.has_content_in_original_bundle": "Besitzt Dateien", + "search.filters.applied.f.subject": "Thema", + "search.filters.filter.author.head": "Autor", + "search.filters.filter.author.placeholder": "Autor", + "search.filters.filter.dateIssued.head": "Datum", + "search.filters.filter.dateIssued.max.placeholder": "Frühestes Datum", + "search.filters.filter.dateIssued.min.placeholder": "Ältestes Datum", + "search.filters.filter.has_content_in_original_bundle.head": "Besitzt Dateien", + "search.filters.filter.scope.head": "Bereich", + "search.filters.filter.scope.placeholder": "Bereichsfilter", + "search.filters.filter.show-less": "Zeige weniger", + "search.filters.filter.show-more": "Zeige mehr", + "search.filters.filter.subject.head": "Schlagwort", + "search.filters.filter.subject.placeholder": "Schlagwort", + "search.filters.head": "Filter", + "search.filters.reset": "Filter zurücksetzen", + "search.form.search": "Suche", + "search.form.search_dspace": "DSpace durchsuchen", + "search.results.head": "Suchergebnisse", + "search.results.no-results": "Zu dieser Suche gibt es keine Treffer.", + "search.sidebar.close": "Zurück zu den Ergebnissen", + "search.sidebar.filters.title": "Filter", + "search.sidebar.open": "Suchwerkzeuge", + "search.sidebar.results": "Ergebnisse", + "search.sidebar.settings.rpp": "Treffer pro Seite", + "search.sidebar.settings.sort-by": "Sortiere nach", + "search.sidebar.settings.title": "Einstellungen", + "search.title": "DSpace Angular :: Suche", + "search.view-switch.show-grid": "Zeige als Raster", + "search.view-switch.show-list": "Zeige als Liste", + "sorting.dc.title.ASC": "Titel aufsteigend", + "sorting.dc.title.DESC": "Titel absteigend", + "sorting.score.DESC": "Relevanz", + "title": "DSpace" } diff --git a/resources/i18n/en.json b/resources/i18n/en.json index 053c810964..63bc598304 100644 --- a/resources/i18n/en.json +++ b/resources/i18n/en.json @@ -1,1117 +1,662 @@ { - "footer": { - "copyright": "copyright © 2002-{{ year }}", - "link.dspace": "DSpace software", - "link.duraspace": "DuraSpace" - }, - "collection": { - "page": { - "news": "News", - "license": "License", - "browse": { - "recent": { - "head": "Recent Submissions" - } - } - }, - "form": { - "title": "Name", - "description": "Introductory text (HTML)", - "abstract": "Short Description", - "rights": "Copyright text (HTML)", - "tableofcontents": "News (HTML)", - "license": "License", - "provenance": "Provenance", - "errors": { - "title": { - "required": "Please enter a collection name" - } - } - }, - "edit": { - "head": "Edit Collection", - "delete": "Delete this collection" - }, - "create": { - "head": "Create a Collection", - "sub-head": "Create a Collection for Community {{ parent }}" - }, - "delete": { - "head": "Delete Collection", - "text": "Are you sure you want to delete collection \"{{ dso }}\"", - "confirm": "Confirm", - "cancel": "Cancel", - "notification": { - "success": "Successfully deleted collection", - "fail": "Collection could not be deleted" - } - } - }, - "community": { - "page": { - "news": "News", - "license": "License" - }, - "sub-collection-list": { - "head": "Collections of this Community" - }, - "sub-community-list": { - "head": "Communities of this Community" - }, - "form": { - "title": "Name", - "description": "Introductory text (HTML)", - "abstract": "Short Description", - "rights": "Copyright text (HTML)", - "tableofcontents": "News (HTML)", - "errors": { - "title": { - "required": "Please enter a community name" - } - } - }, - "edit": { - "head": "Edit Community", - "delete": "Delete this community" - }, - "create": { - "head": "Create a Community", - "sub-head": "Create a Sub-Community for Community {{ parent }}" - }, - "delete": { - "head": "Delete Community", - "text": "Are you sure you want to delete community \"{{ dso }}\"", - "confirm": "Confirm", - "cancel": "Cancel", - "notification": { - "success": "Successfully deleted community", - "fail": "Community could not be deleted" - } - } - }, - "item": { - "page": { - "author": "Authors", - "abstract": "Abstract", - "date": "Date", - "uri": "URI", - "files": "Files", - "collections": "Collections", - "subject": "Keywords", - "citation": "Citation", - "filesection": { - "download": "Download", - "name": "Name:", - "format": "Format:", - "size": "Size:", - "description": "Description:" - }, - "link": { - "simple": "Simple item page", - "full": "Full item page" - }, - "journal": { - "search": { - "title": "Articles in this journal" - } - }, - "person": { - "search": { - "title": "Articles by this author" - } - } - }, - "select": { - "table": { - "collection": "Collection", - "author": "Author", - "title": "Title" - }, - "confirm": "Confirm selected" - }, - "edit": { - "head": "Edit Item", - "tabs": { - "status": { - "head": "Item Status", - "description": "Welcome to the item management page. From here you can withdraw, reinstate, move or delete the item. You may also update or add new metadata / bitstreams on the other tabs.", - "title": "Item Edit - Status", - "labels": { - "id": "Item Internal ID", - "handle": "Handle", - "lastModified": "Last Modified", - "itemPage": "Item Page" - }, - "buttons": { - "authorizations": { - "label": "Edit item's authorization policies", - "button": "Authorizations..." - }, - "withdraw": { - "label": "Withdraw item from the repository", - "button": "Withdraw..." - }, - "reinstate": { - "label": "Reinstate item into the repository", - "button": "Reinstate..." - }, - "move": { - "label": "Move item to another collection", - "button": "Move..." - }, - "private": { - "label": "Make item private", - "button": "Make it private..." - }, - "public": { - "label": "Make item public", - "button": "Make it public..." - }, - "delete": { - "label": "Completely expunge item", - "button": "Permanently delete" - }, - "mappedCollections": { - "label": "Manage mapped collections", - "button": "Mapped collections" - } - } - }, - "bitstreams": { - "head": "Item Bitstreams", - "title": "Item Edit - Bitstreams" - }, - "metadata": { - "head": "Item Metadata", - "title": "Item Edit - Metadata" - }, - "view": { - "head": "View Item", - "title": "Item Edit - View" - }, - "curate": { - "head": "Curate", - "title": "Item Edit - Curate" - } - }, - "modify.overview": { - "field": "Field", - "value": "Value", - "language": "Language" - }, - "withdraw": { - "header": "Withdraw item: {{ id }}", - "description": "Are you sure this item should be withdrawn from the archive?", - "confirm": "Withdraw", - "cancel": "Cancel", - "success": "The item was withdrawn successfully", - "error": "An error occurred while withdrawing the item" - }, - "reinstate": { - "header": "Reinstate item: {{ id }}", - "description": "Are you sure this item should be reinstated to the archive?", - "confirm": "Reinstate", - "cancel": "Cancel", - "success": "The item was reinstated successfully", - "error": "An error occurred while reinstating the item" - }, - "private": { - "header": "Make item private: {{ id }}", - "description": "Are you sure this item should be made private in the archive?", - "confirm": "Make it Private", - "cancel": "Cancel", - "success": "The item is now private", - "error": "An error occurred while making the item private" - }, - "public": { - "header": "Make item public: {{ id }}", - "description": "Are you sure this item should be made public in the archive?", - "confirm": "Make it Public", - "cancel": "Cancel", - "success": "The item is now public", - "error": "An error occurred while making the item public" - }, - "delete": { - "header": "Delete item: {{ id }}", - "description": "Are you sure this item should be completely deleted? Caution: At present, no tombstone would be left.", - "confirm": "Delete", - "cancel": "Cancel", - "success": "The item has been deleted", - "error": "An error occurred while deleting the item" - }, - "metadata": { - "add-button": "Add", - "discard-button": "Discard", - "reinstate-button": "Undo", - "save-button": "Save", - "headers": { - "field": "Field", - "value": "Value", - "language": "Lang", - "edit": "Edit" - }, - "edit": { - "buttons": { - "edit": "Edit", - "unedit": "Stop editing", - "remove": "Remove", - "undo": "Undo changes" - } - }, - "metadatafield": { - "invalid": "Please choose a valid metadata field" - }, - "notifications": { - "outdated": { - "title": "Changed outdated", - "content": "The item you're currently working on has been changed by another user. Your current changes are discarded to prevent conflicts" - }, - "discarded": { - "title": "Changed discarded", - "content": "Your changes were discarded. To reinstate your changes click the 'Undo' button" - }, - "invalid": { - "title": "Metadata invalid", - "content": "Your changes were not saved. Please make sure all fields are valid before you save." - }, - "saved": { - "title": "Metadata saved", - "content": "Your changes to this item's metadata were saved." - } - } - } - } - }, - "relationships": { - "isPublicationOf": "Publications", - "isProjectOf": "Research Projects", - "isOrgUnitOf": "Organizational Units", - "isAuthorOf": "Authors", - "isPersonOf": "Authors", - "isJournalOf": "Journals", - "isSingleJournalOf": "Journal", - "isVolumeOf": "Journal Volumes", - "isSingleVolumeOf": "Journal Volume", - "isIssueOf": "Journal Issues", - "isJournalIssueOf": "Journal Issue", - "isPublicationOfJournalIssue": "Articles" - }, - "person": { - "page": { - "titleprefix": "Person: ", - "jobtitle": "Job Title", - "lastname": "Last Name", - "firstname": "First Name", - "email": "Email Address", - "orcid": "ORCID", - "birthdate": "Birth Date", - "staffid": "Staff ID", - "link": { - "full": "Show all metadata" - } - }, - "listelement": { - "badge": "Person" - }, - "search": { - "title": "DSpace Angular :: Person Search", - "results": { - "head": "Person Search Results" - } - } - }, - "project": { - "page": { - "titleprefix": "Research Project: ", - "status": "Status", - "contributor": "Contributors", - "funder": "Funders", - "id": "ID", - "expectedcompletion": "Expected Completion", - "description": "Description", - "keyword": "Keywords" - }, - "listelement": { - "badge": "Research Project" - } - }, - "orgunit": { - "page": { - "titleprefix": "Organizational Unit: ", - "dateestablished": "Date established", - "city": "City", - "country": "Country", - "id": "ID", - "description": "Description" - }, - "listelement": { - "badge": "Organizational Unit" - } - }, - "journal": { - "page": { - "titleprefix": "Journal: ", - "issn": "ISSN", - "publisher": "Publisher", - "description": "Description", - "editor": "Editor-in-Chief" - }, - "listelement": { - "badge": "Journal" - }, - "search": { - "title": "DSpace Angular :: Journal Search", - "results": { - "head": "Journal Search Results" - } - } - }, - "journalvolume": { - "page": { - "titleprefix": "Journal Volume: ", - "volume": "Volume", - "issuedate": "Issue Date", - "description": "Description" - }, - "listelement": { - "badge": "Journal Volume" - } - }, - "journalissue": { - "page": { - "titleprefix": "Journal Issue: ", - "number": "Number", - "issuedate": "Issue Date", - "description": "Description", - "keyword": "Keywords", - "journal-title": "Journal Title", - "journal-issn": "Journal ISSN" - }, - "listelement": { - "badge": "Journal Issue" - } - }, - "publication": { - "page": { - "titleprefix": "Publication: ", - "journal-title": "Journal Title", - "journal-issn": "Journal ISSN", - "volume-title": "Volume Title", - "publisher": "Publisher", - "description": "Description" - - }, - "listelement": { - "badge": "Publication" - }, - "search": { - "title": "DSpace Angular :: Publication Search", - "results": { - "head": "Publication Search Results" - } - } - }, - "nav": { - "browse": { - "header": "All of DSpace" - }, - "community-browse": { - "header": "By Community" - }, - "statistics": { - "header": "Statistics" - }, - "login": "Log In", - "logout": "Log Out", - "mydspace": "MyDSpace", - "language": "Language switch", - "search": "Search" - }, - "pagination": { - "results-per-page": "Results Per Page", - "sort-direction": "Sort Options", - "showing": { - "label": "Now showing ", - "detail": "{{ range }} of {{ total }}" - } - }, - "sorting": { - "score": { - "DESC": "Relevance" - }, - "dc.title": { - "ASC": "Title Ascending", - "DESC": "Title Descending" - } - }, + "404.help": "We can't find the page you're looking for. The page may have been moved or deleted. You can use the button below to get back to the home page. ", + "404.link.home-page": "Take me to the home page", + "404.page-not-found": "page not found", + "admin.registries.bitstream-formats.description": "This list of bitstream formats provides information about known formats and their support level.", + "admin.registries.bitstream-formats.formats.no-items": "No bitstream formats to show.", + "admin.registries.bitstream-formats.formats.table.internal": "internal", + "admin.registries.bitstream-formats.formats.table.mimetype": "MIME Type", + "admin.registries.bitstream-formats.formats.table.name": "Name", + "admin.registries.bitstream-formats.formats.table.supportLevel.0": "Unknown", + "admin.registries.bitstream-formats.formats.table.supportLevel.1": "Known", + "admin.registries.bitstream-formats.formats.table.supportLevel.2": "Support", + "admin.registries.bitstream-formats.formats.table.supportLevel.head": "Support Level", + "admin.registries.bitstream-formats.head": "Bitstream Format Registry", + "admin.registries.bitstream-formats.title": "DSpace Angular :: Bitstream Format Registry", + "admin.registries.metadata.description": "The metadata registry maintains a list of all metadata fields available in the repository. These fields may be divided amongst multiple schemas. However, DSpace requires the qualified Dublin Core schema.", + "admin.registries.metadata.form.create": "Create metadata schema", + "admin.registries.metadata.form.edit": "Edit metadata schema", + "admin.registries.metadata.form.name": "Name", + "admin.registries.metadata.form.namespace": "Namespace", + "admin.registries.metadata.head": "Metadata Registry", + "admin.registries.metadata.schemas.no-items": "No metadata schemas to show.", + "admin.registries.metadata.schemas.table.delete": "Delete selected", + "admin.registries.metadata.schemas.table.id": "ID", + "admin.registries.metadata.schemas.table.name": "Name", + "admin.registries.metadata.schemas.table.namespace": "Namespace", + "admin.registries.metadata.title": "DSpace Angular :: Metadata Registry", + "admin.registries.schema.description": "This is the metadata schema for \"{{namespace}}\".", + "admin.registries.schema.fields.head": "Schema metadata fields", + "admin.registries.schema.fields.no-items": "No metadata fields to show.", + "admin.registries.schema.fields.table.delete": "Delete selected", + "admin.registries.schema.fields.table.field": "Field", + "admin.registries.schema.fields.table.scopenote": "Scope Note", + "admin.registries.schema.form.create": "Create metadata field", + "admin.registries.schema.form.edit": "Edit metadata field", + "admin.registries.schema.form.element": "Element", + "admin.registries.schema.form.qualifier": "Qualifier", + "admin.registries.schema.form.scopenote": "Scope Note", + "admin.registries.schema.head": "Metadata Schema", + "admin.registries.schema.notification.created": "Successfully created metadata schema \"{{prefix}}\"", + "admin.registries.schema.notification.deleted.failure": "Failed to delete {{amount}} metadata schemas", + "admin.registries.schema.notification.deleted.success": "Successfully deleted {{amount}} metadata schemas", + "admin.registries.schema.notification.edited": "Successfully edited metadata schema \"{{prefix}}\"", + "admin.registries.schema.notification.failure": "Error", + "admin.registries.schema.notification.field.created": "Successfully created metadata field \"{{field}}\"", + "admin.registries.schema.notification.field.deleted.failure": "Failed to delete {{amount}} metadata fields", + "admin.registries.schema.notification.field.deleted.success": "Successfully deleted {{amount}} metadata fields", + "admin.registries.schema.notification.field.edited": "Successfully edited metadata field \"{{field}}\"", + "admin.registries.schema.notification.success": "Success", + "admin.registries.schema.return": "Return", + "admin.registries.schema.title": "DSpace Angular :: Metadata Schema Registry", + "auth.errors.invalid-user": "Invalid email address or password.", + "auth.messages.expired": "Your session has expired. Please log in again.", + "browse.comcol.by.author": "By Author", + "browse.comcol.by.dateissued": "By Issue Date", + "browse.comcol.by.subject": "By Subject", + "browse.comcol.by.title": "By Title", + "browse.comcol.head": "Browse", + "browse.empty": "No items to show.", + "browse.metadata.author": "Author", + "browse.metadata.dateissued": "Issue Date", + "browse.metadata.subject": "Subject", + "browse.metadata.title": "Title", + "browse.startsWith.choose_start": "(Choose start)", + "browse.startsWith.choose_year": "(Choose year)", + "browse.startsWith.jump": "Jump to a point in the index:", + "browse.startsWith.months.april": "April", + "browse.startsWith.months.august": "August", + "browse.startsWith.months.december": "December", + "browse.startsWith.months.february": "February", + "browse.startsWith.months.january": "January", + "browse.startsWith.months.july": "July", + "browse.startsWith.months.june": "June", + "browse.startsWith.months.march": "March", + "browse.startsWith.months.may": "May", + "browse.startsWith.months.none": "(Choose month)", + "browse.startsWith.months.november": "November", + "browse.startsWith.months.october": "October", + "browse.startsWith.months.september": "September", + "browse.startsWith.submit": "Go", + "browse.startsWith.type_date": "Or type in a date (year-month):", + "browse.startsWith.type_text": "Or enter first few letters:", + "browse.title": "Browsing {{ collection }} by {{ field }} {{ value }}", + "chips.remove": "Remove chip", + "collection.create.head": "Create a Collection", + "collection.create.sub-head": "Create a Collection for Community {{ parent }}", + "collection.delete.cancel": "Cancel", + "collection.delete.confirm": "Confirm", + "collection.delete.head": "Delete Collection", + "collection.delete.notification.fail": "Collection could not be deleted", + "collection.delete.notification.success": "Successfully deleted collection", + "collection.delete.text": "Are you sure you want to delete collection \"{{ dso }}\"", + "collection.edit.delete": "Delete this collection", + "collection.edit.head": "Edit Collection", + "collection.form.abstract": "Short Description", + "collection.form.description": "Introductory text (HTML)", + "collection.form.errors.title.required": "Please enter a collection name", + "collection.form.license": "License", + "collection.form.provenance": "Provenance", + "collection.form.rights": "Copyright text (HTML)", + "collection.form.tableofcontents": "News (HTML)", + "collection.form.title": "Name", + "collection.page.browse.recent.head": "Recent Submissions", + "collection.page.license": "License", + "collection.page.news": "News", + "community.create.head": "Create a Community", + "community.create.sub-head": "Create a Sub-Community for Community {{ parent }}", + "community.delete.cancel": "Cancel", + "community.delete.confirm": "Confirm", + "community.delete.head": "Delete Community", + "community.delete.notification.fail": "Community could not be deleted", + "community.delete.notification.success": "Successfully deleted community", + "community.delete.text": "Are you sure you want to delete community \"{{ dso }}\"", + "community.edit.delete": "Delete this community", + "community.edit.head": "Edit Community", + "community.form.abstract": "Short Description", + "community.form.description": "Introductory text (HTML)", + "community.form.errors.title.required": "Please enter a community name", + "community.form.rights": "Copyright text (HTML)", + "community.form.tableofcontents": "News (HTML)", + "community.form.title": "Name", + "community.page.license": "License", + "community.page.news": "News", + "community.sub-collection-list.head": "Collections of this Community", + "community.sub-community-list.head": "Communities of this Community", + "dso-selector.create.collection.head": "New collection", + "dso-selector.create.community.head": "New community", + "dso-selector.create.community.sub-level": "Create a new community in", + "dso-selector.create.community.top-level": "Create a new top-level community", + "dso-selector.create.item.head": "New item", + "dso-selector.edit.collection.head": "Edit collection", + "dso-selector.edit.community.head": "Edit community", + "dso-selector.edit.item.head": "Edit item", + "dso-selector.no-results": "No {{ type }} found", + "dso-selector.placeholder": "Search for a {{ type }}", + "error.browse-by": "Error fetching items", + "error.collection": "Error fetching collection", + "error.community": "Error fetching community", + "error.default": "Error", + "error.item": "Error fetching item", + "error.objects": "Error fetching objects", + "error.recent-submissions": "Error fetching recent submissions", + "error.search-results": "Error fetching search results", + "error.sub-collections": "Error fetching sub-collections", + "error.sub-communities": "Error fetching sub-communities", + "error.submission.sections.init-form-error": "An error occurred during section initialize, please check your input-form configuration. Details are below :

", + "error.top-level-communities": "Error fetching top-level communities", + "error.validation.license.notgranted": "You must grant this license to complete your submission. If you are unable to grant this license at this time you may save your work and return later or remove the submission.", + "error.validation.pattern": "This input is restricted by the current pattern: {{ pattern }}.", + "footer.copyright": "copyright © 2002-{{ year }}", + "footer.link.dspace": "DSpace software", + "footer.link.duraspace": "DuraSpace", + "form.cancel": "Cancel", + "form.clear": "Clear", + "form.clear-help": "Click here to remove the selected value", + "form.edit": "Edit", + "form.edit-help": "Click here to edit the selected value", + "form.first-name": "First name", + "form.group-collapse": "Collapse", + "form.group-collapse-help": "Click here to collapse", + "form.group-expand": "Expand", + "form.group-expand-help": "Click here to expand and add more elements", + "form.last-name": "Last name", + "form.loading": "Loading...", + "form.no-results": "No results found", + "form.no-value": "No value entered", + "form.other-information": {}, + "form.remove": "Remove", + "form.save": "Save", + "form.save-help": "Save changes", + "form.search": "Search", + "form.search-help": "Click here to looking for an existing correspondence", + "form.submit": "Submit", + "home.description": "", + "home.title": "DSpace Angular :: Home", + "home.top-level-communities.head": "Communities in DSpace", + "home.top-level-communities.help": "Select a community to browse its collections.", + "item.edit.delete.cancel": "Cancel", + "item.edit.delete.confirm": "Delete", + "item.edit.delete.description": "Are you sure this item should be completely deleted? Caution: At present, no tombstone would be left.", + "item.edit.delete.error": "An error occurred while deleting the item", + "item.edit.delete.header": "Delete item: {{ id }}", + "item.edit.delete.success": "The item has been deleted", + "item.edit.head": "Edit Item", + "item.edit.metadata.add-button": "Add", + "item.edit.metadata.discard-button": "Discard", + "item.edit.metadata.edit.buttons.edit": "Edit", + "item.edit.metadata.edit.buttons.remove": "Remove", + "item.edit.metadata.edit.buttons.undo": "Undo changes", + "item.edit.metadata.edit.buttons.unedit": "Stop editing", + "item.edit.metadata.headers.edit": "Edit", + "item.edit.metadata.headers.field": "Field", + "item.edit.metadata.headers.language": "Lang", + "item.edit.metadata.headers.value": "Value", + "item.edit.metadata.metadatafield.invalid": "Please choose a valid metadata field", + "item.edit.metadata.notifications.discarded.content": "Your changes were discarded. To reinstate your changes click the 'Undo' button", + "item.edit.metadata.notifications.discarded.title": "Changed discarded", + "item.edit.metadata.notifications.invalid.content": "Your changes were not saved. Please make sure all fields are valid before you save.", + "item.edit.metadata.notifications.invalid.title": "Metadata invalid", + "item.edit.metadata.notifications.outdated.content": "The item you're currently working on has been changed by another user. Your current changes are discarded to prevent conflicts", + "item.edit.metadata.notifications.outdated.title": "Changed outdated", + "item.edit.metadata.notifications.saved.content": "Your changes to this item's metadata were saved.", + "item.edit.metadata.notifications.saved.title": "Metadata saved", + "item.edit.metadata.reinstate-button": "Undo", + "item.edit.metadata.save-button": "Save", + "item.edit.modify.overview.field": "Field", + "item.edit.modify.overview.language": "Language", + "item.edit.modify.overview.value": "Value", + "item.edit.private.cancel": "Cancel", + "item.edit.private.confirm": "Make it Private", + "item.edit.private.description": "Are you sure this item should be made private in the archive?", + "item.edit.private.error": "An error occurred while making the item private", + "item.edit.private.header": "Make item private: {{ id }}", + "item.edit.private.success": "The item is now private", + "item.edit.public.cancel": "Cancel", + "item.edit.public.confirm": "Make it Public", + "item.edit.public.description": "Are you sure this item should be made public in the archive?", + "item.edit.public.error": "An error occurred while making the item public", + "item.edit.public.header": "Make item public: {{ id }}", + "item.edit.public.success": "The item is now public", + "item.edit.reinstate.cancel": "Cancel", + "item.edit.reinstate.confirm": "Reinstate", + "item.edit.reinstate.description": "Are you sure this item should be reinstated to the archive?", + "item.edit.reinstate.error": "An error occurred while reinstating the item", + "item.edit.reinstate.header": "Reinstate item: {{ id }}", + "item.edit.reinstate.success": "The item was reinstated successfully", + "item.edit.tabs.bitstreams.head": "Item Bitstreams", + "item.edit.tabs.bitstreams.title": "Item Edit - Bitstreams", + "item.edit.tabs.curate.head": "Curate", + "item.edit.tabs.curate.title": "Item Edit - Curate", + "item.edit.tabs.metadata.head": "Item Metadata", + "item.edit.tabs.metadata.title": "Item Edit - Metadata", + "item.edit.tabs.status.buttons.authorizations.button": "Authorizations...", + "item.edit.tabs.status.buttons.authorizations.label": "Edit item's authorization policies", + "item.edit.tabs.status.buttons.delete.button": "Permanently delete", + "item.edit.tabs.status.buttons.delete.label": "Completely expunge item", + "item.edit.tabs.status.buttons.mappedCollections.button": "Mapped collections", + "item.edit.tabs.status.buttons.mappedCollections.label": "Manage mapped collections", + "item.edit.tabs.status.buttons.move.button": "Move...", + "item.edit.tabs.status.buttons.move.label": "Move item to another collection", + "item.edit.tabs.status.buttons.private.button": "Make it private...", + "item.edit.tabs.status.buttons.private.label": "Make item private", + "item.edit.tabs.status.buttons.public.button": "Make it public...", + "item.edit.tabs.status.buttons.public.label": "Make item public", + "item.edit.tabs.status.buttons.reinstate.button": "Reinstate...", + "item.edit.tabs.status.buttons.reinstate.label": "Reinstate item into the repository", + "item.edit.tabs.status.buttons.withdraw.button": "Withdraw...", + "item.edit.tabs.status.buttons.withdraw.label": "Withdraw item from the repository", + "item.edit.tabs.status.description": "Welcome to the item management page. From here you can withdraw, reinstate, move or delete the item. You may also update or add new metadata / bitstreams on the other tabs.", + "item.edit.tabs.status.head": "Item Status", + "item.edit.tabs.status.labels.handle": "Handle", + "item.edit.tabs.status.labels.id": "Item Internal ID", + "item.edit.tabs.status.labels.itemPage": "Item Page", + "item.edit.tabs.status.labels.lastModified": "Last Modified", + "item.edit.tabs.status.title": "Item Edit - Status", + "item.edit.tabs.view.head": "View Item", + "item.edit.tabs.view.title": "Item Edit - View", + "item.edit.withdraw.cancel": "Cancel", + "item.edit.withdraw.confirm": "Withdraw", + "item.edit.withdraw.description": "Are you sure this item should be withdrawn from the archive?", + "item.edit.withdraw.error": "An error occurred while withdrawing the item", + "item.edit.withdraw.header": "Withdraw item: {{ id }}", + "item.edit.withdraw.success": "The item was withdrawn successfully", + "item.page.abstract": "Abstract", + "item.page.author": "Authors", + "item.page.citation": "Citation", + "item.page.collections": "Collections", + "item.page.date": "Date", + "item.page.files": "Files", + "item.page.filesection.description": "Description:", + "item.page.filesection.download": "Download", + "item.page.filesection.format": "Format:", + "item.page.filesection.name": "Name:", + "item.page.filesection.size": "Size:", + "item.page.journal.search.title": "Articles in this journal", + "item.page.link.full": "Full item page", + "item.page.link.simple": "Simple item page", + "item.page.person.search.title": "Articles by this author", + "item.page.subject": "Keywords", + "item.page.uri": "URI", + "item.select.confirm": "Confirm selected", + "item.select.table.author": "Author", + "item.select.table.collection": "Collection", + "item.select.table.title": "Title", + "journal.listelement.badge": "Journal", + "journal.page.description": "Description", + "journal.page.editor": "Editor-in-Chief", + "journal.page.issn": "ISSN", + "journal.page.publisher": "Publisher", + "journal.page.titleprefix": "Journal: ", + "journal.search.results.head": "Journal Search Results", + "journal.search.title": "DSpace Angular :: Journal Search", + "journalissue.listelement.badge": "Journal Issue", + "journalissue.page.description": "Description", + "journalissue.page.issuedate": "Issue Date", + "journalissue.page.journal-issn": "Journal ISSN", + "journalissue.page.journal-title": "Journal Title", + "journalissue.page.keyword": "Keywords", + "journalissue.page.number": "Number", + "journalissue.page.titleprefix": "Journal Issue: ", + "journalvolume.listelement.badge": "Journal Volume", + "journalvolume.page.description": "Description", + "journalvolume.page.issuedate": "Issue Date", + "journalvolume.page.titleprefix": "Journal Volume: ", + "journalvolume.page.volume": "Volume", + "loading.browse-by": "Loading items...", + "loading.browse-by-page": "Loading page...", + "loading.collection": "Loading collection...", + "loading.community": "Loading community...", + "loading.default": "Loading...", + "loading.item": "Loading item...", + "loading.mydspace-results": "Loading items...", + "loading.objects": "Loading...", + "loading.recent-submissions": "Loading recent submissions...", + "loading.search-results": "Loading search results...", + "loading.sub-collections": "Loading sub-collections...", + "loading.sub-communities": "Loading sub-communities...", + "loading.top-level-communities": "Loading top-level communities...", + "login.form.email": "Email address", + "login.form.forgot-password": "Have you forgotten your password?", + "login.form.header": "Please log in to DSpace", + "login.form.new-user": "New user? Click here to register.", + "login.form.password": "Password", + "login.form.submit": "Log in", + "login.title": "Login", + "logout.form.header": "Log out from DSpace", + "logout.form.submit": "Log out", + "logout.title": "Logout", + "menu.header.admin": "Admin", + "menu.header.image.logo": "Repository logo", + "menu.section.access_control": "Access Control", + "menu.section.access_control_authorizations": "Authorizations", + "menu.section.access_control_groups": "Groups", + "menu.section.access_control_people": "People", + "menu.section.browse_community": "This Community", + "menu.section.browse_community_by_author": "By Author", + "menu.section.browse_community_by_issue_date": "By Issue Date", + "menu.section.browse_community_by_title": "By Title", + "menu.section.browse_global": "All of DSpace", + "menu.section.browse_global_by_author": "By Author", + "menu.section.browse_global_by_dateissued": "By Issue Date", + "menu.section.browse_global_by_subject": "By Subject", + "menu.section.browse_global_by_title": "By Title", + "menu.section.browse_global_communities_and_collections": "Communities & Collections", + "menu.section.control_panel": "Control Panel", + "menu.section.curation_task": "Curation Task", + "menu.section.edit": "Edit", + "menu.section.edit_collection": "Collection", + "menu.section.edit_community": "Community", + "menu.section.edit_item": "Item", + "menu.section.export": "Export", + "menu.section.export_collection": "Collection", + "menu.section.export_community": "Community", + "menu.section.export_item": "Item", + "menu.section.export_metadata": "Metadata", + "menu.section.find": "Find", + "menu.section.find_items": "Items", + "menu.section.find_private_items": "Private Items", + "menu.section.find_withdrawn_items": "Withdrawn Items", + "menu.section.icon.access_control": "Access Control menu section", + "menu.section.icon.control_panel": "Control Panel menu section", + "menu.section.icon.curation_task": "Curation Task menu section", + "menu.section.icon.edit": "Edit menu section", + "menu.section.icon.export": "Export menu section", + "menu.section.icon.find": "Find menu section", + "menu.section.icon.import": "Import menu section", + "menu.section.icon.new": "New menu section", + "menu.section.icon.pin": "Pin sidebar", + "menu.section.icon.registries": "Registries menu section", + "menu.section.icon.statistics_task": "Statistics Task menu section", + "menu.section.icon.unpin": "Unpin sidebar", + "menu.section.import": "Import", + "menu.section.import_batch": "Batch Import (ZIP)", + "menu.section.import_metadata": "Metadata", + "menu.section.new": "New", + "menu.section.new_collection": "Collection", + "menu.section.new_community": "Community", + "menu.section.new_item": "Item", + "menu.section.new_item_version": "Item Version", + "menu.section.pin": "Pin sidebar", + "menu.section.registries": "Registries", + "menu.section.registries_format": "Format", + "menu.section.registries_metadata": "Metadata", + "menu.section.statistics": "Statistics", + "menu.section.statistics_task": "Statistics Task", + "menu.section.toggle.access_control": "Toggle Access Control section", + "menu.section.toggle.control_panel": "Toggle Control Panel section", + "menu.section.toggle.curation_task": "Toggle Curation Task section", + "menu.section.toggle.edit": "Toggle Edit section", + "menu.section.toggle.export": "Toggle Export section", + "menu.section.toggle.find": "Toggle Find section", + "menu.section.toggle.import": "Toggle Import section", + "menu.section.toggle.new": "Toggle New section", + "menu.section.toggle.registries": "Toggle Registries section", + "menu.section.toggle.statistics_task": "Toggle Statistics Task section", + "menu.section.unpin": "Unpin sidebar", + "mydspace.description": "", + "mydspace.general.text-here": "HERE", + "mydspace.messages.controller-help": "Select this option to send a message to item's submitter.", + "mydspace.messages.description-placeholder": "Insert your message here...", + "mydspace.messages.hide-msg": "Hide message", + "mydspace.messages.mark-as-read": "Mark as read", + "mydspace.messages.mark-as-unread": "Mark as unread", + "mydspace.messages.no-content": "No content.", + "mydspace.messages.no-messages": "No messages yet.", + "mydspace.messages.send-btn": "Send", + "mydspace.messages.show-msg": "Show message", + "mydspace.messages.subject-placeholder": "Subject...", + "mydspace.messages.submitter-help": "Select this option to send a message to controller.", + "mydspace.messages.title": "Messages", + "mydspace.messages.to": "To", + "mydspace.new-submission": "New submission", + "mydspace.results.head": "Your submissions", + "mydspace.results.no-abstract": "No Abstract", + "mydspace.results.no-authors": "No Authors", + "mydspace.results.no-collections": "No Collections", + "mydspace.results.no-date": "No Date", + "mydspace.results.no-files": "No Files", + "mydspace.results.no-results": "There were no items to show", + "mydspace.results.no-title": "No title", + "mydspace.results.no-uri": "No Uri", + "mydspace.show.workflow": "All tasks", + "mydspace.show.workspace": "Your Submissions", + "mydspace.status.archived": "Archived", + "mydspace.status.validation": "Validation", + "mydspace.status.waiting-for-controller": "Waiting for controller", + "mydspace.status.workflow": "Workflow", + "mydspace.status.workspace": "Workspace", + "mydspace.title": "MyDSpace", + "mydspace.upload.upload-failed": "Error creating new workspace. Please verify the content uploaded before retry.", + "mydspace.upload.upload-multiple-successful": "{{qty}} new workspace items created.", + "mydspace.upload.upload-successful": "New workspace item created. Click {{here}} for edit it.", + "mydspace.view-btn": "View", + "nav.browse.header": "All of DSpace", + "nav.community-browse.header": "By Community", + "nav.language": "Language switch", + "nav.login": "Log In", + "nav.logout": "Log Out", + "nav.mydspace": "MyDSpace", + "nav.search": "Search", + "nav.statistics.header": "Statistics", + "orgunit.listelement.badge": "Organizational Unit", + "orgunit.page.city": "City", + "orgunit.page.country": "Country", + "orgunit.page.dateestablished": "Date established", + "orgunit.page.description": "Description", + "orgunit.page.id": "ID", + "orgunit.page.titleprefix": "Organizational Unit: ", + "pagination.results-per-page": "Results Per Page", + "pagination.showing.detail": "{{ range }} of {{ total }}", + "pagination.showing.label": "Now showing ", + "pagination.sort-direction": "Sort Options", + "person.listelement.badge": "Person", + "person.page.birthdate": "Birth Date", + "person.page.email": "Email Address", + "person.page.firstname": "First Name", + "person.page.jobtitle": "Job Title", + "person.page.lastname": "Last Name", + "person.page.link.full": "Show all metadata", + "person.page.orcid": "ORCID", + "person.page.staffid": "Staff ID", + "person.page.titleprefix": "Person: ", + "person.search.results.head": "Person Search Results", + "person.search.title": "DSpace Angular :: Person Search", + "project.listelement.badge": "Research Project", + "project.page.contributor": "Contributors", + "project.page.description": "Description", + "project.page.expectedcompletion": "Expected Completion", + "project.page.funder": "Funders", + "project.page.id": "ID", + "project.page.keyword": "Keywords", + "project.page.status": "Status", + "project.page.titleprefix": "Research Project: ", + "publication.listelement.badge": "Publication", + "publication.page.description": "Description", + "publication.page.journal-issn": "Journal ISSN", + "publication.page.journal-title": "Journal Title", + "publication.page.publisher": "Publisher", + "publication.page.titleprefix": "Publication: ", + "publication.page.volume-title": "Volume Title", + "publication.search.results.head": "Publication Search Results", + "publication.search.title": "DSpace Angular :: Publication Search", + "relationships.isAuthorOf": "Authors", + "relationships.isIssueOf": "Journal Issues", + "relationships.isJournalIssueOf": "Journal Issue", + "relationships.isJournalOf": "Journals", + "relationships.isOrgUnitOf": "Organizational Units", + "relationships.isPersonOf": "Authors", + "relationships.isProjectOf": "Research Projects", + "relationships.isPublicationOf": "Publications", + "relationships.isPublicationOfJournalIssue": "Articles", + "relationships.isSingleJournalOf": "Journal", + "relationships.isSingleVolumeOf": "Journal Volume", + "relationships.isVolumeOf": "Journal Volumes", + "search.description": "", + "search.filters.applied.f.author": "Author", + "search.filters.applied.f.dateIssued.max": "End date", + "search.filters.applied.f.dateIssued.min": "Start date", + "search.filters.applied.f.dateSubmitted": "Date submitted", + "search.filters.applied.f.entityType": "Item Type", + "search.filters.applied.f.has_content_in_original_bundle": "Has files", + "search.filters.applied.f.itemtype": "Type", + "search.filters.applied.f.namedresourcetype": "Status", + "search.filters.applied.f.subject": "Subject", + "search.filters.applied.f.submitter": "Submitter", + "search.filters.filter.author.head": "Author", + "search.filters.filter.author.placeholder": "Author name", + "search.filters.filter.birthDate.head": "Birth Date", + "search.filters.filter.birthDate.placeholder": "Birth Date", + "search.filters.filter.creativeDatePublished.head": "Date Published", + "search.filters.filter.creativeDatePublished.placeholder": "Date Published", + "search.filters.filter.creativeWorkEditor.head": "Editor", + "search.filters.filter.creativeWorkEditor.placeholder": "Editor", + "search.filters.filter.creativeWorkKeywords.head": "Subject", + "search.filters.filter.creativeWorkKeywords.placeholder": "Subject", + "search.filters.filter.creativeWorkPublisher.head": "Publisher", + "search.filters.filter.creativeWorkPublisher.placeholder": "Publisher", + "search.filters.filter.dateIssued.head": "Date", + "search.filters.filter.dateIssued.max.placeholder": "Minimum Date", + "search.filters.filter.dateIssued.min.placeholder": "Maximum Date", + "search.filters.filter.dateSubmitted.head": "Date submitted", + "search.filters.filter.dateSubmitted.placeholder": "Date submitted", + "search.filters.filter.entityType.head": "Item Type", + "search.filters.filter.entityType.placeholder": "Item Type", + "search.filters.filter.has_content_in_original_bundle.head": "Has files", + "search.filters.filter.itemtype.head": "Type", + "search.filters.filter.itemtype.placeholder": "Type", + "search.filters.filter.jobTitle.head": "Job Title", + "search.filters.filter.jobTitle.placeholder": "Job Title", + "search.filters.filter.knowsLanguage.head": "Known language", + "search.filters.filter.knowsLanguage.placeholder": "Known language", + "search.filters.filter.namedresourcetype.head": "Status", + "search.filters.filter.namedresourcetype.placeholder": "Status", + "search.filters.filter.objectpeople.head": "People", + "search.filters.filter.objectpeople.placeholder": "People", + "search.filters.filter.organizationAddressCountry.head": "Country", + "search.filters.filter.organizationAddressCountry.placeholder": "Country", + "search.filters.filter.organizationAddressLocality.head": "City", + "search.filters.filter.organizationAddressLocality.placeholder": "City", + "search.filters.filter.organizationFoundingDate.head": "Date Founded", + "search.filters.filter.organizationFoundingDate.placeholder": "Date Founded", + "search.filters.filter.scope.head": "Scope", + "search.filters.filter.scope.placeholder": "Scope filter", + "search.filters.filter.show-less": "Collapse", + "search.filters.filter.show-more": "Show more", + "search.filters.filter.subject.head": "Subject", + "search.filters.filter.subject.placeholder": "Subject", + "search.filters.filter.submitter.head": "Submitter", + "search.filters.filter.submitter.placeholder": "Submitter", + "search.filters.head": "Filters", + "search.filters.reset": "Reset filters", + "search.form.search": "Search", + "search.form.search_dspace": "Search DSpace", + "search.form.search_mydspace": "Search MyDSpace", + "search.results.head": "Search Results", + "search.results.no-results": "Your search returned no results. Having trouble finding what you're looking for? Try putting", + "search.results.no-results-link": "quotes around it", + "search.sidebar.close": "Back to results", + "search.sidebar.filters.title": "Filters", + "search.sidebar.open": "Search Tools", + "search.sidebar.results": "results", + "search.sidebar.settings.rpp": "Results per page", + "search.sidebar.settings.sort-by": "Sort By", + "search.sidebar.settings.title": "Settings", + "search.switch-configuration.title": "Show", + "search.title": "DSpace Angular :: Search", + "search.view-switch.show-detail": "Show detail", + "search.view-switch.show-grid": "Show as grid", + "search.view-switch.show-list": "Show as list", + "sorting.dc.title.ASC": "Title Ascending", + "sorting.dc.title.DESC": "Title Descending", + "sorting.score.DESC": "Relevance", + "submission.edit.title": "Edit Submission", + "submission.general.cannot_submit": "You have not the privilege to make a new submission.", + "submission.general.deposit": "Deposit", + "submission.general.discard.confirm.cancel": "Cancel", + "submission.general.discard.confirm.info": "This operation can't be undone. Are you sure?", + "submission.general.discard.confirm.submit": "Yes, I'm sure", + "submission.general.discard.confirm.title": "Discard submission", + "submission.general.discard.submit": "Discard", + "submission.general.save": "Save", + "submission.general.save-later": "Save for later", + "submission.mydspace": {}, + "submission.sections.general.add-more": "Add more", + "submission.sections.general.collection": "Collection", + "submission.sections.general.deposit_error_notice": "There was an issue when submitting the item, please try again later.", + "submission.sections.general.deposit_success_notice": "Submission deposited successfully.", + "submission.sections.general.discard_error_notice": "There was an issue when discarding the item, please try again later.", + "submission.sections.general.discard_success_notice": "Submission discarded successfully.", + "submission.sections.general.metadata-extracted": "New metadata have been extracted and added to the {{sectionId}} section.", + "submission.sections.general.metadata-extracted-new-section": "New {{sectionId}} section has been added to submission.", + "submission.sections.general.no-collection": "No collection found", + "submission.sections.general.no-sections": "No options available", + "submission.sections.general.save_error_notice": "There was an issue when saving the item, please try again later.", + "submission.sections.general.save_success_notice": "Submission saved successfully.", + "submission.sections.general.search-collection": "Search for a collection", + "submission.sections.general.sections_not_valid": "There are incomplete sections.", + "submission.sections.submit.progressbar.cclicense": "Creative commons license", + "submission.sections.submit.progressbar.describe.recycle": "Recycle", + "submission.sections.submit.progressbar.describe.stepcustom": "Describe", + "submission.sections.submit.progressbar.describe.stepone": "Describe", + "submission.sections.submit.progressbar.describe.steptwo": "Describe", + "submission.sections.submit.progressbar.detect-duplicate": "Potential duplicates", + "submission.sections.submit.progressbar.license": "Deposit license", + "submission.sections.submit.progressbar.upload": "Upload files", + "submission.sections.upload.delete.confirm.cancel": "Cancel", + "submission.sections.upload.delete.confirm.info": "This operation can't be undone. Are you sure?", + "submission.sections.upload.delete.confirm.submit": "Yes, I'm sure", + "submission.sections.upload.delete.confirm.title": "Delete bitstream", + "submission.sections.upload.delete.submit": "Delete", + "submission.sections.upload.drop-message": "Drop files to attach them to the item", + "submission.sections.upload.form.access-condition-label": "Access condition type", + "submission.sections.upload.form.date-required": "Date is required.", + "submission.sections.upload.form.from-label": "Access grant from", + "submission.sections.upload.form.from-placeholder": "From", + "submission.sections.upload.form.group-label": "Group", + "submission.sections.upload.form.group-required": "Group is required.", + "submission.sections.upload.form.until-label": "Access grant until", + "submission.sections.upload.form.until-placeholder": "Until", + "submission.sections.upload.header.policy.default.nolist": "Uploaded files in the {{collectionName}} collection will be accessible according to the following group(s):", + "submission.sections.upload.header.policy.default.withlist": "Please note that uploaded files in the {{collectionName}} collection will be accessible, in addition to what is explicitly decided for the single file, with the following group(s):", + "submission.sections.upload.info": "Here you will find all the files currently in the item. You can update the fle metadata and access conditions or upload additional files just dragging & dropping them everywhere in the page", + "submission.sections.upload.no-entry": "No", + "submission.sections.upload.no-file-uploaded": "No file uploaded yet.", + "submission.sections.upload.save-metadata": "Save metadata", + "submission.sections.upload.undo": "Cancel", + "submission.sections.upload.upload-failed": "Upload failed", + "submission.sections.upload.upload-successful": "Upload successful", + "submission.submit.title": "Submission", + "submission.workflow.generic.delete": "Delete", + "submission.workflow.generic.delete-help": "If you would to discard this item, select \"Delete\". You will then be asked to confirm it.", + "submission.workflow.generic.edit": "Edit", + "submission.workflow.generic.edit-help": "Select this option to change the item's metadata.", + "submission.workflow.generic.view": "View", + "submission.workflow.generic.view-help": "Select this option to view the item's metadata.", + "submission.workflow.tasks.claimed.approve": "Approve", + "submission.workflow.tasks.claimed.approve_help": "If you have reviewed the item and it is suitable for inclusion in the collection, select \"Approve\".", + "submission.workflow.tasks.claimed.edit": "Edit", + "submission.workflow.tasks.claimed.edit_help": "Select this option to change the item's metadata.", + "submission.workflow.tasks.claimed.reject.reason.info": "Please enter your reason for rejecting the submission into the box below, indicating whether the submitter may fix a problem and resubmit.", + "submission.workflow.tasks.claimed.reject.reason.placeholder": "Describe the reason of reject", + "submission.workflow.tasks.claimed.reject.reason.submit": "Reject item", + "submission.workflow.tasks.claimed.reject.reason.title": "Reason", + "submission.workflow.tasks.claimed.reject.submit": "Reject", + "submission.workflow.tasks.claimed.reject_help": "If you have reviewed the item and found it is not suitable for inclusion in the collection, select \"Reject\". You will then be asked to enter a message indicating why the item is unsuitable, and whether the submitter should change something and resubmit.", + "submission.workflow.tasks.claimed.return": "Return to pool", + "submission.workflow.tasks.claimed.return_help": "Return the task to the pool so that another user may perform the task.", + "submission.workflow.tasks.generic.error": "Error occurred during operation...", + "submission.workflow.tasks.generic.processing": "Processing...", + "submission.workflow.tasks.generic.submitter": "Submitter", + "submission.workflow.tasks.generic.success": "Operation successful", + "submission.workflow.tasks.pool.claim": "Claim", + "submission.workflow.tasks.pool.claim_help": "Assign this task to yourself.", + "submission.workflow.tasks.pool.hide-detail": "Hide detail", + "submission.workflow.tasks.pool.show-detail": "Show detail", "title": "DSpace", - "404": { - "help": "We can't find the page you're looking for. The page may have been moved or deleted. You can use the button below to get back to the home page. ", - "page-not-found": "page not found", - "link": { - "home-page": "Take me to the home page" - } - }, - "home": { - "title": "DSpace Angular :: Home", - "description": "", - "top-level-communities": { - "head": "Communities in DSpace", - "help": "Select a community to browse its collections." - } - }, - "mydspace": { - "title": "MyDSpace", - "description": "", - "new-submission": "New submission", - "results": { - "head": "Your submissions", - "no-results": "There were no items to show", - "no-title": "No title", - "no-authors": "No Authors", - "no-date": "No Date", - "no-abstract": "No Abstract", - "no-files": "No Files", - "no-uri": "No Uri", - "no-collections": "No Collections" - }, - "messages": { - "title": "Messages", - "to": "To", - "hide-msg": "Hide message", - "show-msg": "Show message", - "no-messages": "No messages yet.", - "no-content": "No content.", - "send-btn": "Send", - "subject-placeholder": "Subject...", - "description-placeholder": "Insert your message here...", - "mark-as-read": "Mark as read", - "mark-as-unread": "Mark as unread", - "submitter-help": "Select this option to send a message to controller.", - "controller-help": "Select this option to send a message to item's submitter." - }, - "show": { - "workspace": "Your Submissions", - "workflow": "All tasks" - }, - "status": { - "workflow": "Workflow", - "validation": "Validation", - "waiting-for-controller": "Waiting for controller", - "workspace": "Workspace", - "archived": "Archived" - }, - "view-btn": "View", - "general": { - "text-here": "HERE" - }, - "upload": { - "upload-successful": "New workspace item created. Click {{here}} for edit it.", - "upload-multiple-successful": "{{qty}} new workspace items created.", - "upload-failed": "Error creating new workspace. Please verify the content uploaded before retry." - } - }, - "search": { - "title": "DSpace Angular :: Search", - "description": "", - "form": { - "search": "Search", - "search_dspace": "Search DSpace", - "search_mydspace": "Search MyDSpace" - }, - "results": { - "head": "Search Results", - "no-results": "Your search returned no results. Having trouble finding what you're looking for? Try putting", - "no-results-link": "quotes around it" - }, - "sidebar": { - "close": "Back to results", - "open": "Search Tools", - "results": "results", - "filters": { - "title": "Filters" - }, - "settings": { - "title": "Settings", - "sort-by": "Sort By", - "rpp": "Results per page" - } - }, - "switch-configuration": { - "title":"Show" - }, - "view-switch": { - "show-list": "Show as list", - "show-grid": "Show as grid", - "show-detail": "Show detail" - }, - "filters": { - "head": "Filters", - "reset": "Reset filters", - "applied": { - "f.author": "Author", - "f.dateIssued.min": "Start date", - "f.dateIssued.max": "End date", - "f.subject": "Subject", - "f.has_content_in_original_bundle": "Has files", - "f.entityType": "Item Type", - "f.namedresourcetype": "Status", - "f.dateSubmitted": "Date submitted", - "f.itemtype": "Type", - "f.submitter": "Submitter" - }, - "filter": { - "show-more": "Show more", - "show-less": "Collapse", - "author": { - "placeholder": "Author name", - "head": "Author" - }, - "scope": { - "placeholder": "Scope filter", - "head": "Scope" - }, - "subject": { - "placeholder": "Subject", - "head": "Subject" - }, - "dateIssued": { - "max": { - "placeholder": "Minimum Date" - }, - "min": { - "placeholder": "Maximum Date" - }, - "head": "Date" - }, - "has_content_in_original_bundle": { - "head": "Has files" - }, - "entityType": { - "placeholder": "Item Type", - "head": "Item Type" - }, - "namedresourcetype": { - "placeholder": "Status", - "head": "Status" - }, - "dateSubmitted": { - "placeholder": "Date submitted", - "head": "Date submitted" - }, - "itemtype": { - "placeholder": "Type", - "head": "Type" - }, - "submitter": { - "placeholder": "Submitter", - "head": "Submitter" - }, - "objectpeople": { - "placeholder": "People", - "head": "People" - }, - "jobTitle": { - "placeholder": "Job Title", - "head": "Job Title" - }, - "knowsLanguage": { - "placeholder": "Known language", - "head": "Known language" - }, - "birthDate": { - "placeholder": "Birth Date", - "head": "Birth Date" - }, - "creativeWorkPublisher": { - "placeholder": "Publisher", - "head": "Publisher" - }, - "creativeWorkEditor": { - "placeholder": "Editor", - "head": "Editor" - }, - "creativeWorkKeywords": { - "placeholder": "Subject", - "head": "Subject" - }, - "creativeDatePublished": { - "placeholder": "Date Published", - "head": "Date Published" - }, - "organizationAddressCountry": { - "placeholder": "Country", - "head": "Country" - }, - "organizationAddressLocality": { - "placeholder": "City", - "head": "City" - }, - "organizationFoundingDate": { - "placeholder": "Date Founded", - "head": "Date Founded" - } - } - } - }, - "browse": { - "title": "Browsing {{ collection }} by {{ field }} {{ value }}", - "startsWith": { - "jump": "Jump to a point in the index:", - "choose_year": "(Choose year)", - "choose_start": "(Choose start)", - "type_date": "Or type in a date (year-month):", - "type_text": "Or enter first few letters:", - "months": { - "none": "(Choose month)", - "january": "January", - "february": "February", - "march": "March", - "april": "April", - "may": "May", - "june": "June", - "july": "July", - "august": "August", - "september": "September", - "october": "October", - "november": "November", - "december": "December" - }, - "submit": "Go" - }, - "metadata": { - "title": "Title", - "author": "Author", - "subject": "Subject", - "dateissued": "Issue Date" - }, - "comcol": { - "head": "Browse", - "by": { - "title": "By Title", - "dateissued": "By Issue Date", - "author": "By Author", - "subject": "By Subject" - } - }, - "empty": "No items to show." - }, - "admin": { - "registries": { - "metadata": { - "title": "DSpace Angular :: Metadata Registry", - "head": "Metadata Registry", - "description": "The metadata registry maintains a list of all metadata fields available in the repository. These fields may be divided amongst multiple schemas. However, DSpace requires the qualified Dublin Core schema.", - "form": { - "create": "Create metadata schema", - "edit": "Edit metadata schema", - "namespace": "Namespace", - "name": "Name" - }, - "schemas": { - "table": { - "id": "ID", - "namespace": "Namespace", - "name": "Name", - "delete": "Delete selected" - }, - "no-items": "No metadata schemas to show." - } - }, - "schema": { - "title": "DSpace Angular :: Metadata Schema Registry", - "head": "Metadata Schema", - "description": "This is the metadata schema for \"{{namespace}}\".", - "return": "Return", - "form": { - "create": "Create metadata field", - "edit": "Edit metadata field", - "element": "Element", - "qualifier": "Qualifier", - "scopenote": "Scope Note" - }, - "fields": { - "head": "Schema metadata fields", - "table": { - "field": "Field", - "scopenote": "Scope Note", - "delete": "Delete selected" - }, - "no-items": "No metadata fields to show." - }, - "notification": { - "success": "Success", - "failure": "Error", - "created": "Successfully created metadata schema \"{{prefix}}\"", - "edited": "Successfully edited metadata schema \"{{prefix}}\"", - "deleted": { - "success": "Successfully deleted {{amount}} metadata schemas", - "failure": "Failed to delete {{amount}} metadata schemas" - }, - "field": { - "created": "Successfully created metadata field \"{{field}}\"", - "edited": "Successfully edited metadata field \"{{field}}\"", - "deleted": { - "success": "Successfully deleted {{amount}} metadata fields", - "failure": "Failed to delete {{amount}} metadata fields" - } - } - } - }, - "bitstream-formats": { - "title": "DSpace Angular :: Bitstream Format Registry", - "head": "Bitstream Format Registry", - "description": "This list of bitstream formats provides information about known formats and their support level.", - "formats": { - "table": { - "name": "Name", - "mimetype": "MIME Type", - "supportLevel": { - "head": "Support Level", - "0": "Unknown", - "1": "Known", - "2": "Support" - }, - "internal": "internal" - }, - "no-items": "No bitstream formats to show." - } - } - } - }, - "menu": { - "header": { - "admin": "Admin", - "image": { - "logo": "Repository logo" - } - }, - "section": { - "pin": "Pin sidebar", - "unpin": "Unpin sidebar", - "new": "New", - "new_community": "Community", - "new_collection": "Collection", - "new_item": "Item", - "new_item_version": "Item Version", - "edit": "Edit", - "edit_community": "Community", - "edit_collection": "Collection", - "edit_item": "Item", - "import": "Import", - "import_metadata": "Metadata", - "import_batch": "Batch Import (ZIP)", - "export": "Export", - "export_community": "Community", - "export_collection": "Collection", - "export_item": "Item", - "export_metadata": "Metadata", - "access_control": "Access Control", - "access_control_people": "People", - "access_control_groups": "Groups", - "access_control_authorizations": "Authorizations", - "find": "Find", - "find_items": "Items", - "find_withdrawn_items": "Withdrawn Items", - "find_private_items": "Private Items", - "registries": "Registries", - "registries_metadata": "Metadata", - "registries_format": "Format", - "curation_task": "Curation Task", - "statistics_task": "Statistics Task", - "control_panel": "Control Panel", - "browse_global": "All of DSpace", - "browse_global_communities_and_collections": "Communities & Collections", - "browse_global_by_dateissued": "By Issue Date", - "browse_global_by_author": "By Author", - "browse_global_by_title": "By Title", - "browse_global_by_subject": "By Subject", - "statistics": "Statistics", - "browse_community": "This Community", - "browse_community_by_issue_date": "By Issue Date", - "browse_community_by_author": "By Author", - "browse_community_by_title": "By Title", - "icon": { - "pin": "Pin sidebar", - "unpin": "Unpin sidebar", - "new": "New menu section", - "edit": "Edit menu section", - "import": "Import menu section", - "export": "Export menu section", - "access_control": "Access Control menu section", - "find": "Find menu section", - "registries": "Registries menu section", - "curation_task": "Curation Task menu section", - "statistics_task": "Statistics Task menu section", - "control_panel": "Control Panel menu section" - }, - "toggle": { - "new": "Toggle New section", - "edit": "Toggle Edit section", - "import": "Toggle Import section", - "export": "Toggle Export section", - "access_control": "Toggle Access Control section", - "find": "Toggle Find section", - "registries": "Toggle Registries section", - "curation_task": "Toggle Curation Task section", - "statistics_task": "Toggle Statistics Task section", - "control_panel": "Toggle Control Panel section" - } - } - }, - "loading": { - "default": "Loading...", - "top-level-communities": "Loading top-level communities...", - "community": "Loading community...", - "collection": "Loading collection...", - "sub-collections": "Loading sub-collections...", - "sub-communities": "Loading sub-communities...", - "recent-submissions": "Loading recent submissions...", - "item": "Loading item...", - "objects": "Loading...", - "search-results": "Loading search results...", - "mydspace-results": "Loading items...", - "browse-by": "Loading items...", - "browse-by-page": "Loading page..." - }, - "error": { - "default": "Error", - "top-level-communities": "Error fetching top-level communities", - "community": "Error fetching community", - "collection": "Error fetching collection", - "sub-collections": "Error fetching sub-collections", - "sub-communities": "Error fetching sub-communities", - "recent-submissions": "Error fetching recent submissions", - "item": "Error fetching item", - "objects": "Error fetching objects", - "search-results": "Error fetching search results", - "browse-by": "Error fetching items", - "validation": { - "pattern": "This input is restricted by the current pattern: {{ pattern }}.", - "license": { - "notgranted": "You must grant this license to complete your submission. If you are unable to grant this license at this time you may save your work and return later or remove the submission." - } - }, - "submission": { - "sections": { - "init-form-error": "An error occurred during section initialize, please check your input-form configuration. Details are below :

" - } - } - }, - "form": { - "submit": "Submit", - "cancel": "Cancel", - "search": "Search", - "search-help": "Click here to looking for an existing correspondence", - "remove": "Remove", - "clear": "Clear", - "clear-help": "Click here to remove the selected value", - "edit": "Edit", - "edit-help": "Click here to edit the selected value", - "save": "Save", - "save-help": "Save changes", - "first-name": "First name", - "last-name": "Last name", - "loading": "Loading...", - "no-results": "No results found", - "no-value": "No value entered", - "group-collapse": "Collapse", - "group-expand": "Expand", - "group-collapse-help": "Click here to collapse", - "group-expand-help": "Click here to expand and add more elements", - "other-information": { - } - }, - "login": { - "title": "Login", - "form": { - "header": "Please log in to DSpace", - "email": "Email address", - "forgot-password": "Have you forgotten your password?", - "new-user": "New user? Click here to register.", - "password": "Password", - "submit": "Log in" - } - }, - "logout": { - "title": "Logout", - "form": { - "header": "Log out from DSpace", - "submit": "Log out" - } - }, - "auth": { - "messages": { - "expired": "Your session has expired. Please log in again." - }, - "errors": { - "invalid-user": "Invalid email address or password." - } - }, - "chips": { - "remove": "Remove chip" - }, - "dso-selector": { - "create": { - "community": { - "head": "New community", - "sub-level": "Create a new community in", - "top-level": "Create a new top-level community" - }, - "collection": { - "head": "New collection" - }, - "item": { - "head": "New item" - } - }, - "edit": { - "community": { - "head": "Edit community" - }, - "collection": { - "head": "Edit collection" - }, - "item": { - "head": "Edit item" - } - }, - "placeholder": "Search for a {{ type }}", - "no-results": "No {{ type }} found" - }, - "submission": { - "general":{ - "cannot_submit": "You have not the privilege to make a new submission.", - "deposit": "Deposit", - "discard": { - "submit": "Discard", - "confirm": { - "cancel": "Cancel", - "submit": "Yes, I'm sure", - "title": "Discard submission", - "info": "This operation can't be undone. Are you sure?" - } - }, - "save": "Save", - "save-later": "Save for later" - }, - "submit": { - "title": "Submission" - }, - "edit": { - "title": "Edit Submission" - }, - "mydspace": { - - }, - "sections": { - - "general": { - "add-more": "Add more", - "no-sections": "No options available", - "sections_not_valid": "There are incomplete sections.", - "collection": "Collection", - "no-collection": "No collection found", - "search-collection": "Search for a collection", - "save_error_notice": "There was an issue when saving the item, please try again later.", - "deposit_success_notice": "Submission deposited successfully.", - "deposit_error_notice": "There was an issue when submitting the item, please try again later.", - "discard_success_notice": "Submission discarded successfully.", - "discard_error_notice": "There was an issue when discarding the item, please try again later.", - "save_success_notice": "Submission saved successfully.", - "metadata-extracted": "New metadata have been extracted and added to the {{sectionId}} section.", - "metadata-extracted-new-section": "New {{sectionId}} section has been added to submission." - }, - "submit.progressbar.describe.stepone": "Describe", - "submit.progressbar.describe.steptwo": "Describe", - "submit.progressbar.describe.stepcustom": "Describe", - "submit.progressbar.describe.recycle": "Recycle", - "submit.progressbar.upload": "Upload files", - "submit.progressbar.license": "Deposit license", - "submit.progressbar.cclicense": "Creative commons license", - "submit.progressbar.detect-duplicate": "Potential duplicates", - - "upload": { - "no-entry": "No", - "no-file-uploaded": "No file uploaded yet.", - "info": "Here you will find all the files currently in the item. You can update the fle metadata and access conditions or upload additional files just dragging & dropping them everywhere in the page", - "drop-message": "Drop files to attach them to the item", - "upload-successful": "Upload successful", - "upload-failed": "Upload failed", - "header.policy.default.nolist": "Uploaded files in the {{collectionName}} collection will be accessible according to the following group(s):", - "header.policy.default.withlist": "Please note that uploaded files in the {{collectionName}} collection will be accessible, in addition to what is explicitly decided for the single file, with the following group(s):", - "form": { - "access-condition-label": "Access condition type", - "from-label": "Access grant from", - "from-placeholder": "From", - "until-label": "Access grant until", - "until-placeholder": "Until", - "group-label": "Group", - "group-required": "Group is required.", - "date-required": "Date is required." - }, - "save-metadata": "Save metadata", - "undo": "Cancel", - "delete": { - "submit": "Delete", - "confirm": { - "cancel": "Cancel", - "submit": "Yes, I'm sure", - "title": "Delete bitstream", - "info": "This operation can't be undone. Are you sure?" - } - } - } - }, - "workflow": { - "generic": { - "delete": "Delete", - "delete-help": "If you would to discard this item, select \"Delete\". You will then be asked to confirm it.", - "edit": "Edit", - "edit-help": "Select this option to change the item's metadata.", - "view": "View", - "view-help": "Select this option to view the item's metadata." - }, - "tasks": { - "generic": { - "processing": "Processing...", - "success": "Operation successful", - "error": "Error occurred during operation...", - "submitter": "Submitter" - }, - "claimed": { - "approve": "Approve", - "approve_help": "If you have reviewed the item and it is suitable for inclusion in the collection, select \"Approve\".", - "edit": "Edit", - "edit_help": "Select this option to change the item's metadata.", - "reject": { - "submit": "Reject", - "reason": { - "submit": "Reject item", - "title": "Reason", - "info": "Please enter your reason for rejecting the submission into the box below, indicating whether the submitter may fix a problem and resubmit.", - "placeholder": "Describe the reason of reject" - } - }, - "reject_help": "If you have reviewed the item and found it is not suitable for inclusion in the collection, select \"Reject\". You will then be asked to enter a message indicating why the item is unsuitable, and whether the submitter should change something and resubmit.", - "return": "Return to pool", - "return_help": "Return the task to the pool so that another user may perform the task." - - }, - "pool": { - "claim": "Claim", - "claim_help": "Assign this task to yourself.", - "show-detail": "Show detail", - "hide-detail": "Hide detail" - } - } - } - }, - "uploader": { - "drag-message": "Drag & Drop your files here", - "or": ", or", - "browse": "browse", - "queue-lenght": "Queue length", - "processing": "Processing" - } + "uploader.browse": "browse", + "uploader.drag-message": "Drag & Drop your files here", + "uploader.or": ", or", + "uploader.processing": "Processing", + "uploader.queue-lenght": "Queue length" } diff --git a/resources/i18n/nl.json b/resources/i18n/nl.json index f4dda3b3c8..da12ff0518 100644 --- a/resources/i18n/nl.json +++ b/resources/i18n/nl.json @@ -1,277 +1,149 @@ { - "footer": { - "copyright": "copyright © 2002-{{ year }}", - "link.dspace": "DSpace software", - "link.duraspace": "DuraSpace" - }, - "collection": { - "page": { - "news": "Nieuws", - "license": "Licentie", - "browse": { - "recent": { - "head": "Recent toegevoegd" - } - } - } - }, - "community": { - "page": { - "news": "Nieuws", - "license": "Licentie" - }, - "sub-collection-list": { - "head": "Collecties in deze Community" - } - }, - "item": { - "page": { - "author": "Auteur", - "abstract": "Abstract", - "date": "Datum", - "uri": "URI", - "files": "Bestanden", - "collections": "Collecties", - "filesection": { - "download": "Download", - "name": "Naam:", - "format": "Formaat:", - "size": "Grootte:", - "description": "Beschrijving:" - }, - "link": { - "simple": "Eenvoudige itemweergave", - "full": "Volledige itemweergave" - } - } - }, - "nav": { - "home": "Home", - "login": "Log In", - "logout": "Log Uit" - }, - "pagination": { - "results-per-page": "Resultaten per pagina", - "sort-direction": "Sorteermogelijkheden", - "showing": { - "label": "Resultaten ", - "detail": "{{ range }} van {{ total }}" - } - }, - "sorting": { - "score": { - "DESC": "Relevantie" - }, - "dc.title": { - "ASC": "Oplopend op titel", - "DESC": "Aflopend op titel" - } - }, - "title": "DSpace", - "404": { - "help": "De pagina die u zoekt kan niet gevonden worden. De pagina werd mogelijk verplaatst of verwijderd. U kan onderstaande knop gebruiken om terug naar de homepagina te gaan. ", - "page-not-found": "Pagina niet gevonden", - "link": { - "home-page": "Terug naar de homepagina" - } - }, - "home": { - "title": "DSpace Angular :: Home", - "description": "", - "top-level-communities": { - "head": "Communities in DSpace", - "help": "Selecteer een community om diens collecties te verkennen." - } - }, - "search": { - "title": "DSpace Angular :: Zoek", - "description": "", - "form": { - "search": "Zoek", - "search_dspace": "Zoek in DSpace" - }, - "results": { - "head": "Zoekresultaten", - "no-results": "Er waren geen resultaten voor deze zoekopdracht" - }, - "sidebar": { - "close": "Terug naar de resultaten", - "open": "Zoek Tools", - "results": "resultaten", - "filters": { - "title": "Filters" - }, - "settings": { - "title": "Instellingen", - "sort-by": "Sorteer volgens", - "rpp": "Resultaten per pagina" - } - }, - "view-switch": { - "show-list": "Toon als lijst", - "show-grid": "Toon in raster" - }, - "filters": { - "head": "Filters", - "reset": "Filters verwijderen", - "applied": { - "f.author": "Auteur", - "f.dateIssued.min": "Startdatum", - "f.dateIssued.max": "Einddatum", - "f.subject": "Sleutelwoord", - "f.has_content_in_original_bundle": "Heeft bestanden" - }, - "filter": { - "show-more": "Toon meer", - "show-less": "Inklappen", - "author": { - "placeholder": "Auteursnaam", - "head": "Auteur" - }, - "scope": { - "placeholder": "Bereikfilter", - "head": "Bereik" - }, - "subject": { - "placeholder": "Onderwerp", - "head": "Onderwerp" - }, - "dateIssued": { - "max": { - "placeholder": "Vroegste Datum" - }, - "min": { - "placeholder": "Laatste Datum" - }, - "head": "Datum" - }, - "has_content_in_original_bundle": { - "head": "Heeft bestanden" - } - } - } - }, - "browse": { - "title": "Verken {{ collection }} volgens {{ field }} {{ value }}" - }, - "admin": { - "registries": { - "metadata": { - "title": "DSpace Angular :: Metadata Register", - "head": "Metadata Register", - "description": "Het metadataregister omvat de lijst van alle metadatavelden die beschikbaar zijn in het systeem. Deze velden kunnen verspreid zijn over verschillende metadataschema's. Het qualified Dublin Core schema (dc) is een verplicht schema en kan niet worden verwijderd.", - "schemas": { - "table": { - "id": "ID", - "namespace": "Naamruimte", - "name": "Naam" - }, - "no-items": "Er kunnen geen metadataschema's getoond worden." - } - }, - "schema": { - "title": "DSpace Angular :: Metadata Schema Register", - "head": "Metadata Schema", - "description": "Dit is het metadataschema voor \"{{namespace}}\".", - "fields": { - "head": "Schema metadatavelden", - "table": { - "field": "Veld", - "scopenote": "Opmerking over bereik" - }, - "no-items": "Er kunnen geen metadatavelden getoond worden." - } - }, - "bitstream-formats": { - "title": "DSpace Angular :: Bitstream Formaat Register", - "head": "Bitstream Formaat Register", - "description": "Deze lijst van Bitstream formaten biedt informatie over de formaten die in deze repository zijn toegelaten en op welke manier ze ondersteund worden. De term Bitstream wordt in DSpace gebruikt om een bestand aan te duiden dat samen met metadata onderdeel uitmaakt van een item. De naam bitstream duidt op het feit dat het bestand achterliggend wordt opgeslaan zonder bestandsextensie.", - "formats": { - "table": { - "name": "Naam", - "mimetype": "MIME Type", - "supportLevel": { - "head": "Ondersteuning", - "0": "Onbekend", - "1": "Gekend", - "2": "Ondersteund" - }, - "internal": "intern" - }, - "no-items": "Er kunnen geen bitstreamformaten getoond worden." - } - } - } - }, - "loading": { - "default": "Laden...", - "top-level-communities": "Inladen van de Communities op het hoogste niveau...", - "community": "Community wordt ingeladen...", - "collection": "Collectie wordt ingeladen...", - "sub-collections": "De sub-collecties worden ingeladen...", - "recent-submissions": "Recent toegevoegde items worden ingeladen...", - "item": "Item wordt ingeladen...", - "objects": "Laden...", - "search-results": "Zoekresultaten worden ingeladen...", - "browse-by": "Items worden ingeladen..." - }, - "error": { - "default": "Fout", - "top-level-communities": "Fout bij het inladen van communities op het hoogste niveau", - "community": "Fout bij het ophalen van een community", - "collection": "Fout bij het ophalen van een collectie", - "sub-collections": "Fout bij het ophalen van sub-collecties", - "recent-submissions": "Fout bij het ophalen van recent toegevoegde items", - "item": "Fout bij het ophalen van items", - "objects": "Fout bij het ophalen van objecten", - "search-results": "Fout bij het ophalen van zoekresultaten", - "browse-by": "Fout bij het ophalen van items", - "validation": { - "pattern": "Deze invoer is niet toegelaten volgens dit patroon: {{ pattern }}.", - "license": { - "notgranted": "U moet de invoerlicentie goedkeuren om de invoer af te werken. Indien u deze licentie momenteel niet kan of mag goedkeuren, kan u uw werk opslaan en de invoer later afwerken. U kunt dit nieuwe item ook verwijderen indien u niet voldoet aan de vereisten van de invoerlicentie." - } - } - }, - "form": { - "submit": "Verstuur", - "cancel": "Annuleer", - "search": "Zoek", - "remove": "Verwijder", - "first-name": "Voornaam", - "last-name": "Achternaam", - "loading": "Inladen...", - "no-results": "Geen resultaten gevonden", - "no-value": "Geen waarde ingevoerd", - "group-collapse": "Inklappen", - "group-expand": "Uitklappen", - "group-collapse-help": "Klik hier op in te klappen", - "group-expand-help": "Klik hier om uit te klappen en om meer onderdelen toe te voegen" - }, - "login": { - "title": "Aanmelden", - "form": { - "header": "Gelieve in te loggen in DSpace", - "email": "Email adres", - "forgot-password": "Bent u uw wachtwoord vergeten?", - "new-user": "Nieuwe gebruiker? Gelieve u hier te registreren", - "password": "Wachtwoord", - "submit": "Aanmelden" - } - }, - "logout": { - "title": "Afmelden", - "form": { - "header": "Afmelden in DSpace", - "submit": "Afmelden" - } - }, - "auth": { - "messages": { - "expired": "Uw sessie is vervallen. Gelieve opnieuw aan te melden." - }, - "errors": { - "invalid-user": "Ongeldig e-mailadres of wachtwoord." - } - } + "404.help": "De pagina die u zoekt kan niet gevonden worden. De pagina werd mogelijk verplaatst of verwijderd. U kan onderstaande knop gebruiken om terug naar de homepagina te gaan. ", + "404.link.home-page": "Terug naar de homepagina", + "404.page-not-found": "Pagina niet gevonden", + "admin.registries.bitstream-formats.description": "Deze lijst van Bitstream formaten biedt informatie over de formaten die in deze repository zijn toegelaten en op welke manier ze ondersteund worden. De term Bitstream wordt in DSpace gebruikt om een bestand aan te duiden dat samen met metadata onderdeel uitmaakt van een item. De naam bitstream duidt op het feit dat het bestand achterliggend wordt opgeslaan zonder bestandsextensie.", + "admin.registries.bitstream-formats.formats.no-items": "Er kunnen geen bitstreamformaten getoond worden.", + "admin.registries.bitstream-formats.formats.table.internal": "intern", + "admin.registries.bitstream-formats.formats.table.mimetype": "MIME Type", + "admin.registries.bitstream-formats.formats.table.name": "Naam", + "admin.registries.bitstream-formats.formats.table.supportLevel.0": "Onbekend", + "admin.registries.bitstream-formats.formats.table.supportLevel.1": "Gekend", + "admin.registries.bitstream-formats.formats.table.supportLevel.2": "Ondersteund", + "admin.registries.bitstream-formats.formats.table.supportLevel.head": "Ondersteuning", + "admin.registries.bitstream-formats.head": "Bitstream Formaat Register", + "admin.registries.bitstream-formats.title": "DSpace Angular :: Bitstream Formaat Register", + "admin.registries.metadata.description": "Het metadataregister omvat de lijst van alle metadatavelden die beschikbaar zijn in het systeem. Deze velden kunnen verspreid zijn over verschillende metadataschema's. Het qualified Dublin Core schema (dc) is een verplicht schema en kan niet worden verwijderd.", + "admin.registries.metadata.head": "Metadata Register", + "admin.registries.metadata.schemas.no-items": "Er kunnen geen metadataschema's getoond worden.", + "admin.registries.metadata.schemas.table.id": "ID", + "admin.registries.metadata.schemas.table.name": "Naam", + "admin.registries.metadata.schemas.table.namespace": "Naamruimte", + "admin.registries.metadata.title": "DSpace Angular :: Metadata Register", + "admin.registries.schema.description": "Dit is het metadataschema voor \"{{namespace}}\".", + "admin.registries.schema.fields.head": "Schema metadatavelden", + "admin.registries.schema.fields.no-items": "Er kunnen geen metadatavelden getoond worden.", + "admin.registries.schema.fields.table.field": "Veld", + "admin.registries.schema.fields.table.scopenote": "Opmerking over bereik", + "admin.registries.schema.head": "Metadata Schema", + "admin.registries.schema.title": "DSpace Angular :: Metadata Schema Register", + "auth.errors.invalid-user": "Ongeldig e-mailadres of wachtwoord.", + "auth.messages.expired": "Uw sessie is vervallen. Gelieve opnieuw aan te melden.", + "browse.title": "Verken {{ collection }} volgens {{ field }} {{ value }}", + "collection.page.browse.recent.head": "Recent toegevoegd", + "collection.page.license": "Licentie", + "collection.page.news": "Nieuws", + "community.page.license": "Licentie", + "community.page.news": "Nieuws", + "community.sub-collection-list.head": "Collecties in deze Community", + "error.browse-by": "Fout bij het ophalen van items", + "error.collection": "Fout bij het ophalen van een collectie", + "error.community": "Fout bij het ophalen van een community", + "error.default": "Fout", + "error.item": "Fout bij het ophalen van items", + "error.objects": "Fout bij het ophalen van objecten", + "error.recent-submissions": "Fout bij het ophalen van recent toegevoegde items", + "error.search-results": "Fout bij het ophalen van zoekresultaten", + "error.sub-collections": "Fout bij het ophalen van sub-collecties", + "error.top-level-communities": "Fout bij het inladen van communities op het hoogste niveau", + "error.validation.license.notgranted": "U moet de invoerlicentie goedkeuren om de invoer af te werken. Indien u deze licentie momenteel niet kan of mag goedkeuren, kan u uw werk opslaan en de invoer later afwerken. U kunt dit nieuwe item ook verwijderen indien u niet voldoet aan de vereisten van de invoerlicentie.", + "error.validation.pattern": "Deze invoer is niet toegelaten volgens dit patroon: {{ pattern }}.", + "footer.copyright": "copyright © 2002-{{ year }}", + "footer.link.dspace": "DSpace software", + "footer.link.duraspace": "DuraSpace", + "form.cancel": "Annuleer", + "form.first-name": "Voornaam", + "form.group-collapse": "Inklappen", + "form.group-collapse-help": "Klik hier op in te klappen", + "form.group-expand": "Uitklappen", + "form.group-expand-help": "Klik hier om uit te klappen en om meer onderdelen toe te voegen", + "form.last-name": "Achternaam", + "form.loading": "Inladen...", + "form.no-results": "Geen resultaten gevonden", + "form.no-value": "Geen waarde ingevoerd", + "form.remove": "Verwijder", + "form.search": "Zoek", + "form.submit": "Verstuur", + "home.description": "", + "home.title": "DSpace Angular :: Home", + "home.top-level-communities.head": "Communities in DSpace", + "home.top-level-communities.help": "Selecteer een community om diens collecties te verkennen.", + "item.page.abstract": "Abstract", + "item.page.author": "Auteur", + "item.page.collections": "Collecties", + "item.page.date": "Datum", + "item.page.files": "Bestanden", + "item.page.filesection.description": "Beschrijving:", + "item.page.filesection.download": "Download", + "item.page.filesection.format": "Formaat:", + "item.page.filesection.name": "Naam:", + "item.page.filesection.size": "Grootte:", + "item.page.link.full": "Volledige itemweergave", + "item.page.link.simple": "Eenvoudige itemweergave", + "item.page.uri": "URI", + "loading.browse-by": "Items worden ingeladen...", + "loading.collection": "Collectie wordt ingeladen...", + "loading.community": "Community wordt ingeladen...", + "loading.default": "Laden...", + "loading.item": "Item wordt ingeladen...", + "loading.objects": "Laden...", + "loading.recent-submissions": "Recent toegevoegde items worden ingeladen...", + "loading.search-results": "Zoekresultaten worden ingeladen...", + "loading.sub-collections": "De sub-collecties worden ingeladen...", + "loading.top-level-communities": "Inladen van de Communities op het hoogste niveau...", + "login.form.email": "Email adres", + "login.form.forgot-password": "Bent u uw wachtwoord vergeten?", + "login.form.header": "Gelieve in te loggen in DSpace", + "login.form.new-user": "Nieuwe gebruiker? Gelieve u hier te registreren", + "login.form.password": "Wachtwoord", + "login.form.submit": "Aanmelden", + "login.title": "Aanmelden", + "logout.form.header": "Afmelden in DSpace", + "logout.form.submit": "Afmelden", + "logout.title": "Afmelden", + "nav.home": "Home", + "nav.login": "Log In", + "nav.logout": "Log Uit", + "pagination.results-per-page": "Resultaten per pagina", + "pagination.showing.detail": "{{ range }} van {{ total }}", + "pagination.showing.label": "Resultaten ", + "pagination.sort-direction": "Sorteermogelijkheden", + "search.description": "", + "search.filters.applied.f.author": "Auteur", + "search.filters.applied.f.dateIssued.max": "Einddatum", + "search.filters.applied.f.dateIssued.min": "Startdatum", + "search.filters.applied.f.has_content_in_original_bundle": "Heeft bestanden", + "search.filters.applied.f.subject": "Sleutelwoord", + "search.filters.filter.author.head": "Auteur", + "search.filters.filter.author.placeholder": "Auteursnaam", + "search.filters.filter.dateIssued.head": "Datum", + "search.filters.filter.dateIssued.max.placeholder": "Vroegste Datum", + "search.filters.filter.dateIssued.min.placeholder": "Laatste Datum", + "search.filters.filter.has_content_in_original_bundle.head": "Heeft bestanden", + "search.filters.filter.scope.head": "Bereik", + "search.filters.filter.scope.placeholder": "Bereikfilter", + "search.filters.filter.show-less": "Inklappen", + "search.filters.filter.show-more": "Toon meer", + "search.filters.filter.subject.head": "Onderwerp", + "search.filters.filter.subject.placeholder": "Onderwerp", + "search.filters.head": "Filters", + "search.filters.reset": "Filters verwijderen", + "search.form.search": "Zoek", + "search.form.search_dspace": "Zoek in DSpace", + "search.results.head": "Zoekresultaten", + "search.results.no-results": "Er waren geen resultaten voor deze zoekopdracht", + "search.sidebar.close": "Terug naar de resultaten", + "search.sidebar.filters.title": "Filters", + "search.sidebar.open": "Zoek Tools", + "search.sidebar.results": "resultaten", + "search.sidebar.settings.rpp": "Resultaten per pagina", + "search.sidebar.settings.sort-by": "Sorteer volgens", + "search.sidebar.settings.title": "Instellingen", + "search.title": "DSpace Angular :: Zoek", + "search.view-switch.show-grid": "Toon in raster", + "search.view-switch.show-list": "Toon als lijst", + "sorting.dc.title.ASC": "Oplopend op titel", + "sorting.dc.title.DESC": "Aflopend op titel", + "sorting.score.DESC": "Relevantie", + "title": "DSpace" } From 01198c3ac52957435f66c4e1e6a654bcd630852f Mon Sep 17 00:00:00 2001 From: lotte Date: Thu, 1 Aug 2019 13:26:54 +0200 Subject: [PATCH 29/38] removed unnecessary static type in NormalizedWorkflowItem and fixed generic type for NormalizedWorkspaceItem --- .../core/submission/models/normalized-workflowitem.model.ts | 6 ------ .../submission/models/normalized-workspaceitem.model.ts | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/app/core/submission/models/normalized-workflowitem.model.ts b/src/app/core/submission/models/normalized-workflowitem.model.ts index 1f984f29d4..e96024b4ae 100644 --- a/src/app/core/submission/models/normalized-workflowitem.model.ts +++ b/src/app/core/submission/models/normalized-workflowitem.model.ts @@ -3,11 +3,6 @@ import { autoserialize, inheritSerialization } from 'cerialize'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { WorkflowItem } from './workflowitem.model'; import { NormalizedSubmissionObject } from './normalized-submission-object.model'; -import { ResourceType } from '../../shared/resource-type'; -import { NormalizedItem } from '../../cache/models/normalized-item.model'; -import { NormalizedCollection } from '../../cache/models/normalized-collection.model'; -import { NormalizedEPerson } from '../../eperson/models/normalized-eperson.model'; -import { NormalizedSubmissionDefinitionsModel } from '../../config/models/normalized-config-submission-definitions.model'; import { Collection } from '../../shared/collection.model'; import { Item } from '../../shared/item.model'; import { SubmissionDefinitionsModel } from '../../config/models/config-submission-definitions.model'; @@ -19,7 +14,6 @@ import { EPerson } from '../../eperson/models/eperson.model'; @mapsTo(WorkflowItem) @inheritSerialization(NormalizedSubmissionObject) export class NormalizedWorkflowItem extends NormalizedSubmissionObject { - static type = new ResourceType('workflowitem'); /** * The collection this workflowitem belonging to diff --git a/src/app/core/submission/models/normalized-workspaceitem.model.ts b/src/app/core/submission/models/normalized-workspaceitem.model.ts index 6fac3401e2..4275420191 100644 --- a/src/app/core/submission/models/normalized-workspaceitem.model.ts +++ b/src/app/core/submission/models/normalized-workspaceitem.model.ts @@ -4,7 +4,6 @@ import { WorkspaceItem } from './workspaceitem.model'; import { NormalizedSubmissionObject } from './normalized-submission-object.model'; import { mapsTo, relationship } from '../../cache/builders/build-decorators'; import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-object.model'; -import { WorkflowItem } from './workflowitem.model'; import { Item } from '../../shared/item.model'; import { Collection } from '../../shared/collection.model'; import { SubmissionDefinitionModel } from '../../config/models/config-submission-definition.model'; @@ -16,7 +15,7 @@ import { EPerson } from '../../eperson/models/eperson.model'; @mapsTo(WorkspaceItem) @inheritSerialization(NormalizedDSpaceObject) @inheritSerialization(NormalizedSubmissionObject) -export class NormalizedWorkspaceItem extends NormalizedSubmissionObject { +export class NormalizedWorkspaceItem extends NormalizedSubmissionObject { /** * The collection this workspaceitem belonging to From 16b8184dad5ac40f61832ee2a406b344338b4945 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Thu, 1 Aug 2019 13:54:34 +0200 Subject: [PATCH 30/38] patch protractor with the latest webdriver-manager --- package.json | 8 ++++++-- yarn.lock | 46 +++++++++++++++++++++++++++++++--------------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 5ec7b2d694..71e3775b7f 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,9 @@ "webdriver:update": "node node_modules/protractor/bin/webdriver-manager update --standalone --gecko false", "lint": "tslint \"src/**/*.ts\" && tslint \"e2e/**/*.ts\"", "docs": "typedoc --options typedoc.json ./src/", - "coverage": "http-server -c-1 -o -p 9875 ./coverage" + "coverage": "http-server -c-1 -o -p 9875 ./coverage", + "postinstall": "yarn run patch-protractor", + "patch-protractor": "ncp node_modules/webdriver-manager node_modules/protractor/node_modules/webdriver-manager" }, "dependencies": { "@angular/animations": "^6.1.4", @@ -192,6 +194,7 @@ "karma-sourcemap-loader": "0.3.7", "karma-webdriver-launcher": "1.0.5", "karma-webpack": "3.0.0", + "ncp": "^2.0.0", "ngrx-store-freeze": "^0.2.4", "node-sass": "^4.11.0", "nodemon": "^1.15.0", @@ -204,7 +207,7 @@ "postcss-loader": "^3.0.0", "postcss-responsive-type": "1.0.0", "postcss-smart-import": "0.7.6", - "protractor": "^5.3.0", + "protractor": "^5.4.2", "protractor-istanbul-plugin": "2.0.0", "raw-loader": "0.5.1", "resolve-url-loader": "^2.3.0", @@ -225,6 +228,7 @@ "tslint": "5.11.0", "typedoc": "^0.9.0", "typescript": "^2.9.1", + "webdriver-manager": "^12.1.6", "webpack": "^4.17.1", "webpack-bundle-analyzer": "^3.3.2", "webpack-dev-middleware": "3.2.0", diff --git a/yarn.lock b/yarn.lock index eb0733e695..fcc26f5ce0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -411,11 +411,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.4.tgz#0f4cb2dc7c1de6096055357f70179043c33e9897" integrity sha512-fCHV45gS+m3hH17zgkgADUSi2RR1Vht6wOZ0jyHP8rjiQra9f+mIcgwPQHllmDocYOstIEbKlxbFDYlgrTPYqw== -"@types/node@^6.0.46": - version "6.0.116" - resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.116.tgz#2f9cd62b4ecc4927e3942e2655c182eecf5b45f1" - integrity sha512-vToa8YEeulfyYg1gSOeHjvvIRqrokng62VMSj2hoZrwZNcYrp2h3AWo6KeBVuymIklQUaY5zgVJvVsC4KiiLkQ== - "@types/q@^0.0.32": version "0.0.32" resolved "https://registry.yarnpkg.com/@types/q/-/q-0.0.32.tgz#bd284e57c84f1325da702babfc82a5328190c0c5" @@ -6737,6 +6732,11 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" +ncp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" + integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M= + needle@^2.2.1: version "2.2.2" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.2.tgz#1120ca4c41f2fcc6976fd28a8968afe239929418" @@ -8480,12 +8480,11 @@ protractor-istanbul-plugin@2.0.0: q "^1.4.1" uuid "^2.0.1" -protractor@^5.3.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/protractor/-/protractor-5.4.0.tgz#e71c9c1f5cf6c5e9bdbcdb71e7f31b17ffd2878f" - integrity sha512-6TSYqMhUUzxr4/wN0ttSISqPMKvcVRXF4k8jOEpGWD8OioLak4KLgfzHK9FJ49IrjzRrZ+Mx1q2Op8Rk0zEcnQ== +protractor@^5.4.2: + version "5.4.2" + resolved "https://registry.yarnpkg.com/protractor/-/protractor-5.4.2.tgz#329efe37f48b2141ab9467799be2d4d12eb48c13" + integrity sha512-zlIj64Cr6IOWP7RwxVeD8O4UskLYPoyIcg0HboWJL9T79F1F0VWtKkGTr/9GN6BKL+/Q/GmM7C9kFVCfDbP5sA== dependencies: - "@types/node" "^6.0.46" "@types/q" "^0.0.32" "@types/selenium-webdriver" "^3.0.0" blocking-proxy "^1.0.0" @@ -8499,7 +8498,7 @@ protractor@^5.3.0: saucelabs "^1.5.0" selenium-webdriver "3.6.0" source-map-support "~0.4.0" - webdriver-js-extender "2.0.0" + webdriver-js-extender "2.1.0" webdriver-manager "^12.0.6" proxy-addr@~2.0.2: @@ -11027,10 +11026,10 @@ wd@^1.0.0: request "2.85.0" vargs "0.1.0" -webdriver-js-extender@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/webdriver-js-extender/-/webdriver-js-extender-2.0.0.tgz#b27fc1ed1afbf78f0ac57e4c878f31b10e57f146" - integrity sha512-fbyKiVu3azzIc5d4+26YfuPQcFTlgFQV5yQ/0OQj4Ybkl4g1YQuIPskf5v5wqwRJhHJnPHthB6tqCjWHOKLWag== +webdriver-js-extender@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz#57d7a93c00db4cc8d556e4d3db4b5db0a80c3bb7" + integrity sha512-lcUKrjbBfCK6MNsh7xaY2UAUmZwe+/ib03AjVOpFobX4O7+83BUveSrLfU0Qsyb1DaKJdQRbuU+kM9aZ6QUhiQ== dependencies: "@types/selenium-webdriver" "^3.0.0" selenium-webdriver "^3.0.1" @@ -11052,6 +11051,23 @@ webdriver-manager@^12.0.6: semver "^5.3.0" xml2js "^0.4.17" +webdriver-manager@^12.1.6: + version "12.1.6" + resolved "https://registry.yarnpkg.com/webdriver-manager/-/webdriver-manager-12.1.6.tgz#9e5410c506d1a7e0a7aa6af91ba3d5bb37f362b6" + integrity sha512-B1mOycNCrbk7xODw7Jgq/mdD3qzPxMaTsnKIQDy2nXlQoyjTrJTTD0vRpEZI9b8RibPEyQvh9zIZ0M1mpOxS3w== + dependencies: + adm-zip "^0.4.9" + chalk "^1.1.1" + del "^2.2.0" + glob "^7.0.3" + ini "^1.3.4" + minimist "^1.2.0" + q "^1.4.1" + request "^2.87.0" + rimraf "^2.5.2" + semver "^5.3.0" + xml2js "^0.4.17" + webfontloader@1.6.28: version "1.6.28" resolved "https://registry.yarnpkg.com/webfontloader/-/webfontloader-1.6.28.tgz#db786129253cb6e8eae54c2fb05f870af6675bae" From 8148a67e40d2c19d73c08005dfb5149347ed347f Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Fri, 2 Aug 2019 16:52:15 +0200 Subject: [PATCH 31/38] double e2e jasmine timeout --- protractor.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protractor.conf.js b/protractor.conf.js index 2949702a0a..b7b054a61e 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -73,7 +73,7 @@ exports.config = { framework: 'jasmine', jasmineNodeOpts: { showColors: true, - defaultTimeoutInterval: 30000, + defaultTimeoutInterval: 60000, print: function () {} }, useAllAngular2AppRoots: true, From 73f67827f36918e04ba52ab618d494a2e4fc0e5e Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Mon, 5 Aug 2019 18:19:46 +0200 Subject: [PATCH 32/38] upgrade dependencies to prevent CVE-2019-10744, CVE-2019-13173, CVE-2018-14732, CVE-2018-16469, CVE-2018-1000620, CVE-2019-10744 and WS-2018-0236 --- package.json | 6 +- yarn.lock | 1236 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 809 insertions(+), 433 deletions(-) diff --git a/package.json b/package.json index 0a4f8c3793..ba354ad830 100644 --- a/package.json +++ b/package.json @@ -169,7 +169,7 @@ "codelyzer": "^4.4.4", "compression-webpack-plugin": "^1.1.6", "copy-webpack-plugin": "^4.4.1", - "copyfiles": "^2.1.0", + "copyfiles": "^2.1.1", "coveralls": "3.0.0", "css-loader": "1.0.0", "cssnano": "^4.1.10", @@ -192,7 +192,7 @@ "karma-remap-coverage": "^0.1.5", "karma-remap-istanbul": "0.6.0", "karma-sourcemap-loader": "0.3.7", - "karma-webdriver-launcher": "1.0.5", + "karma-webdriver-launcher": "^1.0.7", "karma-webpack": "3.0.0", "ncp": "^2.0.0", "ngrx-store-freeze": "^0.2.4", @@ -232,7 +232,7 @@ "webpack": "^4.17.1", "webpack-bundle-analyzer": "^3.3.2", "webpack-dev-middleware": "3.2.0", - "webpack-dev-server": "^3.1.5", + "webpack-dev-server": "^3.1.11", "webpack-import-glob-loader": "^1.6.3", "webpack-merge": "4.1.4", "webpack-node-externals": "1.7.2" diff --git a/yarn.lock b/yarn.lock index cc8244dd35..0829523983 100644 --- a/yarn.lock +++ b/yarn.lock @@ -346,6 +346,15 @@ dependencies: "@types/node" "*" +"@types/glob@^7.1.1": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" + integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== + dependencies: + "@types/events" "*" + "@types/minimatch" "*" + "@types/node" "*" + "@types/hammerjs@2.0.35": version "2.0.35" resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.35.tgz#7b7c950c7d54593e23bffc8d2b4feba9866a7277" @@ -396,6 +405,11 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.0.tgz#5a7306e367c539b9f6543499de8dd519fac37a8b" integrity sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA== +"@types/minimatch@*": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" + integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== + "@types/minimatch@2.0.29": version "2.0.29" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a" @@ -720,7 +734,7 @@ ajv-keywords@^3.1.0: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" integrity sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo= -ajv@^5.0.0, ajv@^5.1.0, ajv@^5.3.0: +ajv@^5.0.0, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= @@ -798,6 +812,13 @@ ansi-align@^2.0.0: dependencies: string-width "^2.0.0" +ansi-colors@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" + integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA== + dependencies: + ansi-wrap "^0.1.0" + ansi-colors@^3.0.0: version "3.0.5" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.0.5.tgz#cb9dc64993b64fd6945485f797fc3853137d9a7b" @@ -849,6 +870,11 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -861,7 +887,7 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-wrap@0.1.0: +ansi-wrap@0.1.0, ansi-wrap@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= @@ -897,31 +923,34 @@ aproba@^1.0.3, aproba@^1.1.1: resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== -archiver-utils@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-1.3.0.tgz#e50b4c09c70bf3d680e32ff1b7994e9f9d895174" - integrity sha1-5QtMCccL89aA4y/xt5lOn52JUXQ= +archiver-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-2.1.0.tgz#e8a460e94b693c3e3da182a098ca6285ba9249e2" + integrity sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw== dependencies: - glob "^7.0.0" - graceful-fs "^4.1.0" + glob "^7.1.4" + graceful-fs "^4.2.0" lazystream "^1.0.0" - lodash "^4.8.0" - normalize-path "^2.0.0" + lodash.defaults "^4.2.0" + lodash.difference "^4.5.0" + lodash.flatten "^4.4.0" + lodash.isplainobject "^4.0.6" + lodash.union "^4.6.0" + normalize-path "^3.0.0" readable-stream "^2.0.0" -archiver@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/archiver/-/archiver-2.1.1.tgz#ff662b4a78201494a3ee544d3a33fe7496509ebc" - integrity sha1-/2YrSnggFJSj7lRNOjP+dJZQnrw= +archiver@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/archiver/-/archiver-3.1.1.tgz#9db7819d4daf60aec10fe86b16cb9258ced66ea0" + integrity sha512-5Hxxcig7gw5Jod/8Gq0OneVgLYET+oNHcxgWItq4TbhOzRLKNAFUb9edAftiMKXvXfCB0vbGrJdZDNq0dWMsxg== dependencies: - archiver-utils "^1.3.0" - async "^2.0.0" + archiver-utils "^2.1.0" + async "^2.6.3" buffer-crc32 "^0.2.1" - glob "^7.0.0" - lodash "^4.8.0" - readable-stream "^2.0.0" - tar-stream "^1.5.0" - zip-stream "^1.2.0" + glob "^7.1.4" + readable-stream "^3.4.0" + tar-stream "^2.1.0" + zip-stream "^2.1.2" are-we-there-yet@~1.1.2: version "1.1.5" @@ -1083,6 +1112,11 @@ async-each@^1.0.0: resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" integrity sha1-GdOGodntxufByF04iu28xW0zYC0= +async-each@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + async-foreach@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" @@ -1098,13 +1132,6 @@ async@1.x, async@^1.5.2: resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= -async@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.0.1.tgz#b709cc0280a9c36f09f4536be823c838a9049e25" - integrity sha1-twnMAoCpw28J9FNr6CPIOKkEniU= - dependencies: - lodash "^4.8.0" - async@^2.0.0, async@^2.5.0: version "2.6.1" resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" @@ -1118,6 +1145,13 @@ async@^2.1.4: dependencies: lodash "^4.17.11" +async@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== + dependencies: + lodash "^4.17.14" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1157,7 +1191,7 @@ aws-sign2@~0.7.0: resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= -aws4@^1.6.0, aws4@^1.8.0: +aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== @@ -1353,13 +1387,12 @@ binary-extensions@^1.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" integrity sha1-RqoXUftqL5PuXmibsQh9SxTGwgU= -bl@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" - integrity sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA== +bl@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-3.0.0.tgz#3611ec00579fd18561754360b21e9f784500ff88" + integrity sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A== dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" + readable-stream "^3.0.1" blob@0.0.4: version "0.0.4" @@ -1455,20 +1488,6 @@ boolbase@^1.0.0, boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= -boom@4.x.x: - version "4.3.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" - integrity sha1-T4owBctKfjiJ90kDD9JbluAdLjE= - dependencies: - hoek "4.x.x" - -boom@5.x.x: - version "5.2.0" - resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" - integrity sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw== - dependencies: - hoek "4.x.x" - bootstrap@4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.3.1.tgz#280ca8f610504d99d7b6b4bfc4b68cec601704ac" @@ -1511,7 +1530,7 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" -braces@^2.3.0, braces@^2.3.1: +braces@^2.3.0, braces@^2.3.1, braces@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== @@ -1532,6 +1551,11 @@ brorand@^1.0.1: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" @@ -1629,7 +1653,7 @@ buffer-alloc-unsafe@^1.1.0: resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== -buffer-alloc@^1.1.0, buffer-alloc@^1.2.0: +buffer-alloc@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== @@ -1637,7 +1661,7 @@ buffer-alloc@^1.1.0, buffer-alloc@^1.2.0: buffer-alloc-unsafe "^1.1.0" buffer-fill "^1.0.0" -buffer-crc32@^0.2.1: +buffer-crc32@^0.2.1, buffer-crc32@^0.2.13: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= @@ -1813,6 +1837,11 @@ camelcase@^4.0.0, camelcase@^4.1.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + caniuse-api@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-2.0.0.tgz#b1ddb5a5966b16f48dc4998444d4bbc6c7d9d834" @@ -1936,6 +1965,25 @@ chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.0.3, chokidar@^2.0.4: optionalDependencies: fsevents "^1.2.2" +chokidar@^2.1.6: + version "2.1.6" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.6.tgz#b6cad653a929e244ce8a834244164d241fa954c5" + integrity sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.1" + optionalDependencies: + fsevents "^1.2.7" + chownr@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" @@ -2023,6 +2071,15 @@ cliui@^4.0.0: strip-ansi "^4.0.0" wrap-ansi "^2.0.0" +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + clone-deep@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-2.0.2.tgz#00db3a1e173656730d1188c3d6aced6d7ea97713" @@ -2169,13 +2226,18 @@ combine-lists@^1.0.0: dependencies: lodash "^4.5.0" -combined-stream@1.0.6, combined-stream@~1.0.5, combined-stream@~1.0.6: +combined-stream@1.0.6, combined-stream@~1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" integrity sha1-cj599ugBrFYTETp+RFqbactjKBg= dependencies: delayed-stream "~1.0.0" +commander@2.15.1: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== + commander@2.17.x, commander@~2.17.1: version "2.17.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" @@ -2211,23 +2273,30 @@ component-inherit@0.0.3: resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= -compress-commons@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-1.2.2.tgz#524a9f10903f3a813389b0225d27c48bb751890f" - integrity sha1-UkqfEJA/OoEzibAiXSfEi7dRiQ8= +compress-commons@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-2.1.1.tgz#9410d9a534cf8435e3fbbb7c6ce48de2dc2f0610" + integrity sha512-eVw6n7CnEMFzc3duyFVrQEuY1BlHR3rYsSztyG32ibGMW722i3C6IizEGMFmfMU+A+fALvBIwxN3czffTcdA+Q== dependencies: - buffer-crc32 "^0.2.1" - crc32-stream "^2.0.0" - normalize-path "^2.0.0" - readable-stream "^2.0.0" + buffer-crc32 "^0.2.13" + crc32-stream "^3.0.1" + normalize-path "^3.0.0" + readable-stream "^2.3.6" -compressible@~2.0.11, compressible@~2.0.14: +compressible@~2.0.11: version "2.0.14" resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.14.tgz#326c5f507fbb055f54116782b969a81b67a29da7" integrity sha1-MmxfUH+7BV9UEWeCuWmoG2einac= dependencies: mime-db ">= 1.34.0 < 2" +compressible@~2.0.16: + version "2.0.17" + resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.17.tgz#6e8c108a16ad58384a977f3a482ca20bff2f38c1" + integrity sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw== + dependencies: + mime-db ">= 1.40.0 < 2" + compression-webpack-plugin@^1.1.6: version "1.1.12" resolved "https://registry.yarnpkg.com/compression-webpack-plugin/-/compression-webpack-plugin-1.1.12.tgz#becd2aec620ace96bb3fe9a42a55cf48acc8b4d4" @@ -2252,16 +2321,16 @@ compression@1.7.1: safe-buffer "5.1.1" vary "~1.1.2" -compression@^1.5.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.3.tgz#27e0e176aaf260f7f2c2813c3e440adb9f1993db" - integrity sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg== +compression@^1.7.4: + version "1.7.4" + resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f" + integrity sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ== dependencies: accepts "~1.3.5" bytes "3.0.0" - compressible "~2.0.14" + compressible "~2.0.16" debug "2.6.9" - on-headers "~1.0.1" + on-headers "~1.0.2" safe-buffer "5.1.2" vary "~1.1.2" @@ -2292,10 +2361,10 @@ configstore@^3.0.0: write-file-atomic "^2.0.0" xdg-basedir "^3.0.0" -connect-history-api-fallback@^1.3.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz#b06873934bc5e344fef611a196a6faae0aee015a" - integrity sha1-sGhzk0vF40T+9hGhlqb6rgruAVo= +connect-history-api-fallback@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" + integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== connect@^3.6.0: version "3.6.6" @@ -2405,17 +2474,17 @@ copy-webpack-plugin@^4.4.1: p-limit "^1.0.0" serialize-javascript "^1.4.0" -copyfiles@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-2.1.0.tgz#0e2a4188162d6b2f3c5adfe34e9c0bd564d23164" - integrity sha512-cAeDE0vL/koE9WSEGxqPpSyvU638Kgfu6wfrnj7kqp9FWa1CWsU54Coo6sdYZP4GstWa39tL/wIVJWfXcujgNA== +copyfiles@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-2.1.1.tgz#d430e122d7880f92c45d372208b0af03b0c39db6" + integrity sha512-y6DZHve80whydXzBal7r70TBgKMPKesVRR1Sn/raUu7Jh/i7iSLSyGvYaq0eMJ/3Y/CKghwzjY32q1WzEnpp3Q== dependencies: glob "^7.0.5" minimatch "^3.0.3" mkdirp "^0.5.1" noms "0.0.0" through2 "^2.0.1" - yargs "^11.0.0" + yargs "^13.2.4" core-js@^2.2.0, core-js@^2.4.0, core-js@^2.5.7: version "2.5.7" @@ -2469,13 +2538,13 @@ coveralls@3.0.0: minimist "^1.2.0" request "^2.79.0" -crc32-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/crc32-stream/-/crc32-stream-2.0.0.tgz#e3cdd3b4df3168dd74e3de3fbbcb7b297fe908f4" - integrity sha1-483TtN8xaN10494/u8t7KX/pCPQ= +crc32-stream@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/crc32-stream/-/crc32-stream-3.0.1.tgz#cae6eeed003b0e44d739d279de5ae63b171b4e85" + integrity sha512-mctvpXlbzsvK+6z8kJwSJ5crm7yBwrQMTybJzMw1O4lLGJqjlDCXY2Zw7KheiA6XBEcBmfLx1D88mjRGVJtY9w== dependencies: crc "^3.4.4" - readable-stream "^2.0.0" + readable-stream "^3.4.0" crc@3.4.4: version "3.4.4" @@ -2560,13 +2629,6 @@ crypt@~0.0.1: resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs= -cryptiles@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" - integrity sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4= - dependencies: - boom "5.x.x" - crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -2826,6 +2888,11 @@ d@1: dependencies: es5-ext "^0.10.9" +dargs@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/dargs/-/dargs-5.1.0.tgz#ec7ea50c78564cd36c9d5ec18f66329fade27829" + integrity sha1-7H6lDHhWTNNsnV7Bj2Yyn63ieCk= + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -2857,32 +2924,39 @@ debug-loader@^0.0.1: dependencies: loader-utils "^0.2.12" -debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.6, debug@^2.6.8: +debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@^3.1.0, debug@~3.1.0: +debug@3.1.0, debug@^3.1.0, debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: ms "2.0.0" -decamelize@^1.1.1, decamelize@^1.1.2: +debug@^3.2.5: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@^4.1.0, debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= -decamelize@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-2.0.0.tgz#656d7bbc8094c4c788ea53c5840908c9c7d063c7" - integrity sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg== - dependencies: - xregexp "4.0.0" - decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -2913,12 +2987,12 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -default-gateway@^2.6.0: - version "2.7.2" - resolved "https://registry.yarnpkg.com/default-gateway/-/default-gateway-2.7.2.tgz#b7ef339e5e024b045467af403d50348db4642d0f" - integrity sha512-lAc4i9QJR0YHSDFdzeBQKfZ1SRDG3hsJNEkrpcZa8QhBfidLAilT60BDEIVUUGqosFp425KOgB3uYqcnQrWafQ== +default-gateway@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/default-gateway/-/default-gateway-4.2.0.tgz#167104c7500c2115f6dd69b0a536bb8ed720552b" + integrity sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA== dependencies: - execa "^0.10.0" + execa "^1.0.0" ip-regex "^2.1.0" define-properties@^1.1.2, define-properties@^1.1.3: @@ -2963,17 +3037,18 @@ del@^2.2.0: pinkie-promise "^2.0.0" rimraf "^2.2.8" -del@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" - integrity sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU= +del@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4" + integrity sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ== dependencies: + "@types/glob" "^7.1.1" globby "^6.1.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - p-map "^1.1.1" - pify "^3.0.0" - rimraf "^2.2.8" + is-path-cwd "^2.0.0" + is-path-in-cwd "^2.0.0" + p-map "^2.0.0" + pify "^4.0.1" + rimraf "^2.6.3" delayed-stream@~1.0.0: version "1.0.0" @@ -3025,17 +3100,17 @@ detect-libc@^1.0.2: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= -detect-node@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.3.tgz#a2033c09cc8e158d37748fbde7507832bd6ce127" - integrity sha1-ogM8CcyOFY03dI+951B4Mr1s4Sc= +detect-node@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" + integrity sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw== di@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= -diff@^3.1.0, diff@^3.2.0: +diff@3.5.0, diff@^3.1.0, diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== @@ -3237,6 +3312,11 @@ elliptic@^6.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.0" +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" @@ -3254,7 +3334,7 @@ encoding@^0.1.11: dependencies: iconv-lite "~0.4.13" -end-of-stream@^1.0.0, end-of-stream@^1.1.0: +end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== @@ -3435,7 +3515,7 @@ escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -3525,12 +3605,12 @@ events@^1.0.0: resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ= -eventsource@0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-0.1.6.tgz#0acede849ed7dd1ccc32c811bb11b944d4f29232" - integrity sha1-Cs7ehJ7X3RzMMsgRuxG5RNTykjI= +eventsource@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.0.7.tgz#8fbc72c93fcd34088090bc0a4e64f4b5cee6d8d0" + integrity sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ== dependencies: - original ">=0.0.5" + original "^1.0.0" evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: version "1.0.3" @@ -3566,6 +3646,19 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -3674,7 +3767,7 @@ express@4.16.2: utils-merge "1.0.1" vary "~1.1.2" -express@^4.16.2, express@^4.16.3: +express@^4.16.3, express@^4.17.1: version "4.17.1" resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== @@ -3732,7 +3825,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@^3.0.0, extend@~3.0.1, extend@~3.0.2: +extend@^3.0.0, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -3805,6 +3898,16 @@ fancy-log@^1.1.0: color-support "^1.1.3" time-stamp "^1.0.0" +fancy-log@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" + integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== + dependencies: + ansi-gray "^0.1.1" + color-support "^1.1.3" + parse-node-version "^1.0.0" + time-stamp "^1.0.0" + fast-deep-equal@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" @@ -3856,10 +3959,10 @@ faye-websocket@^0.10.0: dependencies: websocket-driver ">=0.5.1" -faye-websocket@~0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.1.tgz#f0efe18c4f56e4f40afc7e06c719fd5ee6188f38" - integrity sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg= +faye-websocket@~0.11.1: + version "0.11.3" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.3.tgz#5c0e9a8968e8912c286639fde977a8b209f2508e" + integrity sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA== dependencies: websocket-driver ">=0.5.1" @@ -4040,7 +4143,7 @@ fork-ts-checker-webpack-plugin@^0.4.10: resolve "^1.5.0" tapable "^1.0.0" -form-data@~2.3.1, form-data@~2.3.2: +form-data@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" integrity sha1-SXBJi+YEwgwAXU9cI67NIda0kJk= @@ -4157,10 +4260,18 @@ fsevents@^1.0.0, fsevents@^1.2.2: nan "^2.9.2" node-pre-gyp "^0.10.0" +fsevents@^1.2.7: + version "1.2.9" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" + integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw== + dependencies: + nan "^2.12.1" + node-pre-gyp "^0.12.0" + fstream@^1.0.0, fstream@^1.0.2: - version "1.0.11" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" - integrity sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE= + version "1.0.12" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045" + integrity sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg== dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -4198,6 +4309,11 @@ get-caller-file@^1.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" @@ -4213,6 +4329,13 @@ get-stream@^3.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -4253,6 +4376,18 @@ glob-to-regexp@^0.3.0: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= +glob@7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + glob@^5.0.15: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" @@ -4276,6 +4411,18 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2, gl once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.3, glob@^7.1.4: + version "7.1.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + global-dirs@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" @@ -4381,11 +4528,34 @@ got@^6.7.1: unzip-response "^2.0.1" url-parse-lax "^1.0.0" -graceful-fs@^4.1.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= +graceful-fs@^4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.1.tgz#1c1f0c364882c868f5bff6512146328336a11b1d" + integrity sha512-b9usnbDGnD928gJB3LrCmxoibr3VE4U2SMo5PBuBnokWyDADTqDPXg4YpwKF1trpH+UbGp7QLicO3+aWEy0+mw== + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +gulp-mocha@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/gulp-mocha/-/gulp-mocha-6.0.0.tgz#80f32bc705ce30747f355ddb8ccd96a1c73bef13" + integrity sha512-FfBldW5ttnDpKf4Sg6/BLOOKCCbr5mbixDGK1t02/8oSrTCwNhgN/mdszG3cuQuYNzuouUdw4EH/mlYtgUscPg== + dependencies: + dargs "^5.1.0" + execa "^0.10.0" + mocha "^5.2.0" + npm-run-path "^2.0.2" + plugin-error "^1.0.1" + supports-color "^5.4.0" + through2 "^2.0.3" + gulp-util@3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.7.tgz#78925c4b8f8b49005ac01a011c557e6218941cbb" @@ -4425,10 +4595,10 @@ gzip-size@^5.0.0: duplexer "^0.1.1" pify "^4.0.1" -handle-thing@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" - integrity sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ= +handle-thing@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.0.tgz#0e039695ff50c93fc288557d696f3c1dc6776754" + integrity sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ== handlebars@^4.0.1, handlebars@^4.0.6: version "4.1.2" @@ -4446,14 +4616,6 @@ har-schema@^2.0.0: resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= -har-validator@~5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" - integrity sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0= - dependencies: - ajv "^5.1.0" - har-schema "^2.0.0" - har-validator@~5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" @@ -4570,17 +4732,7 @@ hasha@^2.2.0: is-stream "^1.0.1" pinkie-promise "^2.0.0" -hawk@~6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" - integrity sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ== - dependencies: - boom "4.x.x" - cryptiles "3.x.x" - hoek "4.x.x" - sntp "2.x.x" - -he@1.1.x: +he@1.1.1, he@1.1.x: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= @@ -4609,11 +4761,6 @@ hmac-drbg@^1.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -hoek@4.x.x: - version "4.2.1" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" - integrity sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA== - homedir-polyfill@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" @@ -4656,7 +4803,7 @@ html-comment-regex@^1.1.0: resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7" integrity sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ== -html-entities@^1.2.0: +html-entities@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.2.1.tgz#0df29351f0721163515dfb9e5543e5f6eed5162f" integrity sha1-DfKTUfByEWNRXfueVUPl9u7VFi8= @@ -4738,17 +4885,17 @@ http-parser-js@>=0.4.0: resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.4.13.tgz#3bd6d6fde6e3172c9334c3b33b6c193d80fe1137" integrity sha1-O9bW/ebjFyyTNMOzO2wZPYD+ETc= -http-proxy-middleware@~0.18.0: - version "0.18.0" - resolved "http://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz#0987e6bb5a5606e5a69168d8f967a87f15dd8aab" - integrity sha512-Fs25KVMPAIIcgjMZkVHJoKg9VcXcC1C8yb9JUgeDvVXY0S/zgVIhMb+qVswDIgtJe2DfckMSY2d6TuTEutlk6Q== +http-proxy-middleware@^0.19.1: + version "0.19.1" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz#183c7dc4aa1479150306498c210cdaf96080a43a" + integrity sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q== dependencies: - http-proxy "^1.16.2" + http-proxy "^1.17.0" is-glob "^4.0.0" - lodash "^4.17.5" - micromatch "^3.1.9" + lodash "^4.17.11" + micromatch "^3.1.10" -http-proxy@^1.13.0, http-proxy@^1.16.2, http-proxy@^1.8.1: +http-proxy@^1.13.0, http-proxy@^1.17.0, http-proxy@^1.8.1: version "1.17.0" resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" integrity sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g== @@ -4896,6 +5043,14 @@ import-local@^1.0.0: pkg-dir "^2.0.0" resolve-cwd "^2.0.0" +import-local@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" + integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== + dependencies: + pkg-dir "^3.0.0" + resolve-cwd "^2.0.0" + imports-loader@0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/imports-loader/-/imports-loader-0.8.0.tgz#030ea51b8ca05977c40a3abfd9b4088fe0be9a69" @@ -4992,13 +5147,13 @@ inquirer@^6.0.0: strip-ansi "^4.0.0" through "^2.3.6" -internal-ip@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-3.0.1.tgz#df5c99876e1d2eb2ea2d74f520e3f669a00ece27" - integrity sha512-NXXgESC2nNVtU+pqmC9e6R8B1GpKxzsAQhffvh5AL79qKnodd+L7tnEQmTiUAVngqLalPbSqRA7XGIEL5nCd0Q== +internal-ip@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907" + integrity sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg== dependencies: - default-gateway "^2.6.0" - ipaddr.js "^1.5.2" + default-gateway "^4.2.0" + ipaddr.js "^1.9.0" interpret@^1.0.0, interpret@^1.1.0: version "1.1.0" @@ -5017,6 +5172,11 @@ invert-kv@^1.0.0: resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== + ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" @@ -5037,10 +5197,10 @@ ipaddr.js@1.9.0: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== -ipaddr.js@^1.5.2: - version "1.8.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.1.tgz#fa4b79fa47fd3def5e3b159825161c0a519c9427" - integrity sha1-+kt5+kf9Pe9eOxWYJRYcClGclCc= +ipaddr.js@^1.9.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== is-absolute-url@^2.0.0: version "2.1.0" @@ -5282,6 +5442,11 @@ is-path-cwd@^1.0.0: resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= +is-path-cwd@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" + integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== + is-path-in-cwd@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" @@ -5289,6 +5454,13 @@ is-path-in-cwd@^1.0.0: dependencies: is-path-inside "^1.0.0" +is-path-in-cwd@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz#bfe2dca26c69f397265a4009963602935a053acb" + integrity sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ== + dependencies: + is-path-inside "^2.1.0" + is-path-inside@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" @@ -5296,6 +5468,13 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" +is-path-inside@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-2.1.0.tgz#7c9810587d659a40d27bcdb4d5616eab059494b2" + integrity sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg== + dependencies: + path-is-inside "^1.0.2" + is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -5749,12 +5928,12 @@ karma-sourcemap-loader@0.3.7: dependencies: graceful-fs "^4.1.2" -karma-webdriver-launcher@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/karma-webdriver-launcher/-/karma-webdriver-launcher-1.0.5.tgz#b1c3cb347f26e786039c15abf7f19a7791e8ddd7" - integrity sha1-scPLNH8m54YDnBWr9/Gad5Ho3dc= +karma-webdriver-launcher@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/karma-webdriver-launcher/-/karma-webdriver-launcher-1.0.7.tgz#fad955be541e0c41e2a19cfa2b4b9022e5b77626" + integrity sha512-LFO3EYQPjMXvilZ6ZJVfc2SRJpSDdhv73kmPVjDJy7vqC+wIuF7kUqKUuP0feHcJQnEGsj85SE4H3QFj1YObuw== dependencies: - wd "^1.0.0" + wd "^1.11.0" karma-webpack@3.0.0: version "3.0.0" @@ -5806,10 +5985,10 @@ kew@^0.7.0: resolved "https://registry.yarnpkg.com/kew/-/kew-0.7.0.tgz#79d93d2d33363d6fdd2970b335d9141ad591d79b" integrity sha1-edk9LTM2PW/dKXCzNdkUGtWR15s= -killable@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.0.tgz#da8b84bd47de5395878f95d64d02f2449fe05e6b" - integrity sha1-2ouEvUfeU5WHj5XWTQLyRJ/gXms= +killable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" + integrity sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg== kind-of@^1.1.0: version "1.1.0" @@ -5876,6 +6055,13 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== + dependencies: + invert-kv "^2.0.0" + lcov-parse@^0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" @@ -6022,7 +6208,7 @@ lodash._reevaluate@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" integrity sha1-WLx0xAZklTrgsSTYBpltrKQx4u0= -lodash._reinterpolate@^3.0.0, lodash._reinterpolate@~3.0.0: +lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= @@ -6069,11 +6255,16 @@ lodash.defaults@^3.1.2: lodash.assign "^3.0.0" lodash.restparam "^3.0.0" -lodash.defaults@^4.0.0: +lodash.defaults@^4.0.0, lodash.defaults@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= +lodash.difference@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.difference/-/lodash.difference-4.5.0.tgz#9ccb4e505d486b91651345772885a2df27fd017c" + integrity sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw= + lodash.endswith@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/lodash.endswith/-/lodash.endswith-4.2.1.tgz#fed59ac1738ed3e236edd7064ec456448b37bc09" @@ -6086,6 +6277,11 @@ lodash.escape@^3.0.0: dependencies: lodash._root "^3.0.0" +lodash.flatten@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" + integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= + lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" @@ -6106,6 +6302,11 @@ lodash.isfunction@^3.0.8: resolved "https://registry.yarnpkg.com/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz#06de25df4db327ac931981d1bdb067e5af68d051" integrity sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw== +lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= + lodash.isstring@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" @@ -6161,11 +6362,11 @@ lodash.template@^3.0.0: lodash.templatesettings "^3.0.0" lodash.template@^4.2.4: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" - integrity sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A= + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" + integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== dependencies: - lodash._reinterpolate "~3.0.0" + lodash._reinterpolate "^3.0.0" lodash.templatesettings "^4.0.0" lodash.templatesettings@^3.0.0: @@ -6177,25 +6378,26 @@ lodash.templatesettings@^3.0.0: lodash.escape "^3.0.0" lodash.templatesettings@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" - integrity sha1-K01OlbpEDZFf8IvImeRVNmZxMxY= + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" + integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== dependencies: - lodash._reinterpolate "~3.0.0" + lodash._reinterpolate "^3.0.0" + +lodash.union@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" + integrity sha1-SLtQiECfFvGCFmZkHETdGqrjzYg= lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@4.17.10, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.13.1, lodash@^4.17.0, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@^4.5.0, lodash@^4.8.0, lodash@~4.17.10: - version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" - integrity sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg== - -lodash@^4.17.11: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" +lodash@^4.0.0, lodash@^4.0.1, lodash@^4.13.1, lodash@^4.17.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@^4.5.0, lodash@~4.17.10: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== log-driver@^1.2.5: version "1.2.7" @@ -6220,10 +6422,10 @@ log4js@^3.0.0: rfdc "^1.1.2" streamroller "0.7.0" -loglevel@^1.4.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa" - integrity sha1-4PyVEztu8nbNyIh82vJKpvFW+Po= +loglevel@^1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.3.tgz#77f2eb64be55a404c9fd04ad16d57c1d6d6b1280" + integrity sha512-LoEDv5pgpvWgPF4kNYuIp0qqSJVWak/dML0RY74xlzMZiT9w77teNAwKYKWBTYjlokMirg+o3jBwp+vlLrcfAA== loglevelnext@^1.0.1: version "1.0.5" @@ -6305,6 +6507,13 @@ mamacro@^0.0.3: resolved "https://registry.yarnpkg.com/mamacro/-/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4" integrity sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA== +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== + dependencies: + p-defer "^1.0.0" + map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -6369,14 +6578,16 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= -mem@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" - integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= +mem@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== dependencies: - mimic-fn "^1.0.0" + map-age-cleaner "^0.1.1" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" -memory-fs@^0.4.0, memory-fs@~0.4.1: +memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= @@ -6423,9 +6634,9 @@ merge2@^1.2.1: integrity sha512-bgM8twH86rWni21thii6WCMQMRMmwqqdW3sGWi9IipnVAszdLXRjwDwAnyrVXo6DuP3AjRMMttZKUB48QWIFGg== merge@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" - integrity sha1-dTHjnUlJwoGma4xabgJl6LBYlNo= + version "1.2.1" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" + integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ== methods@1.1.2, methods@~1.1.2: version "1.1.2" @@ -6451,7 +6662,7 @@ micromatch@^2.1.5, micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8, micromatch@^3.1.9: +micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -6478,7 +6689,7 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.40.0: +mime-db@1.40.0, "mime-db@>= 1.40.0 < 2": version "1.40.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== @@ -6517,11 +6728,21 @@ mime@^2.1.0, mime@^2.3.1: resolved "https://registry.yarnpkg.com/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369" integrity sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg== +mime@^2.4.2: + version "2.4.4" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" + integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA== + mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== +mimic-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -6532,7 +6753,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: +"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -6613,6 +6834,23 @@ mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdi dependencies: minimist "0.0.8" +mocha@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== + dependencies: + browser-stdout "1.3.1" + commander "2.15.1" + debug "3.1.0" + diff "3.5.0" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.5" + he "1.1.1" + minimatch "3.0.4" + mkdirp "0.5.1" + supports-color "5.4.0" + moment@^2.22.1: version "2.22.2" resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66" @@ -6651,6 +6889,11 @@ ms@2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== +ms@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + multicast-dns-service-types@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901" @@ -6681,6 +6924,11 @@ nan@^2.10.0, nan@^2.9.2: resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099" integrity sha512-F4miItu2rGnV2ySkXOQoA8FKz/SR2Q2sWP0sbTxNxz/tuokeC8WxOhPMcwi0qIyGtVn/rrSeLbvVkznqCdwYnw== +nan@^2.12.1: + version "2.14.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" + integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== + nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -6866,6 +7114,22 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" +node-pre-gyp@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" + integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + node-releases@^1.0.0-alpha.11: version "1.0.0-alpha.11" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.0.0-alpha.11.tgz#73c810acc2e5b741a17ddfbb39dfca9ab9359d8a" @@ -6968,6 +7232,11 @@ normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: dependencies: remove-trailing-separator "^1.0.1" +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + normalize-range@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" @@ -7040,7 +7309,7 @@ npm-run-all@4.1.3: shell-quote "^1.6.1" string.prototype.padend "^3.0.0" -npm-run-path@^2.0.0: +npm-run-path@^2.0.0, npm-run-path@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= @@ -7086,11 +7355,6 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -oauth-sign@~0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" - integrity sha1-Rqarfwrq2N6unsBWV4C31O/rnUM= - oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" @@ -7180,7 +7444,7 @@ object.values@^1.1.0: function-bind "^1.1.1" has "^1.0.3" -obuf@^1.0.0, obuf@^1.1.1: +obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== @@ -7197,6 +7461,11 @@ on-headers@~1.0.1: resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7" integrity sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c= +on-headers@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" + integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== + once@1.x, once@^1.3.0, once@^1.3.1, once@^1.3.3, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -7246,13 +7515,20 @@ opn@4.0.2: object-assign "^4.0.1" pinkie-promise "^2.0.0" -opn@^5.1.0, opn@^5.3.0: +opn@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/opn/-/opn-5.3.0.tgz#64871565c863875f052cfdf53d3e3cb5adb53b1c" integrity sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g== dependencies: is-wsl "^1.1.0" +opn@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc" + integrity sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA== + dependencies: + is-wsl "^1.1.0" + optimist@0.6.x, optimist@^0.6.1, optimist@~0.6.0: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" @@ -7281,7 +7557,7 @@ optionator@^0.8.1: type-check "~0.3.2" wordwrap "~1.0.0" -original@>=0.0.5: +original@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" integrity sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg== @@ -7305,14 +7581,14 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-locale@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" - integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== +os-locale@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== dependencies: - execa "^0.7.0" - lcid "^1.0.0" - mem "^1.1.0" + execa "^1.0.0" + lcid "^2.0.0" + mem "^4.0.0" os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" @@ -7327,11 +7603,21 @@ osenv@0, osenv@^0.1.4, osenv@^0.1.5: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== + p-limit@^1.0.0, p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" @@ -7360,10 +7646,17 @@ p-locate@^3.0.0: dependencies: p-limit "^2.0.0" -p-map@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" - integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== +p-map@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" + integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== + +p-retry@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-3.0.1.tgz#316b4c8893e2c8dc1cfa891f406c4b422bebf328" + integrity sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w== + dependencies: + retry "^0.12.0" p-try@^1.0.0: version "1.0.0" @@ -7442,6 +7735,11 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse-node-version@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" + integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== + parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" @@ -7503,7 +7801,7 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@^1.0.1: +path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= @@ -7635,6 +7933,13 @@ pkg-dir@^2.0.0: dependencies: find-up "^2.1.0" +pkg-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== + dependencies: + find-up "^3.0.0" + pleeease-filters@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/pleeease-filters/-/pleeease-filters-4.0.0.tgz#6632b2fb05648d2758d865384fbced79e1ccaec7" @@ -7654,7 +7959,17 @@ plugin-error@^0.1.2: arr-union "^2.0.1" extend-shallow "^1.1.2" -portfinder@^1.0.13, portfinder@^1.0.9: +plugin-error@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c" + integrity sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA== + dependencies: + ansi-colors "^1.0.1" + arr-diff "^4.0.0" + arr-union "^3.1.0" + extend-shallow "^3.0.2" + +portfinder@^1.0.13: version "1.0.17" resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.17.tgz#a8a1691143e46c4735edefcf4fbcccedad26456a" integrity sha512-syFcRIRzVI1BoEFOCaAiizwDolh1S1YXSodsVhncbhjzjZQulhczNRbqnUl9N31Q4dKGOXsNDqxC2BWBgSMqeQ== @@ -7663,6 +7978,15 @@ portfinder@^1.0.13, portfinder@^1.0.9: debug "^2.2.0" mkdirp "0.5.x" +portfinder@^1.0.20: + version "1.0.21" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.21.tgz#60e1397b95ac170749db70034ece306b9a27e324" + integrity sha512-ESabpDCzmBS3ekHbmpAIiESq3udRsCBGiBZLsC+HgBKv2ezb0R4oG+7RnYEVZ/ZCfhel5Tx3UzdNWA0Lox2QCA== + dependencies: + async "^1.5.2" + debug "^2.2.0" + mkdirp "0.5.x" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -8531,6 +8855,14 @@ pump@^2.0.0, pump@^2.0.1: end-of-stream "^1.1.0" once "^1.3.1" +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + pumpify@^1.3.3: version "1.5.1" resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" @@ -8560,7 +8892,7 @@ q@1.4.1: resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" integrity sha1-VXBbzZPF82c1MMLCy8DCs63cKG4= -q@^1.1.2, q@^1.4.1: +q@^1.1.2, q@^1.4.1, q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= @@ -8575,7 +8907,7 @@ qs@6.5.1: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" integrity sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A== -qs@6.5.2, qs@~6.5.1, qs@~6.5.2: +qs@6.5.2, qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== @@ -8639,7 +8971,7 @@ range-parser@^1.0.3, range-parser@^1.2.0, range-parser@~1.2.0: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= -range-parser@~1.2.1: +range-parser@^1.2.1, range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== @@ -8722,7 +9054,7 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.9, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -8745,6 +9077,15 @@ readable-stream@1.0, readable-stream@~1.0.31: isarray "0.0.1" string_decoder "~0.10.x" +readable-stream@^3.0.1, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" + integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readable-stream@~1.1.9: version "1.1.14" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" @@ -8777,6 +9118,15 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" +readdirp@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -8971,35 +9321,7 @@ request-progress@^2.0.1: dependencies: throttleit "^1.0.0" -request@2.85.0: - version "2.85.0" - resolved "http://registry.npmjs.org/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" - integrity sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - hawk "~6.0.2" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - stringstream "~0.0.5" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - -request@^2.74.0, request@^2.79.0, request@^2.81.0, request@^2.87.0, request@^2.88.0: +request@2.88.0, request@^2.74.0, request@^2.79.0, request@^2.81.0, request@^2.87.0, request@^2.88.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== @@ -9040,6 +9362,11 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -9107,6 +9434,11 @@ retry@^0.10.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= +retry@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= + rework-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/rework-visit/-/rework-visit-1.0.0.tgz#9945b2803f219e2f7aca00adb8bc9f640f842c9a" @@ -9152,6 +9484,13 @@ rimraf@2, rimraf@2.6.2, rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6 dependencies: glob "^7.0.5" +rimraf@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -9372,10 +9711,10 @@ selenium-webdriver@3.6.0, selenium-webdriver@^3.0.1: tmp "0.0.30" xml2js "^0.4.17" -selfsigned@^1.9.1: - version "1.10.3" - resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.3.tgz#d628ecf9e3735f84e8bafba936b3cf85bea43823" - integrity sha512-vmZenZ+8Al3NLHkWnhBQ0x6BkML1eCP2xEi3JE+f3D9wW9fipD9NNJHYtE9XJM4TsPaHGZJIamrSI6MTg1dU2Q== +selfsigned@^1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.4.tgz#cdd7eccfca4ed7635d47a08bf2d5d3074092e2cd" + integrity sha512-9AukTiDmHXGXWtWjembZ5NDmVvP2695EtpgbCsxCa68w3c88B+alqbmZ4O3hZ4VWGXeGWzEVdvqgAJD8DQPCDw== dependencies: node-forge "0.7.5" @@ -9410,6 +9749,11 @@ semver@^5.0.1: resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== +semver@^6.1.1: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -9458,7 +9802,7 @@ serialize-javascript@^1.4.0: resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.5.0.tgz#1aa336162c88a890ddad5384baebc93a655161fe" integrity sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ== -serve-index@^1.7.2: +serve-index@^1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" integrity sha1-03aNabHn2C5c4FD/9bRTvqEqkjk= @@ -9641,13 +9985,6 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -sntp@2.x.x: - version "2.1.0" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" - integrity sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg== - dependencies: - hoek "4.x.x" - socket.io-adapter@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" @@ -9694,17 +10031,17 @@ socket.io@2.1.1: socket.io-client "2.1.1" socket.io-parser "~3.2.0" -sockjs-client@1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.1.5.tgz#1bb7c0f7222c40f42adf14f4442cbd1269771a83" - integrity sha1-G7fA9yIsQPQq3xT0RCy9Eml3GoM= +sockjs-client@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.3.0.tgz#12fc9d6cb663da5739d3dc5fb6e8687da95cb177" + integrity sha512-R9jxEzhnnrdxLCNln0xg5uGHqMnkhPSTzUZH2eXcR03S/On9Yvoq2wyUZILRUhZCNVu2PmwWVoyuiPz8th8zbg== dependencies: - debug "^2.6.6" - eventsource "0.1.6" - faye-websocket "~0.11.0" - inherits "^2.0.1" + debug "^3.2.5" + eventsource "^1.0.7" + faye-websocket "~0.11.1" + inherits "^2.0.3" json3 "^3.3.2" - url-parse "^1.1.8" + url-parse "^1.4.3" sockjs@0.3.19: version "0.3.19" @@ -9840,30 +10177,28 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" integrity sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA== -spdy-transport@^2.0.18: - version "2.1.0" - resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-2.1.0.tgz#4bbb15aaffed0beefdd56ad61dbdc8ba3e2cb7a1" - integrity sha512-bpUeGpZcmZ692rrTiqf9/2EUakI6/kXX1Rpe0ib/DyOzbiexVfXkw6GnvI9hVGvIwVaUhkaBojjCZwLNRGQg1g== +spdy-transport@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-3.0.0.tgz#00d4863a6400ad75df93361a1608605e5dcdcf31" + integrity sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw== dependencies: - debug "^2.6.8" - detect-node "^2.0.3" + debug "^4.1.0" + detect-node "^2.0.4" hpack.js "^2.1.6" - obuf "^1.1.1" - readable-stream "^2.2.9" - safe-buffer "^5.0.1" - wbuf "^1.7.2" + obuf "^1.1.2" + readable-stream "^3.0.6" + wbuf "^1.7.3" -spdy@^3.4.1: - version "3.4.7" - resolved "https://registry.yarnpkg.com/spdy/-/spdy-3.4.7.tgz#42ff41ece5cc0f99a3a6c28aabb73f5c3b03acbc" - integrity sha1-Qv9B7OXMD5mjpsKKq7c/XDsDrLw= +spdy@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/spdy/-/spdy-4.0.1.tgz#6f12ed1c5db7ea4f24ebb8b89ba58c87c08257f2" + integrity sha512-HeZS3PBdMA+sZSu0qwpCxl3DeALD5ASx8pAX0jZdKXSpPWbQ6SYGnlg3BBmYLx5LtiZrmkAZfErCm2oECBcioA== dependencies: - debug "^2.6.8" - handle-thing "^1.2.5" + debug "^4.1.0" + handle-thing "^2.0.0" http-deceiver "^1.2.7" - safe-buffer "^5.0.1" select-hose "^2.0.0" - spdy-transport "^2.0.18" + spdy-transport "^3.0.0" split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" @@ -10029,6 +10364,15 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0, string-width@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + string.prototype.padend@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" @@ -10045,16 +10389,18 @@ string_decoder@^1.0.0, string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= -stringstream@~0.0.5: - version "0.0.6" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.6.tgz#7880225b0d4ad10e30927d167a1d6f2fd3b33a72" - integrity sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA== - strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -10069,6 +10415,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -10114,6 +10467,13 @@ sugarss@^1.0.1: dependencies: postcss "^6.0.14" +supports-color@5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== + dependencies: + has-flag "^3.0.0" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -10126,7 +10486,7 @@ supports-color@^3.1.0: dependencies: has-flag "^1.0.0" -supports-color@^5.1.0, supports-color@^5.2.0, supports-color@^5.3.0, supports-color@^5.4.0: +supports-color@^5.2.0, supports-color@^5.3.0, supports-color@^5.4.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== @@ -10170,18 +10530,16 @@ tapable@^1.0.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.0.0.tgz#cbb639d9002eed9c6b5975eb20598d7936f1f9f2" integrity sha512-dQRhbNQkRnaqauC7WqSJ21EEksgT0fYZX2lqXzGkpo8JNig9zGZTYoMGvyI2nWmXlE2VSVXVDu7wLVGu/mQEsg== -tar-stream@^1.5.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.1.tgz#f84ef1696269d6223ca48f6e1eeede3f7e81f395" - integrity sha512-IFLM5wp3QrJODQFPm6/to3LJZrONdBY/otxcvDIQzu217zKye6yVR3hhi9lAjrC2Z+m/j5oDxMPb1qcd8cIvpA== +tar-stream@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.1.0.tgz#d1aaa3661f05b38b5acc9b7020efdca5179a2cc3" + integrity sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw== dependencies: - bl "^1.0.0" - buffer-alloc "^1.1.0" - end-of-stream "^1.0.0" + bl "^3.0.0" + end-of-stream "^1.4.1" fs-constants "^1.0.0" - readable-stream "^2.3.0" - to-buffer "^1.1.0" - xtend "^4.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" tar@^2.0.0: version "2.2.1" @@ -10252,7 +10610,7 @@ through2@^2.0.0: readable-stream "^2.1.5" xtend "~4.0.1" -through2@^2.0.1: +through2@^2.0.1, through2@^2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== @@ -10316,11 +10674,6 @@ to-arraybuffer@^1.0.0: resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= -to-buffer@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== - to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" @@ -10370,13 +10723,6 @@ touch@^3.1.0: dependencies: nopt "~1.0.10" -tough-cookie@~2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" - integrity sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA== - dependencies: - punycode "^1.4.1" - tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" @@ -10729,6 +11075,11 @@ upath@^1.0.5: resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== +upath@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.2.tgz#3db658600edaeeccbe6db5e684d67ee8c2acd068" + integrity sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q== + update-notifier@^2.3.0: version "2.5.0" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" @@ -10786,7 +11137,7 @@ url-parse-lax@^1.0.0: dependencies: prepend-http "^1.0.1" -url-parse@^1.1.8, url-parse@^1.4.3: +url-parse@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.3.tgz#bfaee455c889023219d757e045fa6a684ec36c15" integrity sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw== @@ -10815,7 +11166,7 @@ useragent@2.2.1: lru-cache "2.2.x" tmp "0.0.x" -util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= @@ -10894,7 +11245,7 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" -vargs@0.1.0: +vargs@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/vargs/-/vargs-0.1.0.tgz#6b6184da6520cc3204ce1b407cac26d92609ebff" integrity sha1-a2GE2mUgzDIEzhtAfKwm2SYJ6/8= @@ -10958,25 +11309,27 @@ watchpack@^1.5.0: graceful-fs "^4.1.2" neo-async "^2.5.0" -wbuf@^1.1.0, wbuf@^1.7.2: +wbuf@^1.1.0, wbuf@^1.7.3: version "1.7.3" resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df" integrity sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA== dependencies: minimalistic-assert "^1.0.0" -wd@^1.0.0: - version "1.10.3" - resolved "https://registry.yarnpkg.com/wd/-/wd-1.10.3.tgz#395ac7eb58a98e556369f8f8e5f845d91fb152a3" - integrity sha512-ffqqZDtFFLeg5u/4pw2vYKECW+z+vW6vc+7rcqF15uu1/rmw3BydV84BONNc9DIcQ5Z7gQFS/hAuMvj53eVtSg== +wd@^1.11.0: + version "1.11.3" + resolved "https://registry.yarnpkg.com/wd/-/wd-1.11.3.tgz#db228863e15648e0c1466df45b263fc30470dbc4" + integrity sha512-doB7E6DDhis6sSCfWps9Uz0UBBPAySv1x96KH6klfHp8y89HvhqEq3c0O8LPZhG37egJULN0m7+M9t16xUTG0g== dependencies: - archiver "2.1.1" - async "2.0.1" - lodash "4.17.10" + archiver "^3.0.0" + async "^2.0.0" + fancy-log "^1.3.3" + gulp-mocha "^6.0.0" + lodash "^4.0.0" mkdirp "^0.5.1" - q "1.4.1" - request "2.85.0" - vargs "0.1.0" + q "^1.5.1" + request "2.88.0" + vargs "^0.1.0" webdriver-js-extender@2.1.0: version "2.1.0" @@ -11087,39 +11440,52 @@ webpack-dev-middleware@^2.0.6: url-join "^2.0.2" webpack-log "^1.0.1" -webpack-dev-server@^3.1.5: - version "3.1.7" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.1.7.tgz#cbf8071cc092d9493732aee4f062f0e065994854" - integrity sha512-KagFrNHf3QKndS61cXqzkQ4gpdXo0d1LZTTplAJzNK1Ev2ZyJiu+BzerW/2dixYYfpnGzp0AcvCXpmYXIOkFOA== +webpack-dev-middleware@^3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.0.tgz#ef751d25f4e9a5c8a35da600c5fda3582b5c6cff" + integrity sha512-qvDesR1QZRIAZHOE3iQ4CXLZZSQ1lAUsSpnQmlB1PBfoN/xdRjmge3Dok0W4IdaVLJOGJy3sGI4sZHwjRU0PCA== + dependencies: + memory-fs "^0.4.1" + mime "^2.4.2" + range-parser "^1.2.1" + webpack-log "^2.0.0" + +webpack-dev-server@^3.1.11: + version "3.7.2" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.7.2.tgz#f79caa5974b7f8b63268ef5421222a8486d792f5" + integrity sha512-mjWtrKJW2T9SsjJ4/dxDC2fkFVUw8jlpemDERqV0ZJIkjjjamR2AbQlr3oz+j4JLhYCHImHnXZK5H06P2wvUew== dependencies: ansi-html "0.0.7" bonjour "^3.5.0" - chokidar "^2.0.0" - compression "^1.5.2" - connect-history-api-fallback "^1.3.0" - debug "^3.1.0" - del "^3.0.0" - express "^4.16.2" - html-entities "^1.2.0" - http-proxy-middleware "~0.18.0" - import-local "^1.0.0" - internal-ip "^3.0.1" + chokidar "^2.1.6" + compression "^1.7.4" + connect-history-api-fallback "^1.6.0" + debug "^4.1.1" + del "^4.1.1" + express "^4.17.1" + html-entities "^1.2.1" + http-proxy-middleware "^0.19.1" + import-local "^2.0.0" + internal-ip "^4.3.0" ip "^1.1.5" - killable "^1.0.0" - loglevel "^1.4.1" - opn "^5.1.0" - portfinder "^1.0.9" + killable "^1.0.1" + loglevel "^1.6.3" + opn "^5.5.0" + p-retry "^3.0.1" + portfinder "^1.0.20" schema-utils "^1.0.0" - selfsigned "^1.9.1" - serve-index "^1.7.2" + selfsigned "^1.10.4" + semver "^6.1.1" + serve-index "^1.9.1" sockjs "0.3.19" - sockjs-client "1.1.5" - spdy "^3.4.1" - strip-ansi "^3.0.0" - supports-color "^5.1.0" - webpack-dev-middleware "3.2.0" + sockjs-client "1.3.0" + spdy "^4.0.0" + strip-ansi "^3.0.1" + supports-color "^6.1.0" + url "^0.11.0" + webpack-dev-middleware "^3.7.0" webpack-log "^2.0.0" - yargs "12.0.1" + yargs "12.0.5" webpack-import-glob-loader@^1.6.3: version "1.6.3" @@ -11265,6 +11631,15 @@ wrap-ansi@^2.0.0: string-width "^1.0.1" strip-ansi "^3.0.1" +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -11323,11 +11698,6 @@ xmlhttprequest-ssl@~1.5.4: resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= -xregexp@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" - integrity sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg== - xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" @@ -11353,13 +11723,29 @@ yallist@^3.0.0, yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" integrity sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k= -yargs-parser@^10.0.0, yargs-parser@^10.1.0: +yargs-parser@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== dependencies: camelcase "^4.1.0" +yargs-parser@^11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" + integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-parser@^13.1.1: + version "13.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" + integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" @@ -11367,48 +11753,39 @@ yargs-parser@^5.0.0: dependencies: camelcase "^3.0.0" -yargs-parser@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" - integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= - dependencies: - camelcase "^4.1.0" - -yargs@12.0.1, yargs@^12.0.1: - version "12.0.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.1.tgz#6432e56123bb4e7c3562115401e98374060261c2" - integrity sha512-B0vRAp1hRX4jgIOWFtjfNjd9OA9RWYZ6tqGA9/I/IrTMsxmKvtWy+ersM+jzpQqbC3YfLzeABPdeTgcJ9eu1qQ== +yargs@12.0.5, yargs@^12.0.1: + version "12.0.5" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== dependencies: cliui "^4.0.0" - decamelize "^2.0.0" + decamelize "^1.2.0" find-up "^3.0.0" get-caller-file "^1.0.1" - os-locale "^2.0.0" + os-locale "^3.0.0" require-directory "^2.1.1" require-main-filename "^1.0.1" set-blocking "^2.0.0" string-width "^2.0.0" which-module "^2.0.0" y18n "^3.2.1 || ^4.0.0" - yargs-parser "^10.1.0" + yargs-parser "^11.1.1" -yargs@^11.0.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" - integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== +yargs@^13.2.4: + version "13.3.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" + integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== dependencies: - cliui "^4.0.0" - decamelize "^1.1.1" - find-up "^2.1.0" - get-caller-file "^1.0.1" - os-locale "^2.0.0" + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" require-directory "^2.1.1" - require-main-filename "^1.0.1" + require-main-filename "^2.0.0" set-blocking "^2.0.0" - string-width "^2.0.0" + string-width "^3.0.0" which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^9.0.2" + y18n "^4.0.0" + yargs-parser "^13.1.1" yargs@^7.0.0: version "7.1.0" @@ -11446,15 +11823,14 @@ yn@^2.0.0: resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo= -zip-stream@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-1.2.0.tgz#a8bc45f4c1b49699c6b90198baacaacdbcd4ba04" - integrity sha1-qLxF9MG0lpnGuQGYuqyqzbzUugQ= +zip-stream@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-2.1.2.tgz#841efd23214b602ff49c497cba1a85d8b5fbc39c" + integrity sha512-ykebHGa2+uzth/R4HZLkZh3XFJzivhVsjJt8bN3GvBzLaqqrUdRacu+c4QtnUgjkkQfsOuNE1JgLKMCPNmkKgg== dependencies: - archiver-utils "^1.3.0" - compress-commons "^1.2.0" - lodash "^4.8.0" - readable-stream "^2.0.0" + archiver-utils "^2.1.0" + compress-commons "^2.1.1" + readable-stream "^3.4.0" zone.js@^0.8.26: version "0.8.26" From dc868853a8be863891bea42ad4b210e508f6dcb8 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 6 Aug 2019 11:17:17 +0200 Subject: [PATCH 33/38] remove node 9, add node 10 --- .travis.yml | 2 +- README.md | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d46202f5f3..403a10b770 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ language: node_js node_js: - "8" - - "9" + - "10" cache: yarn: true diff --git a/README.md b/README.md index cb2f41130f..0aa4e652ba 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Requirements ------------ - [Node.js](https://nodejs.org), [npm](https://www.npmjs.com/), and [yarn](https://yarnpkg.com) -- Ensure you're running node >= `v8.x`, npm >= `v5.x` and yarn >= `v1.x` +- Ensure you're running node `v8.x` or `v10.x`, npm >= `v5.x` and yarn >= `v1.x` If you have [`nvm`](https://github.com/creationix/nvm#install-script) or [`nvm-windows`](https://github.com/coreybutler/nvm-windows) installed, which is highly recommended, you can run `nvm install --lts && nvm use` to install and start using the latest Node LTS. diff --git a/package.json b/package.json index ba354ad830..5f3716702d 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "license": "BSD-2-Clause", "engines": { - "node": ">=8.0.0" + "node": "8.* || >= 10.*" }, "scripts": { "global": "npm install -g @angular/cli marked node-gyp nodemon node-nightly npm-check-updates npm-run-all rimraf typescript ts-node typedoc webpack webpack-bundle-analyzer pm2 rollup", From 1fb38fe56dd08c122e4e841204e795e9b99b5db3 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 6 Aug 2019 13:31:32 +0200 Subject: [PATCH 34/38] increase protractor allScriptsTimeout --- protractor.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protractor.conf.js b/protractor.conf.js index b7b054a61e..8a5cbb439d 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -5,7 +5,7 @@ var SpecReporter = require('jasmine-spec-reporter').SpecReporter; exports.config = { - allScriptsTimeout: 11000, + allScriptsTimeout: 60000, // ----------------------------------------------------------------- // Uncomment to run tests using a remote Selenium server //seleniumAddress: 'http://selenium.address:4444/wd/hub', From 004f4ce38c47388f89f31915d19d20ca320e9e22 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 6 Aug 2019 14:40:53 +0200 Subject: [PATCH 35/38] increase protractor timeouts again --- protractor.conf.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protractor.conf.js b/protractor.conf.js index 8a5cbb439d..6570c9f7c3 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -5,7 +5,7 @@ var SpecReporter = require('jasmine-spec-reporter').SpecReporter; exports.config = { - allScriptsTimeout: 60000, + allScriptsTimeout: 600000, // ----------------------------------------------------------------- // Uncomment to run tests using a remote Selenium server //seleniumAddress: 'http://selenium.address:4444/wd/hub', @@ -73,7 +73,7 @@ exports.config = { framework: 'jasmine', jasmineNodeOpts: { showColors: true, - defaultTimeoutInterval: 60000, + defaultTimeoutInterval: 600000, print: function () {} }, useAllAngular2AppRoots: true, From 588fc484a4ca791cca50ff7da4b993a8c5575e4b Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 6 Aug 2019 17:08:43 +0200 Subject: [PATCH 36/38] remove e2e tests from the ci task --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f3716702d..7916379039 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "debug:server": "node-nightly --inspect --debug-brk dist/server.js", "debug:build": "node-nightly --inspect --debug-brk node_modules/webpack/bin/webpack.js --mode development", "debug:build:prod": "node-nightly --inspect --debug-brk node_modules/webpack/bin/webpack.js --env.aot --env.client --env.server --mode production", - "ci": "yarn run lint && yarn run build:aot && yarn run test:headless && npm-run-all -p -r server e2e", + "ci": "yarn run lint && yarn run build:aot && yarn run test:headless", "protractor": "node node_modules/protractor/bin/protractor", "pree2e": "yarn run webdriver:update", "e2e": "yarn run protractor", From d1ba6ab610c0e36f1f0285d723230030b225305c Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 6 Aug 2019 17:19:49 +0200 Subject: [PATCH 37/38] restore protractor timeouts to their default values --- protractor.conf.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protractor.conf.js b/protractor.conf.js index 6570c9f7c3..2949702a0a 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -5,7 +5,7 @@ var SpecReporter = require('jasmine-spec-reporter').SpecReporter; exports.config = { - allScriptsTimeout: 600000, + allScriptsTimeout: 11000, // ----------------------------------------------------------------- // Uncomment to run tests using a remote Selenium server //seleniumAddress: 'http://selenium.address:4444/wd/hub', @@ -73,7 +73,7 @@ exports.config = { framework: 'jasmine', jasmineNodeOpts: { showColors: true, - defaultTimeoutInterval: 600000, + defaultTimeoutInterval: 30000, print: function () {} }, useAllAngular2AppRoots: true, From c81f589338e81fb9b985819ae63d7423cbe4a55c Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 6 Aug 2019 17:41:22 +0200 Subject: [PATCH 38/38] Update the Quick Start docs to include node 10 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0aa4e652ba..1b3ed9b7cb 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ If you're looking for the 2016 Angular 2 DSpace UI prototype, you can find it [h Quick start ----------- -**Ensure you're running [Node](https://nodejs.org) >= `v8.0.x`, [npm](https://www.npmjs.com/) >= `v5.x` and [yarn](https://yarnpkg.com) >= `v1.x`** +**Ensure you're running [Node](https://nodejs.org) `v8.0.x` or `v10.0.x`, [npm](https://www.npmjs.com/) >= `v5.x` and [yarn](https://yarnpkg.com) >= `v1.x`** ```bash # clone the repo