forked from hazza/dspace-angular

# Conflicts: # src/app/+admin/admin-access-control/epeople-registry/epeople-registry.component.spec.ts # src/app/+admin/admin-access-control/epeople-registry/epeople-registry.component.ts # src/app/+admin/admin-access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts # src/app/+admin/admin-access-control/group-registry/group-form/group-form.component.spec.ts # src/app/+admin/admin-access-control/group-registry/group-form/members-list/members-list.component.spec.ts # src/app/+admin/admin-access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts # src/app/+admin/admin-access-control/group-registry/groups-registry.component.ts # src/app/+admin/admin-import-metadata-page/metadata-import-page.component.ts # src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.ts # src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.ts # src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts # src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts # src/app/+bitstream-page/bitstream-page.resolver.ts # src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts # src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts # src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.ts # src/app/+collection-page/collection-page.component.ts # src/app/+collection-page/edit-collection-page/collection-roles/collection-roles.component.ts # src/app/+collection-page/edit-item-template-page/item-template-page.resolver.spec.ts # src/app/+collection-page/edit-item-template-page/item-template-page.resolver.ts # src/app/+item-page/edit-item-page/item-authorizations/item-authorizations.component.ts # src/app/+item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts # src/app/+item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts # src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts # src/app/+item-page/edit-item-page/item-private/item-private.component.ts # src/app/+item-page/edit-item-page/item-public/item-public.component.ts # src/app/+item-page/edit-item-page/item-reinstate/item-reinstate.component.ts # src/app/+item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts # src/app/+item-page/edit-item-page/item-relationships/item-relationships.component.ts # src/app/+item-page/edit-item-page/item-withdraw/item-withdraw.component.ts # src/app/+item-page/simple/item-types/shared/item-relationships-utils.ts # src/app/+my-dspace-page/collection-selector/collection-selector.component.spec.ts # src/app/+search-page/search-tracker.component.ts # src/app/app-routing.module.ts # src/app/community-list-page/community-list-service.ts # src/app/community-list-page/community-list.reducer.spec.ts # src/app/core/auth/auth-response-parsing.service.spec.ts # src/app/core/auth/auth.interceptor.spec.ts # src/app/core/browse/browse.service.spec.ts # src/app/core/browse/browse.service.ts # src/app/core/cache/builders/link.service.spec.ts # src/app/core/cache/builders/remote-data-build.service.ts # src/app/core/cache/object-cache.service.spec.ts # src/app/core/cache/response.models.ts # src/app/core/data/base-response-parsing.service.ts # src/app/core/data/bitstream-data.service.ts # src/app/core/data/bitstream-format-data.service.ts # src/app/core/data/bundle-data.service.spec.ts # src/app/core/data/bundle-data.service.ts # src/app/core/data/change-analyzer.ts # src/app/core/data/collection-data.service.spec.ts # src/app/core/data/collection-data.service.ts # src/app/core/data/comcol-data.service.spec.ts # src/app/core/data/comcol-data.service.ts # src/app/core/data/data.service.ts # src/app/core/data/entity-type-data.service.ts # src/app/core/data/entity-type.service.ts # src/app/core/data/feature-authorization/authorization-data.service.ts # src/app/core/data/feature-authorization/feature-data.service.ts # src/app/core/data/item-template-data.service.ts # src/app/core/data/license-data.service.ts # src/app/core/data/metadata-field-data.service.ts # src/app/core/data/processes/process-data.service.ts # src/app/core/data/processes/script-data.service.ts # src/app/core/data/relationship.service.spec.ts # src/app/core/data/relationship.service.ts # src/app/core/data/remote-data.ts # src/app/core/data/request.actions.ts # src/app/core/data/request.effects.ts # src/app/core/data/request.reducer.spec.ts # src/app/core/data/request.reducer.ts # src/app/core/data/request.service.spec.ts # src/app/core/data/request.service.ts # src/app/core/dspace-rest/dspace-rest.service.spec.ts # src/app/core/eperson/eperson-data.service.spec.ts # src/app/core/eperson/eperson-data.service.ts # src/app/core/eperson/group-data.service.spec.ts # src/app/core/eperson/group-data.service.ts # src/app/core/forward-client-ip/forward-client-ip.interceptor.spec.ts # src/app/core/index/index.reducer.ts # src/app/core/json-patch/json-patch-operations.service.spec.ts # src/app/core/json-patch/json-patch-operations.service.ts # src/app/core/locale/locale.interceptor.spec.ts # src/app/core/registry/registry.service.ts # src/app/core/resource-policy/resource-policy.service.ts # src/app/core/shared/operators.ts # src/app/core/shared/search/search.service.ts # src/app/core/submission/submission-object-data.service.ts # src/app/core/submission/submission-rest.service.ts # src/app/core/submission/vocabularies/vocabulary-entries-response-parsing.service.spec.ts # src/app/core/submission/vocabularies/vocabulary.service.spec.ts # src/app/core/submission/vocabularies/vocabulary.service.ts # src/app/core/submission/workflowitem-data.service.ts # src/app/core/tasks/tasks.service.ts # src/app/curation-form/curation-form.component.ts # src/app/process-page/process-page.resolver.ts # src/app/shared/collection-dropdown/collection-dropdown.component.spec.ts # src/app/shared/collection-dropdown/collection-dropdown.component.ts # src/app/shared/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts # src/app/shared/comcol-forms/create-comcol-page/create-comcol-page.component.ts # src/app/shared/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.spec.ts # src/app/shared/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.spec.ts # src/app/shared/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts # src/app/shared/dso-selector/dso-selector/dso-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.ts # src/app/shared/form/builder/form-builder.service.ts # src/app/shared/item/item-versions/item-versions.component.ts # src/app/shared/mocks/remote-data-build.service.mock.ts # src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts # src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.spec.ts # src/app/shared/object-select/collection-select/collection-select.component.spec.ts # src/app/shared/object-select/item-select/item-select.component.spec.ts # src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.spec.ts # src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts # src/app/shared/resource-policies/form/eperson-group-list/eperson-group-list.component.ts # src/app/shared/search/search-query-response.model.ts # src/app/statistics/statistics.module.ts # src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.spec.ts # src/app/submission/sections/form/section-form.component.ts # src/app/submission/sections/upload/section-upload.component.spec.ts # src/app/submission/sections/upload/section-upload.component.ts # src/app/submission/submission.service.spec.ts # src/app/submission/submission.service.ts
1583 lines
49 KiB
TypeScript
1583 lines
49 KiB
TypeScript
import { SubmissionDefinitionsModel } from '../../core/config/models/config-submission-definitions.model';
|
|
import { buildPaginatedList } from '../../core/data/paginated-list.model';
|
|
import { Group } from '../../core/eperson/models/group.model';
|
|
import { PageInfo } from '../../core/shared/page-info.model';
|
|
import { SubmissionObjectState } from '../../submission/objects/submission-objects.reducer';
|
|
import { FormFieldMetadataValueObject } from '../form/builder/models/form-field-metadata-value.model';
|
|
import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils';
|
|
|
|
export const mockSectionsData = {
|
|
traditionalpageone: {
|
|
'dc.title': [
|
|
new FormFieldMetadataValueObject('test', null, null, 'test')
|
|
]
|
|
},
|
|
license: {
|
|
url: null,
|
|
acceptanceDate: null,
|
|
granted: false
|
|
},
|
|
upload: {
|
|
files: []
|
|
}
|
|
};
|
|
|
|
export const mockSectionsDataTwo = {
|
|
traditionalpageone: {
|
|
'dc.title': [
|
|
new FormFieldMetadataValueObject('test', null, null, 'test')
|
|
]
|
|
},
|
|
traditionalpagetwo: {
|
|
'dc.relation': [
|
|
new FormFieldMetadataValueObject('test', null, null, 'test')
|
|
]
|
|
},
|
|
license: {
|
|
url: null,
|
|
acceptanceDate: null,
|
|
granted: false
|
|
},
|
|
upload: {
|
|
files: []
|
|
}
|
|
};
|
|
|
|
export const mockSectionsErrors = [
|
|
{
|
|
message: 'error.validation.required',
|
|
paths: [
|
|
'/sections/traditionalpageone/dc.contributor.author',
|
|
'/sections/traditionalpageone/dc.title',
|
|
'/sections/traditionalpageone/dc.date.issued'
|
|
]
|
|
},
|
|
{
|
|
message: 'error.validation.license.notgranted',
|
|
paths: [
|
|
'/sections/license'
|
|
]
|
|
}
|
|
];
|
|
|
|
export const mockSectionsErrorsTwo = [
|
|
{
|
|
message: 'error.validation.required',
|
|
paths: [
|
|
'/sections/traditionalpageone/dc.title',
|
|
]
|
|
},
|
|
{
|
|
message: 'error.validation.license.notgranted',
|
|
paths: [
|
|
'/sections/license'
|
|
]
|
|
}
|
|
];
|
|
|
|
export const mockUploadResponse1Errors = {
|
|
errors: [
|
|
{
|
|
message: 'error.validation.required',
|
|
paths: [
|
|
'/sections/traditionalpageone/dc.title',
|
|
'/sections/traditionalpageone/dc.date.issued'
|
|
]
|
|
}
|
|
]
|
|
};
|
|
|
|
export const mockUploadResponse1ParsedErrors: any = {
|
|
traditionalpageone: [
|
|
{ path: '/sections/traditionalpageone/dc.title', message: 'error.validation.required' },
|
|
{ path: '/sections/traditionalpageone/dc.date.issued', message: 'error.validation.required' }
|
|
]
|
|
};
|
|
|
|
export const mockLicenseParsedErrors: any = {
|
|
license: [
|
|
{ path: '/sections/license', message: 'error.validation.license.notgranted' }
|
|
]
|
|
};
|
|
|
|
export const mockUploadResponse2Errors = {
|
|
errors: [
|
|
{
|
|
message: 'error.validation.required',
|
|
paths: [
|
|
'/sections/traditionalpageone/dc.title',
|
|
'/sections/traditionalpageone/dc.date.issued'
|
|
]
|
|
},
|
|
{
|
|
message: 'error.upload',
|
|
paths: [
|
|
'/sections/upload'
|
|
]
|
|
}
|
|
]
|
|
};
|
|
|
|
export const mockUploadResponse2ParsedErrors = {
|
|
traditionalpageone: [
|
|
{ path: '/sections/traditionalpageone/dc.title', message: 'error.validation.required' },
|
|
{ path: '/sections/traditionalpageone/dc.date.issued', message: 'error.validation.required' }
|
|
],
|
|
upload: [
|
|
{ path: '/sections/upload', message: 'error.upload' }
|
|
]
|
|
};
|
|
|
|
export const mockSubmissionRestResponse = [
|
|
{
|
|
id: 826,
|
|
lastModified: '2018-08-03T12:49:45.268+0000',
|
|
collection: [
|
|
{
|
|
handle: '10673/2',
|
|
license: 'https://rest.api/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/license',
|
|
defaultAccessConditions: [],
|
|
logo: [
|
|
{
|
|
sizeBytes: 7451,
|
|
content: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425/content',
|
|
format: [],
|
|
bundleName: null,
|
|
id: '3f859425-ffbd-4b0e-bf91-bfeb458a7425',
|
|
uuid: '3f859425-ffbd-4b0e-bf91-bfeb458a7425',
|
|
type: 'bitstream',
|
|
name: null,
|
|
metadata: [],
|
|
_links: {
|
|
content: { href: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425/content' },
|
|
format: { href: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425/format' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425' }
|
|
}
|
|
}
|
|
],
|
|
id: '1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb',
|
|
uuid: '1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb',
|
|
type: 'collection',
|
|
name: 'Collection of Sample Items',
|
|
metadata: [
|
|
{
|
|
key: 'dc.provenance',
|
|
language: null,
|
|
value: 'This field is for private provenance information. It is only visible to Administrative users and is not displayed in the user interface by default.'
|
|
},
|
|
{
|
|
key: 'dc.rights.license',
|
|
language: null,
|
|
value: ''
|
|
},
|
|
{
|
|
key: 'dc.description',
|
|
language: null,
|
|
value: '<p>This is a <em>DSpace Collection</em> which contains sample DSpace Items.</p>\r\n<p><strong>Collections in DSpace may only contain Items.</strong></p>\r\n<p>This particular Collection has its own logo (the <a href=\'http://www.opensource.org/\'>Open Source Initiative</a> logo).</p>\r\n<p>This introductory text is editable by System Administrators, Community Administrators (of a parent Community) or Collection Administrators (of this Collection).</p>'
|
|
},
|
|
{
|
|
key: 'dc.description.abstract',
|
|
language: null,
|
|
value: 'This collection contains sample items.'
|
|
},
|
|
{
|
|
key: 'dc.description.tableofcontents',
|
|
language: null,
|
|
value: '<p>This is the <strong>news</strong> section for this Collection. System Administrators, Community Administrators (of a parent Community) or Collection Administrators (of this Collection) can edit this News field.</p>'
|
|
},
|
|
{
|
|
key: 'dc.rights',
|
|
language: null,
|
|
value: '<p><em>If this collection had a specific copyright statement, it would be placed here.</em></p>'
|
|
},
|
|
{
|
|
key: 'dc.title',
|
|
language: null,
|
|
value: 'Collection of Sample Items'
|
|
}
|
|
],
|
|
_links: {
|
|
license: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/license' },
|
|
defaultAccessConditions: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/defaultAccessConditions' },
|
|
logo: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/logo' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb' }
|
|
}
|
|
}
|
|
],
|
|
item: [
|
|
{
|
|
handle: null,
|
|
lastModified: '2018-07-25T14:08:28.750+0000',
|
|
isArchived: false,
|
|
isDiscoverable: true,
|
|
isWithdrawn: false,
|
|
bitstreams: 'https://rest.api/dspace-spring-rest/api/core/items/6f344222-6980-4738-8192-b808d79af8a5/bitstreams',
|
|
id: '6f344222-6980-4738-8192-b808d79af8a5',
|
|
uuid: '6f344222-6980-4738-8192-b808d79af8a5',
|
|
type: 'item',
|
|
name: null,
|
|
metadata: [],
|
|
_links: {
|
|
bitstreams: { href: 'https://rest.api/dspace-spring-rest/api/core/items/6f344222-6980-4738-8192-b808d79af8a5/bitstreams' },
|
|
owningCollection: { href: 'https://rest.api/dspace-spring-rest/api/core/items/6f344222-6980-4738-8192-b808d79af8a5/owningCollection' },
|
|
templateItemOf: { href: 'https://rest.api/dspace-spring-rest/api/core/items/6f344222-6980-4738-8192-b808d79af8a5/templateItemOf' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/core/items/6f344222-6980-4738-8192-b808d79af8a5' }
|
|
}
|
|
}
|
|
],
|
|
sections: {},
|
|
submissionDefinition: [
|
|
{
|
|
isDefault: true,
|
|
sections: [
|
|
{
|
|
mandatory: true,
|
|
sectionType: 'utils',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/extraction' },
|
|
config: ''
|
|
},
|
|
},
|
|
{
|
|
mandatory: true,
|
|
sectionType: 'collection',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/collection' },
|
|
config: ''
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.describe.stepone',
|
|
mandatory: true,
|
|
sectionType: 'submission-form',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/traditionalpageone' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.describe.steptwo',
|
|
mandatory: false,
|
|
sectionType: 'submission-form',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/traditionalpagetwo' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpagetwo' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.upload',
|
|
mandatory: true,
|
|
sectionType: 'upload',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/upload' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.license',
|
|
mandatory: true,
|
|
sectionType: 'license',
|
|
visibility: {
|
|
main: null,
|
|
other: 'READONLY'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/license' },
|
|
config: ''
|
|
},
|
|
}
|
|
],
|
|
name: 'traditional',
|
|
type: 'submissiondefinition',
|
|
_links: {
|
|
collections: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional/collections' },
|
|
sections: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional/sections' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional' }
|
|
},
|
|
}
|
|
],
|
|
submitter: [],
|
|
errors: [],
|
|
type: 'workspaceitem',
|
|
_links: {
|
|
collection: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/collection' },
|
|
item: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/item' },
|
|
submissionDefinition: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/submissionDefinition' },
|
|
submitter: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/submitter' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826' }
|
|
}
|
|
}
|
|
];
|
|
|
|
export const mockSubmissionObject = {
|
|
collection: {
|
|
handle: '10673/2',
|
|
license: 'https://rest.api/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/license',
|
|
defaultAccessConditions: {
|
|
pageInfo: {
|
|
elementsPerPage: 1,
|
|
totalElements: 1,
|
|
totalPages: 1,
|
|
currentPage: 1
|
|
},
|
|
page: [
|
|
{
|
|
name: null,
|
|
groupUUID: '11cc35e5-a11d-4b64-b5b9-0052a5d15509',
|
|
id: 20,
|
|
uuid: 'resource-policy-20',
|
|
type: 'resourcePolicy',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/authz/resourcePolicies/20' }
|
|
}
|
|
}
|
|
]
|
|
},
|
|
logo: {
|
|
sizeBytes: 7451,
|
|
content: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425/content',
|
|
format: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425/format',
|
|
bundleName: null,
|
|
id: '3f859425-ffbd-4b0e-bf91-bfeb458a7425',
|
|
uuid: '3f859425-ffbd-4b0e-bf91-bfeb458a7425',
|
|
type: 'bitstream',
|
|
name: null,
|
|
metadata: [],
|
|
_links: {
|
|
content: { href: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425/content' },
|
|
format: { href: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425/format' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425' }
|
|
}
|
|
},
|
|
id: '1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb',
|
|
uuid: '1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb',
|
|
type: 'collection',
|
|
name: 'Collection of Sample Items',
|
|
metadata: [
|
|
{
|
|
key: 'dc.provenance',
|
|
language: null,
|
|
value: 'This field is for private provenance information. It is only visible to Administrative users and is not displayed in the user interface by default.'
|
|
},
|
|
{
|
|
key: 'dc.rights.license',
|
|
language: null,
|
|
value: ''
|
|
},
|
|
{
|
|
key: 'dc.description',
|
|
language: null,
|
|
value: '<p>This is a <em>DSpace Collection</em> which contains sample DSpace Items.</p>\r\n<p><strong>Collections in DSpace may only contain Items.</strong></p>\r\n<p>This particular Collection has its own logo (the <a href=\'http://www.opensource.org/\'>Open Source Initiative</a> logo).</p>\r\n<p>This introductory text is editable by System Administrators, Community Administrators (of a parent Community) or Collection Administrators (of this Collection).</p>'
|
|
},
|
|
{
|
|
key: 'dc.description.abstract',
|
|
language: null,
|
|
value: 'This collection contains sample items.'
|
|
},
|
|
{
|
|
key: 'dc.description.tableofcontents',
|
|
language: null,
|
|
value: '<p>This is the <strong>news</strong> section for this Collection. System Administrators, Community Administrators (of a parent Community) or Collection Administrators (of this Collection) can edit this News field.</p>'
|
|
},
|
|
{
|
|
key: 'dc.rights',
|
|
language: null,
|
|
value: '<p><em>If this collection had a specific copyright statement, it would be placed here.</em></p>'
|
|
},
|
|
{
|
|
key: 'dc.title',
|
|
language: null,
|
|
value: 'Collection of Sample Items'
|
|
}
|
|
],
|
|
_links: {
|
|
license: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/license' },
|
|
defaultAccessConditions: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/defaultAccessConditions' },
|
|
logo: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/logo' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb' }
|
|
}
|
|
},
|
|
item: {
|
|
handle: null,
|
|
lastModified: '2019-01-09T10:17:33.722+0000',
|
|
isArchived: false,
|
|
isDiscoverable: true,
|
|
isWithdrawn: false,
|
|
owningCollection: 'https://rest.api/dspace-spring-rest/api/core/items/cae8af78-c874-4468-af79-e6c996aa8270/owningCollection',
|
|
bitstreams: {
|
|
pageInfo: {
|
|
elementsPerPage: 0,
|
|
totalElements: 0,
|
|
totalPages: 1,
|
|
currentPage: 1
|
|
},
|
|
page: []
|
|
},
|
|
id: 'cae8af78-c874-4468-af79-e6c996aa8270',
|
|
uuid: 'cae8af78-c874-4468-af79-e6c996aa8270',
|
|
type: 'item',
|
|
name: null,
|
|
metadata: [],
|
|
_links: {
|
|
bitstreams: { href: 'https://rest.api/dspace-spring-rest/api/core/items/cae8af78-c874-4468-af79-e6c996aa8270/bitstreams' },
|
|
owningCollection: { href: 'https://rest.api/dspace-spring-rest/api/core/items/cae8af78-c874-4468-af79-e6c996aa8270/owningCollection' },
|
|
templateItemOf: { href: 'https://rest.api/dspace-spring-rest/api/core/items/cae8af78-c874-4468-af79-e6c996aa8270/templateItemOf' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/core/items/cae8af78-c874-4468-af79-e6c996aa8270' }
|
|
}
|
|
},
|
|
submissionDefinition: {
|
|
isDefault: true,
|
|
sections: {
|
|
pageInfo: {
|
|
elementsPerPage: 5,
|
|
totalElements: 5,
|
|
totalPages: 1,
|
|
currentPage: 1
|
|
},
|
|
page: [
|
|
{
|
|
mandatory: true,
|
|
sectionType: 'collection',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/collection' },
|
|
config: ''
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.describe.stepone',
|
|
mandatory: true,
|
|
sectionType: 'submission-form',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/traditionalpageone' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.describe.steptwo',
|
|
mandatory: true,
|
|
sectionType: 'submission-form',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/traditionalpagetwo' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpagetwo' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.upload',
|
|
mandatory: true,
|
|
sectionType: 'upload',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/upload' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.license',
|
|
mandatory: true,
|
|
sectionType: 'license',
|
|
visibility: {
|
|
main: null,
|
|
other: 'READONLY'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/license' },
|
|
config: ''
|
|
},
|
|
}
|
|
]
|
|
},
|
|
name: 'traditional',
|
|
type: 'submissiondefinition',
|
|
_links: {
|
|
collections: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional/collections' },
|
|
sections: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional/sections' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional' }
|
|
},
|
|
collections: {
|
|
pageInfo: {
|
|
elementsPerPage: 0,
|
|
totalElements: 0,
|
|
totalPages: 1,
|
|
currentPage: 1
|
|
},
|
|
page: []
|
|
}
|
|
},
|
|
submitter: {
|
|
handle: null,
|
|
groups: [],
|
|
netid: null,
|
|
lastActive: '2019-01-09T10:17:33.047+0000',
|
|
canLogIn: true,
|
|
email: 'dspacedemo+submit@gmail.com',
|
|
requireCertificate: false,
|
|
selfRegistered: false,
|
|
id: '99423c27-b642-5tg6-a9cd-6d910e68dca5',
|
|
uuid: '99423c27-b642-5tg6-a9cd-6d910e68dca5',
|
|
type: 'eperson',
|
|
name: 'dspacedemo+submit@gmail.com',
|
|
metadata: [
|
|
{
|
|
key: 'eperson.firstname',
|
|
language: null,
|
|
value: 'Demo'
|
|
},
|
|
{
|
|
key: 'eperson.lastname',
|
|
language: null,
|
|
value: 'Submitter'
|
|
}
|
|
],
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/eperson/epersons/99423c27-b642-5tg6-a9cd-6d910e68dca5' }
|
|
}
|
|
},
|
|
id: 826,
|
|
lastModified: '2019-01-09T10:17:33.738+0000',
|
|
sections: {
|
|
license: {
|
|
url: null,
|
|
acceptanceDate: null,
|
|
granted: false
|
|
},
|
|
upload: {
|
|
files: []
|
|
}
|
|
},
|
|
errors: [
|
|
{
|
|
message: 'error.validation.required',
|
|
paths: [
|
|
'/sections/traditionalpageone/dc.title',
|
|
'/sections/traditionalpageone/dc.date.issued'
|
|
]
|
|
}
|
|
],
|
|
type: 'workspaceitem',
|
|
_links: {
|
|
collection: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/collection' },
|
|
item: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/item' },
|
|
submissionDefinition: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/submissionDefinition' },
|
|
submitter: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/submitter' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826' }
|
|
}
|
|
};
|
|
|
|
export const mockSubmissionObjectNew = {
|
|
collection: {
|
|
handle: '10673/2',
|
|
license: 'https://rest.api/dspace-spring-rest/api/core/collections/45f2f3f1-ba1f-4f36-908a-3f1ea9a557eb/license',
|
|
defaultAccessConditions: {
|
|
pageInfo: {
|
|
elementsPerPage: 1,
|
|
totalElements: 1,
|
|
totalPages: 1,
|
|
currentPage: 1
|
|
},
|
|
page: [
|
|
{
|
|
name: null,
|
|
groupUUID: '11cc35e5-a11d-4b64-b5b9-0052a5d15509',
|
|
id: 20,
|
|
uuid: 'resource-policy-20',
|
|
type: 'resourcePolicy',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/authz/resourcePolicies/20' }
|
|
}
|
|
}
|
|
]
|
|
},
|
|
logo: {
|
|
sizeBytes: 7451,
|
|
content: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425/content',
|
|
format: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425/format',
|
|
bundleName: null,
|
|
id: '3f859425-ffbd-4b0e-bf91-bfeb458a7425',
|
|
uuid: '3f859425-ffbd-4b0e-bf91-bfeb458a7425',
|
|
type: 'bitstream',
|
|
name: null,
|
|
metadata: [],
|
|
_links: {
|
|
content: { href: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425/content' },
|
|
format: { href: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425/format' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/core/bitstreams/3f859425-ffbd-4b0e-bf91-bfeb458a7425' }
|
|
}
|
|
},
|
|
id: '45f2f3f1-ba1f-4f36-908a-3f1ea9a557eb',
|
|
uuid: '45f2f3f1-ba1f-4f36-908a-3f1ea9a557eb',
|
|
type: 'collection',
|
|
name: 'Another Collection of Sample Items',
|
|
metadata: [
|
|
{
|
|
key: 'dc.provenance',
|
|
language: null,
|
|
value: 'This field is for private provenance information. It is only visible to Administrative users and is not displayed in the user interface by default.'
|
|
},
|
|
{
|
|
key: 'dc.rights.license',
|
|
language: null,
|
|
value: ''
|
|
},
|
|
{
|
|
key: 'dc.description',
|
|
language: null,
|
|
value: '<p>This is a <em>DSpace Collection</em> which contains sample DSpace Items.</p>\r\n<p><strong>Collections in DSpace may only contain Items.</strong></p>\r\n<p>This particular Collection has its own logo (the <a href=\'http://www.opensource.org/\'>Open Source Initiative</a> logo).</p>\r\n<p>This introductory text is editable by System Administrators, Community Administrators (of a parent Community) or Collection Administrators (of this Collection).</p>'
|
|
},
|
|
{
|
|
key: 'dc.description.abstract',
|
|
language: null,
|
|
value: 'This collection contains sample items.'
|
|
},
|
|
{
|
|
key: 'dc.description.tableofcontents',
|
|
language: null,
|
|
value: '<p>This is the <strong>news</strong> section for this Collection. System Administrators, Community Administrators (of a parent Community) or Collection Administrators (of this Collection) can edit this News field.</p>'
|
|
},
|
|
{
|
|
key: 'dc.rights',
|
|
language: null,
|
|
value: '<p><em>If this collection had a specific copyright statement, it would be placed here.</em></p>'
|
|
},
|
|
{
|
|
key: 'dc.title',
|
|
language: null,
|
|
value: 'Collection of Sample Items'
|
|
}
|
|
],
|
|
_links: {
|
|
license: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/45f2f3f1-ba1f-4f36-908a-3f1ea9a557eb/license' },
|
|
defaultAccessConditions: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/45f2f3f1-ba1f-4f36-908a-3f1ea9a557eb/defaultAccessConditions' },
|
|
logo: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/45f2f3f1-ba1f-4f36-908a-3f1ea9a557eb/logo' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/core/collections/45f2f3f1-ba1f-4f36-908a-3f1ea9a557eb' }
|
|
}
|
|
},
|
|
item: {
|
|
handle: null,
|
|
lastModified: '2019-01-09T10:17:33.722+0000',
|
|
isArchived: false,
|
|
isDiscoverable: true,
|
|
isWithdrawn: false,
|
|
owningCollection: 'https://rest.api/dspace-spring-rest/api/core/items/cae8af78-c874-4468-af79-e6c996aa8270/owningCollection',
|
|
bitstreams: {
|
|
pageInfo: {
|
|
elementsPerPage: 0,
|
|
totalElements: 0,
|
|
totalPages: 1,
|
|
currentPage: 1
|
|
},
|
|
page: []
|
|
},
|
|
id: 'cae8af78-c874-4468-af79-e6c996aa8270',
|
|
uuid: 'cae8af78-c874-4468-af79-e6c996aa8270',
|
|
type: 'item',
|
|
name: null,
|
|
metadata: [],
|
|
_links: {
|
|
bitstreams: { href: 'https://rest.api/dspace-spring-rest/api/core/items/cae8af78-c874-4468-af79-e6c996aa8270/bitstreams' },
|
|
owningCollection: { href: 'https://rest.api/dspace-spring-rest/api/core/items/cae8af78-c874-4468-af79-e6c996aa8270/owningCollection' },
|
|
templateItemOf: { href: 'https://rest.api/dspace-spring-rest/api/core/items/cae8af78-c874-4468-af79-e6c996aa8270/templateItemOf' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/core/items/cae8af78-c874-4468-af79-e6c996aa8270' }
|
|
}
|
|
},
|
|
submissionDefinition: {
|
|
isDefault: true,
|
|
sections: {
|
|
pageInfo: {
|
|
elementsPerPage: 5,
|
|
totalElements: 5,
|
|
totalPages: 1,
|
|
currentPage: 1
|
|
},
|
|
page: [
|
|
{
|
|
mandatory: true,
|
|
sectionType: 'collection',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/collection' },
|
|
config: ''
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.describe.stepone',
|
|
mandatory: true,
|
|
sectionType: 'submission-form',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/traditionalpageone' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.describe.steptwo',
|
|
mandatory: true,
|
|
sectionType: 'submission-form',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/traditionalpagetwo' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpagetwo' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.upload',
|
|
mandatory: true,
|
|
sectionType: 'upload',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/upload' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.license',
|
|
mandatory: true,
|
|
sectionType: 'license',
|
|
visibility: {
|
|
main: null,
|
|
other: 'READONLY'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/license' },
|
|
config: ''
|
|
},
|
|
}
|
|
]
|
|
},
|
|
name: 'traditionaltwo',
|
|
type: 'submissiondefinition',
|
|
_links: {
|
|
collections: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional/collections' },
|
|
sections: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional/sections' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional' }
|
|
},
|
|
collections: {
|
|
pageInfo: {
|
|
elementsPerPage: 0,
|
|
totalElements: 0,
|
|
totalPages: 1,
|
|
currentPage: 1
|
|
},
|
|
page: []
|
|
}
|
|
},
|
|
submitter: {
|
|
handle: null,
|
|
groups: [],
|
|
netid: null,
|
|
lastActive: '2019-01-09T10:17:33.047+0000',
|
|
canLogIn: true,
|
|
email: 'dspacedemo+submit@gmail.com',
|
|
requireCertificate: false,
|
|
selfRegistered: false,
|
|
id: '99423c27-b642-4bb9-a9cd-45gh23e68dca5',
|
|
uuid: '99423c27-b642-4bb9-a9cd-45gh23e68dca5',
|
|
type: 'eperson',
|
|
name: 'dspacedemo+submit@gmail.com',
|
|
metadata: [
|
|
{
|
|
key: 'eperson.firstname',
|
|
language: null,
|
|
value: 'Demo'
|
|
},
|
|
{
|
|
key: 'eperson.lastname',
|
|
language: null,
|
|
value: 'Submitter'
|
|
}
|
|
],
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/eperson/epersons/99423c27-b642-4bb9-a9cd-45gh23e68dca5' }
|
|
}
|
|
},
|
|
id: 826,
|
|
lastModified: '2019-01-09T10:17:33.738+0000',
|
|
sections: {},
|
|
errors: [],
|
|
type: 'workspaceitem',
|
|
_links: {
|
|
collection: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/collection' },
|
|
item: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/item' },
|
|
submissionDefinition: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/submissionDefinition' },
|
|
submitter: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826/submitter' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826' }
|
|
}
|
|
};
|
|
|
|
export const mockSubmissionCollectionId = '1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb';
|
|
|
|
export const mockSubmissionId = '826';
|
|
|
|
export const mockSubmissionSelfUrl = 'https://rest.api/dspace-spring-rest/api/submission/workspaceitems/826';
|
|
|
|
export const mockSubmissionDefinitionResponse = {
|
|
isDefault: true,
|
|
sections: [
|
|
{
|
|
mandatory: true,
|
|
sectionType: 'utils',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/extraction' },
|
|
config: ''
|
|
},
|
|
},
|
|
{
|
|
mandatory: true,
|
|
sectionType: 'collection',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/collection' },
|
|
config: ''
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.describe.stepone',
|
|
mandatory: true,
|
|
sectionType: 'submission-form',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/traditionalpageone' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.describe.steptwo',
|
|
mandatory: false,
|
|
sectionType: 'submission-form',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/traditionalpagetwo' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpagetwo' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.upload',
|
|
mandatory: true,
|
|
sectionType: 'upload',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/upload' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.license',
|
|
mandatory: true,
|
|
sectionType: 'license',
|
|
visibility: {
|
|
main: null,
|
|
other: 'READONLY'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/license' },
|
|
config: ''
|
|
},
|
|
}
|
|
],
|
|
name: 'traditional',
|
|
type: 'submissiondefinition',
|
|
_links: {
|
|
collections: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional/collections' },
|
|
sections: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional/sections' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional' }
|
|
},
|
|
} as any;
|
|
|
|
export const mockSubmissionDefinition: SubmissionDefinitionsModel = {
|
|
isDefault: true,
|
|
sections: buildPaginatedList(new PageInfo(), [
|
|
{
|
|
mandatory: true,
|
|
sectionType: 'utils',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/extraction' },
|
|
config: ''
|
|
},
|
|
},
|
|
{
|
|
mandatory: true,
|
|
sectionType: 'collection',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/collection' },
|
|
config: ''
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.describe.stepone',
|
|
mandatory: true,
|
|
sectionType: 'submission-form',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/traditionalpageone' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.describe.steptwo',
|
|
mandatory: false,
|
|
sectionType: 'submission-form',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/traditionalpagetwo' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpagetwo' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.upload',
|
|
mandatory: true,
|
|
sectionType: 'upload',
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/upload' },
|
|
config: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload' }
|
|
},
|
|
},
|
|
{
|
|
header: 'submit.progressbar.license',
|
|
mandatory: true,
|
|
sectionType: 'license',
|
|
visibility: {
|
|
main: null,
|
|
other: 'READONLY'
|
|
},
|
|
type: 'submissionsection',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionsections/license' },
|
|
config: ''
|
|
},
|
|
}
|
|
]),
|
|
name: 'traditional',
|
|
type: 'submissiondefinition',
|
|
_links: {
|
|
collections: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional/collections' },
|
|
sections: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional/sections' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional' }
|
|
},
|
|
} as any;
|
|
|
|
export const mockSubmissionState: SubmissionObjectState = Object.assign({}, {
|
|
826: {
|
|
collection: mockSubmissionCollectionId,
|
|
definition: 'traditional',
|
|
selfUrl: mockSubmissionSelfUrl,
|
|
activeSection: null,
|
|
sections: {
|
|
extraction: {
|
|
config: '',
|
|
mandatory: true,
|
|
sectionType: 'utils',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
collapsed: false,
|
|
enabled: true,
|
|
data: {},
|
|
errors: [],
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any,
|
|
collection: {
|
|
config: '',
|
|
mandatory: true,
|
|
sectionType: 'collection',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
collapsed: false,
|
|
enabled: true,
|
|
data: {},
|
|
errors: [],
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any,
|
|
traditionalpageone: {
|
|
header: 'submit.progressbar.describe.stepone',
|
|
config: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone',
|
|
mandatory: true,
|
|
sectionType: 'submission-form',
|
|
collapsed: false,
|
|
enabled: true,
|
|
data: {},
|
|
errors: [],
|
|
formId: '2_traditionalpageone',
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any,
|
|
traditionalpagetwo: {
|
|
header: 'submit.progressbar.describe.steptwo',
|
|
config: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpagetwo',
|
|
mandatory: false,
|
|
sectionType: 'submission-form',
|
|
collapsed: false,
|
|
enabled: false,
|
|
data: {},
|
|
errors: [],
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any,
|
|
upload: {
|
|
header: 'submit.progressbar.upload',
|
|
config: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload',
|
|
mandatory: true,
|
|
sectionType: 'upload',
|
|
collapsed: false,
|
|
enabled: true,
|
|
data: {
|
|
files: []
|
|
},
|
|
errors: [],
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any,
|
|
license: {
|
|
header: 'submit.progressbar.license',
|
|
config: '',
|
|
mandatory: true,
|
|
sectionType: 'license',
|
|
visibility: {
|
|
main: null,
|
|
other: 'READONLY'
|
|
},
|
|
collapsed: false,
|
|
enabled: true,
|
|
data: {},
|
|
errors: [],
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any
|
|
},
|
|
isLoading: false,
|
|
savePending: false,
|
|
depositPending: false
|
|
}
|
|
});
|
|
|
|
export const mockSectionsState = Object.assign({}, {
|
|
extraction: {
|
|
config: '',
|
|
mandatory: true,
|
|
sectionType: 'utils',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
collapsed: false,
|
|
enabled: true,
|
|
data: {},
|
|
errors: [],
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any,
|
|
collection: {
|
|
config: '',
|
|
mandatory: true,
|
|
sectionType: 'collection',
|
|
visibility: {
|
|
main: 'HIDDEN',
|
|
other: 'HIDDEN'
|
|
},
|
|
collapsed: false,
|
|
enabled: true,
|
|
data: {},
|
|
errors: [],
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any,
|
|
traditionalpageone: {
|
|
header: 'submit.progressbar.describe.stepone',
|
|
config: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone',
|
|
mandatory: true,
|
|
sectionType: 'submission-form',
|
|
collapsed: false,
|
|
enabled: true,
|
|
data: {},
|
|
errors: [],
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any,
|
|
traditionalpagetwo: {
|
|
header: 'submit.progressbar.describe.steptwo',
|
|
config: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpagetwo',
|
|
mandatory: false,
|
|
sectionType: 'submission-form',
|
|
collapsed: false,
|
|
enabled: false,
|
|
data: {},
|
|
errors: [],
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any,
|
|
upload: {
|
|
header: 'submit.progressbar.upload',
|
|
config: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload',
|
|
mandatory: true,
|
|
sectionType: 'upload',
|
|
collapsed: false,
|
|
enabled: true,
|
|
data: {},
|
|
errors: [],
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any,
|
|
license: {
|
|
header: 'submit.progressbar.license',
|
|
config: '',
|
|
mandatory: true,
|
|
sectionType: 'license',
|
|
visibility: {
|
|
main: null,
|
|
other: 'READONLY'
|
|
},
|
|
collapsed: false,
|
|
enabled: true,
|
|
data: {},
|
|
errors: [],
|
|
isLoading: false,
|
|
isValid: false
|
|
} as any
|
|
});
|
|
|
|
export const mockSectionsList = [
|
|
{
|
|
config: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone',
|
|
mandatory: true,
|
|
data: {},
|
|
errors: [],
|
|
header: 'submit.progressbar.describe.stepone',
|
|
id: 'traditionalpageone',
|
|
sectionType: 'submission-form'
|
|
},
|
|
{
|
|
config: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpagetwo',
|
|
mandatory: true,
|
|
data: {},
|
|
errors: [],
|
|
header: 'submit.progressbar.describe.steptwo',
|
|
id: 'traditionalpagetwo',
|
|
sectionType: 'submission-form'
|
|
},
|
|
{
|
|
config: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload',
|
|
mandatory: true,
|
|
data: {},
|
|
errors: [],
|
|
header: 'submit.progressbar.upload',
|
|
id: 'upload',
|
|
sectionType: 'upload'
|
|
},
|
|
{
|
|
config: '',
|
|
mandatory: true,
|
|
data: {},
|
|
errors: [],
|
|
header: 'submit.progressbar.license',
|
|
id: 'license',
|
|
sectionType: 'license'
|
|
}
|
|
];
|
|
|
|
export const mockUploadConfigResponseMetadata = {
|
|
rows: [
|
|
{
|
|
fields: [
|
|
{
|
|
input: {
|
|
type: 'onebox'
|
|
},
|
|
label: 'Title',
|
|
mandatory: true,
|
|
repeatable: false,
|
|
mandatoryMessage: 'You must enter a main title for this item.',
|
|
hints: 'Enter the name of the file.',
|
|
selectableMetadata: [
|
|
{
|
|
metadata: 'dc.title',
|
|
label: null,
|
|
controlledVocabulary: null,
|
|
closed: null
|
|
}
|
|
],
|
|
languageCodes: []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
fields: [
|
|
{
|
|
input: {
|
|
type: 'textarea'
|
|
},
|
|
label: 'Description',
|
|
mandatory: false,
|
|
repeatable: true,
|
|
hints: 'Enter a description for the file',
|
|
selectableMetadata: [
|
|
{
|
|
metadata: 'dc.description',
|
|
label: null,
|
|
controlledVocabulary: null,
|
|
closed: null
|
|
}
|
|
],
|
|
languageCodes: []
|
|
}
|
|
]
|
|
}
|
|
],
|
|
name: 'bitstream-metadata',
|
|
type: 'submissionform',
|
|
_links: {
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/bitstream-metadata' }
|
|
},
|
|
};
|
|
|
|
export const mockUploadConfigResponse = {
|
|
accessConditionOptions: [
|
|
{
|
|
name: 'openaccess',
|
|
groupUUID: '123456-g',
|
|
hasStartDate: false,
|
|
hasEndDate: false
|
|
},
|
|
{
|
|
name: 'lease',
|
|
groupUUID: '123456-g',
|
|
hasStartDate: false,
|
|
hasEndDate: true,
|
|
maxEndDate: '2019-07-12T14:40:06.308+0000'
|
|
},
|
|
{
|
|
name: 'embargo',
|
|
groupUUID: '123456-g',
|
|
hasStartDate: true,
|
|
hasEndDate: false,
|
|
maxStartDate: '2022-01-12T14:40:06.308+0000'
|
|
},
|
|
{
|
|
name: 'administrator',
|
|
groupUUID: '0f2773dd-1741-475f-80e7-ccdef153d655',
|
|
hasStartDate: false,
|
|
hasEndDate: false
|
|
}
|
|
],
|
|
metadata: createSuccessfulRemoteDataObject$(mockUploadConfigResponseMetadata),
|
|
required: true,
|
|
maxSize: 536870912,
|
|
name: 'upload',
|
|
type: 'submissionupload',
|
|
_links: {
|
|
metadata: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload/metadata' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload' }
|
|
},
|
|
};
|
|
|
|
// Clone the object and change one property
|
|
export const mockUploadConfigResponseNotRequired = Object.assign({}, mockUploadConfigResponse, { required: false });
|
|
|
|
export const mockAccessConditionOptions = [
|
|
{
|
|
name: 'openaccess',
|
|
groupUUID: '123456-g',
|
|
hasStartDate: false,
|
|
hasEndDate: false
|
|
},
|
|
{
|
|
name: 'lease',
|
|
groupUUID: '123456-g',
|
|
hasStartDate: false,
|
|
hasEndDate: true,
|
|
maxEndDate: '2019-07-12T14:40:06.308+0000'
|
|
},
|
|
{
|
|
name: 'embargo',
|
|
groupUUID: '123456-g',
|
|
hasStartDate: true,
|
|
hasEndDate: false,
|
|
maxStartDate: '2022-01-12T14:40:06.308+0000'
|
|
},
|
|
{
|
|
name: 'administrator',
|
|
groupUUID: '0f2773dd-1741-475f-80e7-ccdef153d655',
|
|
hasStartDate: false,
|
|
hasEndDate: false
|
|
}
|
|
];
|
|
|
|
export const mockGroup = Object.assign(new Group(), {
|
|
handle: null,
|
|
permanent: true,
|
|
id: '123456-g',
|
|
uuid: '123456-g',
|
|
type: 'group',
|
|
name: 'Anonymous',
|
|
metadata: [],
|
|
_links: {
|
|
groups: { href: 'https://rest.api/dspace-spring-rest/api/eperson/groups/123456-g1/groups' },
|
|
self: { href: 'https://rest.api/dspace-spring-rest/api/eperson/groups/123456-g1' }
|
|
},
|
|
groups: {
|
|
pageInfo: {
|
|
elementsPerPage: 0,
|
|
totalElements: 0,
|
|
totalPages: 1,
|
|
currentPage: 1
|
|
},
|
|
page: []
|
|
}
|
|
});
|
|
|
|
export const mockUploadFiles = [
|
|
{
|
|
uuid: '123456-test-upload',
|
|
metadata: {
|
|
'dc.source': [
|
|
{
|
|
value: '123456-test-upload.jpg',
|
|
language: null,
|
|
authority: null,
|
|
display: '123456-test-upload.jpg',
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
],
|
|
'dc.title': [
|
|
{
|
|
value: '123456-test-upload.jpg',
|
|
language: null,
|
|
authority: null,
|
|
display: '123456-test-upload.jpg',
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
]
|
|
},
|
|
accessConditions: [
|
|
{
|
|
id: 3675,
|
|
name: 'lease',
|
|
rpType: 'TYPE_CUSTOM',
|
|
groupUUID: '123456-g',
|
|
action: 'READ',
|
|
endDate: '2019-01-16',
|
|
type: 'resourcePolicy'
|
|
},
|
|
{
|
|
id: 3676,
|
|
name: 'openaccess',
|
|
rpType: 'TYPE_CUSTOM',
|
|
groupUUID: '123456-g',
|
|
action: 'READ',
|
|
type: 'resourcePolicy'
|
|
}
|
|
],
|
|
format: {
|
|
id: 16,
|
|
shortDescription: 'JPEG',
|
|
description: 'Joint Photographic Experts Group/JPEG File Interchange Format (JFIF)',
|
|
mimetype: 'image/jpeg',
|
|
supportLevel: 0,
|
|
internal: false,
|
|
extensions: null,
|
|
type: 'bitstreamformat'
|
|
},
|
|
sizeBytes: 202999,
|
|
checkSum: {
|
|
checkSumAlgorithm: 'MD5',
|
|
value: '5e0996996863d2623439cbb53052bc72'
|
|
},
|
|
url: 'https://test-ui.com/api/core/bitstreams/123456-test-upload/content'
|
|
}
|
|
];
|
|
|
|
export const mockFileFormData = {
|
|
metadata: {
|
|
'dc.title': [
|
|
{
|
|
value: 'title',
|
|
language: null,
|
|
authority: null,
|
|
display: 'title',
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
],
|
|
'dc.description': [
|
|
{
|
|
value: 'description',
|
|
language: null,
|
|
authority: null,
|
|
display: 'description',
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
]
|
|
},
|
|
accessConditions: [
|
|
{
|
|
name: [
|
|
{
|
|
value: 'openaccess',
|
|
language: null,
|
|
authority: null,
|
|
display: 'openaccess',
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
],
|
|
groupUUID: [
|
|
{
|
|
value: '123456-g',
|
|
language: null,
|
|
authority: null,
|
|
display: '123456-g',
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
]
|
|
}
|
|
,
|
|
{
|
|
name: [
|
|
{
|
|
value: 'lease',
|
|
language: null,
|
|
authority: null,
|
|
display: 'lease',
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
],
|
|
endDate: [
|
|
{
|
|
value: {
|
|
year: 2019,
|
|
month: 1,
|
|
day: 16
|
|
},
|
|
language: null,
|
|
authority: null,
|
|
display: {
|
|
year: 2019,
|
|
month: 1,
|
|
day: 16
|
|
},
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
],
|
|
groupUUID: [
|
|
{
|
|
value: '123456-g',
|
|
language: null,
|
|
authority: null,
|
|
display: '123456-g',
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
]
|
|
}
|
|
,
|
|
{
|
|
name: [
|
|
{
|
|
value: 'embargo',
|
|
language: null,
|
|
authority: null,
|
|
display: 'lease',
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
],
|
|
startDate: [
|
|
{
|
|
value: {
|
|
year: 2019,
|
|
month: 1,
|
|
day: 16
|
|
},
|
|
language: null,
|
|
authority: null,
|
|
display: {
|
|
year: 2019,
|
|
month: 1,
|
|
day: 16
|
|
},
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
],
|
|
groupUUID: [
|
|
{
|
|
value: '123456-g',
|
|
language: null,
|
|
authority: null,
|
|
display: '123456-g',
|
|
confidence: -1,
|
|
place: 0,
|
|
otherInformation: null
|
|
}
|
|
]
|
|
}
|
|
]
|
|
};
|