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..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 @@ -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/config/environment.default.js b/config/environment.default.js index 86c413bb29..03080f756f 100644 --- a/config/environment.default.js +++ b/config/environment.default.js @@ -13,7 +13,7 @@ module.exports = { host: 'dspace7.4science.cloud', port: 443, // NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript - nameSpace: '/dspace-spring-rest/api' + nameSpace: '/server/api' }, // Caching settings cache: { diff --git a/package.json b/package.json index 5ec7b2d694..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", @@ -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", @@ -120,7 +122,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", @@ -167,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", @@ -190,8 +192,9 @@ "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", "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,10 +228,11 @@ "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", - "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/protractor.conf.js b/protractor.conf.js index 2949702a0a..6570c9f7c3 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: 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: 30000, + defaultTimeoutInterval: 600000, print: function () {} }, useAllAngular2AppRoots: true, 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.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.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-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.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-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.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-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.spec.ts b/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts index c6402c1f3b..3c4f858c55 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-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.spec.ts b/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts index 674798848b..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 @@ -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,8 @@ 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'; +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/+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/+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 98d7299984..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 @@ -20,6 +20,9 @@ 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'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; +import { BrowseEntry } from '../../core/shared/browse-entry.model'; describe('BrowseByMetadataPageComponent', () => { let comp: BrowseByMetadataPageComponent; @@ -39,21 +42,21 @@ describe('BrowseByMetadataPageComponent', () => { const mockEntries = [ { - type: 'author', + type: BrowseEntry.type, authority: null, value: 'John Doe', language: 'en', count: 1 }, { - type: 'author', + type: BrowseEntry.type, authority: null, value: 'James Doe', language: 'en', count: 3 }, { - type: 'subject', + type: BrowseEntry.type, authority: null, value: 'Fake subject', language: 'en', @@ -68,12 +71,12 @@ 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) }; const mockDsoService = { - findById: () => observableOf(new RemoteData(false, false, true, null, mockCommunity)) + findById: () => createSuccessfulRemoteDataObject$(mockCommunity) }; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { @@ -105,12 +108,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(); }); @@ -160,5 +157,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/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/+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/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/+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 09363b9964..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 @@ -6,17 +6,18 @@ 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'; +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/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/+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..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 { 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'; +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-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/+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.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}}:
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..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,7 @@ 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', () => { let comp: ItemStatusComponent; @@ -27,7 +27,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/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 12312656f6..3f525e6a25 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,13 +103,13 @@ 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())), - leftItem: observableOf(new RemoteData(false, false, true, null, new Item())), - rightItem: observableOf(new RemoteData(false, false, true, null, new Item())) + relationshipType: createSuccessfulRemoteDataObject$(new RelationshipType()), + leftItem: createSuccessfulRemoteDataObject$(new Item()), + rightItem: createSuccessfulRemoteDataObject$(new Item()) }) - ]))); + ])); } describe('ItemComponent', () => { const arr1 = [ @@ -337,15 +338,15 @@ describe('ItemComponent', () => { uuid: '1', metadata: new MetadataMap() }); - mockItem.relationships = observableOf(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), [ + mockItem.relationships = createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [ Object.assign(new Relationship(), { uuid: '123', id: '123', - leftItem: observableOf(new RemoteData(false, false, true, null, mockItem)), - rightItem: observableOf(new RemoteData(false, false, true, null, relatedItem)), - relationshipType: observableOf(new RemoteData(false, false, true, null, new RelationshipType())) + leftItem: createSuccessfulRemoteDataObject$(mockItem), + rightItem: createSuccessfulRemoteDataObject$(relatedItem), + relationshipType: createSuccessfulRemoteDataObject$(new RelationshipType()) }) - ]))); + ])); mockItem.metadata[metadataField] = [ { value: 'Second value', @@ -369,7 +370,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/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/+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-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-configuration.service.ts b/src/app/+search-page/search-service/search-configuration.service.ts index 14fcdd8d60..e55363f1f5 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 @@ -269,7 +270,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/+search-page/search-service/search.service.ts b/src/app/+search-page/search-service/search.service.ts index 598657a1b2..86611cc87b 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,7 @@ 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) { + 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/+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 cb80d0165e..86364aca89 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -32,7 +32,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-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.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/auth/auth-response-parsing.service.ts b/src/app/core/auth/auth-response-parsing.service.ts index c736c3b22b..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,7 +9,6 @@ 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'; @@ -18,7 +16,6 @@ import { NormalizedObject } from '../cache/models/normalized-object.model'; @Injectable() export class AuthResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - protected objectFactory = AuthObjectFactory; protected toCache = true; constructor(@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig, @@ -28,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/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/auth-status.model.ts b/src/app/core/auth/models/auth-status.model.ts index 6e722a80c9..e0d568397a 100644 --- a/src/app/core/auth/models/auth-status.model.ts +++ b/src/app/core/auth/models/auth-status.model.ts @@ -4,20 +4,51 @@ 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 { 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 + */ 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; } 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..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,16 +1,22 @@ 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'; @mapsTo(AuthStatus) @inheritSerialization(NormalizedObject) 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; @@ -26,7 +32,10 @@ export class NormalizedAuthStatus extends NormalizedObject { @autoserialize authenticated: boolean; - @relationship(ResourceType.EPerson, false) + /** + * The self link to the eperson of this auth status + */ + @relationship(EPerson, false) @autoserialize eperson: string; } 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/builders/build-decorators.ts b/src/app/core/cache/builders/build-decorators.ts index 937fb37cd3..0bfb5f0321 100644 --- a/src/app/core/cache/builders/build-decorators.ts +++ b/src/app/core/cache/builders/build-decorators.ts @@ -1,23 +1,59 @@ 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); +/** + * 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); + mapsToType((value as any).type, objectConstructor); + } } +/** + * 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; + } + typeMap.set(value.value, objectConstructor); +} + +/** + * Returns the mapped class for the given normalized class + * @param target The normalized class + */ export function getMapsTo(target: any) { return Reflect.getOwnMetadata(mapsToMetadataKey, target); } -export function relationship(value: ResourceType, isList: boolean = false): any { +/** + * Returns the mapped class for the given type + * @param type The resource type + */ +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 +64,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 79665fec3d..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 { CacheableObject } from '../object-cache.reducer'; -import { getRelationships } from './build-decorators'; -import { NormalizedObjectFactory } from '../models/normalized-object-factory'; +import { getMapsToType, getRelationships } from './build-decorators'; import { hasValue, isNotEmpty } from '../../../shared/empty.util'; +import { TypedObject } from '../object-cache.reducer'; /** * Return true if halObj has a value for `_links.self` @@ -35,8 +34,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 = getMapsToType((domainModel as any).type); const relationships = getRelationships(normalizedConstructor) || []; const normalizedModel = Object.assign({}, domainModel) as any; 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 563dce23d1..85ba7636b6 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,8 @@ import { getRequestFromRequestUUID, getResourceLinksFromResponse } from '../../shared/operators'; -import { CacheableObject } from '../object-cache.reducer'; +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/cache/models/items/normalized-item-type.model.ts b/src/app/core/cache/models/items/normalized-item-type.model.ts index ed38d80a4b..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,6 +1,5 @@ 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'; @@ -11,7 +10,6 @@ import { IDToUUIDSerializer } from '../../id-to-uuid-serializer'; @mapsTo(ItemType) @inheritSerialization(NormalizedObject) export class NormalizedItemType extends NormalizedObject { - /** * The label that describes the ResourceType of the Item */ @@ -27,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 d201fb2746..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,6 +5,7 @@ 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 { ItemType } from '../../../shared/item-relationships/item-type.model'; /** * Normalized model class for a DSpace RelationshipType @@ -12,7 +13,6 @@ import { IDToUUIDSerializer } from '../../id-to-uuid-serializer'; @mapsTo(RelationshipType) @inheritSerialization(NormalizedDSpaceObject) export class NormalizedRelationshipType extends NormalizedObject { - /** * The identifier of this RelationshipType */ @@ -59,19 +59,19 @@ export class NormalizedRelationshipType 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; /** @@ -48,12 +49,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 994792d535..5ee135b530 100644 --- a/src/app/core/cache/models/normalized-bitstream-format.model.ts +++ b/src/app/core/cache/models/normalized-bitstream-format.model.ts @@ -12,7 +12,6 @@ import { SupportLevel } from './support-level.model'; @mapsTo(BitstreamFormat) @inheritSerialization(NormalizedObject) 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 64a17aae84..a9e389fd41 100644 --- a/src/app/core/cache/models/normalized-bitstream.model.ts +++ b/src/app/core/cache/models/normalized-bitstream.model.ts @@ -1,9 +1,10 @@ -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 { Item } from '../../shared/item.model'; +import { BitstreamFormat } from '../../shared/bitstream-format.model'; /** * Normalized model class for a DSpace Bitstream @@ -11,7 +12,6 @@ import { ResourceType } from '../../shared/resource-type'; @mapsTo(Bitstream) @inheritSerialization(NormalizedDSpaceObject) export class NormalizedBitstream extends NormalizedDSpaceObject { - /** * The size of this bitstream in bytes */ @@ -28,7 +28,7 @@ export class NormalizedBitstream extends NormalizedDSpaceObject { * The format of this Bitstream */ @autoserialize - @relationship(ResourceType.BitstreamFormat, false) + @relationship(BitstreamFormat, false) format: string; /** @@ -41,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 342b13629f..3f4e28bca5 100644 --- a/src/app/core/cache/models/normalized-bundle.model.ts +++ b/src/app/core/cache/models/normalized-bundle.model.ts @@ -3,7 +3,7 @@ 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 { Bitstream } from '../../shared/bitstream.model'; /** * Normalized model class for a DSpace Bundle @@ -15,7 +15,7 @@ export class NormalizedBundle extends NormalizedDSpaceObject { * The primary bitstream of this Bundle */ @autoserialize - @relationship(ResourceType.Bitstream, false) + @relationship(Bitstream, false) primaryBitstream: string; /** @@ -32,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 ddfcc29a2c..9b3419675a 100644 --- a/src/app/core/cache/models/normalized-collection.model.ts +++ b/src/app/core/cache/models/normalized-collection.model.ts @@ -3,7 +3,15 @@ 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 { 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 @@ -22,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 f561089949..173760ca72 100644 --- a/src/app/core/cache/models/normalized-community.model.ts +++ b/src/app/core/cache/models/normalized-community.model.ts @@ -1,9 +1,13 @@ -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 { 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 @@ -11,7 +15,6 @@ import { ResourceType } from '../../shared/resource-type'; @mapsTo(Community) @inheritSerialization(NormalizedDSpaceObject) export class NormalizedCommunity extends NormalizedDSpaceObject { - /** * A string representing the unique handle of this Community */ @@ -22,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 e12faa4a77..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,15 +1,15 @@ -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 { TypedObject } from '../object-cache.reducer'; /** * An model class for a DSpaceObject. */ @mapsTo(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 @@ -38,8 +38,8 @@ export class NormalizedDSpaceObject extends NormalizedOb /** * A string representing the kind of DSpaceObject, e.g. community, item, … */ - @autoserializeAs(String) - 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 d2b7b9c92d..4afceb7612 100644 --- a/src/app/core/cache/models/normalized-item.model.ts +++ b/src/app/core/cache/models/normalized-item.model.ts @@ -4,6 +4,12 @@ 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 { 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 @@ -46,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-object-factory.ts b/src/app/core/cache/models/normalized-object-factory.ts deleted file mode 100644 index aa1f6f2958..0000000000 --- a/src/app/core/cache/models/normalized-object-factory.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { NormalizedItemType } from './items/normalized-item-type.model'; -import { NormalizedRelationshipType } from './items/normalized-relationship-type.model'; -import { NormalizedRelationship } from './items/normalized-relationship.model'; -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 { NormalizedClaimedTask } from '../../tasks/models/normalized-claimed-task-object.model'; -import { NormalizedPoolTask } from '../../tasks/models/normalized-pool-task-object.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'; - -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.Relationship: { - return NormalizedRelationship - } - case ResourceType.RelationshipType: { - return NormalizedRelationshipType - } - case ResourceType.ItemType: { - return NormalizedItemType - } - 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.ClaimedTask: { - return NormalizedClaimedTask - } - case ResourceType.PoolTask: { - return NormalizedPoolTask - } - 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/models/normalized-object.model.ts b/src/app/core/cache/models/normalized-object.model.ts index 6ac8985d64..bb5f192a7a 100644 --- a/src/app/core/cache/models/normalized-object.model.ts +++ b/src/app/core/cache/models/normalized-object.model.ts @@ -1,25 +1,24 @@ -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 { /** * 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 - } + }; + + /** + * A string representing the kind of object + */ + @autoserialize + type: 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 9438c1da0a..cd25a0af05 100644 --- a/src/app/core/cache/models/normalized-resource-policy.model.ts +++ b/src/app/core/cache/models/normalized-resource-policy.model.ts @@ -12,7 +12,6 @@ import { ActionType } from './action-type.model'; @mapsTo(ResourcePolicy) @inheritSerialization(NormalizedObject) 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 efa28d7249..a65e63ab86 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 { Item } from '../shared/item.model'; class NullAction extends RemoveFromObjectCacheAction { type = null; @@ -28,6 +29,7 @@ describe('objectCacheReducer', () => { const testState = { [selfLink1]: { data: { + type: Item.type, self: selfLink1, foo: 'bar' }, @@ -39,6 +41,7 @@ describe('objectCacheReducer', () => { }, [selfLink2]: { data: { + type: Item.type, 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: Item.type }; 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: Item.type + }; 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: 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 982c77341e..f41151fd90 100644 --- a/src/app/core/cache/object-cache.reducer.ts +++ b/src/app/core/cache/object-cache.reducer.ts @@ -32,15 +32,19 @@ export interface Patch { operations: Operation[]; } +export abstract class TypedObject { + static type: ResourceType; +} + +/* tslint:disable:max-classes-per-file */ /** * An interface to represent objects that can be cached * * A cacheable object should have a self link */ -export interface CacheableObject { +export class CacheableObject extends TypedObject { uuid?: string; self: string; - type?: ResourceType; // isNew: boolean; // dirtyType: DirtyType; // hasDirtyAttributes: boolean; @@ -59,6 +63,7 @@ export class ObjectCacheEntry implements CacheEntry { patches: Patch[] = []; isDirty: boolean; } +/* tslint:enable:max-classes-per-file */ /** * The ObjectCache State 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 e6384571c3..e18ff3b3a4 100644 --- a/src/app/core/cache/object-cache.service.ts +++ b/src/app/core/cache/object-cache.service.ts @@ -10,7 +10,6 @@ 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 { 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> = NormalizedObjectFactory.getConstructor(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/cache/response.models.ts b/src/app/core/cache/response.models.ts index b3523addc5..03233e616b 100644 --- a/src/app/core/cache/response.models.ts +++ b/src/app/core/cache/response.models.ts @@ -8,12 +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 { 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/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/config/config-response-parsing.service.ts b/src/app/core/config/config-response-parsing.service.ts index b81dc07624..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'; @@ -16,8 +14,6 @@ import { ObjectCacheService } from '../cache/object-cache.service'; @Injectable() export class ConfigResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - - protected objectFactory = ConfigObjectFactory; protected toCache = false; constructor( @@ -28,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-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/config-submission-definition.model.ts b/src/app/core/config/models/config-submission-definition.model.ts new file mode 100644 index 0000000000..0449e6a964 --- /dev/null +++ b/src/app/core/config/models/config-submission-definition.model.ts @@ -0,0 +1,22 @@ +import { ConfigObject } from './config.model'; +import { SubmissionSectionModel } from './config-submission-section.model'; +import { PaginatedList } from '../../data/paginated-list'; +import { ResourceType } from '../../shared/resource-type'; + +/** + * Class for the configuration describing the submission + */ +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/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/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-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 3887c566c1..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,25 +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 { 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) -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 a957e8c7fa..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,16 +1,12 @@ -import { autoserialize, inheritSerialization } from 'cerialize'; -import { NormalizedConfigObject } from './normalized-config.model'; -import { FormRowModel, SubmissionFormsModel } from './config-submission-forms.model'; +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 */ -@inheritSerialization(NormalizedConfigObject) -export class NormalizedSubmissionFormsModel extends NormalizedConfigObject { - - /** - * An array of [FormRowModel] that are present in this form - */ - @autoserialize - rows: FormRowModel[]; +@mapsTo(SubmissionFormsModel) +@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 c876acf607..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,14 +1,18 @@ 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'; /** * Normalized class for the configuration describing the submission section */ +@mapsTo(SubmissionSectionModel) @inheritSerialization(NormalizedConfigObject) -export class NormalizedSubmissionSectionModel extends NormalizedConfigObject { +export class NormalizedSubmissionSectionModel extends NormalizedConfigObject { /** * The header for this section 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/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/config/models/normalized-config.model.ts b/src/app/core/config/models/normalized-config.model.ts index 0b75158588..1bf4ffb826 100644 --- a/src/app/core/config/models/normalized-config.model.ts +++ b/src/app/core/config/models/normalized-config.model.ts @@ -1,6 +1,6 @@ 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'; /** @@ -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/core.module.ts b/src/app/core/core.module.ts index 418b22351b..1d22b5fefe 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'; @@ -65,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'; @@ -82,12 +81,42 @@ 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 { RoleService } from './roles/role.service'; import { MyDSpaceGuard } from '../+my-dspace-page/my-dspace.guard'; import { MyDSpaceResponseParsingService } from './data/mydspace-response-parsing.service'; 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'; +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, @@ -95,13 +124,9 @@ const IMPORTS = [ EffectsModule.forFeature(coreEffects) ]; -const DECLARATIONS = [ +const DECLARATIONS = []; -]; - -const EXPORTS = [ - -]; +const EXPORTS = []; const PROVIDERS = [ ApiService, @@ -158,11 +183,12 @@ const PROVIDERS = [ AuthorityService, IntegrationResponseParsingService, MetadataschemaParsingService, + MetadatafieldParsingService, UploaderService, UUIDService, NotificationsService, WorkspaceitemDataService, - WorkflowitemDataService, + WorkflowItemDataService, UploaderService, FileService, DSpaceObjectDataService, @@ -188,6 +214,42 @@ const PROVIDERS = [ { 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, + NormalizedSubmissionUploadsModel, + NormalizedAuthStatus, + NormalizedAuthorityValue, + NormalizedBrowseEntry, + BrowseDefinition, + NormalizedClaimedTask, + NormalizedTaskObject, + NormalizedPoolTask, + NormalizedRelationship, + NormalizedRelationshipType, + NormalizedItemType + ]; + @NgModule({ imports: [ ...IMPORTS @@ -202,8 +264,8 @@ const PROVIDERS = [ ...PROVIDERS ] }) -export class CoreModule { +export class CoreModule { static forRoot(): ModuleWithProviders { return { ngModule: CoreModule, @@ -213,10 +275,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/base-response-parsing.service.ts b/src/app/core/data/base-response-parsing.service.ts index 4ede02778c..0ed5dc363c 100644 --- a/src/app/core/data/base-response-parsing.service.ts +++ b/src/app/core/data/base-response-parsing.service.ts @@ -7,16 +7,16 @@ 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 { ResourceType } from '../shared/resource-type'; +import { getMapsToType } from '../cache/builders/build-decorators'; /* 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; @@ -31,7 +31,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; @@ -60,7 +60,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; @@ -74,7 +74,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)]; @@ -83,10 +83,10 @@ export abstract class BaseResponseParsingService { return array; } - protected deserialize(obj): any { - const type: ObjectType = obj.type; + protected deserialize(obj): any { + const type: string = obj.type; if (hasValue(type)) { - const normObjConstructor = this.objectFactory.getConstructor(type) as GenericConstructor; + const normObjConstructor = getMapsToType(type) as GenericConstructor; if (hasValue(normObjConstructor)) { const serializer = new DSpaceRESTv2Serializer(normObjConstructor); @@ -104,7 +104,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/browse-entries-response-parsing.service.ts b/src/app/core/data/browse-entries-response-parsing.service.ts index 4690d738ed..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,24 +3,17 @@ 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 { - protected objectFactory = { - getConstructor: () => BrowseEntry - }; protected toCache = false; constructor( @@ -33,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-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/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/data/data.service.ts b/src/app/core/data/data.service.ts index fc4da69a5c..ad0db51980 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 { 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(NormalizedObjectFactory.getConstructor(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/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/data/metadata-schema-data.service.ts b/src/app/core/data/metadata-schema-data.service.ts index 5e58d972f7..4baca6e8ed 100644 --- a/src/app/core/data/metadata-schema-data.service.ts +++ b/src/app/core/data/metadata-schema-data.service.ts @@ -9,12 +9,12 @@ 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 { ChangeAnalyzer } from './change-analyzer'; import { DefaultChangeAnalyzer } from './default-change-analyzer.service'; +import { MetadataSchema } from '../metadata/metadata-schema.model'; /* tslint:disable:max-classes-per-file */ class DataServiceImpl extends DataService { 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/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..9ef85bfe8b 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 { 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(NormalizedObjectFactory.getConstructor(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/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/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 ad4b20ee80..bf644a83ef 100644 --- a/src/app/core/eperson/models/normalized-eperson.model.ts +++ b/src/app/core/eperson/models/normalized-eperson.model.ts @@ -5,12 +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 { Group } from './group.model'; @mapsTo(EPerson) @inheritSerialization(NormalizedDSpaceObject) export class NormalizedEPerson extends NormalizedDSpaceObject implements CacheableObject, ListableObject { - /** * A string representing the unique handle of this EPerson */ @@ -21,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 f86bec8628..329ffb8adf 100644 --- a/src/app/core/eperson/models/normalized-group.model.ts +++ b/src/app/core/eperson/models/normalized-group.model.ts @@ -5,7 +5,6 @@ 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'; @mapsTo(Group) @inheritSerialization(NormalizedDSpaceObject) @@ -15,7 +14,7 @@ export class NormalizedGroup extends NormalizedDSpaceObject implements Ca * 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-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..8cc0f8d252 100644 --- a/src/app/core/integration/integration-response-parsing.service.ts +++ b/src/app/core/integration/integration-response-parsing.service.ts @@ -2,27 +2,20 @@ 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 { 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'; @Injectable() export class IntegrationResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - protected objectFactory = IntegrationObjectFactory; protected toCache = true; constructor( @@ -34,7 +27,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 +42,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 === AuthorityValue.type.value) { 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/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/metadata/metadata-field.model.ts b/src/app/core/metadata/metadata-field.model.ts new file mode 100644 index 0000000000..288934e52d --- /dev/null +++ b/src/app/core/metadata/metadata-field.model.ts @@ -0,0 +1,53 @@ +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 { + static type = new ResourceType('metadatafield'); + + /** + * 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; + + /** + * 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)) { + key += separator + this.qualifier; + } + return key; + } +} diff --git a/src/app/core/metadata/metadata-schema.model.ts b/src/app/core/metadata/metadata-schema.model.ts new file mode 100644 index 0000000000..bc05e475cc --- /dev/null +++ b/src/app/core/metadata/metadata-schema.model.ts @@ -0,0 +1,29 @@ +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 { + static type = new ResourceType('metadataschema'); + + /** + * 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; +} 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/metadata/metadatafield.model.ts b/src/app/core/metadata/metadatafield.model.ts deleted file mode 100644 index ba28b59d0e..0000000000 --- a/src/app/core/metadata/metadatafield.model.ts +++ /dev/null @@ -1,32 +0,0 @@ -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'; - -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 { - let key = this.schema.prefix + separator + this.element; - if (isNotEmpty(this.qualifier)) { - key += separator + this.qualifier; - } - return key; - } -} diff --git a/src/app/core/metadata/metadataschema.model.ts b/src/app/core/metadata/metadataschema.model.ts deleted file mode 100644 index 13fb8e8b4e..0000000000 --- a/src/app/core/metadata/metadataschema.model.ts +++ /dev/null @@ -1,16 +0,0 @@ -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..c6b2ee32f8 --- /dev/null +++ b/src/app/core/metadata/normalized-metadata-field.model.ts @@ -0,0 +1,51 @@ +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'; +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) +@inheritSerialization(NormalizedObject) +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(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..47c7233d81 100644 --- a/src/app/core/metadata/normalized-metadata-schema.model.ts +++ b/src/app/core/metadata/normalized-metadata-schema.model.ts @@ -1,13 +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 { MetadataSchema } from './metadataschema.model'; +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/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-metadatafields-response.model.ts b/src/app/core/registry/registry-metadatafields-response.model.ts index 19ec537dfb..984603e42e 100644 --- a/src/app/core/registry/registry-metadatafields-response.model.ts +++ b/src/app/core/registry/registry-metadatafields-response.model.ts @@ -1,14 +1,31 @@ import { PageInfo } from '../shared/page-info.model'; -import { autoserialize, autoserializeAs } from 'cerialize'; -import { MetadataField } from '../metadata/metadatafield.model'; +import { autoserialize, deserialize } from 'cerialize'; +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 { - @autoserializeAs(MetadataField) + static type = new ResourceType('metadatafield'); + /** + * List of metadata fields in the response + */ + @deserialize + @relationship(MetadataField, true) 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-metadataschemas-response.model.ts b/src/app/core/registry/registry-metadataschemas-response.model.ts index 5f4799abd7..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 { MetadataSchema } from '../metadata/metadataschema.model'; 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/registry/registry.service.spec.ts b/src/app/core/registry/registry.service.spec.ts index 8274ceef60..47e306d624 100644 --- a/src/app/core/registry/registry.service.spec.ts +++ b/src/app/core/registry/registry.service.spec.ts @@ -39,8 +39,10 @@ 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'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; @Component({ template: '' }) class DummyComponent { @@ -59,13 +61,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: MetadataSchema.type +}, { 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: MetadataSchema.type } ]; const mockFieldsList = [ @@ -75,7 +79,8 @@ describe('RegistryService', () => { element: 'contributor', qualifier: 'advisor', scopeNote: null, - schema: mockSchemasList[0] + schema: mockSchemasList[0], + type: MetadataField.type }, { id: 2, @@ -83,7 +88,8 @@ describe('RegistryService', () => { element: 'contributor', qualifier: 'author', scopeNote: null, - schema: mockSchemasList[0] + schema: mockSchemasList[0], + type: MetadataField.type }, { id: 3, @@ -91,7 +97,8 @@ describe('RegistryService', () => { element: 'contributor', qualifier: 'editor', scopeNote: 'test scope note', - schema: mockSchemasList[1] + schema: mockSchemasList[1], + type: MetadataField.type }, { id: 4, @@ -99,7 +106,8 @@ describe('RegistryService', () => { element: 'contributor', qualifier: 'illustrator', scopeNote: null, - schema: mockSchemasList[1] + schema: mockSchemasList[1], + type: MetadataField.type } ]; @@ -124,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/registry/registry.service.ts b/src/app/core/registry/registry.service.ts index 137b4c3a87..d816c5eab8 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 { getMapsToType } from '../cache/builders/build-decorators'; 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(getMapsToType(MetadataSchema.type)).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 9af345e607..bf50cd832f 100644 --- a/src/app/core/shared/bitstream-format.model.ts +++ b/src/app/core/shared/bitstream-format.model.ts @@ -1,12 +1,14 @@ -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 { + static type = new ResourceType('bitstreamformat'); + bitstreamformat /** * Short description of this Bitstream Format */ @@ -42,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/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-definition.model.ts b/src/app/core/shared/browse-definition.model.ts index 05263858c6..9fafe7e321 100644 --- a/src/app/core/shared/browse-definition.model.ts +++ b/src/app/core/shared/browse-definition.model.ts @@ -1,7 +1,11 @@ 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 implements TypedObject { + static type = new ResourceType('browse'); -export class BrowseDefinition { @autoserialize id: string; @@ -14,9 +18,6 @@ export class BrowseDefinition { @autoserializeAs('order') defaultSortOrder: string; - @autoserialize - type: string; - @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..d5d4093c81 100644 --- a/src/app/core/shared/browse-entry.model.ts +++ b/src/app/core/shared/browse-entry.model.ts @@ -1,21 +1,31 @@ -import { autoserialize, autoserializeAs } from 'cerialize'; import { ListableObject } from '../../shared/object-collection/shared/listable-object.model'; +import { TypedObject } from '../cache/object-cache.reducer'; +import { ResourceType } from './resource-type'; -export class BrowseEntry implements ListableObject { +/** + * Class object representing a browse entry + * This class is not normalized because browse entries do not have self links + */ +export class BrowseEntry implements ListableObject, TypedObject { + static type = new ResourceType('browseEntry'); - @autoserialize - type: string; - - @autoserialize + /** + * The authority string of this browse entry + */ authority: string; - @autoserialize + /** + * The value of this browse entry + */ value: string; - @autoserializeAs('valueLang') + /** + * The language of the value of this browse entry + */ language: string; - @autoserialize + /** + * The count of this browse entry + */ 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 063398b339..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 { 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..2635f154a8 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 */ @@ -15,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 404d8cdb4b..98454bc000 100644 --- a/src/app/core/shared/item-relationships/relationship-type.model.ts +++ b/src/app/core/shared/item-relationships/relationship-type.model.ts @@ -8,16 +8,13 @@ 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 */ 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 63fe7987ab..9ab9751489 100644 --- a/src/app/core/shared/item-relationships/relationship.model.ts +++ b/src/app/core/shared/item-relationships/relationship.model.ts @@ -9,16 +9,13 @@ import { Item } from '../item.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 */ self: string; - /** - * The type of Resource this is - */ - type: ResourceType; - /** * The universally unique identifier of this Relationship */ diff --git a/src/app/core/shared/item.model.spec.ts b/src/app/core/shared/item.model.spec.ts index 2e5388dc4d..f20fb3299a 100644 --- a/src/app/core/shared/item.model.spec.ts +++ b/src/app/core/shared/item.model.spec.ts @@ -1,10 +1,10 @@ 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'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; describe('Item', () => { @@ -32,12 +32,11 @@ 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 - const bundles = [ { @@ -51,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', () => { @@ -99,16 +97,4 @@ describe('Item', () => { }); }); - }); - -function createRemoteDataObject(object: any) { - return observableOf(new RemoteData( - false, - false, - true, - undefined, - object - )); - -} 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..949758cb67 --- /dev/null +++ b/src/app/core/shared/normalized-browse-entry.model.ts @@ -0,0 +1,36 @@ +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'; + +/** + * Class object representing a browse entry + * 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 + */ + @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/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/core/shared/resource-policy.model.ts b/src/app/core/shared/resource-policy.model.ts index ee3d5293f5..a80446a369 100644 --- a/src/app/core/shared/resource-policy.model.ts +++ b/src/app/core/shared/resource-policy.model.ts @@ -1,12 +1,13 @@ 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 { + static type = new ResourceType('resourcePolicy'); + /** * The action that is allowed by this Resource Policy */ @@ -27,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 bdcc3a52f6..657837fbec 100644 --- a/src/app/core/shared/resource-type.ts +++ b/src/app/core/shared/resource-type.ts @@ -1,28 +1,7 @@ -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', - ClaimedTask = 'claimedtask', - PoolTask = 'pooltask' +/** + * Class that represents the type of an object as returned by the REST server + */ +export class ResourceType { + constructor(public value: string) { + } } diff --git a/src/app/core/submission/models/normalized-workflowitem.model.ts b/src/app/core/submission/models/normalized-workflowitem.model.ts index a3fa8992a2..e96024b4ae 100644 --- a/src/app/core/submission/models/normalized-workflowitem.model.ts +++ b/src/app/core/submission/models/normalized-workflowitem.model.ts @@ -1,43 +1,46 @@ 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 { 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) +@mapsTo(WorkflowItem) @inheritSerialization(NormalizedSubmissionObject) -export class NormalizedWorkflowItem extends NormalizedSubmissionObject { +export class NormalizedWorkflowItem extends NormalizedSubmissionObject { /** * 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 7c15925c98..4275420191 100644 --- a/src/app/core/submission/models/normalized-workspaceitem.model.ts +++ b/src/app/core/submission/models/normalized-workspaceitem.model.ts @@ -1,45 +1,47 @@ 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 { 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. */ -@mapsTo(Workspaceitem) +@mapsTo(WorkspaceItem) @inheritSerialization(NormalizedDSpaceObject) @inheritSerialization(NormalizedSubmissionObject) -export class NormalizedWorkspaceItem extends NormalizedSubmissionObject { +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 f1a0467f43..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 { WorkspaceItem } from './workspaceitem.model'; +import { ResourceType } from '../../shared/resource-type'; /** - * A model class for a Workflowitem. + * A model class for a WorkflowItem. */ -export class Workflowitem extends Workspaceitem { +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 6548191ba2..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. + * A model class for a WorkspaceItem. */ -export class Workspaceitem extends SubmissionObject { +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/submission/submission-response-parsing.service.ts b/src/app/core/submission/submission-response-parsing.service.ts index 21135be463..a0811c8f2d 100644 --- a/src/app/core/submission/submission-response-parsing.service.ts +++ b/src/app/core/submission/submission-response-parsing.service.ts @@ -10,12 +10,10 @@ 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'; 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 +73,6 @@ export function normalizeSectionData(obj: any, objIndex?: number) { @Injectable() export class SubmissionResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { - protected objectFactory = NormalizedObjectFactory; protected toCache = false; constructor(@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig, @@ -94,7 +91,7 @@ export class SubmissionResponseParsingService extends BaseResponseParsingService if (isNotEmpty(data.payload) && isNotEmpty(data.payload._links) && this.isSuccessStatus(data.statusCode)) { - 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) && this.isSuccessStatus(data.statusCode)) { return new SubmissionSuccessResponse(null, data.statusCode, data.statusText); @@ -115,8 +112,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); 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/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/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 c2c3f12bc4..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,7 +2,9 @@ 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 { 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. @@ -10,7 +12,6 @@ import { ResourceType } from '../../shared/resource-type'; @mapsTo(ClaimedTask) @inheritSerialization(NormalizedTaskObject) export class NormalizedClaimedTask extends NormalizedTaskObject { - /** * The task identifier */ @@ -29,11 +30,25 @@ export class NormalizedClaimedTask extends NormalizedTaskObject { @autoserialize action: string; + /** + * The eperson object for this task + */ + @autoserialize + @relationship(EPerson, false) + eperson: string; + + /** + * The group object for this task + */ + @autoserialize + @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 22cda6ff9c..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,7 +2,8 @@ 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 { Group } from '../../eperson/models/group.model'; +import { WorkflowItem } from '../../submission/models/workflowitem.model'; /** * A normalized model class for a PoolTask. @@ -10,7 +11,6 @@ import { ResourceType } from '../../shared/resource-type'; @mapsTo(PoolTask) @inheritSerialization(NormalizedTaskObject) export class NormalizedPoolTask extends NormalizedTaskObject { - /** * The task identifier */ @@ -29,10 +29,17 @@ export class NormalizedPoolTask extends NormalizedTaskObject { @autoserialize action: string; + /** + * The group object for this task + */ + @autoserialize + @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 52c274e3a8..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 @@ -30,10 +32,24 @@ export abstract class NormalizedTaskObject extends Norma @autoserialize action: string; + /** + * The eperson object for this task + */ + @autoserialize + @relationship(EPerson, false) + eperson: string; + + /** + * The group object for this task + */ + @autoserialize + @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 97a1c9f59e..14dbbd7301 100644 --- a/src/app/core/tasks/models/task-object.model.ts +++ b/src/app/core/tasks/models/task-object.model.ts @@ -4,12 +4,16 @@ 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'; +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 @@ -26,8 +30,18 @@ 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 */ - 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/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.spec.ts b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.spec.ts index 7c4f4349c3..00403473a7 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.spec.ts @@ -8,9 +8,10 @@ import { createRelationshipsObservable, getItemPageFieldsTest } from '../../../../+item-page/simple/item-types/shared/item.component.spec'; +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: { 'publicationissue.issueNumber': [ { diff --git a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.spec.ts b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.spec.ts index e5da5675f4..d2b3420b2a 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.spec.ts @@ -8,9 +8,10 @@ import { createRelationshipsObservable, getItemPageFieldsTest } from '../../../../+item-page/simple/item-types/shared/item.component.spec'; +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: { 'publicationvolume.volumeNumber': [ { diff --git a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts index 9690c74966..c66c3a2462 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts @@ -15,12 +15,13 @@ import { isNotEmpty } from '../../../../shared/empty.util'; import { JournalComponent } from './journal.component'; import { of as observableOf } from 'rxjs'; import { GenericItemPageFieldComponent } from '../../../../+item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +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: { 'creativeworkseries.issn': [ { diff --git a/src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.spec.ts b/src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.spec.ts index b415879df3..a49105b2e3 100644 --- a/src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.spec.ts @@ -8,9 +8,10 @@ import { createRelationshipsObservable, getItemPageFieldsTest } from '../../../../+item-page/simple/item-types/shared/item.component.spec'; +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: { 'organization.foundingDate': [ { diff --git a/src/app/entity-groups/research-entities/item-pages/person/person.component.spec.ts b/src/app/entity-groups/research-entities/item-pages/person/person.component.spec.ts index 73f61983fc..4c523b81cb 100644 --- a/src/app/entity-groups/research-entities/item-pages/person/person.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-pages/person/person.component.spec.ts @@ -8,9 +8,10 @@ import { createRelationshipsObservable, getItemPageFieldsTest } from '../../../../+item-page/simple/item-types/shared/item.component.spec'; +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.email': [ { diff --git a/src/app/entity-groups/research-entities/item-pages/project/project.component.spec.ts b/src/app/entity-groups/research-entities/item-pages/project/project.component.spec.ts index ad4b70e2aa..5185857494 100644 --- a/src/app/entity-groups/research-entities/item-pages/project/project.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-pages/project/project.component.spec.ts @@ -8,9 +8,10 @@ import { createRelationshipsObservable, getItemPageFieldsTest } from '../../../../+item-page/simple/item-types/shared/item.component.spec'; +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/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/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/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/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/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..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,12 +5,11 @@ 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'; describe('DSOSelectorComponent', () => { let component: DSOSelectorComponent; @@ -30,7 +29,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(() => { @@ -68,6 +67,4 @@ describe('DSOSelectorComponent', () => { expect(searchService.search).toHaveBeenCalledWith(searchOptions); }); - -}) -; +}); 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/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/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/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/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/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/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-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/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 4144cb3760..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,12 +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 { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; +import { createSuccessfulRemoteDataObject } from '../../testing/utils'; +import { CoreModule } from '../../../core/core.module'; let component: ClaimedTaskActionsComponent; let fixture: ComponentFixture; @@ -25,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'), @@ -60,9 +61,9 @@ 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 rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdItem = createSuccessfulRemoteDataObject(item); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem), id: '1234' }); describe('ClaimedTaskActionsComponent', () => { 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..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 @@ -9,10 +9,9 @@ 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'; import { NotificationsService } from '../../notifications/notifications.service'; /** @@ -33,7 +32,7 @@ export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent; + public workflowitem$: Observable; /** * A boolean representing if an approve operation is pending @@ -62,7 +61,7 @@ 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/item/item-actions.component.ts b/src/app/shared/mydspace-actions/item/item-actions.component.ts index 0760fe54e0..eeb6e49ad9 100644 --- a/src/app/shared/mydspace-actions/item/item-actions.component.ts +++ b/src/app/shared/mydspace-actions/item/item-actions.component.ts @@ -6,7 +6,6 @@ import { TranslateService } from '@ngx-translate/core'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; import { ItemDataService } from '../../../core/data/item-data.service'; import { Item } from '../../../core/shared/item.model'; -import { ResourceType } from '../../../core/shared/resource-type'; import { NotificationsService } from '../../notifications/notifications.service'; /** @@ -37,7 +36,7 @@ export class ItemActionsComponent extends MyDSpaceActionsComponent> { public getConstructor(type: ResourceType): TService { switch (type) { - case ResourceType.Item: { + case Item.type: { return ItemDataService as any; } - case ResourceType.Workspaceitem: { + case WorkspaceItem.type: { return WorkspaceitemDataService as any; } - case ResourceType.Workflowitem: { - return WorkflowitemDataService as any; + case WorkflowItem.type: { + return WorkflowItemDataService as any; } - case ResourceType.ClaimedTask: { + case ClaimedTask.type: { return ClaimedTaskDataService as any; } - case ResourceType.PoolTask: { + case PoolTask.type: { return PoolTaskDataService as any; } default: { 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 1c0e8e71fa..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,12 +11,12 @@ 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'; import { PoolTask } from '../../../core/tasks/models/pool-task-object.model'; -import { Workflowitem } from '../../../core/submission/models/workflowitem.model'; +import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; +import { createSuccessfulRemoteDataObject } from '../../testing/utils'; let component: PoolTaskActionsComponent; let fixture: ComponentFixture; @@ -58,9 +58,9 @@ 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 rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdItem = createSuccessfulRemoteDataObject(item); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem), id: '1234' }); describe('PoolTaskActionsComponent', () => { 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..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 @@ -5,14 +5,13 @@ 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'; 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'; /** @@ -39,7 +38,7 @@ export class PoolTaskActionsComponent extends MyDSpaceActionsComponent; + public workflowitem$: Observable; /** * Initialize instance variables @@ -53,7 +52,7 @@ 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..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 @@ -9,16 +9,17 @@ 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'; +import { createSuccessfulRemoteDataObject } from '../../testing/utils'; let component: WorkflowitemActionsComponent; let fixture: ComponentFixture; -let mockObject: Workflowitem; +let mockObject: WorkflowItem; const mockDataService = {}; @@ -51,8 +52,8 @@ 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' }); +const rd = createSuccessfulRemoteDataObject(item); +mockObject = Object.assign(new WorkflowItem(), { item: observableOf(rd), id: '1234', uuid: '1234' }); describe('WorkflowitemActionsComponent', () => { beforeEach(async(() => { @@ -69,7 +70,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..71f854c5e7 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,24 @@ 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 { ResourceType } from '../../../core/shared/resource-type'; +import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; +import { WorkflowItemDataService } from '../../../core/submission/workflowitem-data.service'; 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 +35,15 @@ export class WorkflowitemActionsComponent extends MyDSpaceActionsComponent; -let mockObject: Workspaceitem; +let mockObject: WorkspaceItem; let notificationsServiceStub: NotificationsServiceStub; const mockDataService = jasmine.createSpyObj('WorkspaceitemDataService', { @@ -56,8 +57,8 @@ 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' }); +const rd = createSuccessfulRemoteDataObject(item); +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..69214e800e 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 rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdSumbitter = createSuccessfulRemoteDataObject(EPersonMock); +const workflowitem = Object.assign(new WorkflowItem(), { submitter: observableOf(rdSumbitter) }); +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 77460a3674..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 @@ -7,11 +7,12 @@ 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'; 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 workflowitem = Object.assign(new Workflowitem(), { submitter: observableOf(rdSumbitter) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdSumbitter = createSuccessfulRemoteDataObject(EPersonMock); +const workflowitem = Object.assign(new WorkflowItem(), { submitter: observableOf(rdSumbitter) }); +const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); mockResultObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); describe('ItemSubmitterComponent', () => { 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..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 @@ -10,7 +10,8 @@ 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'; +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 workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdItem = createSuccessfulRemoteDataObject(item); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +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/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..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 @@ -10,7 +10,8 @@ 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'; +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 workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdItem = createSuccessfulRemoteDataObject(item); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +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/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..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 @@ -7,9 +7,10 @@ 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'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: WorkflowitemMyDSpaceResultDetailElementComponent; let fixture: ComponentFixture; @@ -48,8 +49,8 @@ const item = Object.assign(new Item(), { ] } }); -const rd = new RemoteData(false, false, true, null, item); -mockResultObject.indexableObject = Object.assign(new Workflowitem(), { item: observableOf(rd) }); +const rd = createSuccessfulRemoteDataObject(item); +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..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 @@ -7,9 +7,10 @@ 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'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: WorkspaceitemMyDSpaceResultDetailElementComponent; let fixture: ComponentFixture; @@ -48,8 +49,8 @@ const item = Object.assign(new Item(), { ] } }); -const rd = new RemoteData(false, false, true, null, item); -mockResultObject.indexableObject = Object.assign(new Workspaceitem(), { item: observableOf(rd) }); +const rd = createSuccessfulRemoteDataObject(item); +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-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 7c30b2ef8c..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 @@ -10,7 +10,8 @@ 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'; +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 workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdItem = createSuccessfulRemoteDataObject(item); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +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/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..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 @@ -10,7 +10,8 @@ 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'; +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 workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) }); -const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem); +const rdItem = createSuccessfulRemoteDataObject(item); +const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +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/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..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 @@ -7,9 +7,10 @@ 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'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: WorkflowitemMyDSpaceResultListElementComponent; let fixture: ComponentFixture; @@ -48,8 +49,8 @@ const item = Object.assign(new Item(), { ] } }); -const rd = new RemoteData(false, false, true, null, item); -mockResultObject.indexableObject = Object.assign(new Workflowitem(), { item: observableOf(rd) }); +const rd = createSuccessfulRemoteDataObject(item); +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..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 @@ -7,9 +7,10 @@ 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'; +import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; let component: WorkspaceitemMyDSpaceResultListElementComponent; let fixture: ComponentFixture; @@ -48,8 +49,8 @@ const item = Object.assign(new Item(), { ] } }); -const rd = new RemoteData(false, false, true, null, item); -mockResultObject.indexableObject = Object.assign(new Workspaceitem(), { item: observableOf(rd) }); +const rd = createSuccessfulRemoteDataObject(item); +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 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': [ { 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..4a551582ee 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. @@ -23,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); @@ -50,3 +53,71 @@ export function spyOnOperator(obj: any, prop: string): any { return spyOn(obj, prop); } + +/** + * 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, + true, + undefined, + object + ); +} + +/** + * 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)); +} + +/** + * 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, + false, + error, + object + ); +} + +/** + * 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)); +} + +/** + * 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, + true, + null, + object + ); +} + +/** + * 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)); +} 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 598d4a1732..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,15 +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 { 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 { + 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', 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/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; 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', { 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 f84ece4969..fd9f88d939 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'; @@ -189,24 +189,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)); - resourcePolicyService.findByHref.and.returnValue(observableOf( - new RemoteData(false, false, true, - undefined, mockDefaultAccessCondition) - )); + resourcePolicyService.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([])); @@ -235,24 +228,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)); - resourcePolicyService.findByHref.and.returnValue(observableOf( - new RemoteData(false, false, true, - undefined, mockDefaultAccessCondition) - )); + resourcePolicyService.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) + ) }) ); } 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'); diff --git a/yarn.lock b/yarn.lock index eb0733e695..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" @@ -411,11 +425,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" @@ -725,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= @@ -755,15 +764,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" @@ -812,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" @@ -863,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" @@ -875,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= @@ -911,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" @@ -1097,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" @@ -1107,18 +1127,11 @@ 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= -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" @@ -1132,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" @@ -1171,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== @@ -1367,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" @@ -1469,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" @@ -1525,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== @@ -1546,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" @@ -1643,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== @@ -1651,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= @@ -1807,7 +1817,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= @@ -1827,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" @@ -1867,14 +1882,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" @@ -1958,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" @@ -2027,15 +2053,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" @@ -2054,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" @@ -2200,19 +2226,24 @@ 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" 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== @@ -2242,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" @@ -2283,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" @@ -2323,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" @@ -2436,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" @@ -2500,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" @@ -2591,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" @@ -2857,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" @@ -2888,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.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" @@ -2944,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: @@ -2994,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" @@ -3056,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== @@ -3226,9 +3270,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" @@ -3268,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" @@ -3285,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== @@ -3448,6 +3497,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" @@ -3461,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= @@ -3551,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" @@ -3592,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" @@ -3700,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== @@ -3758,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== @@ -3831,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" @@ -3882,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" @@ -4066,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= @@ -4183,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" @@ -4224,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" @@ -4239,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" @@ -4279,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" @@ -4302,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" @@ -4407,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" @@ -4451,35 +4595,27 @@ 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.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" 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" @@ -4596,21 +4732,16 @@ 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.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" @@ -4630,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" @@ -4677,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= @@ -4759,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== @@ -4917,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" @@ -5013,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" @@ -5038,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" @@ -5058,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" @@ -5303,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" @@ -5310,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" @@ -5317,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" @@ -5574,18 +5732,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" @@ -5778,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" @@ -5835,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" @@ -5891,11 +6041,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" @@ -5910,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" @@ -6056,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= @@ -6103,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" @@ -6120,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" @@ -6140,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" @@ -6160,9 +6327,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" @@ -6195,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: @@ -6211,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" @@ -6254,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" @@ -6277,11 +6445,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" @@ -6344,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" @@ -6408,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= @@ -6462,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" @@ -6490,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== @@ -6517,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== @@ -6556,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" @@ -6571,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== @@ -6652,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" @@ -6690,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" @@ -6720,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" @@ -6737,6 +6946,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" @@ -6756,10 +6970,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" @@ -6900,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" @@ -7002,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" @@ -7074,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= @@ -7120,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" @@ -7214,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== @@ -7231,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" @@ -7280,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" @@ -7315,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== @@ -7339,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" @@ -7361,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" @@ -7394,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" @@ -7476,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" @@ -7537,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= @@ -7591,15 +7855,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" @@ -7669,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" @@ -7688,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== @@ -7697,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" @@ -8480,12 +8770,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 +8788,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: @@ -8566,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" @@ -8595,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= @@ -8610,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== @@ -8674,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== @@ -8757,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== @@ -8780,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" @@ -8812,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" @@ -9006,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== @@ -9075,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" @@ -9142,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" @@ -9180,13 +9477,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" @@ -9194,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" @@ -9414,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" @@ -9452,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" @@ -9500,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= @@ -9683,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" @@ -9736,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" @@ -9827,14 +10122,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= @@ -9882,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" @@ -10071,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" @@ -10087,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" @@ -10111,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" @@ -10156,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" @@ -10168,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== @@ -10212,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" @@ -10294,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== @@ -10358,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" @@ -10412,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" @@ -10641,20 +10945,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" @@ -10778,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" @@ -10835,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== @@ -10864,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= @@ -10943,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= @@ -11007,30 +11309,32 @@ 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.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 +11356,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" @@ -11119,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" @@ -11251,7 +11585,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== @@ -11272,16 +11606,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" @@ -11307,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" @@ -11365,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" @@ -11395,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" @@ -11409,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" @@ -11471,16 +11806,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" @@ -11498,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"