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/cache/models/items/normalized-relationship.model.ts b/src/app/core/cache/models/items/normalized-relationship.model.ts index 5c37bfddb6..d9322581c3 100644 --- a/src/app/core/cache/models/items/normalized-relationship.model.ts +++ b/src/app/core/cache/models/items/normalized-relationship.model.ts @@ -21,16 +21,18 @@ export class NormalizedRelationship 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(ResourceType.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(ResourceType.Item, false) + rightItem: string; /** * The place of the Item to the left side of this Relationship 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.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/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/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/shared/item-relationships/relationship.model.ts b/src/app/core/shared/item-relationships/relationship.model.ts index 8eb2fd27af..9ab9751489 100644 --- a/src/app/core/shared/item-relationships/relationship.model.ts +++ b/src/app/core/shared/item-relationships/relationship.model.ts @@ -3,6 +3,7 @@ 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 @@ -26,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/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 79% 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 5ef92bc493..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,33 +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: 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 66% 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..a355431100 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,13 @@ -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 { + filterRelationsByTypeLabel, + relationsToItems +} from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('JournalIssue', ItemViewMode.Full) @Component({ @@ -28,23 +29,17 @@ 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) + relationsToItems(this.item.id) ); this.publications$ = this.resolvedRelsAndTypes$.pipe( filterRelationsByTypeLabel('isPublicationOfJournalIssue'), - relationsToItems(this.item.id, this.ids) + relationsToItems(this.item.id) ); } } 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 80% 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 75157a0865..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,27 +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: 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 66% 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..a851bfebbe 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,13 @@ -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 { + filterRelationsByTypeLabel, + relationsToItems +} from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('JournalVolume', ItemViewMode.Full) @Component({ @@ -28,23 +29,17 @@ 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) + relationsToItems(this.item.id) ); this.issues$ = this.resolvedRelsAndTypes$.pipe( filterRelationsByTypeLabel('isIssueOfJournalVolume'), - relationsToItems(this.item.id, this.ids) + relationsToItems(this.item.id) ); } } 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 92% 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 a494364c8b..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,13 +8,13 @@ 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; @@ -23,19 +23,19 @@ let fixture: ComponentFixture; const mockItem: Item = Object.assign(new Item(), { 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 62% 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..99183651e1 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,13 @@ -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 { + filterRelationsByTypeLabel, + relationsToItems +} from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('Journal', ItemViewMode.Full) @Component({ @@ -23,19 +24,13 @@ 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) + relationsToItems(this.item.id) ); } } 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 77% 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 acb73ff685..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,39 +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: 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 68% 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..7101f05d35 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,13 @@ -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 { + filterRelationsByTypeLabel, + relationsToItems +} from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('OrgUnit', ItemViewMode.Full) @Component({ @@ -33,30 +34,23 @@ 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) + relationsToItems(this.item.id) ); this.projects$ = this.resolvedRelsAndTypes$.pipe( filterRelationsByTypeLabel('isProjectOfOrgUnit'), - relationsToItems(this.item.id, this.ids) + relationsToItems(this.item.id) ); this.publications$ = this.resolvedRelsAndTypes$.pipe( filterRelationsByTypeLabel('isPublicationOfOrgUnit'), - relationsToItems(this.item.id, this.ids) + relationsToItems(this.item.id) ); } }} 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 68% 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 5051e047e6..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,51 +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: 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 83% 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..ec91561eb9 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,15 @@ 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 { + filterRelationsByTypeLabel, + relationsToItems +} from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('Person', ItemViewMode.Full) @Component({ @@ -46,7 +48,6 @@ export class PersonComponent extends ItemComponent { constructor( @Inject(ITEM) public item: Item, - private ids: ItemDataService, private fixedFilterService: SearchFixedFilterService ) { super(item); @@ -57,17 +58,17 @@ export class PersonComponent extends ItemComponent { if (isNotEmpty(this.resolvedRelsAndTypes$)) { this.publications$ = this.resolvedRelsAndTypes$.pipe( filterRelationsByTypeLabel('isPublicationOfAuthor'), - relationsToItems(this.item.id, this.ids) + relationsToItems(this.item.id) ); this.projects$ = this.resolvedRelsAndTypes$.pipe( filterRelationsByTypeLabel('isProjectOfPerson'), - relationsToItems(this.item.id, this.ids) + relationsToItems(this.item.id) ); this.orgUnits$ = this.resolvedRelsAndTypes$.pipe( filterRelationsByTypeLabel('isOrgUnitOfPerson'), - relationsToItems(this.item.id, this.ids) + relationsToItems(this.item.id) ); 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 66% 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 dae1226caf..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,39 +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: 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 70% 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..46bc7c9f88 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,14 @@ -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 { + filterRelationsByTypeLabel, + relationsToItems +} from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; @rendersItemType('Project', ItemViewMode.Full) @Component({ @@ -39,32 +40,25 @@ 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) + relationsToItems(this.item.id) ); this.publications$ = this.resolvedRelsAndTypes$.pipe( filterRelationsByTypeLabel('isPublicationOfProject'), - relationsToItems(this.item.id, this.ids) + relationsToItems(this.item.id) ); this.orgUnits$ = this.resolvedRelsAndTypes$.pipe( filterRelationsByTypeLabel('isOrgUnitOfProject'), - relationsToItems(this.item.id, this.ids) + relationsToItems(this.item.id) ); } } 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/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-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/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/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/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/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/notifications/notification/notification.component.scss b/src/app/shared/notifications/notification/notification.component.scss index 1c8f0ae17c..a5ebb72b0b 100644 --- a/src/app/shared/notifications/notification/notification.component.scss +++ b/src/app/shared/notifications/notification/notification.component.scss @@ -1,5 +1,3 @@ -@import '../../../../styles/variables.scss'; - .alert { display: inline-block; min-width: $modal-sm; diff --git a/src/app/shared/notifications/notifications-board/notifications-board.component.scss b/src/app/shared/notifications/notifications-board/notifications-board.component.scss index 47b1dba0c3..1101393e59 100644 --- a/src/app/shared/notifications/notifications-board/notifications-board.component.scss +++ b/src/app/shared/notifications/notifications-board/notifications-board.component.scss @@ -1,6 +1,3 @@ -@import '../../../../styles/variables'; -@import '../../../../styles/mixins'; - .notifications-wrapper { z-index: $zindex-popover; text-align: right; diff --git a/src/app/shared/object-collection/object-collection.component.scss b/src/app/shared/object-collection/object-collection.component.scss index 48e6526dff..e69de29bb2 100644 --- a/src/app/shared/object-collection/object-collection.component.scss +++ b/src/app/shared/object-collection/object-collection.component.scss @@ -1 +0,0 @@ -@import '../../../styles/variables'; 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-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/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.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 4331b5e7e0..816139c8b9 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'; @@ -283,14 +275,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/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/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 3daedbee14..dff503ff5a 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 @@ -36,28 +36,8 @@ 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'; const mockCommunity1Collection1 = Object.assign(new Collection(), { name: 'Community 1-Collection 1', @@ -103,40 +83,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: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [mockCommunity1Collection1, mockCommunity1Collection2])), - subcommunities: createSuccessfulRemoteDataObject$(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: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [mockCommunity2Collection1, mockCommunity2Collection2])), - subcommunities: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])), -}); - -const mockCommunityList = createSuccessfulRemoteDataObject$(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: { @@ -147,8 +107,8 @@ const mockCollectionList = [ { communities: [ { - id: '123456789-1', - name: 'Community 1' + id: 'c0e4de93-f506-4990-a840-d406f6f2ada7', + name: 'Submission test' } ], collection: { @@ -159,8 +119,8 @@ const mockCollectionList = [ { communities: [ { - id: '123456789-2', - name: 'Community 2' + id: 'c0e4de93-f506-4990-a840-d406f6f2ada7', + name: 'Submission test' } ], collection: { @@ -171,8 +131,8 @@ const mockCollectionList = [ { communities: [ { - id: '123456789-2', - name: 'Community 2' + id: 'c0e4de93-f506-4990-a840-d406f6f2ada7', + name: 'Submission test' } ], collection: { @@ -228,6 +188,7 @@ describe('SubmissionFormCollectionComponent Component', () => { { provide: CommunityDataService, useValue: communityDataService }, { provide: JsonPatchOperationsBuilder, useValue: jsonPatchOpBuilder }, { provide: Store, useValue: store }, + { provide: SearchService, useValue: searchService }, ChangeDetectorRef, SubmissionFormCollectionComponent ], @@ -292,14 +253,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 })); 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/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/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/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/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..eb0733e695 100644 --- a/yarn.lock +++ b/yarn.lock @@ -655,6 +655,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 +670,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" @@ -1108,6 +1126,12 @@ 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" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1319,13 +1343,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,6 +1358,10 @@ 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" @@ -1391,6 +1420,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" @@ -1678,6 +1723,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" @@ -1843,16 +1893,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== @@ -2166,11 +2207,16 @@ combined-stream@1.0.6, combined-stream@~1.0.5, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@2.17.x, commander@^2.12.1, commander@^2.13.0, commander@~2.17.1: +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: + 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" @@ -2314,6 +2360,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 +2400,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 +2436,18 @@ copy-webpack-plugin@^4.4.1: p-limit "^1.0.0" serialize-javascript "^1.4.0" +copyfiles@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-2.1.0.tgz#0e2a4188162d6b2f3c5adfe34e9c0bd564d23164" + integrity sha512-cAeDE0vL/koE9WSEGxqPpSyvU638Kgfu6wfrnj7kqp9FWa1CWsU54Coo6sdYZP4GstWa39tL/wIVJWfXcujgNA== + dependencies: + glob "^7.0.5" + minimatch "^3.0.3" + mkdirp "^0.5.1" + noms "0.0.0" + through2 "^2.0.1" + yargs "^11.0.0" + 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" @@ -2812,6 +2882,12 @@ dateformat@^1.0.11, dateformat@^1.0.6: get-stdin "^4.0.1" meow "^3.3.0" +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.6, debug@^2.6.8: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -3164,7 +3240,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== @@ -3624,39 +3700,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.2, express@^4.16.3: + 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" @@ -3837,7 +3913,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 +3952,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: @@ -4367,13 +4443,13 @@ 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" @@ -4566,6 +4642,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" @@ -4662,6 +4743,17 @@ 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" @@ -4739,7 +4831,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== @@ -4961,6 +5053,11 @@ 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.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.5.2: version "1.8.1" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.1.tgz#fa4b79fa47fd3def5e3b159825161c0a519c9427" @@ -5548,6 +5645,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" @@ -5853,7 +5956,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 +5975,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" @@ -6116,6 +6227,10 @@ lodash@4.17.10, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.13.1, lodash@^4.17.0, lo resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" integrity sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg== +lodash@^4.17.11: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + log-driver@^1.2.5: version "1.2.7" resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" @@ -6402,6 +6517,11 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" +mime-db@1.40.0: + 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 +6534,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== @@ -6558,6 +6685,11 @@ 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== + 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" @@ -6619,6 +6751,11 @@ negotiator@0.6.1: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= +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: version "2.5.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.2.tgz#489105ce7bc54e709d736b195f82135048c50fcc" @@ -6818,6 +6955,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" @@ -7117,7 +7262,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== @@ -7355,6 +7500,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" @@ -7486,6 +7636,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" @@ -8347,7 +8502,7 @@ protractor@^5.3.0: webdriver-js-extender "2.0.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 +8510,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" @@ -8452,6 +8615,11 @@ qs@6.5.2, qs@~6.5.1, qs@~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 +8674,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: + 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 +8699,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 +8757,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.2.9, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: 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 +8770,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= @@ -9156,6 +9339,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" @@ -9284,10 +9476,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,12 +9488,12 @@ 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" @@ -9331,15 +9523,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 +9578,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" @@ -9783,7 +9980,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 +9990,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 +10046,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== @@ -10102,6 +10294,14 @@ through2@^2.0.0: readable-stream "^2.1.5" xtend "~4.0.1" +through2@^2.0.1: + 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" @@ -10200,6 +10400,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" @@ -10369,6 +10574,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" @@ -10844,23 +11057,24 @@ webfontloader@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" @@ -10939,6 +11153,12 @@ webpack-dev-server@^3.1.5: webpack-log "^2.0.0" yargs "12.0.1" +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" resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-1.2.0.tgz#a4b34cda6b22b518dbb0ab32e567962d5c72a43d" @@ -11101,13 +11321,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" @@ -11190,6 +11409,13 @@ yargs-parser@^5.0.0: dependencies: camelcase "^3.0.0" +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= + dependencies: + camelcase "^4.1.0" + yargs@12.0.1, yargs@^12.0.1: version "12.0.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.1.tgz#6432e56123bb4e7c3562115401e98374060261c2" @@ -11208,6 +11434,24 @@ yargs@12.0.1, yargs@^12.0.1: y18n "^3.2.1 || ^4.0.0" yargs-parser "^10.1.0" +yargs@^11.0.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + 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" + yargs-parser "^9.0.2" + yargs@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8"