diff --git a/src/app/app.component.scss b/src/app/app.component.scss index fa7e7a873a..7793b7529c 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -1,4 +1,3 @@ -@import '../styles/variables.scss'; @import '../styles/helpers/font_awesome_imports.scss'; @import '../../node_modules/bootstrap/scss/bootstrap.scss'; @import '../../node_modules/nouislider/distribute/nouislider.min'; @@ -48,4 +47,3 @@ ds-admin-sidebar { position: fixed; z-index: $sidebar-z-index; } - diff --git a/src/app/app.component.ts b/src/app/app.component.ts index da01b1297a..52c169e7bc 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -28,10 +28,10 @@ import variables from '../styles/_exposed_variables.scss'; import { CSSVariableService } from './shared/sass-helper/sass-helper.service'; import { MenuService } from './shared/menu/menu.service'; import { MenuID } from './shared/menu/initial-menus-state'; -import { Observable } from 'rxjs/internal/Observable'; +import { combineLatest as combineLatestObservable, Observable, of } from 'rxjs'; import { slideSidebarPadding } from './shared/animations/slide'; -import { combineLatest as combineLatestObservable } from 'rxjs'; import { HostWindowService } from './shared/host-window.service'; +import { Theme } from '../config/theme.inferface'; @Component({ selector: 'ds-app', @@ -47,6 +47,7 @@ export class AppComponent implements OnInit, AfterViewInit { slideSidebarOver: Observable; collapsedSidebarWidth: Observable; totalSidebarWidth: Observable; + theme: Observable = of({} as any); constructor( @Inject(GLOBAL_CONFIG) public config: GlobalConfig, @@ -57,10 +58,9 @@ export class AppComponent implements OnInit, AfterViewInit { private angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics, private authService: AuthService, private router: Router, - private routeService: RouteService, private cssService: CSSVariableService, private menuService: MenuService, - private windowService: HostWindowService + private windowService: HostWindowService, ) { // Load all the languages that are defined as active from the config file translate.addLangs(config.languages.filter((LangConfig) => LangConfig.active === true).map((a) => a.code)); @@ -77,16 +77,14 @@ export class AppComponent implements OnInit, AfterViewInit { metadata.listenForRouteChange(); - routeService.saveRouting(); - if (config.debug) { console.info(config); } this.storeCSSVariables(); - } ngOnInit() { + const env: string = this.config.production ? 'Production' : 'Development'; const color: string = this.config.production ? 'red' : 'green'; console.info(`Environment: %c${env}`, `color: ${color}; font-weight: bold;`); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index f9d6e50dcc..ce5a2d78a2 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -37,6 +37,8 @@ import { AdminSidebarComponent } from './+admin/admin-sidebar/admin-sidebar.comp import { AdminSidebarSectionComponent } from './+admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component'; import { ExpandableAdminSidebarSectionComponent } from './+admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component'; import { NavbarModule } from './navbar/navbar.module'; +import { JournalEntitiesModule } from './entity-groups/journal-entities/journal-entities.module'; +import { ResearchEntitiesModule } from './entity-groups/research-entities/research-entities.module'; export function getConfig() { return ENV_CONFIG; @@ -66,6 +68,11 @@ const IMPORTS = [ StoreRouterConnectingModule, ]; +const ENTITY_IMPORTS = [ + JournalEntitiesModule, + ResearchEntitiesModule +]; + IMPORTS.push( StoreDevtoolsModule.instrument({ maxAge: 100, @@ -112,7 +119,8 @@ const EXPORTS = [ @NgModule({ imports: [ - ...IMPORTS + ...IMPORTS, + ...ENTITY_IMPORTS ], providers: [ ...PROVIDERS 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 { id: string; /** - * The identifier of the Item to the left side of this Relationship + * The item to the left of this relationship */ @autoserialize - leftId: string; + @relationship(Item, false) + leftItem: string; /** - * The identifier of the Item to the right side of this Relationship + * The item to the right of this relationship */ @autoserialize - rightId: string; + @relationship(Item, false) + rightItem: string; /** * The place of the Item to the left side of this Relationship @@ -46,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.effects.ts b/src/app/core/core.effects.ts index bb25c49a7a..1aa5d2d0b1 100644 --- a/src/app/core/core.effects.ts +++ b/src/app/core/core.effects.ts @@ -1,4 +1,3 @@ - import { ObjectCacheEffects } from './cache/object-cache.effects'; import { UUIDIndexEffects } from './index/index.effects'; import { RequestEffects } from './data/request.effects'; @@ -6,6 +5,7 @@ import { AuthEffects } from './auth/auth.effects'; import { JsonPatchOperationsEffects } from './json-patch/json-patch-operations.effects'; import { ServerSyncBufferEffects } from './cache/server-sync-buffer.effects'; import { ObjectUpdatesEffects } from './data/object-updates/object-updates.effects'; +import { RouteEffects } from '../shared/services/route.effects'; export const coreEffects = [ RequestEffects, @@ -14,5 +14,6 @@ export const coreEffects = [ AuthEffects, JsonPatchOperationsEffects, ServerSyncBufferEffects, - ObjectUpdatesEffects + ObjectUpdatesEffects, + RouteEffects ]; diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 6550435aa3..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'; @@ -60,11 +59,12 @@ import { HALEndpointService } from './shared/hal-endpoint.service'; import { FacetValueResponseParsingService } from './data/facet-value-response-parsing.service'; import { FacetValueMapResponseParsingService } from './data/facet-value-map-response-parsing.service'; import { FacetConfigResponseParsingService } from './data/facet-config-response-parsing.service'; +import { ResourcePolicyService } from './data/resource-policy.service'; 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'; @@ -81,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, @@ -94,13 +124,9 @@ const IMPORTS = [ EffectsModule.forFeature(coreEffects) ]; -const DECLARATIONS = [ +const DECLARATIONS = []; -]; - -const EXPORTS = [ - -]; +const EXPORTS = []; const PROVIDERS = [ ApiService, @@ -125,6 +151,7 @@ const PROVIDERS = [ MetadataService, ObjectCacheService, PaginationComponentOptions, + ResourcePolicyService, RegistryService, NormalizedObjectBuildService, RemoteDataBuildService, @@ -156,11 +183,12 @@ const PROVIDERS = [ AuthorityService, IntegrationResponseParsingService, MetadataschemaParsingService, + MetadatafieldParsingService, UploaderService, UUIDService, NotificationsService, WorkspaceitemDataService, - WorkflowitemDataService, + WorkflowItemDataService, UploaderService, FileService, DSpaceObjectDataService, @@ -186,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 @@ -200,8 +264,8 @@ const PROVIDERS = [ ...PROVIDERS ] }) -export class CoreModule { +export class CoreModule { static forRoot(): ModuleWithProviders { return { ngModule: CoreModule, @@ -211,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/core.reducers.ts b/src/app/core/core.reducers.ts index c93b4bf44b..7aecb91a7a 100644 --- a/src/app/core/core.reducers.ts +++ b/src/app/core/core.reducers.ts @@ -13,6 +13,7 @@ import { objectUpdatesReducer, ObjectUpdatesState } from './data/object-updates/object-updates.reducer'; +import { routeReducer, RouteState } from '../shared/services/route.reducer'; export interface CoreState { 'cache/object': ObjectCacheState, @@ -21,7 +22,8 @@ export interface CoreState { 'data/request': RequestState, 'index': MetaIndexState, 'auth': AuthState, - 'json/patch': JsonPatchOperationsState + 'json/patch': JsonPatchOperationsState, + 'route': RouteState } export const coreReducers: ActionReducerMap = { @@ -31,5 +33,6 @@ export const coreReducers: ActionReducerMap = { 'data/request': requestReducer, 'index': indexReducer, 'auth': authReducer, - 'json/patch': jsonPatchOperationsReducer + 'json/patch': jsonPatchOperationsReducer, + 'route': routeReducer }; 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/comcol-data.service.spec.ts b/src/app/core/data/comcol-data.service.spec.ts index 7f628fc5b9..b5232b0bff 100644 --- a/src/app/core/data/comcol-data.service.spec.ts +++ b/src/app/core/data/comcol-data.service.spec.ts @@ -89,7 +89,7 @@ describe('ComColDataService', () => { function initMockCommunityDataService(): CommunityDataService { return jasmine.createSpyObj('responseCache', { getEndpoint: hot('--a-', { a: communitiesEndpoint }), - getIDHref: cold('b-', { b: communityEndpoint }) + getIDHref: communityEndpoint }); } diff --git a/src/app/core/data/comcol-data.service.ts b/src/app/core/data/comcol-data.service.ts index 9d82cc5047..68eb3e4880 100644 --- a/src/app/core/data/comcol-data.service.ts +++ b/src/app/core/data/comcol-data.service.ts @@ -31,7 +31,7 @@ export abstract class ComColDataService extends DataS return this.halService.getEndpoint(linkPath); } else { const scopeCommunityHrefObs = this.cds.getEndpoint().pipe( - mergeMap((endpoint: string) => this.cds.getIDHref(endpoint, options.scopeID)), + map((endpoint: string) => this.cds.getIDHref(endpoint, options.scopeID)), filter((href: string) => isNotEmpty(href)), take(1), tap((href: string) => { 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 1d2bf3b221..4baca6e8ed 100644 --- a/src/app/core/data/metadata-schema-data.service.ts +++ b/src/app/core/data/metadata-schema-data.service.ts @@ -9,19 +9,42 @@ 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 { + protected linkPath = 'metadataschemas'; + protected forceBypassCache = false; + + constructor( + protected requestService: RequestService, + protected rdbService: RemoteDataBuildService, + protected dataBuildService: NormalizedObjectBuildService, + protected store: Store, + protected objectCache: ObjectCacheService, + protected halService: HALEndpointService, + protected notificationsService: NotificationsService, + protected http: HttpClient, + protected comparator: ChangeAnalyzer) { + super(); + } + + getBrowseEndpoint(options: FindAllOptions = {}, linkPath: string = this.linkPath): Observable { + return this.halService.getEndpoint(linkPath); + } +} /** * A service responsible for fetching/sending data from/to the REST API on the metadataschemas endpoint */ @Injectable() -export class MetadataSchemaDataService extends DataService { - protected linkPath = 'metadataschemas'; - protected forceBypassCache = false; +export class MetadataSchemaDataService { + private dataService: DataServiceImpl; constructor( protected requestService: RequestService, @@ -33,17 +56,6 @@ export class MetadataSchemaDataService extends DataService { protected dataBuildService: NormalizedObjectBuildService, protected http: HttpClient, protected notificationsService: NotificationsService) { - super(); + this.dataService = new DataServiceImpl(requestService, rdbService, dataBuildService, null, objectCache, halService, notificationsService, http, comparator); } - - /** - * Get the endpoint for browsing metadataschemas - * @param {FindAllOptions} options - * @returns {Observable} - */ - public getBrowseEndpoint(options: FindAllOptions = {}, linkPath: string = this.linkPath): Observable { - - return null; - } - } 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/data/resource-policy.service.spec.ts b/src/app/core/data/resource-policy.service.spec.ts new file mode 100644 index 0000000000..35d28684a7 --- /dev/null +++ b/src/app/core/data/resource-policy.service.spec.ts @@ -0,0 +1,77 @@ +import { cold, getTestScheduler } from 'jasmine-marbles'; +import { TestScheduler } from 'rxjs/testing'; +import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; +import { ResourcePolicy } from '../shared/resource-policy.model'; +import { HALEndpointService } from '../shared/hal-endpoint.service'; +import { GetRequest } from './request.models'; +import { RequestService } from './request.service'; +import { ResourcePolicyService } from './resource-policy.service'; +import { ObjectCacheService } from '../cache/object-cache.service'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { HttpClient } from '@angular/common/http'; +import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service'; + +describe('ResourcePolicyService', () => { + let scheduler: TestScheduler; + let service: ResourcePolicyService; + let requestService: RequestService; + let rdbService: RemoteDataBuildService; + let objectCache: ObjectCacheService; + const testObject = { + uuid: '664184ee-b254-45e8-970d-220e5ccc060b' + } as ResourcePolicy; + const requestURL = `https://rest.api/rest/api/resourcepolicies/${testObject.uuid}`; + const requestUUID = '8b3c613a-5a4b-438b-9686-be1d5b4a1c5a'; + + beforeEach(() => { + scheduler = getTestScheduler(); + + requestService = jasmine.createSpyObj('requestService', { + generateRequestId: requestUUID, + configure: true + }); + rdbService = jasmine.createSpyObj('rdbService', { + buildSingle: cold('a', { + a: { + payload: testObject + } + }) + }); + objectCache = {} as ObjectCacheService; + const halService = {} as HALEndpointService; + const notificationsService = {} as NotificationsService; + const http = {} as HttpClient; + const comparator = {} as any; + const dataBuildService = {} as NormalizedObjectBuildService; + + service = new ResourcePolicyService( + requestService, + rdbService, + dataBuildService, + objectCache, + halService, + notificationsService, + http, + comparator + ) + }); + + describe('findByHref', () => { + it('should configure the proper GetRequest', () => { + scheduler.schedule(() => service.findByHref(requestURL)); + scheduler.flush(); + + expect(requestService.configure).toHaveBeenCalledWith(new GetRequest(requestUUID, requestURL, null), false); + }); + + it('should return a RemoteData for the object with the given URL', () => { + const result = service.findByHref(requestURL); + const expected = cold('a', { + a: { + payload: testObject + } + }); + expect(result).toBeObservable(expected); + }); + }); +}); diff --git a/src/app/core/data/resource-policy.service.ts b/src/app/core/data/resource-policy.service.ts new file mode 100644 index 0000000000..1a6a1afedc --- /dev/null +++ b/src/app/core/data/resource-policy.service.ts @@ -0,0 +1,67 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; + +import { Store } from '@ngrx/store'; +import { Observable } from 'rxjs'; + +import { DataService } from '../data/data.service'; +import { RequestService } from '../data/request.service'; +import { FindAllOptions } from '../data/request.models'; +import { HALEndpointService } from '../shared/hal-endpoint.service'; +import { ResourcePolicy } from '../shared/resource-policy.model'; +import { RemoteData } from '../data/remote-data'; +import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; +import { CoreState } from '../core.reducers'; +import { ObjectCacheService } from '../cache/object-cache.service'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service'; +import { ChangeAnalyzer } from './change-analyzer'; +import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service'; +import { HttpOptions } from '../dspace-rest-v2/dspace-rest-v2.service'; + +/* tslint:disable:max-classes-per-file */ +class DataServiceImpl extends DataService { + protected linkPath = 'resourcepolicies'; + protected forceBypassCache = false; + + constructor( + protected requestService: RequestService, + protected rdbService: RemoteDataBuildService, + protected dataBuildService: NormalizedObjectBuildService, + protected store: Store, + protected objectCache: ObjectCacheService, + protected halService: HALEndpointService, + protected notificationsService: NotificationsService, + protected http: HttpClient, + protected comparator: ChangeAnalyzer) { + super(); + } + + getBrowseEndpoint(options: FindAllOptions = {}, linkPath: string = this.linkPath): Observable { + return this.halService.getEndpoint(linkPath); + } +} + +/** + * A service responsible for fetching/sending data from/to the REST API on the resourcepolicies endpoint + */ +@Injectable() +export class ResourcePolicyService { + private dataService: DataServiceImpl; + + constructor( + protected requestService: RequestService, + protected rdbService: RemoteDataBuildService, + protected dataBuildService: NormalizedObjectBuildService, + protected objectCache: ObjectCacheService, + protected halService: HALEndpointService, + protected notificationsService: NotificationsService, + protected http: HttpClient, + protected comparator: DefaultChangeAnalyzer) { + this.dataService = new DataServiceImpl(requestService, rdbService, dataBuildService, null, objectCache, halService, notificationsService, http, comparator); + } + + findByHref(href: string, options?: HttpOptions): Observable> { + return this.dataService.findByHref(href, options); + } +} 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/index/index.actions.ts b/src/app/core/index/index.actions.ts index 98d07d59d5..42804dbe26 100644 --- a/src/app/core/index/index.actions.ts +++ b/src/app/core/index/index.actions.ts @@ -14,7 +14,7 @@ export const IndexActionTypes = { /* tslint:disable:max-classes-per-file */ /** - * An ngrx action to add an value to the index + * An ngrx action to add a value to the index */ export class AddToIndexAction implements Action { type = IndexActionTypes.ADD; @@ -40,7 +40,7 @@ export class AddToIndexAction implements Action { } /** - * An ngrx action to remove an value from the index + * An ngrx action to remove a value from the index */ export class RemoveFromIndexByValueAction implements Action { type = IndexActionTypes.REMOVE_BY_VALUE; 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 df8f04cd8a..9ab9751489 100644 --- a/src/app/core/shared/item-relationships/relationship.model.ts +++ b/src/app/core/shared/item-relationships/relationship.model.ts @@ -3,21 +3,19 @@ import { CacheableObject } from '../../cache/object-cache.reducer'; import { RemoteData } from '../../data/remote-data'; import { ResourceType } from '../resource-type'; import { RelationshipType } from './relationship-type.model'; +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 */ @@ -29,14 +27,14 @@ export class Relationship implements CacheableObject { id: string; /** - * The identifier of the Item to the left side of this Relationship + * The item to the left of this relationship */ - leftId: string; + leftItem: Observable>; /** - * The identifier of the Item to the right side of this Relationship + * The item to the right of this relationship */ - rightId: string; + rightItem: Observable>; /** * The place of the Item to the left side 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/shared/object-list/item-list-element/item-types/journal-issue/journal-issue-list-element.component.html b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.html similarity index 73% rename from src/app/shared/object-list/item-list-element/item-types/journal-issue/journal-issue-list-element.component.html rename to src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.html index 65a10ec1b7..030a26df39 100644 --- a/src/app/shared/object-list/item-list-element/item-types/journal-issue/journal-issue-list-element.component.html +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.html @@ -4,14 +4,14 @@ [innerHTML]="firstMetadataValue('dc.title')"> - - + - - + - diff --git a/src/app/shared/object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component.scss b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.scss similarity index 100% rename from src/app/shared/object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component.scss rename to src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.scss diff --git a/src/app/shared/object-list/item-list-element/item-types/journal-issue/journal-issue-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts similarity index 90% rename from src/app/shared/object-list/item-list-element/item-types/journal-issue/journal-issue-list-element.component.spec.ts rename to src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts index 05de6c814b..24498088cb 100644 --- a/src/app/shared/object-list/item-list-element/item-types/journal-issue/journal-issue-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts @@ -1,12 +1,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; -import { Item } from '../../../../../core/shared/item.model'; -import { TruncatePipe } from '../../../../utils/truncate.pipe'; -import { TruncatableService } from '../../../../truncatable/truncatable.service'; -import { ITEM } from '../../../../items/switcher/item-type-switcher.component'; import { JournalIssueListElementComponent } from './journal-issue-list-element.component'; import { of as observableOf } from 'rxjs'; +import { Item } from '../../../../core/shared/item.model'; +import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; +import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; +import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; let journalIssueListElementComponent: JournalIssueListElementComponent; let fixture: ComponentFixture; @@ -20,13 +20,13 @@ const mockItemWithMetadata: Item = Object.assign(new Item(), { value: 'This is just another title' } ], - 'journalvolume.identifier.volume': [ + 'publicationvolume.volumeNumber': [ { language: 'en_US', value: '1234' } ], - 'journalissue.identifier.number': [ + 'publicationissue.issueNumber': [ { language: 'en_US', value: '5678' diff --git a/src/app/shared/object-list/item-list-element/item-types/journal-issue/journal-issue-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts similarity index 64% rename from src/app/shared/object-list/item-list-element/item-types/journal-issue/journal-issue-list-element.component.ts rename to src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts index 92a8dd9930..e1aeb7c4e6 100644 --- a/src/app/shared/object-list/item-list-element/item-types/journal-issue/journal-issue-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { ItemViewMode, rendersItemType } from '../../../../items/item-type-decorator'; -import { TypedItemSearchResultListElementComponent } from '../typed-item-search-result-list-element.component'; +import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; +import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component'; @rendersItemType('JournalIssue', ItemViewMode.Element) @Component({ diff --git a/src/app/shared/object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component.html b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.html similarity index 86% rename from src/app/shared/object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component.html rename to src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.html index 7d7f0cf731..4e6e34d3d6 100644 --- a/src/app/shared/object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component.html +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.html @@ -10,9 +10,9 @@ - - + () diff --git a/src/app/shared/object-list/item-list-element/item-types/journal/journal-list-element.component.scss b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.scss similarity index 100% rename from src/app/shared/object-list/item-list-element/item-types/journal/journal-list-element.component.scss rename to src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.scss diff --git a/src/app/shared/object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts similarity index 91% rename from src/app/shared/object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component.spec.ts rename to src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts index 4cdfb0d732..15f5424960 100644 --- a/src/app/shared/object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts @@ -1,12 +1,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; -import { Item } from '../../../../../core/shared/item.model'; -import { TruncatePipe } from '../../../../utils/truncate.pipe'; -import { TruncatableService } from '../../../../truncatable/truncatable.service'; -import { ITEM } from '../../../../items/switcher/item-type-switcher.component'; import { JournalVolumeListElementComponent } from './journal-volume-list-element.component'; import { of as observableOf } from 'rxjs'; +import { Item } from '../../../../core/shared/item.model'; +import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; +import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; +import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; let journalVolumeListElementComponent: JournalVolumeListElementComponent; let fixture: ComponentFixture; @@ -26,7 +26,7 @@ const mockItemWithMetadata: Item = Object.assign(new Item(), { value: 'This is just another journal title' } ], - 'journalvolume.identifier.volume': [ + 'publicationvolume.volumeNumber': [ { language: 'en_US', value: '1234' diff --git a/src/app/shared/object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts similarity index 64% rename from src/app/shared/object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component.ts rename to src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts index 01acf3ca34..42e83ea7bd 100644 --- a/src/app/shared/object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { ItemViewMode, rendersItemType } from '../../../../items/item-type-decorator'; -import { TypedItemSearchResultListElementComponent } from '../typed-item-search-result-list-element.component'; +import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; +import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component'; @rendersItemType('JournalVolume', ItemViewMode.Element) @Component({ diff --git a/src/app/shared/object-list/item-list-element/item-types/journal/journal-list-element.component.html b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.html similarity index 83% rename from src/app/shared/object-list/item-list-element/item-types/journal/journal-list-element.component.html rename to src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.html index 32c8074503..0e46e921bb 100644 --- a/src/app/shared/object-list/item-list-element/item-types/journal/journal-list-element.component.html +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.html @@ -4,9 +4,9 @@ [innerHTML]="firstMetadataValue('dc.title')"> - - + diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.scss b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/shared/object-list/item-list-element/item-types/journal/journal-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts similarity index 87% rename from src/app/shared/object-list/item-list-element/item-types/journal/journal-list-element.component.spec.ts rename to src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts index fc7ef06fa0..204672dfe9 100644 --- a/src/app/shared/object-list/item-list-element/item-types/journal/journal-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts @@ -1,12 +1,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; -import { Item } from '../../../../../core/shared/item.model'; -import { TruncatePipe } from '../../../../utils/truncate.pipe'; -import { TruncatableService } from '../../../../truncatable/truncatable.service'; -import { ITEM } from '../../../../items/switcher/item-type-switcher.component'; import { JournalListElementComponent } from './journal-list-element.component'; import { of as observableOf } from 'rxjs'; +import { Item } from '../../../../core/shared/item.model'; +import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; +import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; +import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; let journalListElementComponent: JournalListElementComponent; let fixture: ComponentFixture; @@ -20,7 +20,7 @@ const mockItemWithMetadata: Item = Object.assign(new Item(), { value: 'This is just another title' } ], - 'journal.identifier.issn': [ + 'creativeworkseries.issn': [ { language: 'en_US', value: '1234' diff --git a/src/app/shared/object-list/item-list-element/item-types/journal/journal-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts similarity index 62% rename from src/app/shared/object-list/item-list-element/item-types/journal/journal-list-element.component.ts rename to src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts index a40891b452..fdcf0ba5b0 100644 --- a/src/app/shared/object-list/item-list-element/item-types/journal/journal-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { ItemViewMode, rendersItemType } from '../../../../items/item-type-decorator'; -import { TypedItemSearchResultListElementComponent } from '../typed-item-search-result-list-element.component'; +import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; +import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component'; @rendersItemType('Journal', ItemViewMode.Element) @Component({ diff --git a/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.html b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.html similarity index 81% rename from src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.html rename to src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.html index 5d96abb82b..eebd3e03c8 100644 --- a/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.html +++ b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.html @@ -7,11 +7,15 @@ + +
@@ -34,11 +38,11 @@ [label]="'relationships.isPublicationOfJournalIssue' | translate">
diff --git a/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.scss b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.scss similarity index 100% rename from src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.scss rename to src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.scss diff --git a/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.spec.ts b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.spec.ts similarity index 66% rename from src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.spec.ts rename to src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.spec.ts index 24b18af96e..00403473a7 100644 --- a/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.spec.ts @@ -2,32 +2,36 @@ import { Item } from '../../../../core/shared/item.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { PaginatedList } from '../../../../core/data/paginated-list'; import { PageInfo } from '../../../../core/shared/page-info.model'; -import { createRelationshipsObservable, getItemPageFieldsTest } from '../shared/item.component.spec'; import { JournalIssueComponent } from './journal-issue.component'; import { of as observableOf } from 'rxjs'; +import { + 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: { - 'journalissue.identifier.number': [ + 'publicationissue.issueNumber': [ { language: 'en_US', value: '1234' } ], - 'journalissue.issuedate': [ + 'creativework.datePublished': [ { language: 'en_US', value: '2018' } ], - 'journalissue.identifier.description': [ + 'dc.description': [ { language: 'en_US', value: 'desc' } ], - 'journalissue.identifier.keyword': [ + 'creativework.keywords': [ { language: 'en_US', value: 'keyword' diff --git a/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts similarity index 59% rename from src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.ts rename to src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts index 77ed54d67f..b584fa3285 100644 --- a/src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts @@ -1,12 +1,10 @@ -import { Component, Inject } from '@angular/core'; +import { Component } from '@angular/core'; import { Observable } from 'rxjs'; -import { ItemDataService } from '../../../../core/data/item-data.service'; import { Item } from '../../../../core/shared/item.model'; import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; -import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; import { isNotEmpty } from '../../../../shared/empty.util'; -import { ItemComponent } from '../shared/item.component'; -import { filterRelationsByTypeLabel, relationsToItems } from '../shared/item-relationships-utils'; +import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('JournalIssue', ItemViewMode.Full) @Component({ @@ -28,23 +26,15 @@ export class JournalIssueComponent extends ItemComponent { */ publications$: Observable; - constructor( - @Inject(ITEM) public item: Item, - private ids: ItemDataService - ) { - super(item); - } ngOnInit(): void { super.ngOnInit(); if (isNotEmpty(this.resolvedRelsAndTypes$)) { this.volumes$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isJournalVolumeOfIssue'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isJournalVolumeOfIssue') ); this.publications$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isPublicationOfJournalIssue'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isPublicationOfJournalIssue') ); } } diff --git a/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.html b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.html similarity index 89% rename from src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.html rename to src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.html index 18bf1701fc..83626c7ae7 100644 --- a/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.html +++ b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.html @@ -7,11 +7,11 @@
@@ -25,7 +25,7 @@ [label]="'relationships.isIssueOf' | translate">
diff --git a/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.scss b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.scss similarity index 100% rename from src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.scss rename to src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.scss diff --git a/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.spec.ts b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.spec.ts similarity index 65% rename from src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.spec.ts rename to src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.spec.ts index a6f32e9b5f..d2b3420b2a 100644 --- a/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.spec.ts @@ -2,26 +2,30 @@ import { Item } from '../../../../core/shared/item.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { PaginatedList } from '../../../../core/data/paginated-list'; import { PageInfo } from '../../../../core/shared/page-info.model'; -import { createRelationshipsObservable, getItemPageFieldsTest } from '../shared/item.component.spec'; import { JournalVolumeComponent } from './journal-volume.component'; import { of as observableOf } from 'rxjs'; +import { + 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: { - 'journalvolume.identifier.volume': [ + 'publicationvolume.volumeNumber': [ { language: 'en_US', value: '1234' } ], - 'journalvolume.issuedate': [ + 'creativework.datePublished': [ { language: 'en_US', value: '2018' } ], - 'journalvolume.identifier.description': [ + 'dc.description': [ { language: 'en_US', value: 'desc' diff --git a/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts similarity index 59% rename from src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.ts rename to src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts index 616d96178a..66df0b8104 100644 --- a/src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts @@ -1,12 +1,10 @@ -import { Component, Inject } from '@angular/core'; +import { Component } from '@angular/core'; import { Observable } from 'rxjs'; -import { ItemDataService } from '../../../../core/data/item-data.service'; import { Item } from '../../../../core/shared/item.model'; import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; -import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; import { isNotEmpty } from '../../../../shared/empty.util'; -import { ItemComponent } from '../shared/item.component'; -import { filterRelationsByTypeLabel, relationsToItems } from '../shared/item-relationships-utils'; +import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('JournalVolume', ItemViewMode.Full) @Component({ @@ -28,23 +26,15 @@ export class JournalVolumeComponent extends ItemComponent { */ issues$: Observable; - constructor( - @Inject(ITEM) public item: Item, - private ids: ItemDataService - ) { - super(item); - } ngOnInit(): void { super.ngOnInit(); if (isNotEmpty(this.resolvedRelsAndTypes$)) { this.journals$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isJournalOfVolume'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isJournalOfVolume') ); this.issues$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isIssueOfJournalVolume'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isIssueOfJournalVolume') ); } } diff --git a/src/app/+item-page/simple/item-types/journal/journal.component.html b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.html similarity index 88% rename from src/app/+item-page/simple/item-types/journal/journal.component.html rename to src/app/entity-groups/journal-entities/item-pages/journal/journal.component.html index 2ab3430256..a82d3c5df6 100644 --- a/src/app/+item-page/simple/item-types/journal/journal.component.html +++ b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.html @@ -7,15 +7,15 @@
@@ -25,7 +25,7 @@ [label]="'relationships.isVolumeOf' | translate">
diff --git a/src/app/+item-page/simple/item-types/journal/journal.component.scss b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.scss similarity index 100% rename from src/app/+item-page/simple/item-types/journal/journal.component.scss rename to src/app/entity-groups/journal-entities/item-pages/journal/journal.component.scss diff --git a/src/app/+item-page/simple/item-types/journal/journal.component.spec.ts b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts similarity index 87% rename from src/app/+item-page/simple/item-types/journal/journal.component.spec.ts rename to src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts index 08e8859b35..c66c3a2462 100644 --- a/src/app/+item-page/simple/item-types/journal/journal.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts @@ -8,33 +8,34 @@ import { Item } from '../../../../core/shared/item.model'; import { By } from '@angular/platform-browser'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { MockTranslateLoader } from '../../../../shared/mocks/mock-translate-loader'; -import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component'; import { RemoteData } from '../../../../core/data/remote-data'; import { PaginatedList } from '../../../../core/data/paginated-list'; import { PageInfo } from '../../../../core/shared/page-info.model'; import { isNotEmpty } from '../../../../shared/empty.util'; import { JournalComponent } from './journal.component'; import { of as observableOf } from 'rxjs'; +import { 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: { - 'journal.identifier.issn': [ + 'creativeworkseries.issn': [ { language: 'en_US', value: '1234' } ], - 'journal.publisher': [ + 'creativework.publisher': [ { language: 'en_US', value: 'a publisher' } ], - 'journal.identifier.description': [ + 'dc.description': [ { language: 'en_US', value: 'desc' diff --git a/src/app/+item-page/simple/item-types/journal/journal.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts similarity index 58% rename from src/app/+item-page/simple/item-types/journal/journal.component.ts rename to src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts index 0799f5c736..a8f071d78a 100644 --- a/src/app/+item-page/simple/item-types/journal/journal.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts @@ -1,12 +1,10 @@ -import { Component, Inject } from '@angular/core'; +import { Component } from '@angular/core'; import { Observable } from 'rxjs'; -import { ItemDataService } from '../../../../core/data/item-data.service'; import { Item } from '../../../../core/shared/item.model'; import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; -import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; import { isNotEmpty } from '../../../../shared/empty.util'; -import { ItemComponent } from '../shared/item.component'; -import { filterRelationsByTypeLabel, relationsToItems } from '../shared/item-relationships-utils'; +import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('Journal', ItemViewMode.Full) @Component({ @@ -23,19 +21,12 @@ export class JournalComponent extends ItemComponent { */ volumes$: Observable; - constructor( - @Inject(ITEM) public item: Item, - private ids: ItemDataService - ) { - super(item); - } ngOnInit(): void { super.ngOnInit(); if (isNotEmpty(this.resolvedRelsAndTypes$)) { this.volumes$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isVolumeOfJournal'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isVolumeOfJournal') ); } } diff --git a/src/app/entity-groups/journal-entities/journal-entities.module.ts b/src/app/entity-groups/journal-entities/journal-entities.module.ts new file mode 100644 index 0000000000..50ec160650 --- /dev/null +++ b/src/app/entity-groups/journal-entities/journal-entities.module.ts @@ -0,0 +1,38 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { SharedModule } from '../../shared/shared.module'; +import { ItemPageModule } from '../../+item-page/item-page.module'; +import { JournalComponent } from './item-pages/journal/journal.component'; +import { JournalIssueComponent } from './item-pages/journal-issue/journal-issue.component'; +import { JournalVolumeComponent } from './item-pages/journal-volume/journal-volume.component'; +import { JournalListElementComponent } from './item-list-elements/journal/journal-list-element.component'; +import { JournalIssueListElementComponent } from './item-list-elements/journal-issue/journal-issue-list-element.component'; +import { JournalVolumeListElementComponent } from './item-list-elements/journal-volume/journal-volume-list-element.component'; +import { TooltipModule } from 'ngx-bootstrap'; + +const ENTRY_COMPONENTS = [ + JournalComponent, + JournalIssueComponent, + JournalVolumeComponent, + JournalListElementComponent, + JournalIssueListElementComponent, + JournalVolumeListElementComponent +]; + +@NgModule({ + imports: [ + CommonModule, + SharedModule, + TooltipModule.forRoot(), + ItemPageModule + ], + declarations: [ + ...ENTRY_COMPONENTS + ], + entryComponents: [ + ...ENTRY_COMPONENTS + ] +}) +export class JournalEntitiesModule { + +} diff --git a/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.html similarity index 62% rename from src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-list-element.component.html rename to src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.html index a809c0f655..8d312fb7c0 100644 --- a/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.html @@ -1,13 +1,13 @@ + [innerHTML]="firstMetadataValue('organization.legalName')"> - + [innerHTML]="firstMetadataValue('dc.description')"> diff --git a/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.scss b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.scss new file mode 100644 index 0000000000..1d0786105c --- /dev/null +++ b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.scss @@ -0,0 +1 @@ +@import '../../../../../styles/variables'; diff --git a/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.spec.ts similarity index 88% rename from src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-list-element.component.spec.ts rename to src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.spec.ts index 8e74c389e9..dd2b138abb 100644 --- a/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.spec.ts @@ -1,12 +1,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; -import { Item } from '../../../../../core/shared/item.model'; -import { TruncatePipe } from '../../../../utils/truncate.pipe'; -import { TruncatableService } from '../../../../truncatable/truncatable.service'; -import { ITEM } from '../../../../items/switcher/item-type-switcher.component'; import { OrgUnitListElementComponent } from './orgunit-list-element.component'; import { of as observableOf } from 'rxjs'; +import { Item } from '../../../../core/shared/item.model'; +import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; +import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; +import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; let orgUnitListElementComponent: OrgUnitListElementComponent; let fixture: ComponentFixture; @@ -20,7 +20,7 @@ const mockItemWithMetadata: Item = Object.assign(new Item(), { value: 'This is just another title' } ], - 'orgunit.identifier.description': [ + 'dc.description': [ { language: 'en_US', value: 'A description about the OrgUnit' diff --git a/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.ts similarity index 63% rename from src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-list-element.component.ts rename to src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.ts index f047aac586..9a56bb6d03 100644 --- a/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-list-element.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { ItemViewMode, rendersItemType } from '../../../../items/item-type-decorator'; -import { TypedItemSearchResultListElementComponent } from '../typed-item-search-result-list-element.component'; +import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; +import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component'; @rendersItemType('OrgUnit', ItemViewMode.Element) @Component({ diff --git a/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-metadata-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-metadata-list-element.component.html similarity index 52% rename from src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-metadata-list-element.component.html rename to src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-metadata-list-element.component.html index 463770c0ae..ea429e87c6 100644 --- a/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-metadata-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-metadata-list-element.component.html @@ -1,13 +1,13 @@ - - + diff --git a/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-metadata-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-metadata-list-element.component.ts similarity index 53% rename from src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-metadata-list-element.component.ts rename to src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-metadata-list-element.component.ts index 42c6c6f6a2..d59e5c6cc3 100644 --- a/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-metadata-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/orgunit/orgunit-metadata-list-element.component.ts @@ -1,7 +1,7 @@ -import { ItemViewMode, rendersItemType } from '../../../../items/item-type-decorator'; import { Component } from '@angular/core'; -import { TypedItemSearchResultListElementComponent } from '../typed-item-search-result-list-element.component'; -import { MetadataRepresentationType } from '../../../../../core/shared/metadata-representation/metadata-representation.model'; +import { MetadataRepresentationType } from '../../../../core/shared/metadata-representation/metadata-representation.model'; +import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; +import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component'; @rendersItemType('OrgUnit', ItemViewMode.Element, MetadataRepresentationType.Item) @Component({ diff --git a/src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.html similarity index 68% rename from src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.html rename to src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.html index 52b69453ce..c88b77083d 100644 --- a/src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.html @@ -1,12 +1,12 @@ + [innerHTML]="firstMetadataValue('person.familyName') + ', ' + firstMetadataValue('person.givenName')"> - - + diff --git a/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.scss b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.scss new file mode 100644 index 0000000000..1d0786105c --- /dev/null +++ b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.scss @@ -0,0 +1 @@ +@import '../../../../../styles/variables'; diff --git a/src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts similarity index 87% rename from src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.spec.ts rename to src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts index 67dc4e92ac..3b6aeae45b 100644 --- a/src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts @@ -1,12 +1,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; -import { Item } from '../../../../../core/shared/item.model'; -import { TruncatePipe } from '../../../../utils/truncate.pipe'; -import { TruncatableService } from '../../../../truncatable/truncatable.service'; -import { ITEM } from '../../../../items/switcher/item-type-switcher.component'; import { PersonListElementComponent } from './person-list-element.component'; import { of as observableOf } from 'rxjs'; +import { Item } from '../../../../core/shared/item.model'; +import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; +import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; +import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; let personListElementComponent: PersonListElementComponent; let fixture: ComponentFixture; @@ -20,7 +20,7 @@ const mockItemWithMetadata: Item = Object.assign(new Item(), { value: 'This is just another title' } ], - 'person.identifier.jobtitle': [ + 'person.jobTitle': [ { language: 'en_US', value: 'Developer' diff --git a/src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts similarity index 62% rename from src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.ts rename to src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts index b3834a8aab..46d90a6f2d 100644 --- a/src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { ItemViewMode, rendersItemType } from '../../../../items/item-type-decorator'; -import { TypedItemSearchResultListElementComponent } from '../typed-item-search-result-list-element.component'; +import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; +import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component'; @rendersItemType('Person', ItemViewMode.Element) @Component({ diff --git a/src/app/shared/object-list/item-list-element/item-types/person/person-metadata-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/person/person-metadata-list-element.component.html similarity index 67% rename from src/app/shared/object-list/item-list-element/item-types/person/person-metadata-list-element.component.html rename to src/app/entity-groups/research-entities/item-list-elements/person/person-metadata-list-element.component.html index 3dfe17debc..1125c2fb9b 100644 --- a/src/app/shared/object-list/item-list-element/item-types/person/person-metadata-list-element.component.html +++ b/src/app/entity-groups/research-entities/item-list-elements/person/person-metadata-list-element.component.html @@ -1,8 +1,8 @@ - - + @@ -10,6 +10,6 @@ diff --git a/src/app/shared/object-list/item-list-element/item-types/person/person-metadata-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/person/person-metadata-list-element.component.ts similarity index 53% rename from src/app/shared/object-list/item-list-element/item-types/person/person-metadata-list-element.component.ts rename to src/app/entity-groups/research-entities/item-list-elements/person/person-metadata-list-element.component.ts index 959673242d..b036768d0a 100644 --- a/src/app/shared/object-list/item-list-element/item-types/person/person-metadata-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/person/person-metadata-list-element.component.ts @@ -1,7 +1,7 @@ -import { ItemViewMode, rendersItemType } from '../../../../items/item-type-decorator'; import { Component } from '@angular/core'; -import { TypedItemSearchResultListElementComponent } from '../typed-item-search-result-list-element.component'; -import { MetadataRepresentationType } from '../../../../../core/shared/metadata-representation/metadata-representation.model'; +import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; +import { MetadataRepresentationType } from '../../../../core/shared/metadata-representation/metadata-representation.model'; +import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component'; @rendersItemType('Person', ItemViewMode.Element, MetadataRepresentationType.Item) @Component({ diff --git a/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.html b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.html new file mode 100644 index 0000000000..3e979b4e4d --- /dev/null +++ b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.html @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.scss b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.scss new file mode 100644 index 0000000000..1d0786105c --- /dev/null +++ b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.scss @@ -0,0 +1 @@ +@import '../../../../../styles/variables'; diff --git a/src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts similarity index 55% rename from src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.spec.ts rename to src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts index 1dd3c42042..02dc3f6d73 100644 --- a/src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts @@ -1,12 +1,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; -import { Item } from '../../../../../core/shared/item.model'; -import { TruncatePipe } from '../../../../utils/truncate.pipe'; -import { TruncatableService } from '../../../../truncatable/truncatable.service'; -import { ITEM } from '../../../../items/switcher/item-type-switcher.component'; import { ProjectListElementComponent } from './project-list-element.component'; import { of as observableOf } from 'rxjs'; +import { Item } from '../../../../core/shared/item.model'; +import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; +import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; +import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; let projectListElementComponent: ProjectListElementComponent; let fixture: ComponentFixture; @@ -20,12 +20,12 @@ const mockItemWithMetadata: Item = Object.assign(new Item(), { value: 'This is just another title' } ], - 'project.identifier.status': [ - { - language: 'en_US', - value: 'A status about the project' - } - ] + // 'project.identifier.status': [ + // { + // language: 'en_US', + // value: 'A status about the project' + // } + // ] } }); const mockItemWithoutMetadata: Item = Object.assign(new Item(), { @@ -61,27 +61,27 @@ describe('ProjectListElementComponent', () => { })); - describe('When the item has a status', () => { - beforeEach(() => { - projectListElementComponent.item = mockItemWithMetadata; - fixture.detectChanges(); - }); - - it('should show the status span', () => { - const statusField = fixture.debugElement.query(By.css('span.item-list-status')); - expect(statusField).not.toBeNull(); - }); - }); - - describe('When the item has no status', () => { - beforeEach(() => { - projectListElementComponent.item = mockItemWithoutMetadata; - fixture.detectChanges(); - }); - - it('should not show the status span', () => { - const statusField = fixture.debugElement.query(By.css('span.item-list-status')); - expect(statusField).toBeNull(); - }); - }); + // describe('When the item has a status', () => { + // beforeEach(() => { + // projectListElementComponent.item = mockItemWithMetadata; + // fixture.detectChanges(); + // }); + // + // it('should show the status span', () => { + // const statusField = fixture.debugElement.query(By.css('span.item-list-status')); + // expect(statusField).not.toBeNull(); + // }); + // }); + // + // describe('When the item has no status', () => { + // beforeEach(() => { + // projectListElementComponent.item = mockItemWithoutMetadata; + // fixture.detectChanges(); + // }); + // + // it('should not show the status span', () => { + // const statusField = fixture.debugElement.query(By.css('span.item-list-status')); + // expect(statusField).toBeNull(); + // }); + // }); }); diff --git a/src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts similarity index 62% rename from src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.ts rename to src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts index 86b58c94fd..2d3e716ff4 100644 --- a/src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { ItemViewMode, rendersItemType } from '../../../../items/item-type-decorator'; -import { TypedItemSearchResultListElementComponent } from '../typed-item-search-result-list-element.component'; +import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; +import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component'; @rendersItemType('Project', ItemViewMode.Element) @Component({ diff --git a/src/app/+item-page/simple/item-types/orgunit/orgunit.component.html b/src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.html similarity index 83% rename from src/app/+item-page/simple/item-types/orgunit/orgunit.component.html rename to src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.html index 0446ac6861..92ac3eac30 100644 --- a/src/app/+item-page/simple/item-types/orgunit/orgunit.component.html +++ b/src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.html @@ -1,5 +1,5 @@

- {{'orgunit.page.titleprefix' | translate}} + {{'orgunit.page.titleprefix' | translate}}

@@ -7,19 +7,19 @@
@@ -37,7 +37,7 @@ [label]="'relationships.isPublicationOf' | translate">
diff --git a/src/app/+item-page/simple/item-types/orgunit/orgunit.component.scss b/src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.scss similarity index 100% rename from src/app/+item-page/simple/item-types/orgunit/orgunit.component.scss rename to src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.scss diff --git a/src/app/+item-page/simple/item-types/orgunit/orgunit.component.spec.ts b/src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.spec.ts similarity index 65% rename from src/app/+item-page/simple/item-types/orgunit/orgunit.component.spec.ts rename to src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.spec.ts index fa5396fb3d..a49105b2e3 100644 --- a/src/app/+item-page/simple/item-types/orgunit/orgunit.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.spec.ts @@ -2,38 +2,42 @@ import { Item } from '../../../../core/shared/item.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { PaginatedList } from '../../../../core/data/paginated-list'; import { PageInfo } from '../../../../core/shared/page-info.model'; -import { createRelationshipsObservable, getItemPageFieldsTest } from '../shared/item.component.spec'; import { OrgunitComponent } from './orgunit.component'; import { of as observableOf } from 'rxjs'; +import { + 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: { - 'orgunit.identifier.dateestablished': [ + 'organization.foundingDate': [ { language: 'en_US', value: '2018' } ], - 'orgunit.identifier.city': [ + 'organization.address.addressLocality': [ { language: 'en_US', value: 'New York' } ], - 'orgunit.identifier.country': [ + 'organization.adress.addressCountry': [ { language: 'en_US', value: 'USA' } ], - 'orgunit.identifier.id': [ + 'dc.identifier': [ { language: 'en_US', value: '1' } ], - 'orgunit.identifier.description': [ + 'dc.description': [ { language: 'en_US', value: 'desc' diff --git a/src/app/+item-page/simple/item-types/orgunit/orgunit.component.ts b/src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.ts similarity index 59% rename from src/app/+item-page/simple/item-types/orgunit/orgunit.component.ts rename to src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.ts index 96dc9a5960..031ca14ebb 100644 --- a/src/app/+item-page/simple/item-types/orgunit/orgunit.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/orgunit/orgunit.component.ts @@ -1,12 +1,10 @@ -import { Component, Inject, OnInit } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; -import { ItemDataService } from '../../../../core/data/item-data.service'; import { Item } from '../../../../core/shared/item.model'; import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; -import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; import { isNotEmpty } from '../../../../shared/empty.util'; -import { ItemComponent } from '../shared/item.component'; -import { filterRelationsByTypeLabel, relationsToItems } from '../shared/item-relationships-utils'; +import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('OrgUnit', ItemViewMode.Full) @Component({ @@ -33,30 +31,20 @@ export class OrgunitComponent extends ItemComponent implements OnInit { */ publications$: Observable; - constructor( - @Inject(ITEM) public item: Item, - private ids: ItemDataService - ) { - super(item); - } - ngOnInit(): void { super.ngOnInit(); if (isNotEmpty(this.resolvedRelsAndTypes$)) { this.people$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isPersonOfOrgUnit'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isPersonOfOrgUnit') ); this.projects$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isProjectOfOrgUnit'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isProjectOfOrgUnit') ); this.publications$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isPublicationOfOrgUnit'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isPublicationOfOrgUnit') ); } }} diff --git a/src/app/+item-page/simple/item-types/person/person.component.html b/src/app/entity-groups/research-entities/item-pages/person/person.component.html similarity index 69% rename from src/app/+item-page/simple/item-types/person/person.component.html rename to src/app/entity-groups/research-entities/item-pages/person/person.component.html index 88cd647645..04d7b9e062 100644 --- a/src/app/+item-page/simple/item-types/person/person.component.html +++ b/src/app/entity-groups/research-entities/item-pages/person/person.component.html @@ -1,5 +1,5 @@

- {{'person.page.titleprefix' | translate}} + {{'person.page.titleprefix' | translate}}

@@ -7,21 +7,21 @@ + + + + - - - - + + + +
diff --git a/src/app/+item-page/simple/item-types/person/person.component.scss b/src/app/entity-groups/research-entities/item-pages/person/person.component.scss similarity index 100% rename from src/app/+item-page/simple/item-types/person/person.component.scss rename to src/app/entity-groups/research-entities/item-pages/person/person.component.scss diff --git a/src/app/+item-page/simple/item-types/person/person.component.spec.ts b/src/app/entity-groups/research-entities/item-pages/person/person.component.spec.ts similarity index 57% rename from src/app/+item-page/simple/item-types/person/person.component.spec.ts rename to src/app/entity-groups/research-entities/item-pages/person/person.component.spec.ts index cf0d5c197d..4c523b81cb 100644 --- a/src/app/+item-page/simple/item-types/person/person.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-pages/person/person.component.spec.ts @@ -2,50 +2,54 @@ import { Item } from '../../../../core/shared/item.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { PaginatedList } from '../../../../core/data/paginated-list'; import { PageInfo } from '../../../../core/shared/page-info.model'; -import { createRelationshipsObservable, getItemPageFieldsTest } from '../shared/item.component.spec'; import { PersonComponent } from './person.component'; import { of as observableOf } from 'rxjs'; +import { + 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.identifier.email': [ + 'person.email': [ { language: 'en_US', value: 'fake@email.com' } ], - 'person.identifier.orcid': [ - { - language: 'en_US', - value: 'ORCID-1' - } - ], - 'person.identifier.birthdate': [ + // 'person.identifier.orcid': [ + // { + // language: 'en_US', + // value: 'ORCID-1' + // } + // ], + 'person.birthDate': [ { language: 'en_US', value: '1993' } ], - 'person.identifier.staffid': [ - { - language: 'en_US', - value: '1' - } - ], - 'person.identifier.jobtitle': [ + // 'person.identifier.staffid': [ + // { + // language: 'en_US', + // value: '1' + // } + // ], + 'person.jobTitle': [ { language: 'en_US', value: 'Developer' } ], - 'person.identifier.lastname': [ + 'person.familyName': [ { language: 'en_US', value: 'Doe' } ], - 'person.identifier.firstname': [ + 'person.givenName': [ { language: 'en_US', value: 'John' diff --git a/src/app/+item-page/simple/item-types/person/person.component.ts b/src/app/entity-groups/research-entities/item-pages/person/person.component.ts similarity index 76% rename from src/app/+item-page/simple/item-types/person/person.component.ts rename to src/app/entity-groups/research-entities/item-pages/person/person.component.ts index 67a2ae7a2e..8b36175b96 100644 --- a/src/app/+item-page/simple/item-types/person/person.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/person/person.component.ts @@ -1,13 +1,12 @@ import { Component, Inject } from '@angular/core'; import { Observable , of as observableOf } from 'rxjs'; -import { ItemDataService } from '../../../../core/data/item-data.service'; import { Item } from '../../../../core/shared/item.model'; import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; import { SearchFixedFilterService } from '../../../../+search-page/search-filters/search-filter/search-fixed-filter.service'; import { isNotEmpty } from '../../../../shared/empty.util'; -import { ItemComponent } from '../shared/item.component'; -import { filterRelationsByTypeLabel, relationsToItems } from '../shared/item-relationships-utils'; +import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('Person', ItemViewMode.Full) @Component({ @@ -46,7 +45,6 @@ export class PersonComponent extends ItemComponent { constructor( @Inject(ITEM) public item: Item, - private ids: ItemDataService, private fixedFilterService: SearchFixedFilterService ) { super(item); @@ -56,18 +54,15 @@ export class PersonComponent extends ItemComponent { if (isNotEmpty(this.resolvedRelsAndTypes$)) { this.publications$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isPublicationOfAuthor'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isPublicationOfAuthor') ); this.projects$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isProjectOfPerson'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isProjectOfPerson') ); this.orgUnits$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isOrgUnitOfPerson'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isOrgUnitOfPerson') ); this.fixedFilterQuery = this.fixedFilterService.getQueryByRelations('isAuthorOfPublication', this.item.id); diff --git a/src/app/+item-page/simple/item-types/project/project.component.html b/src/app/entity-groups/research-entities/item-pages/project/project.component.html similarity index 74% rename from src/app/+item-page/simple/item-types/project/project.component.html rename to src/app/entity-groups/research-entities/item-pages/project/project.component.html index 08e386182b..4e9a130b8c 100644 --- a/src/app/+item-page/simple/item-types/project/project.component.html +++ b/src/app/entity-groups/research-entities/item-pages/project/project.component.html @@ -1,15 +1,15 @@

- {{'project.page.titleprefix' | translate}} + {{'project.page.titleprefix' | translate}}

- - + + + + @@ -19,13 +19,13 @@ [label]="'project.page.funder'"> - - + + + +
diff --git a/src/app/+item-page/simple/item-types/project/project.component.scss b/src/app/entity-groups/research-entities/item-pages/project/project.component.scss similarity index 100% rename from src/app/+item-page/simple/item-types/project/project.component.scss rename to src/app/entity-groups/research-entities/item-pages/project/project.component.scss diff --git a/src/app/+item-page/simple/item-types/project/project.component.spec.ts b/src/app/entity-groups/research-entities/item-pages/project/project.component.spec.ts similarity index 54% rename from src/app/+item-page/simple/item-types/project/project.component.spec.ts rename to src/app/entity-groups/research-entities/item-pages/project/project.component.spec.ts index 9b54ff9a41..5185857494 100644 --- a/src/app/+item-page/simple/item-types/project/project.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-pages/project/project.component.spec.ts @@ -2,38 +2,42 @@ import { Item } from '../../../../core/shared/item.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { PaginatedList } from '../../../../core/data/paginated-list'; import { PageInfo } from '../../../../core/shared/page-info.model'; -import { createRelationshipsObservable, getItemPageFieldsTest } from '../shared/item.component.spec'; import { ProjectComponent } from './project.component'; import { of as observableOf } from 'rxjs'; +import { + 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': [ - { - language: 'en_US', - value: 'published' - } - ], - 'project.identifier.id': [ + // 'project.identifier.status': [ + // { + // language: 'en_US', + // value: 'published' + // } + // ], + 'dc.identifier': [ { language: 'en_US', value: '1' } ], - 'project.identifier.expectedcompletion': [ - { - language: 'en_US', - value: 'exp comp' - } - ], - 'project.identifier.description': [ + // 'project.identifier.expectedcompletion': [ + // { + // language: 'en_US', + // value: 'exp comp' + // } + // ], + 'dc.description': [ { language: 'en_US', value: 'keyword' } ], - 'project.identifier.keyword': [ + 'dc.subject': [ { language: 'en_US', value: 'keyword' diff --git a/src/app/+item-page/simple/item-types/project/project.component.ts b/src/app/entity-groups/research-entities/item-pages/project/project.component.ts similarity index 63% rename from src/app/+item-page/simple/item-types/project/project.component.ts rename to src/app/entity-groups/research-entities/item-pages/project/project.component.ts index eafef36307..13c2b54ba4 100644 --- a/src/app/+item-page/simple/item-types/project/project.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/project/project.component.ts @@ -1,13 +1,11 @@ -import { Component, Inject, OnInit } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; -import { ItemDataService } from '../../../../core/data/item-data.service'; import { Item } from '../../../../core/shared/item.model'; import { MetadataRepresentation } from '../../../../core/shared/metadata-representation/metadata-representation.model'; import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator'; -import { ITEM } from '../../../../shared/items/switcher/item-type-switcher.component'; import { isNotEmpty } from '../../../../shared/empty.util'; -import { ItemComponent } from '../shared/item.component'; -import { filterRelationsByTypeLabel, relationsToItems } from '../shared/item-relationships-utils'; +import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { getRelatedItemsByTypeLabel } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('Project', ItemViewMode.Full) @Component({ @@ -39,32 +37,22 @@ export class ProjectComponent extends ItemComponent implements OnInit { */ orgUnits$: Observable; - constructor( - @Inject(ITEM) public item: Item, - private ids: ItemDataService - ) { - super(item); - } - ngOnInit(): void { super.ngOnInit(); if (isNotEmpty(this.resolvedRelsAndTypes$)) { - this.contributors$ = this.buildRepresentations('OrgUnit', 'project.contributor.other', this.ids); + this.contributors$ = this.buildRepresentations('OrgUnit', 'project.contributor.other'); this.people$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isPersonOfProject'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isPersonOfProject') ); this.publications$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isPublicationOfProject'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isPublicationOfProject') ); this.orgUnits$ = this.resolvedRelsAndTypes$.pipe( - filterRelationsByTypeLabel('isOrgUnitOfProject'), - relationsToItems(this.item.id, this.ids) + getRelatedItemsByTypeLabel(this.item.id, 'isOrgUnitOfProject') ); } } diff --git a/src/app/entity-groups/research-entities/research-entities.module.ts b/src/app/entity-groups/research-entities/research-entities.module.ts new file mode 100644 index 0000000000..ba28f174df --- /dev/null +++ b/src/app/entity-groups/research-entities/research-entities.module.ts @@ -0,0 +1,42 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { SharedModule } from '../../shared/shared.module'; +import { ItemPageModule } from '../../+item-page/item-page.module'; +import { OrgunitComponent } from './item-pages/orgunit/orgunit.component'; +import { PersonComponent } from './item-pages/person/person.component'; +import { ProjectComponent } from './item-pages/project/project.component'; +import { OrgUnitListElementComponent } from './item-list-elements/orgunit/orgunit-list-element.component'; +import { OrgUnitMetadataListElementComponent } from './item-list-elements/orgunit/orgunit-metadata-list-element.component'; +import { PersonMetadataListElementComponent } from './item-list-elements/person/person-metadata-list-element.component'; +import { PersonListElementComponent } from './item-list-elements/person/person-list-element.component'; +import { ProjectListElementComponent } from './item-list-elements/project/project-list-element.component'; +import { TooltipModule } from 'ngx-bootstrap'; + +const ENTRY_COMPONENTS = [ + OrgunitComponent, + PersonComponent, + ProjectComponent, + OrgUnitListElementComponent, + OrgUnitMetadataListElementComponent, + PersonListElementComponent, + PersonMetadataListElementComponent, + ProjectListElementComponent +]; + +@NgModule({ + imports: [ + CommonModule, + SharedModule, + TooltipModule.forRoot(), + ItemPageModule + ], + declarations: [ + ...ENTRY_COMPONENTS + ], + entryComponents: [ + ...ENTRY_COMPONENTS + ] +}) +export class ResearchEntitiesModule { + +} diff --git a/src/app/footer/footer.component.scss b/src/app/footer/footer.component.scss index bd141706da..51201774d5 100644 --- a/src/app/footer/footer.component.scss +++ b/src/app/footer/footer.component.scss @@ -1,4 +1,3 @@ -@import '../../styles/variables.scss'; $footer-bg: $gray-100; $footer-border: 1px solid darken($footer-bg, 10%); $footer-padding: $spacer * 1.5; diff --git a/src/app/header-nav-wrapper/header-navbar-wrapper.component.scss b/src/app/header-nav-wrapper/header-navbar-wrapper.component.scss index f514508385..c3eba35b79 100644 --- a/src/app/header-nav-wrapper/header-navbar-wrapper.component.scss +++ b/src/app/header-nav-wrapper/header-navbar-wrapper.component.scss @@ -1,5 +1,3 @@ -@import '../../styles/variables.scss'; - @media screen and (max-width: map-get($grid-breakpoints, md)) { :host.open { background-color: $white; diff --git a/src/app/header/header.component.scss b/src/app/header/header.component.scss index df4c0b8fb8..4d25bd0d43 100644 --- a/src/app/header/header.component.scss +++ b/src/app/header/header.component.scss @@ -1,5 +1,3 @@ -@import '../../styles/variables.scss'; - .navbar-brand img { height: $header-logo-height; @media screen and (max-width: map-get($grid-breakpoints, sm)) { diff --git a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.scss b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.scss index 1fb78bef0d..f724c3e751 100644 --- a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.scss +++ b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.scss @@ -1,5 +1,3 @@ -@import '../../../styles/variables.scss'; - .dropdown-menu { overflow: hidden; min-width: 100%; diff --git a/src/app/navbar/navbar.component.scss b/src/app/navbar/navbar.component.scss index 947b785196..d0fa04991d 100644 --- a/src/app/navbar/navbar.component.scss +++ b/src/app/navbar/navbar.component.scss @@ -1,5 +1,3 @@ -@import '../../styles/variables.scss'; - nav.navbar { border-bottom: 1px $gray-400 solid; align-items: baseline; @@ -34,6 +32,4 @@ nav.navbar { } padding: 0; } -} - - +} \ No newline at end of file diff --git a/src/app/navbar/navbar.component.spec.ts b/src/app/navbar/navbar.component.spec.ts index 2d937fd84e..ca054a662b 100644 --- a/src/app/navbar/navbar.component.spec.ts +++ b/src/app/navbar/navbar.component.spec.ts @@ -11,6 +11,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Injector, NO_ERRORS_SCHEMA } from '@angular/core'; import { MenuService } from '../shared/menu/menu.service'; import { MenuServiceStub } from '../shared/testing/menu-service-stub'; +import { ENV_CONFIG, GLOBAL_CONFIG } from '../../config'; let comp: NavbarComponent; let fixture: ComponentFixture; @@ -30,6 +31,7 @@ describe('NavbarComponent', () => { { provide: Injector, useValue: {} }, { provide: MenuService, useValue: menuService }, { provide: HostWindowService, useValue: new HostWindowServiceStub(800) }, + { provide: GLOBAL_CONFIG, useValue: ENV_CONFIG } ], schemas: [NO_ERRORS_SCHEMA] }) diff --git a/src/app/navbar/navbar.component.ts b/src/app/navbar/navbar.component.ts index 48b316af4b..4c7c3cd030 100644 --- a/src/app/navbar/navbar.component.ts +++ b/src/app/navbar/navbar.component.ts @@ -1,4 +1,4 @@ -import { Component, Injector, OnInit } from '@angular/core'; +import { Component, Inject, Injector, OnInit } from '@angular/core'; import { slideMobileNav } from '../shared/animations/slide'; import { MenuComponent } from '../shared/menu/menu.component'; import { MenuService } from '../shared/menu/menu.service'; @@ -6,14 +6,15 @@ import { MenuID, MenuItemType } from '../shared/menu/initial-menus-state'; import { TextMenuItemModel } from '../shared/menu/menu-item/models/text.model'; import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; import { HostWindowService } from '../shared/host-window.service'; +import { GLOBAL_CONFIG, GlobalConfig } from '../../config'; /** * Component representing the public navbar */ @Component({ selector: 'ds-navbar', - styleUrls: ['navbar.component.scss'], - templateUrl: 'navbar.component.html', + styleUrls: ['./navbar.component.scss'], + templateUrl: './navbar.component.html', animations: [slideMobileNav] }) export class NavbarComponent extends MenuComponent implements OnInit { @@ -23,7 +24,8 @@ export class NavbarComponent extends MenuComponent implements OnInit { */ menuID = MenuID.PUBLIC; - constructor(protected menuService: MenuService, + constructor(@Inject(GLOBAL_CONFIG) public config: GlobalConfig, + protected menuService: MenuService, protected injector: Injector, public windowService: HostWindowService ) { @@ -39,7 +41,7 @@ export class NavbarComponent extends MenuComponent implements OnInit { * Initialize all menu sections and items for this menu */ createMenu() { - const menuList = [ + const menuList: any[] = [ /* News */ { id: 'browse_global', @@ -62,50 +64,6 @@ export class NavbarComponent extends MenuComponent implements OnInit { // link: '#' // } as LinkMenuItemModel, // }, - { - id: 'browse_global_global_by_title', - parentID: 'browse_global', - active: false, - visible: true, - model: { - type: MenuItemType.LINK, - text: 'menu.section.browse_global_by_title', - link: '/browse/title' - } as LinkMenuItemModel, - }, - { - id: 'browse_global_global_by_issue_date', - parentID: 'browse_global', - active: false, - visible: true, - model: { - type: MenuItemType.LINK, - text: 'menu.section.browse_global_by_issue_date', - link: '/browse/dateissued' - } as LinkMenuItemModel, - }, - { - id: 'browse_global_by_author', - parentID: 'browse_global', - active: false, - visible: true, - model: { - type: MenuItemType.LINK, - text: 'menu.section.browse_global_by_author', - link: '/browse/author' - } as LinkMenuItemModel, - }, - { - id: 'browse_global_by_subject', - parentID: 'browse_global', - active: false, - visible: true, - model: { - type: MenuItemType.LINK, - text: 'menu.section.browse_global_by_subject', - link: '/browse/subject' - } as LinkMenuItemModel, - }, /* Statistics */ { @@ -120,6 +78,21 @@ export class NavbarComponent extends MenuComponent implements OnInit { index: 2 }, ]; + // Read the different Browse-By types from config and add them to the browse menu + const types = this.config.browseBy.types; + types.forEach((typeConfig) => { + menuList.push({ + id: `browse_global_by_${typeConfig.id}`, + parentID: 'browse_global', + active: false, + visible: true, + model: { + type: MenuItemType.LINK, + text: `menu.section.browse_global_by_${typeConfig.id}`, + link: `/browse/${typeConfig.id}` + } as LinkMenuItemModel + }); + }); menuList.forEach((menuSection) => this.menuService.addSection(this.menuID, menuSection)); } diff --git a/src/app/pagenotfound/pagenotfound.component.scss b/src/app/pagenotfound/pagenotfound.component.scss index da97dd7a62..e69de29bb2 100644 --- a/src/app/pagenotfound/pagenotfound.component.scss +++ b/src/app/pagenotfound/pagenotfound.component.scss @@ -1 +0,0 @@ -@import '../../styles/variables.scss'; 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/chips/chips.component.scss b/src/app/shared/chips/chips.component.scss index 9d7eae7edd..76be755920 100644 --- a/src/app/shared/chips/chips.component.scss +++ b/src/app/shared/chips/chips.component.scss @@ -1,5 +1,3 @@ -@import "../../../styles/variables"; - .chip-selected { background-color: map-get($theme-colors, info) !important; } 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/comcol-page-browse-by/comcol-page-browse-by.component.html b/src/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.html index f9ef4e5232..1c73fbb3df 100644 --- a/src/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.html +++ b/src/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.html @@ -1,7 +1,6 @@

{{'browse.comcol.head' | translate}}

diff --git a/src/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.ts b/src/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.ts index 85d40a77e0..dcc7840bb4 100644 --- a/src/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.ts +++ b/src/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.ts @@ -1,4 +1,6 @@ -import { Component, Input } from '@angular/core'; +import { Component, Inject, Input, OnInit } from '@angular/core'; +import { GLOBAL_CONFIG, GlobalConfig } from '../../../config'; +import { BrowseByTypeConfig } from '../../../config/browse-by-type-config.interface'; /** * A component to display the "Browse By" section of a Community or Collection page @@ -8,9 +10,22 @@ import { Component, Input } from '@angular/core'; selector: 'ds-comcol-page-browse-by', templateUrl: './comcol-page-browse-by.component.html', }) -export class ComcolPageBrowseByComponent { +export class ComcolPageBrowseByComponent implements OnInit { /** * The ID of the Community or Collection */ @Input() id: string; + + /** + * List of currently active browse configurations + */ + types: BrowseByTypeConfig[]; + + constructor(@Inject(GLOBAL_CONFIG) public config: GlobalConfig) { + } + + ngOnInit(): void { + this.types = this.config.browseBy.types; + } + } diff --git a/src/app/shared/comcol-page-content/comcol-page-content.component.scss b/src/app/shared/comcol-page-content/comcol-page-content.component.scss index ad84b72f8c..e69de29bb2 100644 --- a/src/app/shared/comcol-page-content/comcol-page-content.component.scss +++ b/src/app/shared/comcol-page-content/comcol-page-content.component.scss @@ -1 +0,0 @@ -@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/shared/comcol-page-header/comcol-page-header.component.scss b/src/app/shared/comcol-page-header/comcol-page-header.component.scss index ad84b72f8c..e69de29bb2 100644 --- a/src/app/shared/comcol-page-header/comcol-page-header.component.scss +++ b/src/app/shared/comcol-page-header/comcol-page-header.component.scss @@ -1 +0,0 @@ -@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/shared/comcol-page-logo/comcol-page-logo.component.scss b/src/app/shared/comcol-page-logo/comcol-page-logo.component.scss index 50be6f5ad0..e69de29bb2 100644 --- a/src/app/shared/comcol-page-logo/comcol-page-logo.component.scss +++ b/src/app/shared/comcol-page-logo/comcol-page-logo.component.scss @@ -1 +0,0 @@ -@import '../../../styles/variables.scss'; 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.html b/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html index 88f4a6f917..1181e097eb 100644 --- a/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html +++ b/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html @@ -5,6 +5,6 @@
-
\ No newline at end of file +
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/lookup/dynamic-lookup.component.scss b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.scss index 3e6536110d..3af258db79 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.scss +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.scss @@ -1,5 +1,3 @@ -@import "../../../../../../../styles/variables"; - .dropdown-toggle::after { display:none } 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/ds-dynamic-form-ui/models/tag/dynamic-tag.component.scss b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.scss index 7d1160f450..a657d3eeb6 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.scss +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.scss @@ -1,5 +1,3 @@ -@import "../../../../../../../styles/variables"; - /* style fa-spin */ .fa-spin { pointer-events: none; diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/typeahead/dynamic-typeahead.component.scss b/src/app/shared/form/builder/ds-dynamic-form-ui/models/typeahead/dynamic-typeahead.component.scss index 7c58c0272f..fe20afe1ce 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/typeahead/dynamic-typeahead.component.scss +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/typeahead/dynamic-typeahead.component.scss @@ -1,5 +1,3 @@ -@import "../../../../../../../styles/variables"; - :host /deep/ .dropdown-menu { width: 100% !important; max-height: $dropdown-menu-max-height; 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/form/form.component.scss b/src/app/shared/form/form.component.scss index 1d5e034290..01cf09576f 100644 --- a/src/app/shared/form/form.component.scss +++ b/src/app/shared/form/form.component.scss @@ -1,5 +1,3 @@ -@import "../../../styles/_variables.scss"; - .ds-form-input-addon { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; diff --git a/src/app/shared/input-suggestions/input-suggestions.component.scss b/src/app/shared/input-suggestions/input-suggestions.component.scss index f2587e1b6f..b04cef2adf 100644 --- a/src/app/shared/input-suggestions/input-suggestions.component.scss +++ b/src/app/shared/input-suggestions/input-suggestions.component.scss @@ -1,5 +1,3 @@ -@import "../../../styles/_variables.scss"; - .autocomplete { width: 100%; .dropdown-item { 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/log-in/log-in.component.scss b/src/app/shared/log-in/log-in.component.scss index 5e4393edaf..0eda382c0a 100644 --- a/src/app/shared/log-in/log-in.component.scss +++ b/src/app/shared/log-in/log-in.component.scss @@ -1,5 +1,3 @@ -@import '../../../styles/variables.scss'; - .form-login .form-control:focus { z-index: 2; } 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-grid/collection-grid-element/collection-grid-element.component.scss b/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.scss index 51a7fc6a55..8b13789179 100644 --- a/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.scss +++ b/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.scss @@ -1,2 +1 @@ -@import '../../../../styles/variables'; diff --git a/src/app/shared/object-grid/community-grid-element/community-grid-element.component.scss b/src/app/shared/object-grid/community-grid-element/community-grid-element.component.scss index 51a7fc6a55..8b13789179 100644 --- a/src/app/shared/object-grid/community-grid-element/community-grid-element.component.scss +++ b/src/app/shared/object-grid/community-grid-element/community-grid-element.component.scss @@ -1,2 +1 @@ -@import '../../../../styles/variables'; diff --git a/src/app/shared/object-grid/grid-thumbnail/grid-thumbnail.component.scss b/src/app/shared/object-grid/grid-thumbnail/grid-thumbnail.component.scss index 45a533cd01..e69de29bb2 100644 --- a/src/app/shared/object-grid/grid-thumbnail/grid-thumbnail.component.scss +++ b/src/app/shared/object-grid/grid-thumbnail/grid-thumbnail.component.scss @@ -1 +0,0 @@ -@import '../../../../styles/variables'; diff --git a/src/app/shared/object-grid/item-grid-element/item-grid-element.component.scss b/src/app/shared/object-grid/item-grid-element/item-grid-element.component.scss index 51a7fc6a55..8b13789179 100644 --- a/src/app/shared/object-grid/item-grid-element/item-grid-element.component.scss +++ b/src/app/shared/object-grid/item-grid-element/item-grid-element.component.scss @@ -1,2 +1 @@ -@import '../../../../styles/variables'; diff --git a/src/app/shared/object-grid/object-grid.component.scss b/src/app/shared/object-grid/object-grid.component.scss index ff78634863..437dfc3b43 100644 --- a/src/app/shared/object-grid/object-grid.component.scss +++ b/src/app/shared/object-grid/object-grid.component.scss @@ -1,6 +1,3 @@ -@import '../../../styles/variables'; -@import '../../../styles/mixins'; - $ds-wrapper-grid-spacing: $spacer/2; ds-wrapper-grid-element ::ng-deep { diff --git a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.scss b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.scss index 1d0786105c..e69de29bb2 100644 --- a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.scss +++ b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.scss @@ -1 +0,0 @@ -@import '../../../../../styles/variables'; diff --git a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.scss b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.scss index bd63aa6a3a..8b13789179 100644 --- a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.scss +++ b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.scss @@ -1,2 +1 @@ -@import '../../../../../styles/variables'; diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.scss b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.scss index e2751279b6..d61f3ccf55 100644 --- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.scss +++ b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.scss @@ -1,5 +1,3 @@ -@import '../../../../../styles/variables'; - .card { a > div { position: relative; diff --git a/src/app/shared/object-grid/search-result-grid-element/search-result-grid-element.component.scss b/src/app/shared/object-grid/search-result-grid-element/search-result-grid-element.component.scss index e8d681fb32..dc9f9b3969 100644 --- a/src/app/shared/object-grid/search-result-grid-element/search-result-grid-element.component.scss +++ b/src/app/shared/object-grid/search-result-grid-element/search-result-grid-element.component.scss @@ -1,4 +1,3 @@ - @import '../../../../styles/variables'; :host { /deep/ em { font-weight: bold; diff --git a/src/app/shared/object-grid/wrapper-grid-element/wrapper-grid-element.component.scss b/src/app/shared/object-grid/wrapper-grid-element/wrapper-grid-element.component.scss index 51a7fc6a55..8b13789179 100644 --- a/src/app/shared/object-grid/wrapper-grid-element/wrapper-grid-element.component.scss +++ b/src/app/shared/object-grid/wrapper-grid-element/wrapper-grid-element.component.scss @@ -1,2 +1 @@ -@import '../../../../styles/variables'; diff --git a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.scss b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.scss index 45a533cd01..e69de29bb2 100644 --- a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.scss +++ b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.scss @@ -1 +0,0 @@ -@import '../../../../styles/variables'; diff --git a/src/app/shared/object-list/collection-list-element/collection-list-element.component.scss b/src/app/shared/object-list/collection-list-element/collection-list-element.component.scss index 45a533cd01..e69de29bb2 100644 --- a/src/app/shared/object-list/collection-list-element/collection-list-element.component.scss +++ b/src/app/shared/object-list/collection-list-element/collection-list-element.component.scss @@ -1 +0,0 @@ -@import '../../../../styles/variables'; diff --git a/src/app/shared/object-list/community-list-element/community-list-element.component.scss b/src/app/shared/object-list/community-list-element/community-list-element.component.scss index 45a533cd01..e69de29bb2 100644 --- a/src/app/shared/object-list/community-list-element/community-list-element.component.scss +++ b/src/app/shared/object-list/community-list-element/community-list-element.component.scss @@ -1 +0,0 @@ -@import '../../../../styles/variables'; diff --git a/src/app/shared/object-list/item-list-element/item-list-element.component.scss b/src/app/shared/object-list/item-list-element/item-list-element.component.scss index 45a533cd01..e69de29bb2 100644 --- a/src/app/shared/object-list/item-list-element/item-list-element.component.scss +++ b/src/app/shared/object-list/item-list-element/item-list-element.component.scss @@ -1 +0,0 @@ -@import '../../../../styles/variables'; 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/orgunit/orgunit-list-element.component.scss b/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-list-element.component.scss deleted file mode 100644 index 5ab410dcb0..0000000000 --- a/src/app/shared/object-list/item-list-element/item-types/orgunit/orgunit-list-element.component.scss +++ /dev/null @@ -1 +0,0 @@ -@import '../../../../../../styles/variables'; diff --git a/src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.scss b/src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.scss deleted file mode 100644 index 5ab410dcb0..0000000000 --- a/src/app/shared/object-list/item-list-element/item-types/person/person-list-element.component.scss +++ /dev/null @@ -1 +0,0 @@ -@import '../../../../../../styles/variables'; diff --git a/src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.html b/src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.html deleted file mode 100644 index 6f0faa90ef..0000000000 --- a/src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.scss b/src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.scss deleted file mode 100644 index 5ab410dcb0..0000000000 --- a/src/app/shared/object-list/item-list-element/item-types/project/project-list-element.component.scss +++ /dev/null @@ -1 +0,0 @@ -@import '../../../../../../styles/variables'; diff --git a/src/app/shared/object-list/item-list-element/item-types/publication/publication-list-element.component.html b/src/app/shared/object-list/item-list-element/item-types/publication/publication-list-element.component.html index aff19aec1d..d467edfb21 100644 --- a/src/app/shared/object-list/item-list-element/item-types/publication/publication-list-element.component.html +++ b/src/app/shared/object-list/item-list-element/item-types/publication/publication-list-element.component.html @@ -12,6 +12,7 @@ class="item-list-authors"> + ; 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/object-list/object-list.component.scss b/src/app/shared/object-list/object-list.component.scss index 3d2af4d023..e69de29bb2 100644 --- a/src/app/shared/object-list/object-list.component.scss +++ b/src/app/shared/object-list/object-list.component.scss @@ -1 +0,0 @@ -@import '../../../styles/variables'; \ No newline at end of file diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.scss b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.scss index 1d0786105c..e69de29bb2 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.scss +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.scss @@ -1 +0,0 @@ -@import '../../../../../styles/variables'; diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.scss b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.scss index 1d0786105c..e69de29bb2 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.scss +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.scss @@ -1 +0,0 @@ -@import '../../../../../styles/variables'; diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.scss b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.scss index 1d0786105c..e69de29bb2 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.scss +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.scss @@ -1 +0,0 @@ -@import '../../../../../styles/variables'; diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.spec.ts index ef4660fdd9..a370d3a632 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.spec.ts @@ -75,7 +75,6 @@ describe('ItemSearchResultListElementComponent', () => { it('should show the relationship type badge', () => { const badge = fixture.debugElement.query(By.css('span.badge')); - console.log(itemSearchResultListElementComponent.dso); expect(badge.nativeElement.textContent).toContain(type.toLowerCase()); }); }); diff --git a/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.scss b/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.scss index 7134c43dad..efc4d3c414 100644 --- a/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.scss +++ b/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.scss @@ -1,4 +1,3 @@ -@import '../../../../styles/variables'; :host { ::ng-deep em { font-weight: bold; diff --git a/src/app/shared/object-list/wrapper-list-element/wrapper-list-element.component.scss b/src/app/shared/object-list/wrapper-list-element/wrapper-list-element.component.scss index 51a7fc6a55..8b13789179 100644 --- a/src/app/shared/object-list/wrapper-list-element/wrapper-list-element.component.scss +++ b/src/app/shared/object-list/wrapper-list-element/wrapper-list-element.component.scss @@ -1,2 +1 @@ -@import '../../../../styles/variables'; diff --git a/src/app/shared/search-form/search-form.component.scss b/src/app/shared/search-form/search-form.component.scss index d5811186e7..64b97aebd8 100644 --- a/src/app/shared/search-form/search-form.component.scss +++ b/src/app/shared/search-form/search-form.component.scss @@ -1,5 +1,3 @@ -@import '../../../styles/variables.scss'; - // temporary fix for bootstrap 4 beta btn color issue .btn-secondary { background-color: $input-bg; 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/search-form/search-form.component.ts b/src/app/shared/search-form/search-form.component.ts index 10c3a3ede7..7414dd70e6 100644 --- a/src/app/shared/search-form/search-form.component.ts +++ b/src/app/shared/search-form/search-form.component.ts @@ -15,6 +15,7 @@ import { SearchService } from '../../+search-page/search-service/search.service' @Component({ selector: 'ds-search-form', styleUrls: ['./search-form.component.scss'], + // templateUrl: './search-form.component.html', templateUrl: './search-form.component.html' }) @@ -45,6 +46,16 @@ export class SearchFormComponent { */ @Input() scopes: DSpaceObject[]; + /** + * Whether or not the search button should be displayed large + */ + @Input() large = false; + + /** + * The brand color of the search button + */ + @Input() brandColor = 'primary'; + constructor(private router: Router, private searchService: SearchService) { } diff --git a/src/app/shared/services/route.actions.ts b/src/app/shared/services/route.actions.ts new file mode 100644 index 0000000000..968319d260 --- /dev/null +++ b/src/app/shared/services/route.actions.ts @@ -0,0 +1,116 @@ +import { Action } from '@ngrx/store'; +import { type } from '../../shared/ngrx/type'; +import { Params } from '@angular/router'; + +/** + * The list of HrefIndexAction type definitions + */ +export const RouteActionTypes = { + SET_QUERY_PARAMETERS: type('dspace/core/route/SET_QUERY_PARAMETERS'), + SET_PARAMETERS: type('dspace/core/route/SET_PARAMETERS'), + ADD_QUERY_PARAMETER: type('dspace/core/route/ADD_QUERY_PARAMETER'), + ADD_PARAMETER: type('dspace/core/route/ADD_PARAMETER'), + RESET: type('dspace/core/route/RESET'), +}; + +/* tslint:disable:max-classes-per-file */ +/** + * An ngrx action to set the query parameters + */ +export class SetQueryParametersAction implements Action { + type = RouteActionTypes.SET_QUERY_PARAMETERS; + payload: Params; + + /** + * Create a new SetQueryParametersAction + * + * @param parameters + * the query parameters + */ + constructor(parameters: Params) { + this.payload = parameters; + } +} + +/** + * An ngrx action to set the parameters + */ +export class SetParametersAction implements Action { + type = RouteActionTypes.SET_PARAMETERS; + payload: Params; + + /** + * Create a new SetParametersAction + * + * @param parameters + * the parameters + */ + constructor(parameters: Params) { + this.payload = parameters; + } +} + +/** + * An ngrx action to add a query parameter + */ +export class AddQueryParameterAction implements Action { + type = RouteActionTypes.ADD_QUERY_PARAMETER; + payload: { + key: string; + value: string; + }; + + /** + * Create a new AddQueryParameterAction + * + * @param key + * the key to add + * @param value + * the value of this key + */ + constructor(key: string, value: string) { + this.payload = { key, value }; + } +} + +/** + * An ngrx action to add a parameter + */ +export class AddParameterAction implements Action { + type = RouteActionTypes.ADD_PARAMETER; + payload: { + key: string; + value: string; + }; + + /** + * Create a new AddParameterAction + * + * @param key + * the key to add + * @param value + * the value of this key + */ + constructor(key: string, value: string) { + this.payload = { key, value }; + } +} + +/** + * An ngrx action to reset the route state + */ +export class ResetRouteStateAction implements Action { + type = RouteActionTypes.RESET; +} + +/* tslint:enable:max-classes-per-file */ + +/** + * A type to encompass all RouteActions + */ +export type RouteActions = + SetQueryParametersAction + | SetParametersAction + | AddQueryParameterAction + | AddParameterAction + | ResetRouteStateAction; diff --git a/src/app/shared/services/route.effects.ts b/src/app/shared/services/route.effects.ts new file mode 100644 index 0000000000..687f8f9921 --- /dev/null +++ b/src/app/shared/services/route.effects.ts @@ -0,0 +1,23 @@ +import { map } from 'rxjs/operators'; +import { Injectable } from '@angular/core'; +import { Actions, Effect, ofType } from '@ngrx/effects' +import * as fromRouter from '@ngrx/router-store'; +import { ResetRouteStateAction } from './route.actions'; + +@Injectable() +export class RouteEffects { + /** + * Effect that resets the route state on reroute + * @type {Observable} + */ + @Effect() routeChange$ = this.actions$ + .pipe( + ofType(fromRouter.ROUTER_NAVIGATION), + map(() => new ResetRouteStateAction()) + ); + + constructor(private actions$: Actions) { + + } + +} diff --git a/src/app/shared/services/route.reducer.ts b/src/app/shared/services/route.reducer.ts new file mode 100644 index 0000000000..b078521c11 --- /dev/null +++ b/src/app/shared/services/route.reducer.ts @@ -0,0 +1,74 @@ +import { Params } from '@angular/router'; +import { + AddParameterAction, + AddQueryParameterAction, + RouteActions, + RouteActionTypes, SetParametersAction, SetQueryParametersAction +} from './route.actions'; + +/** + * Interface to represent the parameter state of a current route in the store + */ +export interface RouteState { + queryParams: Params; + params: Params; +} + +/** + * The initial route state + */ +const initialState: RouteState = { + queryParams: {}, + params: {} +}; + +/** + * Reducer function to save the current route parameters and query parameters in the store + * @param state The current or initial state + * @param action The action to perform on the state + */ +export function routeReducer(state = initialState, action: RouteActions): RouteState { + switch (action.type) { + case RouteActionTypes.RESET: { + return initialState + } + case RouteActionTypes.SET_PARAMETERS: { + return setParameters(state, action as SetParametersAction, 'params'); + } + case RouteActionTypes.SET_QUERY_PARAMETERS: { + return setParameters(state, action as SetQueryParametersAction, 'queryParams'); + } + case RouteActionTypes.ADD_PARAMETER: { + return addParameter(state, action as AddParameterAction, 'params'); + } + case RouteActionTypes.ADD_QUERY_PARAMETER: { + return addParameter(state, action as AddQueryParameterAction, 'queryParams'); + } + default: { + return state; + } + } +} + +/** + * Add a route or query parameter in the store + * @param state The current state + * @param action The add action to perform on the current state + * @param paramType The type of parameter to add: route or query parameter + */ +function addParameter(state: RouteState, action: AddParameterAction | AddQueryParameterAction, paramType: string): RouteState { + const subState = state[paramType]; + const existingValues = subState[action.payload.key] || []; + const newValues = [...existingValues, action.payload.value]; + const newSubstate = Object.assign(subState, { [action.payload.key]: newValues }); + return Object.assign({}, state, { [paramType]: newSubstate }); +} +/** + * Set a route or query parameter in the store + * @param state The current state + * @param action The set action to perform on the current state + * @param paramType The type of parameter to set: route or query parameter + */ +function setParameters(state: RouteState, action: SetParametersAction | SetQueryParametersAction, paramType: string): RouteState { + return Object.assign({}, state, { [paramType]: action.payload }); +} diff --git a/src/app/shared/services/route.service.spec.ts b/src/app/shared/services/route.service.spec.ts index c9b3710ee6..c6003521a7 100644 --- a/src/app/shared/services/route.service.spec.ts +++ b/src/app/shared/services/route.service.spec.ts @@ -42,6 +42,7 @@ describe('RouteService', () => { provide: ActivatedRoute, useValue: { queryParams: observableOf(paramObject), + params: observableOf(paramObject), queryParamMap: observableOf(convertToParamMap(paramObject)) }, }, diff --git a/src/app/shared/services/route.service.ts b/src/app/shared/services/route.service.ts index a94b7e56da..dc626484c1 100644 --- a/src/app/shared/services/route.service.ts +++ b/src/app/shared/services/route.service.ts @@ -1,4 +1,4 @@ -import { distinctUntilChanged, filter, map, mergeMap } from 'rxjs/operators'; +import { distinctUntilChanged, filter, map, tap } from 'rxjs/operators'; import { Injectable } from '@angular/core'; import { ActivatedRoute, @@ -8,24 +8,67 @@ import { RouterStateSnapshot, } from '@angular/router'; -import { Observable } from 'rxjs'; -import { select, Store } from '@ngrx/store'; +import { combineLatest, Observable } from 'rxjs'; +import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store'; import { isEqual } from 'lodash'; -import { AppState } from '../../app.reducer'; import { AddUrlToHistoryAction } from '../history/history.actions'; import { historySelector } from '../history/selectors'; +import { SetParametersAction, SetQueryParametersAction } from './route.actions'; +import { CoreState } from '../../core/core.reducers'; +import { hasValue } from '../empty.util'; +import { coreSelector } from '../../core/core.selectors'; + +/** + * Selector to select all route parameters from the store + */ +export const routeParametersSelector = createSelector( + coreSelector, + (state: CoreState) => state.route.params +); + +/** + * Selector to select all query parameters from the store + */ +export const queryParametersSelector = createSelector( + coreSelector, + (state: CoreState) => state.route.queryParams +); + +/** + * Selector to select a specific route parameter from the store + * @param key The key of the parameter + */ +export const routeParameterSelector = (key: string) => parameterSelector(key, routeParametersSelector); + +/** + * Selector to select a specific query parameter from the store + * @param key The key of the parameter + */ +export const queryParameterSelector = (key: string) => parameterSelector(key, queryParametersSelector); + +/** + * Function to select a specific parameter from the store + * @param key The key to look for + * @param paramsSelector The selector that selects the parameters to search in + */ +export function parameterSelector(key: string, paramsSelector: (state: CoreState) => Params): MemoizedSelector { + return createSelector(paramsSelector, (state: Params) => { + if (hasValue(state)) { + return state[key]; + } else { + return undefined; + } + }); +} /** * Service to keep track of the current query parameters */ @Injectable() export class RouteService { - params: Observable; - - constructor(private route: ActivatedRoute, private router: Router, private store: Store) { - this.subscribeToRouterParams(); - + constructor(private route: ActivatedRoute, private router: Router, private store: Store) { + this.saveRouting(); } /** @@ -74,11 +117,11 @@ export class RouteService { } getRouteParameterValue(paramName: string): Observable { - return this.params.pipe(map((params) => params[paramName]),distinctUntilChanged(),); + return this.store.pipe(select(routeParameterSelector(paramName))); } getRouteDataValue(datafield: string): Observable { - return this.route.data.pipe(map((data) => data[datafield]),distinctUntilChanged(),); + return this.route.data.pipe(map((data) => data[datafield]), distinctUntilChanged(),); } /** @@ -114,23 +157,21 @@ export class RouteService { } public saveRouting(): void { - this.router.events - .pipe(filter((event) => event instanceof NavigationEnd)) - .subscribe(({ urlAfterRedirects }: NavigationEnd) => { - this.store.dispatch(new AddUrlToHistoryAction(urlAfterRedirects)) + combineLatest(this.router.events, this.getRouteParams(), this.route.queryParams) + .pipe(filter(([event, params, queryParams]) => event instanceof NavigationEnd)) + .subscribe(([event, params, queryParams]: [NavigationEnd, Params, Params]) => { + this.store.dispatch(new SetParametersAction(params)); + this.store.dispatch(new SetQueryParametersAction(queryParams)); + this.store.dispatch(new AddUrlToHistoryAction(event.urlAfterRedirects)); }); } - subscribeToRouterParams() { - this.params = this.router.events.pipe( - mergeMap((event) => { - let active = this.route; - while (active.firstChild) { - active = active.firstChild; - } - return active.params; - }) - ); + private getRouteParams(): Observable { + let active = this.route; + while (active.firstChild) { + active = active.firstChild; + } + return active.params; } public getHistory(): Observable { diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 9306ea817f..d721856a91 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -10,15 +10,8 @@ import { TranslateModule } from '@ngx-translate/core'; import { NgxPaginationModule } from 'ngx-pagination'; import { ItemTypeSwitcherComponent } from './items/switcher/item-type-switcher.component'; -import { OrgUnitMetadataListElementComponent } from './object-list/item-list-element/item-types/orgunit/orgunit-metadata-list-element.component'; import { TypedItemSearchResultListElementComponent } from './object-list/item-list-element/item-types/typed-item-search-result-list-element.component'; import { PublicationListElementComponent } from './object-list/item-list-element/item-types/publication/publication-list-element.component'; -import { OrgUnitListElementComponent } from './object-list/item-list-element/item-types/orgunit/orgunit-list-element.component'; -import { PersonListElementComponent } from './object-list/item-list-element/item-types/person/person-list-element.component'; -import { ProjectListElementComponent } from './object-list/item-list-element/item-types/project/project-list-element.component'; -import { JournalListElementComponent } from './object-list/item-list-element/item-types/journal/journal-list-element.component'; -import { JournalVolumeListElementComponent } from './object-list/item-list-element/item-types/journal-volume/journal-volume-list-element.component'; -import { JournalIssueListElementComponent } from './object-list/item-list-element/item-types/journal-issue/journal-issue-list-element.component'; import { FileUploadModule } from 'ng2-file-upload'; @@ -117,7 +110,6 @@ import { LangSwitchComponent } from './lang-switch/lang-switch.component'; import { PlainTextMetadataListElementComponent } from './object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component'; import { ItemMetadataListElementComponent } from './object-list/metadata-representation-list-element/item/item-metadata-list-element.component'; import { TooltipModule } from 'ngx-bootstrap'; -import { PersonMetadataListElementComponent } from './object-list/item-list-element/item-types/person/person-metadata-list-element.component'; import { MetadataRepresentationListElementComponent } from './object-list/metadata-representation-list-element/metadata-representation-list-element.component'; import { ComColFormComponent } from './comcol-forms/comcol-form/comcol-form.component'; import { CreateComColPageComponent } from './comcol-forms/create-comcol-page/create-comcol-page.component'; @@ -287,14 +279,6 @@ const ENTRY_COMPONENTS = [ CommunityGridElementComponent, SearchResultGridElementComponent, PublicationListElementComponent, - PersonListElementComponent, - PersonMetadataListElementComponent, - OrgUnitMetadataListElementComponent, - OrgUnitListElementComponent, - ProjectListElementComponent, - JournalListElementComponent, - JournalVolumeListElementComponent, - JournalIssueListElementComponent, BrowseEntryListElementComponent, MyDSpaceResultDetailElementComponent, SearchResultGridElementComponent, diff --git a/src/app/shared/starts-with/date/starts-with-date.component.scss b/src/app/shared/starts-with/date/starts-with-date.component.scss index ceec56c8c2..64b97aebd8 100644 --- a/src/app/shared/starts-with/date/starts-with-date.component.scss +++ b/src/app/shared/starts-with/date/starts-with-date.component.scss @@ -1,5 +1,3 @@ -@import '../../../../styles/variables.scss'; - // temporary fix for bootstrap 4 beta btn color issue .btn-secondary { background-color: $input-bg; diff --git a/src/app/shared/starts-with/text/starts-with-text.component.scss b/src/app/shared/starts-with/text/starts-with-text.component.scss index ceec56c8c2..64b97aebd8 100644 --- a/src/app/shared/starts-with/text/starts-with-text.component.scss +++ b/src/app/shared/starts-with/text/starts-with-text.component.scss @@ -1,5 +1,3 @@ -@import '../../../../styles/variables.scss'; - // temporary fix for bootstrap 4 beta btn color issue .btn-secondary { background-color: $input-bg; 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/shared/truncatable/truncatable-part/truncatable-part.component.scss b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.scss index 133328fec1..68b6772465 100644 --- a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.scss +++ b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.scss @@ -1,6 +1,3 @@ -@import '../../../../styles/variables'; -@import '../../../../styles/mixins'; - @mixin clamp($lines, $size-factor: 1, $line-height: $line-height-base) { $height: $line-height * $font-size-base * $size-factor; &.fixedHeight { diff --git a/src/app/shared/uploader/uploader.component.scss b/src/app/shared/uploader/uploader.component.scss index 370c3ea280..8835b87b1e 100644 --- a/src/app/shared/uploader/uploader.component.scss +++ b/src/app/shared/uploader/uploader.component.scss @@ -1,5 +1,3 @@ -@import '../../../styles/_variables.scss'; - .ds-base-drop-zone { border: 2px dashed $gray-600; } diff --git a/src/app/shared/view-mode-switch/view-mode-switch.component.scss b/src/app/shared/view-mode-switch/view-mode-switch.component.scss index ad84b72f8c..e69de29bb2 100644 --- a/src/app/shared/view-mode-switch/view-mode-switch.component.scss +++ b/src/app/shared/view-mode-switch/view-mode-switch.component.scss @@ -1 +0,0 @@ -@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/submission/edit/submission-edit.component.spec.ts b/src/app/submission/edit/submission-edit.component.spec.ts index 5c9a247aa2..115016d2fe 100644 --- a/src/app/submission/edit/submission-edit.component.spec.ts +++ b/src/app/submission/edit/submission-edit.component.spec.ts @@ -16,7 +16,7 @@ import { getMockTranslateService } from '../../shared/mocks/mock-translate.servi import { RouterStub } from '../../shared/testing/router-stub'; import { ActivatedRouteStub } from '../../shared/testing/active-router-stub'; import { mockSubmissionObject } from '../../shared/mocks/mock-submission'; -import { RemoteData } from '../../core/data/remote-data'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; describe('SubmissionEditComponent Component', () => { @@ -66,14 +66,9 @@ describe('SubmissionEditComponent Component', () => { it('should init properly when a valid SubmissionObject has been retrieved', fakeAsync(() => { route.testParams = { id: submissionId }; - submissionServiceStub.retrieveSubmission.and.returnValue(observableOf( - new RemoteData( - false, - false, - true, - null, - submissionObject) - )); + submissionServiceStub.retrieveSubmission.and.returnValue( + createSuccessfulRemoteDataObject$(submissionObject) + ); fixture.detectChanges(); @@ -88,14 +83,8 @@ describe('SubmissionEditComponent Component', () => { it('should redirect to mydspace when an empty SubmissionObject has been retrieved', fakeAsync(() => { route.testParams = { id: submissionId }; - submissionServiceStub.retrieveSubmission.and.returnValue(observableOf( - new RemoteData( - false, - false, - true, - null, - {}) - )); + submissionServiceStub.retrieveSubmission.and.returnValue(createSuccessfulRemoteDataObject$({}) + ); fixture.detectChanges(); diff --git a/src/app/submission/form/collection/submission-form-collection.component.html b/src/app/submission/form/collection/submission-form-collection.component.html index 6547a3cc3c..37ada35155 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.html +++ b/src/app/submission/form/collection/submission-form-collection.component.html @@ -38,7 +38,7 @@ title="{{ listItem.collection.name }}" (click)="onSelect(listItem)">
    -
  • +
  • {{ item.name}}
  • {{ listItem.collection.name}}
  • diff --git a/src/app/submission/form/collection/submission-form-collection.component.scss b/src/app/submission/form/collection/submission-form-collection.component.scss index f91f85677d..deecc39510 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.scss +++ b/src/app/submission/form/collection/submission-form-collection.component.scss @@ -1,5 +1,3 @@ -@import '../../../../styles/variables'; - .scrollable-menu { height: auto; max-height: $dropdown-menu-max-height; diff --git a/src/app/submission/form/collection/submission-form-collection.component.spec.ts b/src/app/submission/form/collection/submission-form-collection.component.spec.ts index 679500a670..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 @@ -1,4 +1,10 @@ -import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, DebugElement, SimpleChange } from '@angular/core'; +import { + ChangeDetectorRef, + Component, + CUSTOM_ELEMENTS_SCHEMA, + DebugElement, + SimpleChange +} from '@angular/core'; import { async, ComponentFixture, fakeAsync, inject, TestBed, tick } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @@ -10,7 +16,10 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; import { SubmissionServiceStub } from '../../../shared/testing/submission-service-stub'; -import { mockSubmissionId, mockSubmissionRestResponse } from '../../../shared/mocks/mock-submission'; +import { + mockSubmissionId, + mockSubmissionRestResponse +} from '../../../shared/mocks/mock-submission'; import { SubmissionService } from '../../submission.service'; import { SubmissionFormCollectionComponent } from './submission-form-collection.component'; import { CommunityDataService } from '../../../core/data/community-data.service'; @@ -18,35 +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'; - -const subcommunities = [Object.assign(new Community(), { - name: 'SubCommunity 1', - id: '123456789-1', - metadata: [ - { - key: 'dc.title', - language: 'en_US', - value: 'SubCommunity 1' - }] -}), - Object.assign(new Community(), { - name: 'SubCommunity 1', - id: '123456789s-1', - metadata: [ - { - key: 'dc.title', - language: 'en_US', - value: 'SubCommunity 1' - }] - }) -]; +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', @@ -92,45 +82,20 @@ const mockCommunity2Collection2 = Object.assign(new Collection(), { }] }); -const mockCommunity = Object.assign(new Community(), { - name: 'Community 1', - id: '123456789-1', - metadata: [ - { - key: 'dc.title', - language: 'en_US', - value: 'Community 1' - }], - collections: observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), [mockCommunity1Collection1, mockCommunity1Collection2]))), - subcommunities: observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), subcommunities))), -}); - -const mockCommunity2 = Object.assign(new Community(), { - name: 'Community 2', - id: '123456789-2', - metadata: [ - { - key: 'dc.title', - language: 'en_US', - value: 'Community 2' - }], - collections: observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), [mockCommunity2Collection1, mockCommunity2Collection2]))), - subcommunities: observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), []))), -}); - -const mockCommunityList = observableOf(new RemoteData(true, true, true, - undefined, new PaginatedList(new PageInfo(), [mockCommunity, mockCommunity2]))); +const collectionResults = [mockCommunity1Collection1, mockCommunity1Collection2, mockCommunity2Collection1, mockCommunity2Collection2].map((collection: Collection) => Object.assign(new SearchResult(), { indexableObject: collection })); +const searchService = { + search: () => { + return observableOf(new RemoteData(true, true, true, + undefined, new PaginatedList(new PageInfo(), collectionResults))) + } +}; const mockCollectionList = [ { communities: [ { - id: '123456789-1', - name: 'Community 1' + id: 'c0e4de93-f506-4990-a840-d406f6f2ada7', + name: 'Submission test' } ], collection: { @@ -141,8 +106,8 @@ const mockCollectionList = [ { communities: [ { - id: '123456789-1', - name: 'Community 1' + id: 'c0e4de93-f506-4990-a840-d406f6f2ada7', + name: 'Submission test' } ], collection: { @@ -153,8 +118,8 @@ const mockCollectionList = [ { communities: [ { - id: '123456789-2', - name: 'Community 2' + id: 'c0e4de93-f506-4990-a840-d406f6f2ada7', + name: 'Submission test' } ], collection: { @@ -165,8 +130,8 @@ const mockCollectionList = [ { communities: [ { - id: '123456789-2', - name: 'Community 2' + id: 'c0e4de93-f506-4990-a840-d406f6f2ada7', + name: 'Submission test' } ], collection: { @@ -214,11 +179,15 @@ describe('SubmissionFormCollectionComponent Component', () => { TestComponent ], providers: [ - { provide: SubmissionJsonPatchOperationsService, useClass: SubmissionJsonPatchOperationsServiceStub }, + { + provide: SubmissionJsonPatchOperationsService, + useClass: SubmissionJsonPatchOperationsServiceStub + }, { provide: SubmissionService, useClass: SubmissionServiceStub }, { provide: CommunityDataService, useValue: communityDataService }, { provide: JsonPatchOperationsBuilder, useValue: jsonPatchOpBuilder }, { provide: Store, useValue: store }, + { provide: SearchService, useValue: searchService }, ChangeDetectorRef, SubmissionFormCollectionComponent ], @@ -283,14 +252,11 @@ describe('SubmissionFormCollectionComponent Component', () => { }); it('should init collection list properly', () => { - communityDataService.findAll.and.returnValue(mockCommunityList); - comp.ngOnChanges({ currentCollectionId: new SimpleChange(null, collectionId, true) }); - expect(comp.searchListCollection$).toBeObservable(cold('(ab)', { - a: [], + expect(comp.searchListCollection$).toBeObservable(cold('(b)', { b: mockCollectionList })); @@ -428,6 +394,8 @@ class TestComponent { definitionId = 'traditional'; submissionId = mockSubmissionId; - onCollectionChange = () => { return; } + onCollectionChange = () => { + return; + } } diff --git a/src/app/submission/form/collection/submission-form-collection.component.ts b/src/app/submission/form/collection/submission-form-collection.component.ts index 2fe424bd3f..e9832985fe 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.ts @@ -17,16 +17,13 @@ import { distinctUntilChanged, filter, find, - flatMap, map, mergeMap, - reduce, startWith } from 'rxjs/operators'; import { Collection } from '../../../core/shared/collection.model'; import { CommunityDataService } from '../../../core/data/community-data.service'; -import { Community } from '../../../core/shared/community.model'; import { hasValue, isEmpty, isNotEmpty } from '../../../shared/empty.util'; import { RemoteData } from '../../../core/data/remote-data'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; @@ -35,6 +32,12 @@ import { PaginatedList } from '../../../core/data/paginated-list'; import { SubmissionService } from '../../submission.service'; import { SubmissionObject } from '../../../core/submission/models/submission-object.model'; import { SubmissionJsonPatchOperationsService } from '../../../core/submission/submission-json-patch-operations.service'; +import { SearchService } from '../../../+search-page/search-service/search.service'; +import { PaginatedSearchOptions } from '../../../+search-page/paginated-search-options.model'; +import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; +import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model'; +import { getSucceededRemoteData } from '../../../core/shared/operators'; +import { SearchResult } from '../../../+search-page/search-result.model'; /** * An interface to represent a collection entry @@ -148,12 +151,14 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit { * @param {JsonPatchOperationsBuilder} operationsBuilder * @param {SubmissionJsonPatchOperationsService} operationsService * @param {SubmissionService} submissionService + * @param {SearchService} searchService */ constructor(protected cdr: ChangeDetectorRef, private communityDataService: CommunityDataService, private operationsBuilder: JsonPatchOperationsBuilder, private operationsService: SubmissionJsonPatchOperationsService, - private submissionService: SubmissionService) { + private submissionService: SubmissionService, + private searchService: SearchService) { } /** @@ -190,38 +195,39 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit { && hasValue(changes.currentCollectionId.currentValue)) { this.selectedCollectionId = this.currentCollectionId; - // @TODO replace with search/top browse endpoint - // @TODO implement community/subcommunity hierarchy - const communities$ = this.communityDataService.findAll().pipe( - find((communities: RemoteData>) => isNotEmpty(communities.payload)), - mergeMap((communities: RemoteData>) => communities.payload.page)); + // // @TODO replace with search/top browse endpoint + // // @TODO implement community/subcommunity hierarchy + // const communities$ = this.communityDataService.findAll().pipe( + // find((communities: RemoteData>) => isNotEmpty(communities.payload)), + // mergeMap((communities: RemoteData>) => communities.payload.page)); - const listCollection$ = communities$.pipe( - flatMap((communityData: Community) => { - return communityData.collections.pipe( - find((collections: RemoteData>) => !collections.isResponsePending && collections.hasSucceeded), - mergeMap((collections: RemoteData>) => collections.payload.page), - filter((collectionData: Collection) => isNotEmpty(collectionData)), - map((collectionData: Collection) => ({ - communities: [{ id: communityData.id, name: communityData.name }], - collection: { id: collectionData.id, name: collectionData.name } - })) - ); - }), - reduce((acc: any, value: any) => [...acc, ...value], []), - startWith([]) + const listCollection$: Observable = this.searchService.search( + new PaginatedSearchOptions({ + dsoType: DSpaceObjectType.COLLECTION, + pagination: new PaginationComponentOptions(), + scope: 'c0e4de93-f506-4990-a840-d406f6f2ada7' + }) + ).pipe( + getSucceededRemoteData(), + map((collections: RemoteData>>) => collections.payload.page), + filter((collectionData: Array>) => isNotEmpty(collectionData)), + map((collectionData: Array>) => { + return collectionData.map((collection: SearchResult) => { + return { + communities: [{ + id: 'c0e4de93-f506-4990-a840-d406f6f2ada7', + name: 'Submission test' + }], + collection: { id: collection.indexableObject.id, name: collection.indexableObject.name } + } + }) + }) ); - this.selectedCollectionName$ = communities$.pipe( - flatMap((communityData: Community) => { - return communityData.collections.pipe( - find((collections: RemoteData>) => !collections.isResponsePending && collections.hasSucceeded), - mergeMap((collections: RemoteData>) => collections.payload.page), - filter((collectionData: Collection) => isNotEmpty(collectionData)), - filter((collectionData: Collection) => collectionData.id === this.selectedCollectionId), - map((collectionData: Collection) => collectionData.name) - ); - }), + this.selectedCollectionName$ = listCollection$.pipe( + map((collectionData: CollectionListEntry[]) => collectionData.find((entry: CollectionListEntry) => entry.collection.id === this.selectedCollectionId)), + filter((entry: CollectionListEntry) => hasValue(entry.collection)), + map((entry: CollectionListEntry) => entry.collection.name), startWith('') ); @@ -237,7 +243,7 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit { if (isEmpty(searchTerm)) { return listCollection; } else { - return listCollection.filter((v) => v.collection.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1).slice(0, 5) + return listCollection.filter((v) => v.collection.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1).slice(0, 5); } })); } diff --git a/src/app/submission/form/section-add/submission-form-section-add.component.scss b/src/app/submission/form/section-add/submission-form-section-add.component.scss index 628f0f5633..c8fd2073d1 100644 --- a/src/app/submission/form/section-add/submission-form-section-add.component.scss +++ b/src/app/submission/form/section-add/submission-form-section-add.component.scss @@ -1,5 +1,3 @@ -@import '../../../../styles/variables'; - .dropdown-toggle::after { display:none } diff --git a/src/app/submission/form/submission-form.component.scss b/src/app/submission/form/submission-form.component.scss index c9b6872146..44551162cc 100644 --- a/src/app/submission/form/submission-form.component.scss +++ b/src/app/submission/form/submission-form.component.scss @@ -1,5 +1,3 @@ -@import '../../../styles/variables'; - .submission-form-header { background-color: rgba($white, .97); padding: ($spacer / 2) 0 ($spacer / 2) 0; 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/container/section-container.component.scss b/src/app/submission/sections/container/section-container.component.scss index 2e17794e42..3917280f8c 100644 --- a/src/app/submission/sections/container/section-container.component.scss +++ b/src/app/submission/sections/container/section-container.component.scss @@ -1,5 +1,3 @@ -@import '../../../../styles/variables'; - :host /deep/ .card { margin-bottom: $submission-sections-margin-bottom; overflow: unset; 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/file/section-upload-file.component.scss b/src/app/submission/sections/upload/file/section-upload-file.component.scss index ce67ef98df..7596652dc2 100644 --- a/src/app/submission/sections/upload/file/section-upload-file.component.scss +++ b/src/app/submission/sections/upload/file/section-upload-file.component.scss @@ -1,5 +1,3 @@ -@import '../../../../../styles/variables'; - .sticky-buttons { position: sticky; top: $dropdown-item-padding-x * 3; diff --git a/src/app/submission/sections/upload/section-upload.component.spec.ts b/src/app/submission/sections/upload/section-upload.component.spec.ts index be8f096964..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'; @@ -30,6 +30,7 @@ import { GroupEpersonService } from '../../../core/eperson/group-eperson.service import { cold, hot } from 'jasmine-marbles'; import { Collection } from '../../../core/shared/collection.model'; import { ResourcePolicy } from '../../../core/shared/resource-policy.model'; +import { ResourcePolicyService } from '../../../core/data/resource-policy.service'; import { RemoteData } from '../../../core/data/remote-data'; import { ConfigData } from '../../../core/config/config-data'; import { PageInfo } from '../../../core/shared/page-info.model'; @@ -47,8 +48,7 @@ function getMockSubmissionUploadsConfigService(): SubmissionFormsConfigService { function getMockCollectionDataService(): CollectionDataService { return jasmine.createSpyObj('CollectionDataService', { - findById: jasmine.createSpy('findById'), - findByHref: jasmine.createSpy('findByHref') + findById: jasmine.createSpy('findById') }); } @@ -59,6 +59,12 @@ function getMockGroupEpersonService(): GroupEpersonService { }); } +function getMockResourcePolicyService(): ResourcePolicyService { + return jasmine.createSpyObj('ResourcePolicyService', { + findByHref: jasmine.createSpy('findByHref') + }); +} + const sectionObject: SectionDataObject = { config: 'https://dspace7.4science.it/or2018/api/config/submissionforms/upload', mandatory: true, @@ -80,6 +86,7 @@ describe('SubmissionSectionUploadComponent test suite', () => { let sectionsServiceStub: SectionsServiceStub; let collectionDataService: any; let groupService: any; + let resourcePolicyService: any; let uploadsConfigService: any; let bitstreamService: any; @@ -120,6 +127,7 @@ describe('SubmissionSectionUploadComponent test suite', () => { providers: [ { provide: CollectionDataService, useValue: getMockCollectionDataService() }, { provide: GroupEpersonService, useValue: getMockGroupEpersonService() }, + { provide: ResourcePolicyService, useValue: getMockResourcePolicyService() }, { provide: SubmissionUploadsConfigService, useValue: getMockSubmissionUploadsConfigService() }, { provide: SectionsService, useClass: SectionsServiceStub }, { provide: SubmissionService, useClass: SubmissionServiceStub }, @@ -166,6 +174,7 @@ describe('SubmissionSectionUploadComponent test suite', () => { sectionsServiceStub = TestBed.get(SectionsService); collectionDataService = TestBed.get(CollectionDataService); groupService = TestBed.get(GroupEpersonService); + resourcePolicyService = TestBed.get(ResourcePolicyService); uploadsConfigService = TestBed.get(SubmissionUploadsConfigService); bitstreamService = TestBed.get(SectionUploadService); }); @@ -180,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)); - collectionDataService.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([])); @@ -226,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)); - collectionDataService.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/sections/upload/section-upload.component.ts b/src/app/submission/sections/upload/section-upload.component.ts index 3a79a670ad..826385af45 100644 --- a/src/app/submission/sections/upload/section-upload.component.ts +++ b/src/app/submission/sections/upload/section-upload.component.ts @@ -8,6 +8,7 @@ import { hasValue, isNotEmpty, isNotUndefined, isUndefined } from '../../../shar import { SectionUploadService } from './section-upload.service'; import { CollectionDataService } from '../../../core/data/collection-data.service'; import { GroupEpersonService } from '../../../core/eperson/group-eperson.service'; +import { ResourcePolicyService } from '../../../core/data/resource-policy.service'; import { SubmissionUploadsConfigService } from '../../../core/config/submission-uploads-config.service'; import { SubmissionUploadsModel } from '../../../core/config/models/config-submission-uploads.model'; import { SubmissionFormsModel } from '../../../core/config/models/config-submission-forms.model'; @@ -116,6 +117,7 @@ export class SubmissionSectionUploadComponent extends SectionModelComponent { * @param {ChangeDetectorRef} changeDetectorRef * @param {CollectionDataService} collectionDataService * @param {GroupEpersonService} groupService + * @param {ResourcePolicyService} resourcePolicyService * @param {SectionsService} sectionService * @param {SubmissionService} submissionService * @param {SubmissionUploadsConfigService} uploadsConfigService @@ -126,6 +128,7 @@ export class SubmissionSectionUploadComponent extends SectionModelComponent { private changeDetectorRef: ChangeDetectorRef, private collectionDataService: CollectionDataService, private groupService: GroupEpersonService, + private resourcePolicyService: ResourcePolicyService, protected sectionService: SectionsService, private submissionService: SubmissionService, private uploadsConfigService: SubmissionUploadsConfigService, @@ -155,7 +158,7 @@ export class SubmissionSectionUploadComponent extends SectionModelComponent { find((rd: RemoteData) => isNotUndefined((rd.payload))), tap((collectionRemoteData: RemoteData) => this.collectionName = collectionRemoteData.payload.name), flatMap((collectionRemoteData: RemoteData) => { - return this.collectionDataService.findByHref( + return this.resourcePolicyService.findByHref( (collectionRemoteData.payload as any)._links.defaultAccessConditions ); }), 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/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index 9700e01821..e31e907b47 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -20,7 +20,7 @@ export class ThumbnailComponent implements OnInit { /** * The default 'holder.js' image */ - @Input() defaultImage? = 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2293%22%20height%3D%22120%22%20viewBox%3D%220%200%2093%20120%22%20preserveAspectRatio%3D%22none%22%3E%3C!--%0ASource%20URL%3A%20holder.js%2F93x120%3Ftext%3DNo%20Thumbnail%0ACreated%20with%20Holder.js%202.8.2.%0ALearn%20more%20at%20http%3A%2F%2Fholderjs.com%0A(c)%202012-2015%20Ivan%20Malopinsky%20-%20http%3A%2F%2Fimsky.co%0A--%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%3C!%5BCDATA%5B%23holder_1543e460b05%20text%20%7B%20fill%3A%23AAAAAA%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A10pt%20%7D%20%5D%5D%3E%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_1543e460b05%22%3E%3Crect%20width%3D%2293%22%20height%3D%22120%22%20fill%3D%22%23EEEEEE%22%2F%3E%3Cg%3E%3Ctext%20x%3D%2235.6171875%22%20y%3D%2257%22%3ENo%3C%2Ftext%3E%3Ctext%20x%3D%2210.8125%22%20y%3D%2272%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E'; + @Input() defaultImage? = 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2293%22%20height%3D%22120%22%20viewBox%3D%220%200%2093%20120%22%20preserveAspectRatio%3D%22none%22%3E%3C!--%0ASource%20URL%3A%20holder.js%2F93x120%3Ftext%3DNo%20Thumbnail%0ACreated%20with%20Holder.js%202.8.2.%0ALearn%20more%20at%20http%3A%2F%2Fholderjs.com%0A(c)%202012-2015%20Ivan%20Malopinsky%20-%20http%3A%2F%2Fimsky.co%0A--%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%3C!%5BCDATA%5B%23holder_1543e460b05%20text%20%7B%20fill%3A%23AAAAAA%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A10pt%20%7D%20%5D%5D%3E%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_1543e460b05%22%3E%3Crect%20width%3D%2293%22%20height%3D%22120%22%20fill%3D%22%23FFFFFF%22%2F%3E%3Cg%3E%3Ctext%20x%3D%2235.6171875%22%20y%3D%2257%22%3ENo%3C%2Ftext%3E%3Ctext%20x%3D%2210.8125%22%20y%3D%2272%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E'; src: string; errorHandler(event) { diff --git a/src/config.js b/src/config.js new file mode 100644 index 0000000000..269277643c --- /dev/null +++ b/src/config.js @@ -0,0 +1,150 @@ +const path = require('path'); + +let production = false; + +let mergedConfig; + +let envConfigOverride; + +let envConfigFile; + +__webpack + +// check process.env.NODE_ENV to determine which environment config to use +// process.env.NODE_ENV is defined by webpack, else assume development +switch (process.env.NODE_ENV) { + case 'prod': + case 'production': + // webpack.prod.dspace-angular-config.ts defines process.env.NODE_ENV = 'production' + envConfigFile = './environment.prod.js'; + production = true; + break; + case 'test': + // webpack.test.dspace-angular-config.ts defines process.env.NODE_ENV = 'test' + envConfigFile = './environment.test.js'; + break; + default: + // if not using webpack.prod.dspace-angular-config.ts or webpack.test.dspace-angular-config.ts, it must be development + envConfigFile = './environment.dev.js'; +} + +try { + mergedConfig = require(path.resolve(__dirname, '..', 'config', 'environment.default.js')); +} catch (e) { + console.log('e', e); + throw new Error('Cannot find file config/environment.default.js'); +} + +// if envConfigFile set try to get configs +if (envConfigFile) { + try { + envConfigOverride = require(path.resolve(__dirname, '..', 'config', envConfigFile)); + } catch (e) { + console.log('e', e); + console.warn('Cannot find file ' + envConfigFile.substring(2, envConfigFile.length), 'Using default environment'); + } + try { + merge(envConfigOverride); + } catch (e) { + console.warn('Unable to merge the default environment'); + } +} + +// allow to override a few important options by environment variables +function createServerConfig(host, port, nameSpace, ssl) { + const result = { host, nameSpace }; + + if (port !== null && port !== undefined) { + result.port = port * 1; + } + + if (ssl !== null && ssl !== undefined) { + result.ssl = ssl.trim().match(/^(true|1|yes)$/i) ? true : false; + } + + return result; +} + +const processEnv = { + ui: createServerConfig( + process.env.DSPACE_HOST, + process.env.DSPACE_PORT, + process.env.DSPACE_NAMESPACE, + process.env.DSPACE_SSL), + rest: createServerConfig( + process.env.DSPACE_REST_HOST, + process.env.DSPACE_REST_PORT, + process.env.DSPACE_REST_NAMESPACE, + process.env.DSPACE_REST_SSL) +}; + +// merge the environment variables with our configuration. +try { + merge(processEnv) +} catch (e) { + console.warn('Unable to merge environment variable into the configuration') +} + +buildBaseUrls(); + +// set config for whether running in production +mergedConfig.production = production; + +function merge(config) { + innerMerge(mergedConfig, config); +} + +function innerMerge(globalConfig, config) { + for (const key in config) { + if (config.hasOwnProperty(key)) { + if (isObject(config[key])) { + innerMerge(globalConfig[key], config[key]); + } else { + if (isDefined(config[key])) { + globalConfig[key] = config[key]; + } + } + } + } +} + +function buildBaseUrls() { + for (const key in mergedConfig) { + if (mergedConfig.hasOwnProperty(key) && mergedConfig[key].host) { + mergedConfig[key].baseUrl = [ + getProtocol(mergedConfig[key].ssl), + getHost(mergedConfig[key].host), + getPort(mergedConfig[key].port), + getNameSpace(mergedConfig[key].nameSpace) + ].join(''); + } + } +} + +function getProtocol(ssl) { + return ssl ? 'https://' : 'http://'; +} + +function getHost(host) { + return host; +} + +function getPort(port) { + return port ? (port !== 80 && port !== 443) ? ':' + port : '' : ''; +} + +function getNameSpace(nameSpace) { + return nameSpace ? nameSpace.charAt(0) === '/' ? nameSpace : '/' + nameSpace : ''; +} + +function isDefined(value) { + return typeof value !== 'undefined' && value !== null; +} + +function isObject(item) { + return item && typeof item === 'object' && !Array.isArray(item); +} + +module.exports = { + mergedConfig: mergedConfig +}; diff --git a/src/config/browse-by-config.interface.ts b/src/config/browse-by-config.interface.ts index 6adba66b92..719e127b4b 100644 --- a/src/config/browse-by-config.interface.ts +++ b/src/config/browse-by-config.interface.ts @@ -1,4 +1,5 @@ import { Config } from './config.interface'; +import { BrowseByTypeConfig } from './browse-by-type-config.interface'; /** * Config that determines how the dropdown list of years are created for browse-by-date components @@ -18,4 +19,9 @@ export interface BrowseByConfig extends Config { * The absolute lowest year to display in the dropdown when no lowest date can be found for all items */ defaultLowerLimit: number; + + /** + * A list of all the active Browse-By pages + */ + types: BrowseByTypeConfig[]; } diff --git a/src/config/browse-by-type-config.interface.ts b/src/config/browse-by-type-config.interface.ts new file mode 100644 index 0000000000..97d3acbe25 --- /dev/null +++ b/src/config/browse-by-type-config.interface.ts @@ -0,0 +1,23 @@ +import { Config } from './config.interface'; +import { BrowseByType } from '../app/+browse-by/+browse-by-switcher/browse-by-decorator'; + +/** + * Config used for rendering Browse-By pages and links + */ +export interface BrowseByTypeConfig extends Config { + /** + * The browse id used for fetching browse data from the rest api + * e.g. author + */ + id: string; + + /** + * The type of Browse-By page to render + */ + type: BrowseByType; + + /** + * The metadata field to use for rendering starts-with options (only necessary when type is set to BrowseByType.Date) + */ + metadataField: string; +} diff --git a/src/config/global-config.interface.ts b/src/config/global-config.interface.ts index d83ec6e4d8..22b4b0500f 100644 --- a/src/config/global-config.interface.ts +++ b/src/config/global-config.interface.ts @@ -8,6 +8,7 @@ import { FormConfig } from './form-config.interfaces'; import {LangConfig} from './lang-config.interface'; import { BrowseByConfig } from './browse-by-config.interface'; import { ItemPageConfig } from './item-page-config.interface'; +import { Theme } from './theme.inferface'; export interface GlobalConfig extends Config { ui: ServerConfig; @@ -25,4 +26,5 @@ export interface GlobalConfig extends Config { languages: LangConfig[]; browseBy: BrowseByConfig; item: ItemPageConfig; + themes: Theme[]; } diff --git a/src/config/theme.inferface.ts b/src/config/theme.inferface.ts new file mode 100644 index 0000000000..d0cf1d77d8 --- /dev/null +++ b/src/config/theme.inferface.ts @@ -0,0 +1,5 @@ +import { Config } from './config.interface'; + +export interface Theme extends Config { + name: string; +} 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/src/styles/_bootstrap_variables.scss b/src/styles/_bootstrap_variables.scss index 7be76ff5d3..5258365cfd 100644 --- a/src/styles/_bootstrap_variables.scss +++ b/src/styles/_bootstrap_variables.scss @@ -1,3 +1,5 @@ +@import '_themed_bootstrap_variables.scss'; + /** Help Variables **/ $fa-fixed-width: 1.25rem; $icon-padding: 1rem; diff --git a/src/styles/_custom_variables.scss b/src/styles/_custom_variables.scss index be03d719c5..8ca2067a2e 100644 --- a/src/styles/_custom_variables.scss +++ b/src/styles/_custom_variables.scss @@ -1,3 +1,5 @@ +@import '_themed_custom_variables.scss'; + $content-spacing: $spacer * 1.5; $button-height: $input-btn-padding-y * 2 + $input-btn-line-height + calculateRem($input-btn-border-width*2); @@ -20,9 +22,9 @@ $sidebar-z-index: 20; $header-logo-height: 80px; $header-logo-height-xs: 50px; -$admin-sidebar-bg: $dark; -$admin-sidebar-active-bg: darken($dark, 3%); -$admin-sidebar-header-bg: darken($dark, 7%); +$admin-sidebar-bg: darken(#2B4E72, 17%); +$admin-sidebar-active-bg: darken($admin-sidebar-bg, 3%); +$admin-sidebar-header-bg: darken($admin-sidebar-bg, 7%); $dark-scrollbar-background: $admin-sidebar-active-bg; $dark-scrollbar-foreground: #47495d; @@ -32,3 +34,5 @@ $submission-sections-margin-bottom: .5rem !default; $edit-item-button-min-width: 100px; $edit-item-metadata-field-width: 190px; $edit-item-language-field-width: 43px; + +$thumbnail-max-width: 175px; diff --git a/src/styles/_exposed_variables.scss b/src/styles/_exposed_variables.scss index 5f0f2d2654..1ab67e709d 100644 --- a/src/styles/_exposed_variables.scss +++ b/src/styles/_exposed_variables.scss @@ -9,4 +9,4 @@ sidebarItemsWidth: $sidebar-items-width; collapsedSidebarWidth: $collapsed-sidebar-width; totalSidebarWidth: $total-sidebar-width; -} \ No newline at end of file +} diff --git a/src/styles/_mixins.scss b/src/styles/_mixins.scss index 40bb9b8f3e..e72af304cd 100644 --- a/src/styles/_mixins.scss +++ b/src/styles/_mixins.scss @@ -1,6 +1,5 @@ @import '../../node_modules/bootstrap/scss/functions.scss'; @import '../../node_modules/bootstrap/scss/mixins.scss'; -@import 'variables.scss'; @mixin word-wrap() { overflow-wrap: break-word; @@ -39,5 +38,4 @@ &::-webkit-resizer { background-color: $dark-scrollbar-background; } - } diff --git a/src/styles/_variables.scss b/src/styles/_variables.scss index 33a3f0b1fa..2632dbfd09 100644 --- a/src/styles/_variables.scss +++ b/src/styles/_variables.scss @@ -1,5 +1,7 @@ @import '_functions.scss'; @import '../../node_modules/bootstrap/scss/functions.scss'; -@import 'bootstrap_variables.scss'; + +@import '_bootstrap_variables.scss'; @import '../../node_modules/bootstrap/scss/variables.scss'; -@import 'custom_variables.scss'; \ No newline at end of file + +@import '_custom_variables.scss'; diff --git a/themes/default/styles/_themed_bootstrap_variables.scss b/themes/default/styles/_themed_bootstrap_variables.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/themes/default/styles/_themed_custom_variables.scss b/themes/default/styles/_themed_custom_variables.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/themes/mantis/app/+home-page/home-news/home-news.component.html b/themes/mantis/app/+home-page/home-news/home-news.component.html new file mode 100644 index 0000000000..4da3ae12f7 --- /dev/null +++ b/themes/mantis/app/+home-page/home-news/home-news.component.html @@ -0,0 +1,21 @@ +
    +
    +
    +

    DSpace 7

    +

    DSpace is the world leading open source repository platform that enables + organisations to:

    +
    +
    +
      +
    • easily ingest documents, audio, video, datasets and their corresponding Dublin Core + metadata +
    • +
    • open up this content to local and global audiences, thanks to the OAI-PMH interface and + Google Scholar optimizations +
    • +
    • issue permanent urls and trustworthy identifiers, including optional integrations with + handle.net and DataCite DOI +
    • +
    +

    Join an international community of leading institutions using DSpace.

    +
    diff --git a/themes/mantis/app/+home-page/home-news/home-news.component.scss b/themes/mantis/app/+home-page/home-news/home-news.component.scss new file mode 100644 index 0000000000..c693e9a493 --- /dev/null +++ b/themes/mantis/app/+home-page/home-news/home-news.component.scss @@ -0,0 +1,15 @@ +@import 'src/app/+home-page/home-news/home-news.component.scss'; +$home-news-link-color: $green !default; +$home-news-link-color: darken($home-news-link-color, 15%) !default; + +.jumbotron { + background-color: transparent; +} + +a { + color: $home-news-link-color; + + @include hover { + color: $home-news-link-color; + } +} diff --git a/themes/mantis/app/+home-page/home-page.component.html b/themes/mantis/app/+home-page/home-page.component.html new file mode 100644 index 0000000000..43edbee9ca --- /dev/null +++ b/themes/mantis/app/+home-page/home-page.component.html @@ -0,0 +1,10 @@ +
    +
    + + +
    + Photo by @inspiredimages +
    +
    + +
    diff --git a/themes/mantis/app/+home-page/home-page.component.scss b/themes/mantis/app/+home-page/home-page.component.scss new file mode 100644 index 0000000000..64bd786cd5 --- /dev/null +++ b/themes/mantis/app/+home-page/home-page.component.scss @@ -0,0 +1,52 @@ +@import 'src/app/+home-page/home-page.component.scss'; + +div.background-image { + color: white; + background-color: $info; + position: relative; + background-position-y: -200px; + background-image: url('/assets/images/banner.jpg'); + background-size: cover; + @media screen and (max-width: map-get($grid-breakpoints, lg)) { + background-position-y: 0; + } + + .container { + position: relative; + text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6); + + &:before, &:after { + content: ''; + display: block; + width: $banner-background-gradient-width; + height: 100%; + top: 0; + position: absolute; + } + + &:before { + background: linear-gradient(to left, $banner-text-background, transparent); + left: -$banner-background-gradient-width; + + } + + &:after { + background: linear-gradient(to right, $banner-text-background, transparent); + right: -$banner-background-gradient-width; + } + + background-color: $banner-text-background; + } + + + small.credits { + a { + color: inherit; + } + + opacity: 0.3; + position: absolute; + right: $spacer; + bottom: 0; + } +} diff --git a/themes/mantis/app/+item-page/simple/item-page.component.html b/themes/mantis/app/+item-page/simple/item-page.component.html new file mode 100644 index 0000000000..472df7c78e --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-page.component.html @@ -0,0 +1,9 @@ +
    +
    +
    + +
    +
    + + +
    diff --git a/themes/mantis/app/+item-page/simple/item-types/journal-issue/journal-issue.component.html b/themes/mantis/app/+item-page/simple/item-types/journal-issue/journal-issue.component.html new file mode 100644 index 0000000000..a25a474eb0 --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/journal-issue/journal-issue.component.html @@ -0,0 +1,73 @@ +
    +
    +
    + + +
    +

    + {{'journalissue.page.titleprefix' | translate}} + +

    +
    +
    + + + + + + +
    +
    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +
    diff --git a/themes/mantis/app/+item-page/simple/item-types/journal-issue/journal-issue.component.scss b/themes/mantis/app/+item-page/simple/item-types/journal-issue/journal-issue.component.scss new file mode 100644 index 0000000000..7ce24acc15 --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/journal-issue/journal-issue.component.scss @@ -0,0 +1,30 @@ +@import 'src/app/+item-page/simple/item-types/journal-issue/journal-issue.component.scss'; + +:host { + > * { + display: block; + padding-top: $content-spacing; + padding-bottom: $content-spacing; + } + + .top-item-page { + background-color: $gray-100; + margin-top: -$content-spacing; + } + + .relationships-item-page { + padding-bottom: $content-spacing - $spacer; + } + + ds-metadata-field-wrapper { + @media screen and (max-width: map-get($grid-breakpoints, md)) { + flex: 1; + padding-right: $spacer/2; + } + + ds-thumbnail { + display: block; + max-width: $thumbnail-max-width; + } + } +} diff --git a/themes/mantis/app/+item-page/simple/item-types/journal-volume/journal-volume.component.html b/themes/mantis/app/+item-page/simple/item-types/journal-volume/journal-volume.component.html new file mode 100644 index 0000000000..c20e9a775a --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/journal-volume/journal-volume.component.html @@ -0,0 +1,62 @@ +
    +
    +
    + + +
    +

    + {{'journalvolume.page.titleprefix' | translate}} + +

    +
    +
    + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +
    diff --git a/themes/mantis/app/+item-page/simple/item-types/journal-volume/journal-volume.component.scss b/themes/mantis/app/+item-page/simple/item-types/journal-volume/journal-volume.component.scss new file mode 100644 index 0000000000..ab1bc700b1 --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/journal-volume/journal-volume.component.scss @@ -0,0 +1,30 @@ +@import 'src/app/+item-page/simple/item-types/journal-volume/journal-volume.component.scss'; + +:host { + > * { + display: block; + padding-top: $content-spacing; + padding-bottom: $content-spacing; + } + + .top-item-page { + background-color: $gray-100; + margin-top: -$content-spacing; + } + + .relationships-item-page { + padding-bottom: $content-spacing - $spacer; + } + + ds-metadata-field-wrapper { + @media screen and (max-width: map-get($grid-breakpoints, md)) { + flex: 1; + padding-right: $spacer/2; + } + + ds-thumbnail { + display: block; + max-width: $thumbnail-max-width; + } + } +} diff --git a/themes/mantis/app/+item-page/simple/item-types/journal/journal.component.html b/themes/mantis/app/+item-page/simple/item-types/journal/journal.component.html new file mode 100644 index 0000000000..ef827af590 --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/journal/journal.component.html @@ -0,0 +1,67 @@ +
    +
    +
    + +
    +

    + {{'journal.page.titleprefix' | translate}} + +

    +
    +
    + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +

    {{"item.page.journal.search.title" | translate}}

    +
    + + +
    diff --git a/themes/mantis/app/+item-page/simple/item-types/journal/journal.component.scss b/themes/mantis/app/+item-page/simple/item-types/journal/journal.component.scss new file mode 100644 index 0000000000..6d97cbf5c3 --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/journal/journal.component.scss @@ -0,0 +1,38 @@ +@import 'src/app/+item-page/simple/item-types/journal/journal.component.scss'; + +:host { + > * { + display: block; + padding-top: $content-spacing; + padding-bottom: $content-spacing; + } + + .top-item-page { + background-color: $gray-100; + margin-top: -$content-spacing; + } + + .relationships-item-page { + padding-bottom: $content-spacing - $spacer; + } + + ds-metadata-field-wrapper { + @media screen and (max-width: map-get($grid-breakpoints, md)) { + flex: 1; + padding-right: $spacer/2; + } + + ds-thumbnail { + display: block; + max-width: $thumbnail-max-width; + } + } + + .search-container { + margin-bottom: $spacer; + @media screen and (max-width: map-get($grid-breakpoints, lg)) { + width: 100%; + max-width: none; + } + } +} diff --git a/themes/mantis/app/+item-page/simple/item-types/orgunit/orgunit.component.html b/themes/mantis/app/+item-page/simple/item-types/orgunit/orgunit.component.html new file mode 100644 index 0000000000..6bb925c93f --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/orgunit/orgunit.component.html @@ -0,0 +1,76 @@ +
    +
    +
    + + +
    +

    + {{'orgunit.page.titleprefix' | translate}} + +

    +
    +
    + + + + + + +
    +
    + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    diff --git a/themes/mantis/app/+item-page/simple/item-types/orgunit/orgunit.component.scss b/themes/mantis/app/+item-page/simple/item-types/orgunit/orgunit.component.scss new file mode 100644 index 0000000000..5b2bdb0382 --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/orgunit/orgunit.component.scss @@ -0,0 +1,30 @@ +@import 'src/app/+item-page/simple/item-types/orgunit/orgunit.component.scss'; + +:host { + > * { + display: block; + padding-top: $content-spacing; + padding-bottom: $content-spacing; + } + + .top-item-page { + background-color: $gray-100; + margin-top: -$content-spacing; + } + + .relationships-item-page { + padding-bottom: $content-spacing - $spacer; + } + + ds-metadata-field-wrapper { + @media screen and (max-width: map-get($grid-breakpoints, md)) { + flex: 1; + padding-right: $spacer/2; + } + + ds-thumbnail { + display: block; + max-width: $thumbnail-max-width; + } + } +} diff --git a/themes/mantis/app/+item-page/simple/item-types/person/person.component.html b/themes/mantis/app/+item-page/simple/item-types/person/person.component.html new file mode 100644 index 0000000000..54d7962b97 --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/person/person.component.html @@ -0,0 +1,85 @@ +
    +
    +
    + + +
    +

    + {{'person.page.titleprefix' | translate}} +

    +
    +
    + + + + + + + + +
    +
    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    +
    +

    {{"item.page.person.search.title" | translate}}

    +
    + + +
    diff --git a/themes/mantis/app/+item-page/simple/item-types/person/person.component.scss b/themes/mantis/app/+item-page/simple/item-types/person/person.component.scss new file mode 100644 index 0000000000..3b454aab0e --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/person/person.component.scss @@ -0,0 +1,38 @@ +@import 'src/app/+item-page/simple/item-types/person/person.component.scss'; + +:host { + > * { + display: block; + padding-top: $content-spacing; + padding-bottom: $content-spacing; + } + + .top-item-page { + background-color: $gray-100; + margin-top: -$content-spacing; + } + + .relationships-item-page { + padding-bottom: $content-spacing - $spacer; + } + + ds-metadata-field-wrapper { + @media screen and (max-width: map-get($grid-breakpoints, md)) { + flex: 1; + padding-right: $spacer/2; + } + + ds-thumbnail { + display: block; + max-width: $thumbnail-max-width; + } + } + + .search-container { + margin-bottom: $spacer; + @media screen and (max-width: map-get($grid-breakpoints, lg)) { + width: 100%; + max-width: none; + } + } +} diff --git a/themes/mantis/app/+item-page/simple/item-types/project/project.component.html b/themes/mantis/app/+item-page/simple/item-types/project/project.component.html new file mode 100644 index 0000000000..aa4a107247 --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/project/project.component.html @@ -0,0 +1,85 @@ +
    +
    +
    + + +
    +

    + {{'project.page.titleprefix' | translate}} + +

    +
    +
    + + + + + + + + +
    +
    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    + diff --git a/themes/mantis/app/+item-page/simple/item-types/project/project.component.scss b/themes/mantis/app/+item-page/simple/item-types/project/project.component.scss new file mode 100644 index 0000000000..9c9aa9c629 --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/project/project.component.scss @@ -0,0 +1,30 @@ +@import 'src/app/+item-page/simple/item-types/project/project.component.scss'; + +:host { + > * { + display: block; + padding-top: $content-spacing; + padding-bottom: $content-spacing; + } + + .top-item-page { + background-color: $gray-100; + margin-top: -$content-spacing; + } + + .relationships-item-page { + padding-bottom: $content-spacing - $spacer; + } + + ds-metadata-field-wrapper { + @media screen and (max-width: map-get($grid-breakpoints, md)) { + flex: 1; + padding-right: $spacer/2; + } + + ds-thumbnail { + display: block; + max-width: $thumbnail-max-width; + } + } +} diff --git a/themes/mantis/app/+item-page/simple/item-types/publication/publication.component.html b/themes/mantis/app/+item-page/simple/item-types/publication/publication.component.html new file mode 100644 index 0000000000..6b6f484183 --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/publication/publication.component.html @@ -0,0 +1,83 @@ +
    +
    +
    + + +
    + +
    +
    + + + + + + + + + + + +
    +
    + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    diff --git a/themes/mantis/app/+item-page/simple/item-types/publication/publication.component.scss b/themes/mantis/app/+item-page/simple/item-types/publication/publication.component.scss new file mode 100644 index 0000000000..f65d9a00d5 --- /dev/null +++ b/themes/mantis/app/+item-page/simple/item-types/publication/publication.component.scss @@ -0,0 +1,30 @@ +@import 'src/app/+item-page/simple/item-types/publication/publication.component.scss'; + +:host { + > * { + display: block; + padding-top: $content-spacing; + padding-bottom: $content-spacing; + } + + .top-item-page { + background-color: $gray-100; + margin-top: -$content-spacing; + } + + .relationships-item-page { + padding-bottom: $content-spacing - $spacer; + } + + ds-metadata-field-wrapper { + @media screen and (max-width: map-get($grid-breakpoints, md)) { + flex: 1; + padding-right: $spacer/2; + } + + ds-thumbnail { + display: block; + max-width: $thumbnail-max-width; + } + } +} diff --git a/themes/mantis/app/+search-page/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.html b/themes/mantis/app/+search-page/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.html new file mode 100644 index 0000000000..86076dfd10 --- /dev/null +++ b/themes/mantis/app/+search-page/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.html @@ -0,0 +1,9 @@ + + + {{filterValue.value}} + + {{filterValue.count}} + + \ No newline at end of file diff --git a/themes/mantis/app/+search-page/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.html b/themes/mantis/app/+search-page/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.html new file mode 100644 index 0000000000..bdb37cb52d --- /dev/null +++ b/themes/mantis/app/+search-page/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.html @@ -0,0 +1,8 @@ + + {{filterValue.value}} + + {{filterValue.count}} + + \ No newline at end of file diff --git a/themes/mantis/app/+search-page/search-filters/search-filter/search-filter.component.html b/themes/mantis/app/+search-page/search-filters/search-filter/search-filter.component.html new file mode 100644 index 0000000000..850447a39e --- /dev/null +++ b/themes/mantis/app/+search-page/search-filters/search-filter/search-filter.component.html @@ -0,0 +1,7 @@ +
    +
    {{'search.filters.filter.' + filter.name + '.head'| translate}}
    +
    + +
    +
    diff --git a/themes/mantis/app/+search-page/search-filters/search-filter/search-filter.component.scss b/themes/mantis/app/+search-page/search-filters/search-filter/search-filter.component.scss new file mode 100644 index 0000000000..8e9b1d32b1 --- /dev/null +++ b/themes/mantis/app/+search-page/search-filters/search-filter/search-filter.component.scss @@ -0,0 +1,10 @@ +@import 'src/app/+search-page/search-filters/search-filter/search-filter.component.scss'; + +.facet-filter { + background-color: map-get($theme-colors, light); + border-radius: $border-radius; + + h5 { + font-size: 1.1rem + } +} diff --git a/themes/mantis/app/+search-page/search-filters/search-filter/search-range-filter/search-range-filter.component.scss b/themes/mantis/app/+search-page/search-filters/search-filter/search-range-filter/search-range-filter.component.scss new file mode 100644 index 0000000000..42b8e0205b --- /dev/null +++ b/themes/mantis/app/+search-page/search-filters/search-filter/search-range-filter/search-range-filter.component.scss @@ -0,0 +1,5 @@ +@import 'src/app/+search-page/search-filters/search-filter/search-range-filter/search-range-filter.component.scss'; + +::ng-deep .noUi-connect { + background: $info; +} diff --git a/themes/mantis/app/+search-page/search-filters/search-filters.component.html b/themes/mantis/app/+search-page/search-filters/search-filters.component.html new file mode 100644 index 0000000000..b7bb1bf50f --- /dev/null +++ b/themes/mantis/app/+search-page/search-filters/search-filters.component.html @@ -0,0 +1,7 @@ +

    {{"search.filters.head" | translate}}

    +
    +
    + +
    +
    +{{"search.filters.reset" | translate}} diff --git a/themes/mantis/app/+search-page/search-settings/search-settings.component.html b/themes/mantis/app/+search-page/search-settings/search-settings.component.html new file mode 100644 index 0000000000..1321ced928 --- /dev/null +++ b/themes/mantis/app/+search-page/search-settings/search-settings.component.html @@ -0,0 +1,24 @@ + +

    {{ 'search.sidebar.settings.title' | translate}}

    +
    +
    {{ 'search.sidebar.settings.sort-by' | translate}}
    + +
    + +
    +
    {{ 'search.sidebar.settings.rpp' | translate}}
    + +
    +
    \ No newline at end of file diff --git a/themes/mantis/app/+search-page/search-settings/search-settings.component.scss b/themes/mantis/app/+search-page/search-settings/search-settings.component.scss new file mode 100644 index 0000000000..602c8ca4c3 --- /dev/null +++ b/themes/mantis/app/+search-page/search-settings/search-settings.component.scss @@ -0,0 +1,10 @@ +@import 'src/app/+search-page/search-settings/search-settings.component.scss'; + +.setting-option { + background-color: map-get($theme-colors, light); + border-radius: $border-radius; + h5 { + font-size: 1.1rem + } +} + diff --git a/themes/mantis/app/navbar/navbar.component.html b/themes/mantis/app/navbar/navbar.component.html new file mode 100644 index 0000000000..d06eceb222 --- /dev/null +++ b/themes/mantis/app/navbar/navbar.component.html @@ -0,0 +1,16 @@ + diff --git a/themes/mantis/app/navbar/navbar.component.scss b/themes/mantis/app/navbar/navbar.component.scss new file mode 100644 index 0000000000..1417acff59 --- /dev/null +++ b/themes/mantis/app/navbar/navbar.component.scss @@ -0,0 +1,7 @@ +@import 'src/app/navbar/navbar.component.scss'; + +nav.navbar { + border-bottom: 5px $green solid; +} + + diff --git a/themes/mantis/app/shared/search-form/search-form.component.html b/themes/mantis/app/shared/search-form/search-form.component.html new file mode 100644 index 0000000000..ea2f54813e --- /dev/null +++ b/themes/mantis/app/shared/search-form/search-form.component.html @@ -0,0 +1,21 @@ +
    +
    + +
    +
    +
    + + + + +
    +
    +
    diff --git a/themes/mantis/styles/_themed_bootstrap_variables.scss b/themes/mantis/styles/_themed_bootstrap_variables.scss new file mode 100644 index 0000000000..e606502e09 --- /dev/null +++ b/themes/mantis/styles/_themed_bootstrap_variables.scss @@ -0,0 +1,19 @@ +@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese'); + +$font-family-sans-serif: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; +$gray-100: #e8ebf3 !default; // #eee +$gray-800: #444444 !default; // #444 + +$navbar-dark-color: #FFFFFF; + +/* Reassign color vars to semantic color scheme */ +$blue: #43515f !default; +$green: #92C642 !default; +$cyan: #2e80a3 !default; +$yellow: #ec9433 !default; +$red: #CF4444 !default; +$dark: #43515f !default; + +$body-color: $gray-800 !default; + +$yiq-contrasted-threshold: 170 !default; diff --git a/themes/mantis/styles/_themed_custom_variables.scss b/themes/mantis/styles/_themed_custom_variables.scss new file mode 100644 index 0000000000..1be25e953f --- /dev/null +++ b/themes/mantis/styles/_themed_custom_variables.scss @@ -0,0 +1,2 @@ +$banner-text-background: rgba(0, 0, 0, 0.35); +$banner-background-gradient-width: 300px; diff --git a/webpack.config.js b/webpack.config.js index 6312cf3605..78ca2d98dc 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,46 +1,45 @@ const webpackMerge = require('webpack-merge'); -const commonPartial = require('./webpack/webpack.common'); -const clientPartial = require('./webpack/webpack.client'); -const { getServerWebpackPartial } = require('./webpack/webpack.server'); + const prodPartial = require('./webpack/webpack.prod'); -const { - getAotPlugin -} = require('./webpack/webpack.aot'); - -module.exports = function(env, options) { +module.exports = function (env, options) { env = env || {}; - if (env.aot) { - console.log(`Running build for ${env.client ? 'client' : 'server'} with AoT Compilation`) - } + const commonPartial = require('./webpack/webpack.common')(env); + const clientPartial = require('./webpack/webpack.client')(env); + const {getAotPlugin} = require('./webpack/webpack.aot')(env); + const {getServerWebpackPartial} = require('./webpack/webpack.server')(env); - let serverPartial = getServerWebpackPartial(env.aot); + if (env.aot) { + console.log(`Running build for ${env.client ? 'client' : 'server'} with AoT Compilation`) + } - let serverConfig = webpackMerge({}, commonPartial, serverPartial, { - plugins: [ - getAotPlugin('server', !!env.aot) - ] - }); + let serverPartial = getServerWebpackPartial(env.aot); - let clientConfig = webpackMerge({}, commonPartial, clientPartial, { - plugins: [ - getAotPlugin('client', !!env.aot) - ] - }); - if (options.mode === 'production') { - serverConfig = webpackMerge({}, serverConfig, prodPartial); - clientConfig = webpackMerge({}, clientConfig, prodPartial); - } + let serverConfig = webpackMerge({}, commonPartial, serverPartial, { + plugins: [ + getAotPlugin('server', !!env.aot) + ] + }); - const configs = []; + let clientConfig = webpackMerge({}, commonPartial, clientPartial, { + plugins: [ + getAotPlugin('client', !!env.aot) + ] + }); + if (options.mode === 'production') { + serverConfig = webpackMerge({}, serverConfig, prodPartial); + clientConfig = webpackMerge({}, clientConfig, prodPartial); + } - if (!env.aot) { - configs.push(clientConfig, serverConfig); - } else if (env.client) { - configs.push(clientConfig); - } else if (env.server) { - configs.push(serverConfig); - } + const configs = []; - return configs; + if (!env.aot) { + configs.push(clientConfig, serverConfig); + } else if (env.client) { + configs.push(clientConfig); + } else if (env.server) { + configs.push(serverConfig); + } + + return configs; }; diff --git a/webpack/helpers.js b/webpack/helpers.js index fdc005f189..fafbbaff5e 100644 --- a/webpack/helpers.js +++ b/webpack/helpers.js @@ -1,13 +1,109 @@ -const { - join, - resolve -} = require('path'); +const path = require('path'); +const fs = require('fs'); -function root(path) { - return resolve(__dirname, '..', path); + +const projectRoot = (relativePath) => { + return path.resolve(__dirname, '..', relativePath); +}; + +const srcPath = projectRoot('src'); + +const buildRoot = (relativePath, env) => { + if (env.aot) { + return path.resolve(projectRoot('./build'), relativePath); + } else { + return path.resolve(projectRoot('src'), relativePath); + } +}; + +//TODO refactor to share between this and config.ts. +const getThemeName = () => { + let defaultCfg = require(projectRoot('config/environment.default.js')); + let envConfigFile; + let envConfigOverride = {}; + + switch (process.env.NODE_ENV) { + case 'prod': + case 'production': + // webpack.prod.dspace-angular-config.ts defines process.env.NODE_ENV = 'production' + envConfigFile = projectRoot('config/environment.prod.js'); + break; + case 'test': + // webpack.test.dspace-angular-config.ts defines process.env.NODE_ENV = 'test' + envConfigFile = projectRoot('config/environment.test.js'); + break; + default: + // if not using webpack.prod.dspace-angular-config.ts or webpack.test.dspace-angular-config.ts, it must be development + envConfigFile = projectRoot('config/environment.dev.js'); + } + + if (envConfigFile) { + try { + envConfigOverride = require(envConfigFile); + } catch (e) { + } + } + + return Object.assign({}, defaultCfg.theme, envConfigOverride.theme).name; } -module.exports = { - root: root, - join: join +const theme = getThemeName(); + +let themePath; + +if (theme !== null && theme !== undefined) { + themePath = path.normalize(path.join(__dirname, '..', 'themes', theme)); +} +else { + themePath = srcPath; +} + +const globalCSSImports = (env) => { return [ + buildRoot('styles/_variables.scss', env), + buildRoot('styles/_mixins.scss', env), +]}; + +const getThemedPath = (componentPath, ext) => { + const parsedPath = path.parse(componentPath); + const relativePath = path.relative(srcPath, parsedPath.dir); + return path.join(themePath, relativePath, `${parsedPath.name}.${ext}`); +}; + +const themedTest = (origPath, extension) => { + if (/\.component.ts$/.test(origPath)) { // only match components + const themedPath = getThemedPath(origPath, extension); + return fs.existsSync(themedPath); + } else { + return false; + } +}; + +const themedUse = (resource, extension) => { + const origPath = path.parse(resource); + let themedPath = getThemedPath(resource, extension); + + /* Make sure backslashes are escaped twice, because the replace unescapes those again */ + themedPath = themedPath.replace(/\\/g, '\\\\'); + + return [ + { + loader: 'string-replace-loader', + options: { + search: `\.\/${origPath.name}\.${extension}`, + replace: themedPath, + flags: 'g' + } + } + ] +}; + +module.exports = { + projectRoot, + buildRoot, + theme: theme, + themePath, + getThemedPath, + themedTest, + themedUse, + globalCSSImports }; diff --git a/webpack/webpack.aot.js b/webpack/webpack.aot.js index 2c2366a23e..c4b970892f 100644 --- a/webpack/webpack.aot.js +++ b/webpack/webpack.aot.js @@ -1,35 +1,37 @@ const { - root + buildRoot } = require('./helpers'); const { - AngularCompilerPlugin + AngularCompilerPlugin } = require('@ngtools/webpack'); -const tsconfigs = { - client: root('./src/tsconfig.browser.json'), - server: root('./src/tsconfig.server.json') -}; +module.exports = (env) => { + const tsconfigs = { + client: buildRoot('./tsconfig.browser.json', env), + server: buildRoot('./tsconfig.server.json', env) + }; -const aotTsconfigs = { - client: root('./src/tsconfig.browser.json'), - server: root('./src/tsconfig.server.aot.json') -}; + const aotTsconfigs = { + client: buildRoot('./tsconfig.browser.json', env), + server: buildRoot('./tsconfig.server.aot.json', env) + }; -/** - * Generates a AotPlugin for @ngtools/webpack - * - * @param {string} platform Should either be client or server - * @param {boolean} aot Enables/Disables AoT Compilation - * @returns {AotPlugin} Configuration of AotPlugin - */ -function getAotPlugin(platform, aot) { - return new AngularCompilerPlugin({ - tsConfigPath: aot ? aotTsconfigs[platform] : tsconfigs[platform], - skipCodeGeneration: !aot - }); -} + /** + * Generates a AotPlugin for @ngtools/webpack + * + * @param {string} platform Should either be client or server + * @param {boolean} aot Enables/Disables AoT Compilation + * @returns {AotPlugin} Configuration of AotPlugin + */ + function getAotPlugin(platform, aot) { + return new AngularCompilerPlugin({ + tsConfigPath: aot ? aotTsconfigs[platform] : tsconfigs[platform], + skipCodeGeneration: !aot + }); + } -module.exports = { - getAotPlugin: getAotPlugin + return { + getAotPlugin: getAotPlugin + } }; diff --git a/webpack/webpack.client.js b/webpack/webpack.client.js index 20dcbddb20..ce49f60ed0 100644 --- a/webpack/webpack.client.js +++ b/webpack/webpack.client.js @@ -2,23 +2,26 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); const ScriptExtPlugin = require('script-ext-html-webpack-plugin'); const { - root + projectRoot, + buildRoot } = require('./helpers'); -module.exports = { - entry: root('./src/main.browser.ts'), - output: { - filename: 'client.js' - }, - target: 'web', - plugins: [ - new HtmlWebpackPlugin({ - template: root('./src/index.html'), - output: root('dist'), - inject: 'head' - }), - new ScriptExtPlugin({ - defaultAttribute: 'defer' - }) - ] -}; +module.exports = (env) => { + return { + entry: buildRoot('./main.browser.ts', env), + output: { + filename: 'client.js' + }, + target: 'web', + plugins: [ + new HtmlWebpackPlugin({ + template: buildRoot('./index.html', env), + output: projectRoot('dist'), + inject: 'head' + }), + new ScriptExtPlugin({ + defaultAttribute: 'defer' + }) + ] + }; +} diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 7fb4656a15..028815d958 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -1,110 +1,173 @@ const CopyWebpackPlugin = require('copy-webpack-plugin'); const path = require('path'); +const fs = require('fs'); const { - root, - join + projectRoot, + buildRoot, + globalCSSImports, + theme, + themePath, + themedTest, + themedUse } = require('./helpers'); -module.exports = { +module.exports = (env) => { + let copyWebpackOptions = [{ + from: path.join(__dirname, '..', 'node_modules', '@fortawesome', 'fontawesome-free', 'webfonts'), + to: path.join('assets', 'fonts') + }, { + from: path.join(__dirname, '..', 'resources', 'images'), + to: path.join('assets', 'images') + }, { + from: path.join(__dirname, '..', 'resources', 'i18n'), + to: path.join('assets', 'i18n') + } + ]; + + const themeImages = path.join(themePath, 'resources', 'images'); + if(theme && fs.existsSync(themeImages)) { + copyWebpackOptions.push({ + from: themeImages, + to: path.join('assets', 'images') , + force: true, + }); + } + + return { mode: 'development', devtool: 'source-map', - resolve: { - extensions: ['.ts', '.js', '.json'] - }, - output: { - path: root('dist') - }, - watchOptions: { - aggregateTimeout: 50, - }, - node: { - fs: "empty", - module: "empty" - }, - module: { - rules: [{ - test: /\.ts$/, - loader: '@ngtools/webpack' + resolve: { + extensions: ['.ts', '.js', '.json'] }, - { - test: /\.css$/, - use: [{ - loader: 'to-string-loader', - options: { - sourceMap: true - } + output: { + path: projectRoot('dist') + }, + watchOptions: { + aggregateTimeout: 50, + }, + node: { + fs: "empty", + module: "empty" + }, + module: { + rules: [ + { + test: (filePath) => themedTest(filePath, 'scss'), + use: (info) => themedUse(info.resource, 'scss') }, - { - loader: 'css-loader', - options: { - sourceMap: true, - modules: true - } - }, - { - loader: 'postcss-loader', - options: { - sourceMap: true - } - } - ] - }, - { - test: /\.scss$/, - exclude: [/node_modules/, - path.resolve(__dirname, '..', 'src/styles/_exposed_variables.scss') - ], - use: [{ - loader: 'to-string-loader', - options: { - sourceMap: true - } - }, { - loader: 'raw-loader', - options: { - sourceMap: true - } + { + test: (filePath) => themedTest(filePath, 'html'), + use: (info) => themedUse(info.resource, 'html') }, - { - loader: 'resolve-url-loader', - options: { - sourceMap: true + { + test: /\.ts$/, + loader: '@ngtools/webpack' + }, + { + test: /\.css$/, + use: [ + { + loader: 'to-string-loader', + options: { + sourceMap: true + } + }, + { + loader: 'css-loader', + options: { + sourceMap: true, + modules: true + } + }, + { + loader: 'postcss-loader', + options: { + sourceMap: true + } } - }, - { - loader: 'sass-loader', - options: { - sourceMap: true + ] + }, + { + test: /\.scss$/, + exclude: [ + /node_modules/, + buildRoot('styles/_exposed_variables.scss', env), + buildRoot('styles/_variables.scss', env) + ], + use: [ + { + loader: 'raw-loader', + options: { + sourceMap: true + } + }, + { + loader: 'postcss-loader', + options: { + sourceMap: true + } + }, + { + loader: 'resolve-url-loader', + options: { + sourceMap: true + } + }, + { + loader: 'sass-loader', + options: { + sourceMap: true, + includePaths: [projectRoot('./'), path.join(themePath, 'styles')] + } + }, + { + loader: 'sass-resources-loader', + options: { + resources: globalCSSImports(env) + }, } - } - ] - }, - { - test: /_exposed_variables.scss$/, - exclude: /node_modules/, - use: [{ - loader: "css-loader" // translates CSS into CommonJS - }, { - loader: "sass-loader" // compiles Sass to CSS - }] - }, - { - test: /\.html$/, - loader: 'raw-loader' - } + ] + }, + { + test: /(_exposed)?_variables.scss$/, + exclude: [/node_modules/], + use: [ + { + loader: 'css-loader', + options: { + sourceMap: true, + modules: true + } + }, + { + loader: 'postcss-loader', + options: { + sourceMap: true + } + }, + { + loader: 'resolve-url-loader', + options: { + sourceMap: true + } + }, + { + loader: 'sass-loader', + options: { + sourceMap: true, + includePaths: [projectRoot('./'), path.join(themePath, 'styles')] + } + } + ] + }, + { + test: /\.html$/, + loader: 'raw-loader' + } + ] + }, + plugins: [ + new CopyWebpackPlugin(copyWebpackOptions) ] - }, - plugins: [ - new CopyWebpackPlugin([{ - from: join(__dirname, '..', 'node_modules', '@fortawesome', 'fontawesome-free', 'webfonts'), - to: join('assets', 'fonts') - }, { - from: join(__dirname, '..', 'resources', 'images'), - to: join('assets', 'images') - }, { - from: join(__dirname, '..', 'resources', 'i18n'), - to: join('assets', 'i18n') - }]) - ] - + } }; diff --git a/webpack/webpack.prod.js b/webpack/webpack.prod.js index 35a683bb96..df0d6274d9 100644 --- a/webpack/webpack.prod.js +++ b/webpack/webpack.prod.js @@ -6,70 +6,70 @@ const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); const cssnano = require("cssnano"); const { - root + projectRoot } = require('./helpers'); module.exports = { - mode: 'production', - recordsOutputPath: root('webpack.records.json'), - plugins: [ - new webpack.EnvironmentPlugin({ - 'process.env': { - 'NODE_ENV': JSON.stringify('production'), - 'AOT': true - } - }), + mode: 'production', + recordsOutputPath: projectRoot('webpack.records.json'), + plugins: [ + new webpack.EnvironmentPlugin({ + 'process.env': { + 'NODE_ENV': JSON.stringify('production'), + 'AOT': true + } + }), - new BundleAnalyzerPlugin({ - analyzerMode: 'disabled', // change it to `server` to view bundle stats - reportFilename: 'report.html', - generateStatsFile: true, - statsFilename: 'stats.json', - }), + new BundleAnalyzerPlugin({ + analyzerMode: 'disabled', // change it to `server` to view bundle stats + reportFilename: 'report.html', + generateStatsFile: true, + statsFilename: 'stats.json', + }), - new CompressionPlugin({ - asset: "[path].gz[query]", - algorithm: "gzip", - test: /\.js$|\.css$|\.html$/, - threshold: 10240, - minRatio: 0.8 - }) + new CompressionPlugin({ + asset: "[path].gz[query]", + algorithm: "gzip", + test: /\.js$|\.css$|\.html$/, + threshold: 10240, + minRatio: 0.8 + }) - ], - optimization: { - minimizer: [ - new UglifyJsPlugin({ - uglifyOptions: { - beautify: false, - mangle: false, - output: { - comments: false - }, - compress: { - warnings: false, - conditionals: false, - unused: true, - comparisons: true, - sequences: true, - dead_code: true, - evaluate: true, - if_return: true, - join_vars: true, - negate_iife: true - }, - sourceMap: true - } - }), - new OptimizeCSSAssetsPlugin({ - cssProcessor: cssnano, - cssProcessorOptions: { - discardComments: { - removeAll: true, - } - }, - safe: true - }) - ] - }, + ], + optimization: { + minimizer: [ + new UglifyJsPlugin({ + uglifyOptions: { + beautify: false, + mangle: false, + output: { + comments: false + }, + compress: { + warnings: false, + conditionals: false, + unused: true, + comparisons: true, + sequences: true, + dead_code: true, + evaluate: true, + if_return: true, + join_vars: true, + negate_iife: true + }, + sourceMap: true + } + }), + new OptimizeCSSAssetsPlugin({ + cssProcessor: cssnano, + cssProcessorOptions: { + discardComments: { + removeAll: true, + } + }, + safe: true + }) + ] + }, }; diff --git a/webpack/webpack.server.js b/webpack/webpack.server.js index ce0c52602a..5e80a286a0 100644 --- a/webpack/webpack.server.js +++ b/webpack/webpack.server.js @@ -1,28 +1,30 @@ var nodeExternals = require('webpack-node-externals'); const { - root + buildRoot } = require('./helpers'); -module.exports = { - getServerWebpackPartial: function (aot) { - const entry = aot ? root('./src/main.server.aot.ts') : root('./src/main.server.ts'); - return { - entry: entry, - output: { - filename: 'server.js' - }, - target: 'node', - externals: [nodeExternals({ - whitelist: [ - /@angular/, - /@ng/, - /angular2-text-mask/, - /ng2-file-upload/, - /angular-sortablejs/, - /sortablejs/, - /ngx/] - })], +module.exports = (env) => { + return { + getServerWebpackPartial: function (aot) { + const entry = aot ? buildRoot('./main.server.aot.ts', env) : buildRoot('./main.server.ts', env); + return { + entry: entry, + output: { + filename: 'server.js' + }, + target: 'node', + externals: [nodeExternals({ + whitelist: [ + /@angular/, + /@ng/, + /angular2-text-mask/, + /ng2-file-upload/, + /angular-sortablejs/, + /sortablejs/, + /ngx/] + })], + } } } }; diff --git a/webpack/webpack.test.js b/webpack/webpack.test.js index 8c6760e377..83e6e44e79 100644 --- a/webpack/webpack.test.js +++ b/webpack/webpack.test.js @@ -1,6 +1,12 @@ const { - root + projectRoot, + buildRoot, + themedTest, + themedUse, + themePath, + globalCSSImports } = require('./helpers'); +const path = require('path'); /** * Webpack Plugins @@ -23,250 +29,288 @@ const ENV = process.env.ENV = process.env.NODE_ENV = 'test'; * * See: http://webpack.github.io/docs/configuration.html#cli */ -module.exports = function (options) { - return { - mode: 'development', - /** - * Source map for Karma from the help of karma-sourcemap-loader & karma-webpack - * - * Do not change, leave as is or it wont work. - * See: https://github.com/webpack/karma-webpack#source-maps - */ - devtool: 'source-map', - - /** - * Options affecting the resolving of modules. - * - * See: http://webpack.github.io/docs/configuration.html#resolve - */ - resolve: { - - /** - * An array of extensions that should be used to resolve modules. - * - * See: http://webpack.github.io/docs/configuration.html#resolve-extensions - */ - extensions: ['.ts', '.js', '.json'], - - /** - * Make sure root is src - */ - modules: [root('src'), 'node_modules'] - - }, - - /** - * Options affecting the normal modules. - * - * See: http://webpack.github.io/docs/configuration.html#module - * - * 'use:' revered back to 'loader:' as a temp. workaround for #1188 - * See: https://github.com/AngularClass/angular2-webpack-starter/issues/1188#issuecomment-262872034 - */ - module: { - - rules: [ +module.exports = function (env) { + return { + mode: 'development', + /** + * Source map for Karma from the help of karma-sourcemap-loader & karma-webpack + * + * Do not change, leave as is or it wont work. + * See: https://github.com/webpack/karma-webpack#source-maps + */ + devtool: 'source-map', /** - * Source map loader support for *.js files - * Extracts SourceMaps for source files that as added as sourceMappingURL comment. + * Options affecting the resolving of modules. * - * See: https://github.com/webpack/source-map-loader + * See: http://webpack.github.io/docs/configuration.html#resolve */ - { - enforce: 'pre', - test: /\.js$/, - loader: 'source-map-loader', - exclude: [/node_modules/], + resolve: { + + /** + * An array of extensions that should be used to resolve modules. + * + * See: http://webpack.github.io/docs/configuration.html#resolve-extensions + */ + extensions: ['.ts', '.js', '.json'], + + /** + * Make sure root is src + */ + modules: [projectRoot('src'), 'node_modules'] }, /** - * Typescript loader support for .ts and Angular 2 async routes via .async.ts + * Options affecting the normal modules. * - * See: https://github.com/TypeStrong/ts-loader + * See: http://webpack.github.io/docs/configuration.html#module + * + * 'use:' revered back to 'loader:' as a temp. workaround for #1188 + * See: https://github.com/AngularClass/angular2-webpack-starter/issues/1188#issuecomment-262872034 */ - { - test: /\.tsx?$/, - loaders: [{ - loader: 'ts-loader', - options: { - configFile: root('src/tsconfig.test.json'), - transpileOnly: true - } - }, - 'angular2-template-loader' - ], - exclude: [/\.e2e\.ts$/] + module: { + + rules: [ + + /** + * Source map loader support for *.js files + * Extracts SourceMaps for source files that as added as sourceMappingURL comment. + * + * See: https://github.com/webpack/source-map-loader + */ + { + test: (filePath) => themedTest(filePath, 'scss'), + use: (info) => themedUse(info.resource, 'scss') + }, + { + test: (filePath) => themedTest(filePath, 'html'), + use: (info) => themedUse(info.resource, 'html') + }, + /** + * Typescript loader support for .ts and Angular 2 async routes via .async.ts + * + * See: https://github.com/TypeStrong/ts-loader + */ + { + test: /\.tsx?$/, + loaders: [{ + loader: 'ts-loader', + options: { + configFile: projectRoot('src/tsconfig.test.json'), + transpileOnly: true + } + }, + 'angular2-template-loader' + ], + exclude: [/\.e2e\.ts$/] + }, + + /** + * CSS loader support for *.css files + * Returns file content as string + * + * See: https://github.com/webpack/css-loader + */ + { + test: /\.css$/, + use: [{ + loader: 'to-string-loader', + options: { + sourceMap: true + } + }, + { + loader: 'css-loader', + options: { + sourceMap: true + } + }, + { + loader: 'postcss-loader', + options: { + sourceMap: true + } + } + ], + }, + + /** + * SASS loader support for *.css files + * Returns file content as string + * + */ + { + test: /\.scss$/, + exclude: [ + /node_modules/, + buildRoot('styles/_exposed_variables.scss', env), + buildRoot('styles/_variables.scss', env) + ], + use: [ + { + loader: 'raw-loader', + options: { + sourceMap: true + } + }, + { + loader: 'postcss-loader', + options: { + sourceMap: true + } + }, + { + loader: 'resolve-url-loader', + options: { + sourceMap: true + } + }, + { + loader: 'sass-loader', + options: { + sourceMap: true, + includePaths: [projectRoot('./'), path.join(themePath, 'styles')] + } + }, + { + loader: 'sass-resources-loader', + options: { + resources: globalCSSImports(env) + }, + } + ] + }, + { + test: /(_exposed)?_variables.scss$/, + exclude: [/node_modules/], + use: [ + { + loader: 'css-loader', + options: { + sourceMap: true, + modules: true + } + }, + { + loader: 'postcss-loader', + options: { + sourceMap: true + } + }, + { + loader: 'resolve-url-loader', + options: { + sourceMap: true + } + }, + { + loader: 'sass-loader', + options: { + sourceMap: true, + includePaths: [projectRoot('./'), path.join(themePath, 'styles')] + } + } + ] + }, + + /** + * Raw loader support for *.html + * Returns file content as string + * + * See: https://github.com/webpack/raw-loader + */ + { + test: /\.html$/, + loader: 'raw-loader', + exclude: [projectRoot('src/index.html')] + }, + + /** + * Instruments JS files with Istanbul for subsequent code coverage reporting. + * Instrument only testing sources. + * + * See: https://github.com/deepsweet/istanbul-instrumenter-loader + */ + { + enforce: 'post', + test: /\.(js|ts)$/, + loader: 'istanbul-instrumenter-loader', + query: { + esModules: true + }, + include: projectRoot('src'), + exclude: [ + /\.(e2e|spec)\.ts$/, + /node_modules/ + ] + } + + ] }, /** - * CSS loader support for *.css files - * Returns file content as string + * Add additional plugins to the compiler. * - * See: https://github.com/webpack/css-loader + * See: http://webpack.github.io/docs/configuration.html#plugins */ - { - test: /\.css$/, - use: [{ - loader: 'to-string-loader', - options: { - sourceMap: true - } - }, - { - loader: 'css-loader', - options: { - sourceMap: true - } - }, - { - loader: 'postcss-loader', - options: { - sourceMap: true - } - } - ], - exclude: [root('src/index.html')] + plugins: [ + + new ContextReplacementPlugin( + /angular(\\|\/)core(\\|\/)@angular/, + projectRoot('./src'), {} + ), + // Workaround for https://github.com/angular/angular/issues/20357 + new ContextReplacementPlugin( + /\@angular(\\|\/)core(\\|\/)esm5/, + projectRoot('./src'), {} + ), + + /** + * Plugin: DefinePlugin + * Description: Define free variables. + * Useful for having development builds with debug logging or adding global constants. + * + * Environment helpers + * + * See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin + */ + // NOTE: when adding more properties make sure you include them in custom-typings.d.ts + new DefinePlugin({ + 'ENV': JSON.stringify(ENV), + 'HMR': false, + 'process.env': { + 'ENV': JSON.stringify(ENV), + 'NODE_ENV': JSON.stringify(ENV), + 'HMR': false, + } + }), + new ForkTsCheckerWebpackPlugin() + ], + + /** + * Disable performance hints + * + * See: https://github.com/a-tarasyuk/rr-boilerplate/blob/master/webpack/dev.config.babel.js#L41 + */ + performance: { + hints: false }, /** - * SASS loader support for *.css files - * Returns file content as string + * Include polyfills or mocks for various node stuff + * Description: Node configuration * + * See: https://webpack.github.io/docs/configuration.html#node */ - { - test: /\.scss$/, - use: [{ - loader: 'to-string-loader', - options: { - sourceMap: true - } - }, { - loader: 'raw-loader', - options: { - sourceMap: true - } - }, - { - loader: 'postcss-loader', - options: { - sourceMap: true - } - }, - { - loader: 'resolve-url-loader', - options: { - sourceMap: true - } - }, - { - loader: 'sass-loader', - options: { - sourceMap: true - } - } - ], - exclude: [root('src/index.html')] - }, - - /** - * Raw loader support for *.html - * Returns file content as string - * - * See: https://github.com/webpack/raw-loader - */ - { - test: /\.html$/, - loader: 'raw-loader', - exclude: [root('src/index.html')] - }, - - /** - * Instruments JS files with Istanbul for subsequent code coverage reporting. - * Instrument only testing sources. - * - * See: https://github.com/deepsweet/istanbul-instrumenter-loader - */ - { - enforce: 'post', - test: /\.(js|ts)$/, - loader: 'istanbul-instrumenter-loader', - query: { - esModules: true - }, - include: root('src'), - exclude: [ - /\.(e2e|spec)\.ts$/, - /node_modules/ - ] + node: { + global: true, + process: false, + crypto: 'empty', + module: false, + clearImmediate: false, + setImmediate: false } - ] - }, - - /** - * Add additional plugins to the compiler. - * - * See: http://webpack.github.io/docs/configuration.html#plugins - */ - plugins: [ - - new ContextReplacementPlugin( - /angular(\\|\/)core(\\|\/)@angular/, - root('./src'), {} - ), - // Workaround for https://github.com/angular/angular/issues/20357 - new ContextReplacementPlugin( - /\@angular(\\|\/)core(\\|\/)esm5/, - root('./src'), {} - ), - - /** - * Plugin: DefinePlugin - * Description: Define free variables. - * Useful for having development builds with debug logging or adding global constants. - * - * Environment helpers - * - * See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin - */ - // NOTE: when adding more properties make sure you include them in custom-typings.d.ts - new DefinePlugin({ - 'ENV': JSON.stringify(ENV), - 'HMR': false, - 'process.env': { - 'ENV': JSON.stringify(ENV), - 'NODE_ENV': JSON.stringify(ENV), - 'HMR': false, - } - }), - new ForkTsCheckerWebpackPlugin() - ], - - /** - * Disable performance hints - * - * See: https://github.com/a-tarasyuk/rr-boilerplate/blob/master/webpack/dev.config.babel.js#L41 - */ - performance: { - hints: false - }, - - /** - * Include polyfills or mocks for various node stuff - * Description: Node configuration - * - * See: https://webpack.github.io/docs/configuration.html#node - */ - node: { - global: true, - process: false, - crypto: 'empty', - module: false, - clearImmediate: false, - setImmediate: false - } - - }; + }; }; diff --git a/yarn.lock b/yarn.lock index 50cf67c8d8..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" @@ -655,6 +664,14 @@ accepts@~1.3.4, accepts@~1.3.5: mime-types "~2.1.18" negotiator "0.6.1" +accepts@~1.3.7: + version "1.3.7" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + dependencies: + mime-types "~2.1.24" + negotiator "0.6.2" + acorn-dynamic-import@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz#901ceee4c7faaef7e07ad2a47e890675da50a278" @@ -662,11 +679,21 @@ acorn-dynamic-import@^3.0.0: dependencies: acorn "^5.0.0" -acorn@^5.0.0, acorn@^5.3.0, acorn@^5.5.0, acorn@^5.6.2: +acorn-walk@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" + integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== + +acorn@^5.0.0, acorn@^5.5.0, acorn@^5.6.2: version "5.7.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.2.tgz#91fa871883485d06708800318404e72bfb26dcc5" integrity sha512-cJrKCNcr2kv8dlDnbw+JPUGjHZzo4myaxOLmpOX8a+rgX94YeTcTMv/LFJUSByRpc+i4GgVnnhLxvMu/2Y+rqw== +acorn@^6.0.7: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== + adjust-sourcemap-loader@^1.1.0: version "1.2.0" resolved "http://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-1.2.0.tgz#e33fde95e50db9f2a802e3647e311d2fc5000c69" @@ -707,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= @@ -737,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" @@ -794,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" @@ -845,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" @@ -857,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= @@ -893,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" @@ -1079,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" @@ -1089,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" @@ -1108,6 +1139,19 @@ async@^2.0.0, async@^2.5.0: dependencies: lodash "^4.17.10" +async@^2.1.4: + version "2.6.2" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" + 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" @@ -1147,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== @@ -1319,13 +1363,14 @@ better-assert@~1.0.0: dependencies: callsite "1.0.0" -bfj-node4@^5.2.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/bfj-node4/-/bfj-node4-5.3.1.tgz#e23d8b27057f1d0214fc561142ad9db998f26830" - integrity sha512-SOmOsowQWfXc7ybFARsK3C4MCOWzERaOMV/Fl3Tgjs+5dJWyzo3oa127jL44eMbQiAN17J7SvAs2TRxEScTUmg== +bfj@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/bfj/-/bfj-6.1.1.tgz#05a3b7784fbd72cfa3c22e56002ef99336516c48" + integrity sha512-+GUNvzHR4nRyGybQc2WpNJL4MJazMuvf92ueIyA0bIkPRwhhQu3IfZQ2PSoVPpCBJfmoSdOxu5rnotfFLlvYRQ== dependencies: bluebird "^3.5.1" check-types "^7.3.0" + hoopy "^0.1.2" tryer "^1.0.0" big.js@^3.1.3: @@ -1333,18 +1378,21 @@ big.js@^3.1.3: resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" integrity sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q== +big.js@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + binary-extensions@^1.0.0: version "1.11.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" @@ -1391,6 +1439,22 @@ body-parser@1.18.2: raw-body "2.3.2" type-is "~1.6.15" +body-parser@1.19.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" + integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== + dependencies: + bytes "3.1.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "1.7.2" + iconv-lite "0.4.24" + on-finished "~2.3.0" + qs "6.7.0" + raw-body "2.4.0" + type-is "~1.6.17" + body-parser@^1.16.1: version "1.18.3" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" @@ -1424,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" @@ -1480,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== @@ -1501,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" @@ -1598,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== @@ -1606,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= @@ -1678,6 +1733,11 @@ bytes@3.0.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= +bytes@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" + integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + cacache@^10.0.1, cacache@^10.0.4: version "10.0.4" resolved "https://registry.yarnpkg.com/cacache/-/cacache-10.0.4.tgz#6452367999eff9d4188aefd9a14e9d7c6a263460" @@ -1757,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= @@ -1777,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" @@ -1817,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" @@ -1843,16 +1900,7 @@ chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" - integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1917,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" @@ -1986,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" @@ -2013,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" @@ -2159,18 +2226,28 @@ 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.17.x, commander@^2.12.1, commander@^2.13.0, commander@~2.17.1: +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.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== + commander@~2.13.0: version "2.13.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" @@ -2196,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" @@ -2237,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" @@ -2277,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" @@ -2314,6 +2398,13 @@ content-disposition@0.5.2: resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= +content-disposition@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== + dependencies: + safe-buffer "5.1.2" + content-type@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" @@ -2347,6 +2438,11 @@ cookie@0.3.1: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= +cookie@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" @@ -2378,6 +2474,18 @@ copy-webpack-plugin@^4.4.1: p-limit "^1.0.0" serialize-javascript "^1.4.0" +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 "^13.2.4" + core-js@^2.2.0, core-js@^2.4.0, core-js@^2.5.7: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" @@ -2430,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" @@ -2521,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" @@ -2787,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" @@ -2812,32 +2918,45 @@ dateformat@^1.0.11, dateformat@^1.0.6: get-stdin "^4.0.1" meow "^3.3.0" -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-loader@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/debug-loader/-/debug-loader-0.0.1.tgz#44dc37e09e3c39e6af334681960f70a534a9d056" + 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.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" @@ -2868,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: @@ -2918,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" @@ -2980,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== @@ -3150,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" @@ -3164,7 +3284,7 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -ejs@^2.5.7: +ejs@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.6.1.tgz#498ec0d495655abc6f23cd61868d926464071aa0" integrity sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ== @@ -3192,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" @@ -3209,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== @@ -3372,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" @@ -3385,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= @@ -3475,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" @@ -3516,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" @@ -3624,39 +3767,39 @@ express@4.16.2: utils-merge "1.0.1" vary "~1.1.2" -express@^4.16.2: - version "4.16.3" - resolved "https://registry.yarnpkg.com/express/-/express-4.16.3.tgz#6af8a502350db3246ecc4becf6b5a34d22f7ed53" - integrity sha1-avilAjUNsyRuzEvs9rWjTSL37VM= +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== dependencies: - accepts "~1.3.5" + accepts "~1.3.7" array-flatten "1.1.1" - body-parser "1.18.2" - content-disposition "0.5.2" + body-parser "1.19.0" + content-disposition "0.5.3" content-type "~1.0.4" - cookie "0.3.1" + cookie "0.4.0" cookie-signature "1.0.6" debug "2.6.9" depd "~1.1.2" encodeurl "~1.0.2" escape-html "~1.0.3" etag "~1.8.1" - finalhandler "1.1.1" + finalhandler "~1.1.2" fresh "0.5.2" merge-descriptors "1.0.1" methods "~1.1.2" on-finished "~2.3.0" - parseurl "~1.3.2" + parseurl "~1.3.3" path-to-regexp "0.1.7" - proxy-addr "~2.0.3" - qs "6.5.1" - range-parser "~1.2.0" - safe-buffer "5.1.1" - send "0.16.2" - serve-static "1.13.2" - setprototypeof "1.1.0" - statuses "~1.4.0" - type-is "~1.6.16" + proxy-addr "~2.0.5" + qs "6.7.0" + range-parser "~1.2.1" + safe-buffer "5.1.2" + send "0.17.1" + serve-static "1.14.1" + setprototypeof "1.1.1" + statuses "~1.5.0" + type-is "~1.6.18" utils-merge "1.0.1" vary "~1.1.2" @@ -3682,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== @@ -3755,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" @@ -3806,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" @@ -3837,7 +3990,7 @@ filename-regex@^2.0.0: resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= -filesize@^3.5.11: +filesize@^3.6.1: version "3.6.1" resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.6.1.tgz#090bb3ee01b6f801a8a8be99d31710b3422bb317" integrity sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg== @@ -3876,17 +4029,17 @@ finalhandler@1.1.0: statuses "~1.3.1" unpipe "~1.0.0" -finalhandler@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" - integrity sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg== +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== dependencies: debug "2.6.9" encodeurl "~1.0.2" escape-html "~1.0.3" on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.4.0" + parseurl "~1.3.3" + statuses "~1.5.0" unpipe "~1.0.0" find-cache-dir@^1.0.0: @@ -3990,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= @@ -4107,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" @@ -4148,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" @@ -4163,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" @@ -4203,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" @@ -4226,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" @@ -4331,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" @@ -4367,43 +4587,35 @@ gulplog@^1.0.0: dependencies: glogg "^1.0.0" -gzip-size@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-4.1.0.tgz#8ae096257eabe7d69c45be2b67c448124ffb517c" - integrity sha1-iuCWJX6r59acRb4rZ8RIEk/7UXw= +gzip-size@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.1.1.tgz#cb9bee692f87c0612b232840a873904e4c135274" + integrity sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA== dependencies: duplexer "^0.1.1" - pify "^3.0.0" + 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" @@ -4520,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" @@ -4554,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" @@ -4566,6 +4768,11 @@ homedir-polyfill@^1.0.1: dependencies: parse-passwd "^1.0.0" +hoopy@^0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/hoopy/-/hoopy-0.1.4.tgz#609207d661100033a9a9402ad3dea677381c1b1d" + integrity sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ== + hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" @@ -4596,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= @@ -4662,22 +4869,33 @@ http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: setprototypeof "1.1.0" statuses ">= 1.4.0 < 2" +http-errors@1.7.2, http-errors@~1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + http-parser-js@>=0.4.0: version "0.4.13" 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== @@ -4739,7 +4957,7 @@ iconv-lite@0.4.23: dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -4825,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" @@ -4921,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" @@ -4946,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" @@ -4961,10 +5192,15 @@ ipaddr.js@1.8.0: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.0.tgz#eaa33d6ddd7ace8f7f6fe0c9ca0440e706738b1e" integrity sha1-6qM9bd16zo9/b+DJygRA5wZzix4= -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.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.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" @@ -5206,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" @@ -5213,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" @@ -5220,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" @@ -5477,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" @@ -5548,6 +5795,12 @@ json5@^0.5.0: resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + dependencies: + minimist "^1.2.0" + jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" @@ -5675,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" @@ -5732,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" @@ -5788,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" @@ -5807,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" @@ -5853,7 +6108,7 @@ loader-runner@^2.3.0: resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2" integrity sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI= -loader-utils@^0.2.15, loader-utils@^0.2.16: +loader-utils@^0.2.12, loader-utils@^0.2.15, loader-utils@^0.2.16: version "0.2.17" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" integrity sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g= @@ -5872,6 +6127,14 @@ loader-utils@^1.0.0, loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1 emojis-list "^2.0.0" json5 "^0.5.0" +loader-utils@^1.0.4: + version "1.2.3" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" + dependencies: + big.js "^5.2.2" + emojis-list "^2.0.0" + json5 "^1.0.1" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -5945,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= @@ -5992,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" @@ -6009,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" @@ -6029,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" @@ -6049,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" @@ -6084,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: @@ -6100,21 +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.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" @@ -6139,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" @@ -6162,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" @@ -6229,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" @@ -6293,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= @@ -6347,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" @@ -6375,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== @@ -6402,6 +6689,11 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" +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== + "mime-db@>= 1.34.0 < 2", mime-db@~1.36.0: version "1.36.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" @@ -6414,12 +6706,19 @@ mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.19: dependencies: mime-db "~1.36.0" +mime-types@~2.1.24: + version "2.1.24" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" + integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== + dependencies: + mime-db "1.40.0" + mime@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== -mime@^1.6.0: +mime@1.6.0, mime@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== @@ -6429,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" @@ -6444,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== @@ -6525,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" @@ -6558,6 +6884,16 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= +ms@2.1.1: + version "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" @@ -6588,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" @@ -6605,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" @@ -6619,10 +6965,15 @@ negotiator@0.6.1: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= -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== +negotiator@0.6.2: + version "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, 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" @@ -6763,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" @@ -6818,6 +7185,14 @@ nodemon@^1.15.0: undefsafe "^2.0.2" update-notifier "^2.3.0" +noms@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/noms/-/noms-0.0.0.tgz#da8ebd9f3af9d6760919b27d9cdc8092a7332859" + integrity sha1-2o69nzr51nYJGbJ9nNyAkqczKFk= + dependencies: + inherits "^2.0.1" + readable-stream "~1.0.31" + "nopt@2 || 3", nopt@3.x: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -6857,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" @@ -6929,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= @@ -6975,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" @@ -7069,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== @@ -7086,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" @@ -7117,7 +7497,7 @@ opencollective@^1.0.3: node-fetch "1.6.3" opn "4.0.2" -opener@^1.4.3: +opener@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed" integrity sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA== @@ -7135,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" @@ -7170,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== @@ -7194,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" @@ -7216,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" @@ -7249,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" @@ -7331,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" @@ -7355,6 +7764,11 @@ parseurl@~1.3.2: resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" @@ -7387,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= @@ -7441,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" @@ -7486,6 +7900,11 @@ pify@^3.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -7514,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" @@ -7533,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== @@ -7542,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" @@ -8325,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" @@ -8344,10 +8788,10 @@ 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, proxy-addr@~2.0.3: +proxy-addr@~2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93" integrity sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA== @@ -8355,6 +8799,14 @@ proxy-addr@~2.0.2, proxy-addr@~2.0.3: forwarded "~0.1.2" ipaddr.js "1.8.0" +proxy-addr@~2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" + integrity sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ== + dependencies: + forwarded "~0.1.2" + ipaddr.js "1.9.0" + prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -8403,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" @@ -8432,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= @@ -8447,11 +8907,16 @@ 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== +qs@6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + qs@~2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/qs/-/qs-2.3.3.tgz#e9e85adbe75da0bbe4c8e0476a086290f863b404" @@ -8506,6 +8971,11 @@ 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: + 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== + raw-body@2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89" @@ -8526,6 +8996,16 @@ raw-body@2.3.3: iconv-lite "0.4.23" unpipe "1.0.0" +raw-body@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" + integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== + dependencies: + bytes "3.1.0" + http-errors "1.7.2" + iconv-lite "0.4.24" + unpipe "1.0.0" + raw-loader@0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-0.5.1.tgz#0c3d0beaed8a01c966d9787bf778281252a979aa" @@ -8574,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@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== @@ -8587,7 +9067,7 @@ read-pkg@^3.0.0: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@1.0: +readable-stream@1.0, readable-stream@~1.0.31: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= @@ -8597,6 +9077,15 @@ readable-stream@1.0: 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" @@ -8629,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" @@ -8823,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== @@ -8892,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" @@ -8959,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" @@ -8997,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" @@ -9011,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" @@ -9156,6 +9636,15 @@ sass-loader@7.1.0: pify "^3.0.0" semver "^5.5.0" +sass-resources-loader@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/sass-resources-loader/-/sass-resources-loader-2.0.0.tgz#88569c542fbf1f18f33a6578b77cc5b36c56911d" + dependencies: + async "^2.1.4" + chalk "^1.1.3" + glob "^7.1.1" + loader-utils "^1.0.4" + saucelabs@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" @@ -9222,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" @@ -9260,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" @@ -9284,10 +9778,10 @@ send@0.16.1: range-parser "~1.2.0" statuses "~1.3.1" -send@0.16.2: - version "0.16.2" - resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" - integrity sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw== +send@0.17.1: + version "0.17.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" + integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== dependencies: debug "2.6.9" depd "~1.1.2" @@ -9296,19 +9790,19 @@ send@0.16.2: escape-html "~1.0.3" etag "~1.8.1" fresh "0.5.2" - http-errors "~1.6.2" - mime "1.4.1" - ms "2.0.0" + http-errors "~1.7.2" + mime "1.6.0" + ms "2.1.1" on-finished "~2.3.0" - range-parser "~1.2.0" - statuses "~1.4.0" + range-parser "~1.2.1" + statuses "~1.5.0" serialize-javascript@^1.4.0: version "1.5.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= @@ -9331,15 +9825,15 @@ serve-static@1.13.1: parseurl "~1.3.2" send "0.16.1" -serve-static@1.13.2: - version "1.13.2" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" - integrity sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw== +serve-static@1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" + integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" - parseurl "~1.3.2" - send "0.16.2" + parseurl "~1.3.3" + send "0.17.1" set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" @@ -9386,6 +9880,11 @@ setprototypeof@1.1.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" @@ -9486,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" @@ -9539,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" @@ -9630,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= @@ -9685,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" @@ -9783,7 +10273,7 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"statuses@>= 1.3.1 < 2", "statuses@>= 1.4.0 < 2": +"statuses@>= 1.3.1 < 2", "statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= @@ -9793,11 +10283,6 @@ statuses@~1.3.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" integrity sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4= -statuses@~1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" - integrity sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew== - stdout-stream@^1.4.0: version "1.4.1" resolved "https://registry.yarnpkg.com/stdout-stream/-/stdout-stream-1.4.1.tgz#5ac174cdd5cd726104aa0c0b2bd83815d8d535de" @@ -9854,7 +10339,7 @@ streamroller@0.7.0: mkdirp "^0.5.1" readable-stream "^2.3.0" -string-replace-loader@2.1.1: +string-replace-loader@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-replace-loader/-/string-replace-loader-2.1.1.tgz#b72e7b57b6ef04efe615aff0ad989b5c14ca63d1" integrity sha512-0Nvw1LDclF45AFNuYPcD2Jvkv0mwb/dQSnJZMvhqGrT+zzmrpG3OJFD600qfQfNUd5aqfp7fCm2mQMfF7zLbyQ== @@ -9879,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" @@ -9895,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" @@ -9919,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" @@ -9964,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" @@ -9976,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== @@ -10020,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" @@ -10102,6 +10610,14 @@ through2@^2.0.0: readable-stream "^2.1.5" xtend "~4.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== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + through@2, through@X.X.X, through@^2.3.6, through@~2.3, through@~2.3.1: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -10158,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" @@ -10200,6 +10711,11 @@ to-string-loader@1.1.5: dependencies: loader-utils "^0.2.16" +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + touch@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" @@ -10207,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" @@ -10369,6 +10878,14 @@ type-is@~1.6.15, type-is@~1.6.16: media-typer "0.3.0" mime-types "~2.1.18" +type-is@~1.6.17, type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -10428,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" @@ -10565,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" @@ -10622,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== @@ -10651,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= @@ -10730,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= @@ -10794,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" @@ -10839,28 +11356,46 @@ 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" integrity sha1-23hhKSU8tujq5UwvsF+HCvZnW64= -webpack-bundle-analyzer@^2.13.1: - version "2.13.1" - resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz#07d2176c6e86c3cdce4c23e56fae2a7b6b4ad526" - integrity sha512-rwxyfecTAxoarCC9VlHlIpfQCmmJ/qWD5bpbjkof+7HrNhTNZIwZITxN6CdlYL2axGmwNUQ+tFgcSOiNXMf/sQ== +webpack-bundle-analyzer@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.3.2.tgz#3da733a900f515914e729fcebcd4c40dde71fc6f" + integrity sha512-7qvJLPKB4rRWZGjVp5U1KEjwutbDHSKboAl0IfafnrdXMrgC0tOtZbQD6Rw0u4cmpgRN4O02Fc0t8eAT+FgGzA== dependencies: - acorn "^5.3.0" - bfj-node4 "^5.2.0" - chalk "^2.3.0" - commander "^2.13.0" - ejs "^2.5.7" - express "^4.16.2" - filesize "^3.5.11" - gzip-size "^4.1.0" - lodash "^4.17.4" + acorn "^6.0.7" + acorn-walk "^6.1.1" + bfj "^6.1.1" + chalk "^2.4.1" + commander "^2.18.0" + ejs "^2.6.1" + express "^4.16.3" + filesize "^3.6.1" + gzip-size "^5.0.0" + lodash "^4.17.10" mkdirp "^0.5.1" - opener "^1.4.3" - ws "^4.0.0" + opener "^1.5.1" + ws "^6.0.0" webpack-cli@^3.1.0: version "3.1.0" @@ -10905,39 +11440,58 @@ 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" + resolved "https://registry.yarnpkg.com/webpack-import-glob-loader/-/webpack-import-glob-loader-1.6.3.tgz#1b1de573f49c2c2afdb814dc13b44b2111b2ea7b" + dependencies: + glob "^5.0.15" webpack-log@^1.0.1: version "1.2.0" @@ -11031,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== @@ -11052,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" @@ -11087,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" @@ -11101,13 +11654,12 @@ write-file-atomic@^2.0.0: imurmurhash "^0.1.4" signal-exit "^3.0.2" -ws@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-4.1.0.tgz#a979b5d7d4da68bf54efe0408967c324869a7289" - integrity sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA== +ws@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" + integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== dependencies: async-limiter "~1.0.0" - safe-buffer "~5.1.0" ws@~3.3.1: version "3.3.3" @@ -11146,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" @@ -11176,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" @@ -11190,23 +11753,39 @@ yargs-parser@^5.0.0: dependencies: camelcase "^3.0.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@^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 "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.1" yargs@^7.0.0: version "7.1.0" @@ -11227,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" @@ -11254,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"