diff --git a/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts b/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts index 0bbfb30821..62a8d8dabb 100644 --- a/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts +++ b/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts @@ -1,29 +1,23 @@ import { CollectionItemMapperComponent } from './collection-item-mapper.component'; -import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { CommonModule } from '@angular/common'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { SearchFormComponent } from '../../shared/search-form/search-form.component'; -import { SearchPageModule } from '../../+search-page/search-page.module'; -import { ObjectCollectionComponent } from '../../shared/object-collection/object-collection.component'; import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRouteStub } from '../../shared/testing/active-router-stub'; import { RouterStub } from '../../shared/testing/router-stub'; -import { SearchConfigurationService } from '../../+search-page/search-service/search-configuration.service'; -import { SearchService } from '../../+search-page/search-service/search.service'; import { SearchServiceStub } from '../../shared/testing/search-service-stub'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { NotificationsServiceStub } from '../../shared/testing/notifications-service-stub'; import { ItemDataService } from '../../core/data/item-data.service'; import { FormsModule } from '@angular/forms'; -import { SharedModule } from '../../shared/shared.module'; import { Collection } from '../../core/shared/collection.model'; import { RemoteData } from '../../core/data/remote-data'; -import { PaginatedSearchOptions } from '../../+search-page/paginated-search-options.model'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { EventEmitter, NgModule } from '@angular/core'; +import { EventEmitter } from '@angular/core'; import { HostWindowService } from '../../shared/host-window.service'; import { HostWindowServiceStub } from '../../shared/testing/host-window-service-stub'; import { By } from '@angular/platform-browser'; @@ -36,13 +30,14 @@ import { ItemSelectComponent } from '../../shared/object-select/item-select/item import { ObjectSelectService } from '../../shared/object-select/object-select.service'; import { ObjectSelectServiceStub } from '../../shared/testing/object-select-service-stub'; import { VarDirective } from '../../shared/utils/var.directive'; -import { Observable } from 'rxjs/internal/Observable'; import { of as observableOf, of } from 'rxjs/internal/observable/of'; import { RestResponse } from '../../core/cache/response.models'; -import { SearchFixedFilterService } from '../../+search-page/search-filters/search-filter/search-fixed-filter.service'; import { RouteService } from '../../core/services/route.service'; import { ErrorComponent } from '../../shared/error/error.component'; import { LoadingComponent } from '../../shared/loading/loading.component'; +import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; +import { SearchService } from '../../core/shared/search/search.service'; +import { PaginatedSearchOptions } from '../../shared/search/paginated-search-options.model'; describe('CollectionItemMapperComponent', () => { let comp: CollectionItemMapperComponent; @@ -135,7 +130,6 @@ describe('CollectionItemMapperComponent', () => { { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: ObjectSelectService, useValue: new ObjectSelectServiceStub() }, { provide: RouteService, useValue: routeServiceStub }, - { provide: SearchFixedFilterService, useValue: fixedFilterServiceStub } ] }).compileComponents(); })); diff --git a/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.ts b/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.ts index 750578cc35..5c67a78401 100644 --- a/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.ts +++ b/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.ts @@ -5,12 +5,9 @@ import { fadeIn, fadeInOut } from '../../shared/animations/fade'; import { ActivatedRoute, Router } from '@angular/router'; import { RemoteData } from '../../core/data/remote-data'; import { Collection } from '../../core/shared/collection.model'; -import { SearchConfigurationService } from '../../+search-page/search-service/search-configuration.service'; -import { PaginatedSearchOptions } from '../../+search-page/paginated-search-options.model'; import { PaginatedList } from '../../core/data/paginated-list'; -import { map, startWith, switchMap, take, tap } from 'rxjs/operators'; +import { map, startWith, switchMap, take } from 'rxjs/operators'; import { getRemoteDataPayload, getSucceededRemoteData, toDSpaceObjectListRD } from '../../core/shared/operators'; -import { SearchService } from '../../+search-page/search-service/search.service'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../core/shared/dspace-object-type.model'; import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; @@ -22,6 +19,9 @@ import { isNotEmpty } from '../../shared/empty.util'; import { RestResponse } from '../../core/cache/response.models'; import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; import { SEARCH_CONFIG_SERVICE } from '../../+my-dspace-page/my-dspace-page.component'; +import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; +import { PaginatedSearchOptions } from '../../shared/search/paginated-search-options.model'; +import { SearchService } from '../../core/shared/search/search.service'; @Component({ selector: 'ds-collection-item-mapper', diff --git a/src/app/+collection-page/collection-page.module.ts b/src/app/+collection-page/collection-page.module.ts index 8a3abf876c..9b859a59db 100644 --- a/src/app/+collection-page/collection-page.module.ts +++ b/src/app/+collection-page/collection-page.module.ts @@ -10,7 +10,6 @@ import { CollectionFormComponent } from './collection-form/collection-form.compo import { EditCollectionPageComponent } from './edit-collection-page/edit-collection-page.component'; import { DeleteCollectionPageComponent } from './delete-collection-page/delete-collection-page.component'; import { CollectionItemMapperComponent } from './collection-item-mapper/collection-item-mapper.component'; -import { SearchFixedFilterService } from '../+search-page/search-filters/search-filter/search-fixed-filter.service'; import { SearchService } from '../core/shared/search/search.service'; @NgModule({ @@ -29,7 +28,6 @@ import { SearchService } from '../core/shared/search/search.service'; ], providers: [ SearchService, - SearchFixedFilterService ] }) export class CollectionPageModule { diff --git a/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts b/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts index ed9351d5d2..c8740c35b2 100644 --- a/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts @@ -1,15 +1,12 @@ -import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { CommonModule } from '@angular/common'; import { ItemCollectionMapperComponent } from './item-collection-mapper.component'; import { ActivatedRoute, Router } from '@angular/router'; -import { SearchConfigurationService } from '../../../+search-page/search-service/search-configuration.service'; -import { SearchService } from '../../../+search-page/search-service/search.service'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ItemDataService } from '../../../core/data/item-data.service'; import { RemoteData } from '../../../core/data/remote-data'; -import { PaginatedSearchOptions } from '../../../+search-page/paginated-search-options.model'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model'; import { RouterStub } from '../../../shared/testing/router-stub'; @@ -19,7 +16,6 @@ import { SearchServiceStub } from '../../../shared/testing/search-service-stub'; import { PaginatedList } from '../../../core/data/paginated-list'; import { PageInfo } from '../../../core/shared/page-info.model'; import { FormsModule } from '@angular/forms'; -import { SharedModule } from '../../../shared/shared.module'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub'; import { HostWindowService } from '../../../shared/host-window.service'; @@ -28,7 +24,6 @@ import { By } from '@angular/platform-browser'; import { Item } from '../../../core/shared/item.model'; import { ObjectSelectService } from '../../../shared/object-select/object-select.service'; import { ObjectSelectServiceStub } from '../../../shared/testing/object-select-service-stub'; -import { Observable } from 'rxjs/internal/Observable'; import { of } from 'rxjs/internal/observable/of'; import { RestResponse } from '../../../core/cache/response.models'; import { CollectionSelectComponent } from '../../../shared/object-select/collection-select/collection-select.component'; @@ -39,6 +34,9 @@ import { SearchFormComponent } from '../../../shared/search-form/search-form.com import { Collection } from '../../../core/shared/collection.model'; import { ErrorComponent } from '../../../shared/error/error.component'; import { LoadingComponent } from '../../../shared/loading/loading.component'; +import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; +import { SearchService } from '../../../core/shared/search/search.service'; +import { PaginatedSearchOptions } from '../../../shared/search/paginated-search-options.model'; describe('ItemCollectionMapperComponent', () => { let comp: ItemCollectionMapperComponent; diff --git a/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts b/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts index 97b8164a6e..5494d5ab5f 100644 --- a/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts +++ b/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts @@ -2,15 +2,12 @@ import { combineLatest as observableCombineLatest, Observable } from 'rxjs'; import { ChangeDetectionStrategy, Component, OnInit, ViewChild } from '@angular/core'; import { fadeIn, fadeInOut } from '../../../shared/animations/fade'; -import { PaginatedSearchOptions } from '../../../+search-page/paginated-search-options.model'; import { RemoteData } from '../../../core/data/remote-data'; import { PaginatedList } from '../../../core/data/paginated-list'; import { Collection } from '../../../core/shared/collection.model'; import { Item } from '../../../core/shared/item.model'; import { getRemoteDataPayload, getSucceededRemoteData, toDSpaceObjectListRD } from '../../../core/shared/operators'; import { ActivatedRoute, Router } from '@angular/router'; -import { SearchService } from '../../../+search-page/search-service/search.service'; -import { SearchConfigurationService } from '../../../+search-page/search-service/search-configuration.service'; import { map, startWith, switchMap, take } from 'rxjs/operators'; import { ItemDataService } from '../../../core/data/item-data.service'; import { TranslateService } from '@ngx-translate/core'; @@ -19,6 +16,9 @@ import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model' import { isNotEmpty } from '../../../shared/empty.util'; import { RestResponse } from '../../../core/cache/response.models'; import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; +import { PaginatedSearchOptions } from '../../../shared/search/paginated-search-options.model'; +import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; +import { SearchService } from '../../../core/shared/search/search.service'; @Component({ selector: 'ds-item-collection-mapper', diff --git a/src/app/+item-page/edit-item-page/item-move/item-move.component.spec.ts b/src/app/+item-page/edit-item-page/item-move/item-move.component.spec.ts index e73b4b6f9a..aa84b160a0 100644 --- a/src/app/+item-page/edit-item-page/item-move/item-move.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-move/item-move.component.spec.ts @@ -9,7 +9,6 @@ import { ActivatedRoute, Router } from '@angular/router'; import { ItemMoveComponent } from './item-move.component'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { SearchService } from '../../../+search-page/search-service/search.service'; import { of as observableOf } from 'rxjs'; import { FormsModule } from '@angular/forms'; import { ItemDataService } from '../../../core/data/item-data.service'; @@ -18,6 +17,7 @@ import { PaginatedList } from '../../../core/data/paginated-list'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { RestResponse } from '../../../core/cache/response.models'; import { Collection } from '../../../core/shared/collection.model'; +import { SearchService } from '../../../core/shared/search/search.service'; describe('ItemMoveComponent', () => { let comp: ItemMoveComponent; diff --git a/src/app/+item-page/edit-item-page/item-move/item-move.component.ts b/src/app/+item-page/edit-item-page/item-move/item-move.component.ts index 113ee97b3f..4db7cf94da 100644 --- a/src/app/+item-page/edit-item-page/item-move/item-move.component.ts +++ b/src/app/+item-page/edit-item-page/item-move/item-move.component.ts @@ -1,12 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import { SearchService } from '../../../+search-page/search-service/search.service'; import { first, map } from 'rxjs/operators'; import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model'; -import { SearchOptions } from '../../../+search-page/search-options.model'; import { RemoteData } from '../../../core/data/remote-data'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { PaginatedList } from '../../../core/data/paginated-list'; -import { SearchResult } from '../../../+search-page/search-result.model'; import { Item } from '../../../core/shared/item.model'; import { ActivatedRoute, Router } from '@angular/router'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; @@ -17,9 +14,10 @@ import { getItemEditPath } from '../../item-page-routing.module'; import { Observable, of as observableOf } from 'rxjs'; import { RestResponse } from '../../../core/cache/response.models'; import { Collection } from '../../../core/shared/collection.model'; -import { tap } from 'rxjs/internal/operators/tap'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; -import { PaginatedSearchOptions } from '../../../+search-page/paginated-search-options.model'; +import { SearchService } from '../../../core/shared/search/search.service'; +import { PaginatedSearchOptions } from '../../../shared/search/paginated-search-options.model'; +import { SearchResult } from '../../../shared/search/search-result.model'; @Component({ selector: 'ds-item-move', diff --git a/src/app/+item-page/simple/item-types/publication/publication.component.html b/src/app/+item-page/simple/item-types/publication/publication.component.html index 0f049e5bf4..3cd4d0aa69 100644 --- a/src/app/+item-page/simple/item-types/publication/publication.component.html +++ b/src/app/+item-page/simple/item-types/publication/publication.component.html @@ -28,23 +28,23 @@
diff --git a/src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts b/src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts index 76853db924..1d5564a295 100644 --- a/src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts +++ b/src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts @@ -14,7 +14,7 @@ import { UploaderOptions } from '../../shared/uploader/uploader-options.model'; import { HALEndpointService } from '../../core/shared/hal-endpoint.service'; import { NotificationType } from '../../shared/notifications/models/notification-type'; import { hasValue } from '../../shared/empty.util'; -import { SearchResult } from '../../+search-page/search-result.model'; +import { SearchResult } from '../../shared/search/search-result.model'; /** * This component represents the whole mydspace page header diff --git a/src/app/+my-dspace-page/my-dspace-page.component.ts b/src/app/+my-dspace-page/my-dspace-page.component.ts index 0ee697bae7..d7dfb1831b 100644 --- a/src/app/+my-dspace-page/my-dspace-page.component.ts +++ b/src/app/+my-dspace-page/my-dspace-page.component.ts @@ -27,7 +27,7 @@ import { SearchConfigurationService } from '../core/shared/search/search-configu import { MyDSpaceConfigurationService } from './my-dspace-configuration.service'; import { ViewMode } from '../core/shared/view-mode.model'; import { MyDSpaceRequest } from '../core/data/request.models'; -import { SearchResult } from '../+search-page/search-result.model'; +import { SearchResult } from '../shared/search/search-result.model'; export const MYDSPACE_ROUTE = '/mydspace'; export const SEARCH_CONFIG_SERVICE: InjectionToken = new InjectionToken('searchConfigurationService'); diff --git a/src/app/+my-dspace-page/my-dspace-results/my-dspace-results.component.ts b/src/app/+my-dspace-page/my-dspace-results/my-dspace-results.component.ts index 408d167ec1..a781372e8a 100644 --- a/src/app/+my-dspace-page/my-dspace-results/my-dspace-results.component.ts +++ b/src/app/+my-dspace-page/my-dspace-results/my-dspace-results.component.ts @@ -6,8 +6,8 @@ import { SearchOptions } from '../../shared/search/search-options.model'; import { PaginatedList } from '../../core/data/paginated-list'; import { ViewMode } from '../../core/shared/view-mode.model'; import { isEmpty } from '../../shared/empty.util'; -import { SearchResult } from '../../+search-page/search-result.model'; import { Context } from '../../core/shared/context.model'; +import { SearchResult } from '../../shared/search/search-result.model'; /** * Component that represents all results for mydspace page diff --git a/src/app/core/data/collection-data.service.ts b/src/app/core/data/collection-data.service.ts index e49267d1f2..1197ced0ad 100644 --- a/src/app/core/data/collection-data.service.ts +++ b/src/app/core/data/collection-data.service.ts @@ -25,8 +25,8 @@ import { ResponseParsingService } from './parsing.service'; import { GenericConstructor } from '../shared/generic-constructor'; import { hasValue, isNotEmptyOperator } from '../../shared/empty.util'; import { DSpaceObject } from '../shared/dspace-object.model'; -import { PaginatedSearchOptions } from '../../+search-page/paginated-search-options.model'; import { SearchParam } from '../cache/models/search-param.model'; +import { PaginatedSearchOptions } from '../../shared/search/paginated-search-options.model'; @Injectable() export class CollectionDataService extends ComColDataService { diff --git a/src/app/core/data/relationship-type.service.ts b/src/app/core/data/relationship-type.service.ts index 9d7de280a9..7a2c8af681 100644 --- a/src/app/core/data/relationship-type.service.ts +++ b/src/app/core/data/relationship-type.service.ts @@ -56,8 +56,8 @@ export class RelationshipTypeService { /* Flatten the page so we can treat it like an observable */ switchMap((typeListRD: RemoteData>) => typeListRD.payload.page), switchMap((type: RelationshipType) => { - if (type.leftLabel === label) return this.checkType(type, firstType, secondType); - else if (type.rightLabel === label) return this.checkType(type, secondType, firstType); + if (type.leftwardType === label) return this.checkType(type, firstType, secondType); + else if (type.rightwardType === label) return this.checkType(type, secondType, firstType); else return []; }), ); diff --git a/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.html b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.html index cd982ff17d..87312f8784 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.html +++ b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.html @@ -29,13 +29,13 @@
diff --git a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.html b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.html index 6ecc124978..e77b24a98b 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.html +++ b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.html @@ -17,12 +17,12 @@
diff --git a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.html b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.html index 1a48f525fa..ae6c3a8914 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.html +++ b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.html @@ -21,7 +21,7 @@
diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html index e1bd4a90d6..4d97868b58 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html @@ -25,17 +25,17 @@
diff --git a/src/app/entity-groups/research-entities/item-pages/person/person.component.html b/src/app/entity-groups/research-entities/item-pages/person/person.component.html index 13522acec9..cdfee1de28 100644 --- a/src/app/entity-groups/research-entities/item-pages/person/person.component.html +++ b/src/app/entity-groups/research-entities/item-pages/person/person.component.html @@ -18,19 +18,19 @@ [fields]="['person.birthDate']" [label]="'person.page.birthdate'"> - +
diff --git a/src/app/entity-groups/research-entities/item-pages/project/project.component.html b/src/app/entity-groups/research-entities/item-pages/project/project.component.html index 95b7b03ec7..11326f2e48 100644 --- a/src/app/entity-groups/research-entities/item-pages/project/project.component.html +++ b/src/app/entity-groups/research-entities/item-pages/project/project.component.html @@ -6,12 +6,12 @@ - + @@ -31,17 +31,17 @@
diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.html index ca5d27884e..97b2932b87 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.html @@ -61,7 +61,7 @@ - + diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts index 8c7d046b27..34d2cd574b 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts @@ -81,16 +81,15 @@ import { SelectableListService } from '../../../object-list/selectable-list/sele import { DsDynamicDisabledComponent } from './models/disabled/dynamic-disabled.component'; import { DYNAMIC_FORM_CONTROL_TYPE_DISABLED } from './models/disabled/dynamic-disabled.model'; import { DsDynamicLookupRelationModalComponent } from './relation-lookup-modal/dynamic-lookup-relation-modal.component'; -import { ItemViewMode } from '../../../items/item-type-decorator'; import { ItemMetadataRepresentation } from '../../../../core/shared/metadata-representation/item/item-metadata-representation.model'; import { getSucceededRemoteData } from '../../../../core/shared/operators'; import { RemoteData } from '../../../../core/data/remote-data'; import { Item } from '../../../../core/shared/item.model'; -import { Relationship } from '../../../../core/shared/item-relationships/relationship.model'; import { ItemDataService } from '../../../../core/data/item-data.service'; import { RemoveRelationshipAction } from './relation-lookup-modal/relationship.actions'; import { Store } from '@ngrx/store'; import { AppState } from '../../../../app.reducer'; +import { ViewMode } from '../../../../core/shared/view-mode.model'; export function dsDynamicFormControlMapFn(model: DynamicFormControlModel): Type | null { switch (model.type) { @@ -162,7 +161,6 @@ export function dsDynamicFormControlMapFn(model: DynamicFormControlModel): Type< changeDetection: ChangeDetectionStrategy.Default }) export class DsDynamicFormControlContainerComponent extends DynamicFormControlContainerComponent implements OnInit, OnChanges { - itemViewMode = ItemViewMode; @ContentChildren(DynamicTemplateDirective) contentTemplateList: QueryList; // tslint:disable-next-line:no-input-rename @Input('templates') inputTemplateList: QueryList; diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.ts index d61ffe3296..6c47d23699 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.ts @@ -79,7 +79,7 @@ export class RelationshipEffects { return this.relationshipTypeService.getRelationshipTypeByLabelAndTypes(relationshipType, type1, type2) .pipe( mergeMap((type: RelationshipType) => { - const isSwitched = type.rightLabel === relationshipType; + const isSwitched = type.rightwardType === relationshipType; if (isSwitched) { return this.relationshipService.addRelationship(type.id, item2, item1); } else { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts index e266ff81e1..59268992a6 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts @@ -13,12 +13,11 @@ import { ListableObject } from '../../../../../object-collection/shared/listable import { SearchService } from '../../../../../../core/shared/search/search.service'; import { Router } from '@angular/router'; import { SelectableListService } from '../../../../../object-list/selectable-list/selectable-list.service'; -import { RouteService } from '../../../../../services/route.service'; -import { SelectableListState } from '../../../../../object-list/selectable-list/selectable-list.reducer'; import { hasValue, isNotEmpty } from '../../../../../empty.util'; import { concat, map, multicast, switchMap, take, takeWhile, tap } from 'rxjs/operators'; import { DSpaceObject } from '../../../../../../core/shared/dspace-object.model'; import { getSucceededRemoteData } from '../../../../../../core/shared/operators'; +import { RouteService } from '../../../../../../core/services/route.service'; @Component({ selector: 'ds-dynamic-lookup-relation-search-tab', diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts index 4670c1128c..cab042ebbc 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts @@ -2,7 +2,6 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { SEARCH_CONFIG_SERVICE } from '../../../../../../+my-dspace-page/my-dspace-page.component'; import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service'; import { Observable } from 'rxjs'; -import { RelationshipOptions } from '../../../models/relationship-options.model'; import { ListableObject } from '../../../../../object-collection/shared/listable-object.model'; import { RemoteData } from '../../../../../../core/data/remote-data'; import { map, switchMap, take } from 'rxjs/operators'; @@ -10,10 +9,7 @@ import { createSuccessfulRemoteDataObject } from '../../../../../testing/utils'; import { PaginationComponentOptions } from '../../../../../pagination/pagination-component-options.model'; import { PaginatedList } from '../../../../../../core/data/paginated-list'; import { Router } from '@angular/router'; -import { SelectableListService } from '../../../../../object-list/selectable-list/selectable-list.service'; -import { RouteService } from '../../../../../services/route.service'; import { PaginatedSearchOptions } from '../../../../../search/paginated-search-options.model'; -import { size } from 'memory-cache'; import { PageInfo } from '../../../../../../core/shared/page-info.model'; @Component({ diff --git a/src/app/shared/object-collection/shared/claimed-task-search-result.model.ts b/src/app/shared/object-collection/shared/claimed-task-search-result.model.ts index 4a7bf97850..1148ea1526 100644 --- a/src/app/shared/object-collection/shared/claimed-task-search-result.model.ts +++ b/src/app/shared/object-collection/shared/claimed-task-search-result.model.ts @@ -1,6 +1,6 @@ import { ClaimedTask } from '../../../core/tasks/models/claimed-task-object.model'; -import { SearchResult } from '../../../+search-page/search-result.model'; -import { searchResultFor } from '../../../+search-page/search-service/search-result-element-decorator'; +import { SearchResult } from '../../search/search-result.model'; +import { searchResultFor } from '../../search/search-result-element-decorator'; /** * Represents a search result object of a ClaimedTask object diff --git a/src/app/shared/object-collection/shared/item-search-result.model.ts b/src/app/shared/object-collection/shared/item-search-result.model.ts index 6d20d1ba96..442fb4230c 100644 --- a/src/app/shared/object-collection/shared/item-search-result.model.ts +++ b/src/app/shared/object-collection/shared/item-search-result.model.ts @@ -1,9 +1,9 @@ import { SearchResult } from '../../search/search-result.model'; import { Item } from '../../../core/shared/item.model'; import { inheritEquatable } from '../../../core/utilities/equals.decorators'; -import { searchResultFor } from '../../../+search-page/search-service/search-result-element-decorator'; import { GenericConstructor } from '../../../core/shared/generic-constructor'; import { ListableObject } from './listable-object.model'; +import { searchResultFor } from '../../search/search-result-element-decorator'; @searchResultFor(Item) @inheritEquatable(SearchResult) diff --git a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts index f470f566f0..59e2ddc822 100644 --- a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts +++ b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts @@ -14,7 +14,7 @@ const testType = 'TestType'; const testContext = Context.Search; const testViewMode = ViewMode.StandalonePage; -class TestType implements ListableObject { +class TestType extends ListableObject { getRenderTypes(): Array> { return [testType]; } diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts index 2456913080..5c880133bc 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts @@ -2,7 +2,7 @@ import { Component, Input } from '@angular/core'; import { Metadata } from '../../../../../core/shared/metadata.utils'; import { Item } from '../../../../../core/shared/item.model'; -import { SearchResult } from '../../../../../+search-page/search-result.model'; +import { SearchResult } from '../../../../search/search-result.model'; /** * This component show values for the given item metadata diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts index 0e808321ae..9a8f5ebeec 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts @@ -7,9 +7,9 @@ import { Item } from '../../../../core/shared/item.model'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; import { fadeInOut } from '../../../animations/fade'; import { Bitstream } from '../../../../core/shared/bitstream.model'; -import { SearchResult } from '../../../../+search-page/search-result.model'; import { FileService } from '../../../../core/shared/file.service'; import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service'; +import { SearchResult } from '../../../search/search-result.model'; /** * This component show metadata for the given item object in the detail view. diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/search-result-detail-element.component.ts index f1e9fe698c..e56576a08b 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/search-result-detail-element.component.ts @@ -3,8 +3,8 @@ import { Component, OnInit } from '@angular/core'; import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { Metadata } from '../../../core/shared/metadata.utils'; -import { SearchResult } from '../../../+search-page/search-result.model'; import { hasValue } from '../../empty.util'; +import { SearchResult } from '../../search/search-result.model'; /** * Component representing Search Results with ViewMode.DetailedElement diff --git a/src/app/shared/object-list/item-type-badge/item-type-badge.component.ts b/src/app/shared/object-list/item-type-badge/item-type-badge.component.ts index 5518ede202..88fe2d7f54 100644 --- a/src/app/shared/object-list/item-type-badge/item-type-badge.component.ts +++ b/src/app/shared/object-list/item-type-badge/item-type-badge.component.ts @@ -1,6 +1,4 @@ import { Component, Input } from '@angular/core'; -import { ListableObject } from '../../object-collection/shared/listable-object.model'; -import { SearchResult } from '../../../+search-page/search-result.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; @Component({ diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts index 327bb750b1..3b278492a2 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts @@ -11,7 +11,6 @@ import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspa import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { createSuccessfulRemoteDataObject } from '../../../testing/utils'; import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model'; -import { TruncatableAction } from '../../../truncatable/truncatable.actions'; import { TruncatableService } from '../../../truncatable/truncatable.service'; let component: ClaimedSearchResultListElementComponent; diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts index 0395c8c84b..6d9f325757 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts @@ -3,7 +3,7 @@ import { Component, Input } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { fadeInOut } from '../../../animations/fade'; import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; -import { SearchResult } from '../../../../+search-page/search-result.model'; +import { SearchResult } from '../../../search/search-result.model'; /** * This component show metadata for the given item object in the list view. diff --git a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts index 372bcc9d76..b289d5dd61 100644 --- a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts @@ -11,11 +11,10 @@ import { FILTER_CONFIG, IN_PLACE_SEARCH, SearchFilterService } from '../../../.. import { SearchService } from '../../../../../core/shared/search/search.service'; import { Router } from '@angular/router'; import * as moment from 'moment'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../+my-dspace-page/my-dspace-page.component'; import { SearchConfigurationService } from '../../../../../core/shared/search/search-configuration.service'; -import { RouteService } from '../../../../core/services/route.service'; -import { hasValue } from '../../../../shared/empty.util'; -import { SearchConfigurationService } from '../../../search-service/search-configuration.service'; -import { SEARCH_CONFIG_SERVICE } from '../../../../+my-dspace-page/my-dspace-page.component'; +import { RouteService } from '../../../../../core/services/route.service'; +import { hasValue } from '../../../../empty.util'; /** * The suffix for a range filters' minimum in the frontend URL diff --git a/src/app/+search-page/search-labels/search-label/search-label.component.html b/src/app/shared/search/search-labels/search-label/search-label.component.html similarity index 100% rename from src/app/+search-page/search-labels/search-label/search-label.component.html rename to src/app/shared/search/search-labels/search-label/search-label.component.html diff --git a/src/app/+search-page/search-labels/search-label/search-label.component.spec.ts b/src/app/shared/search/search-labels/search-label/search-label.component.spec.ts similarity index 86% rename from src/app/+search-page/search-labels/search-label/search-label.component.spec.ts rename to src/app/shared/search/search-labels/search-label/search-label.component.spec.ts index a2603b7b8b..0b382015af 100644 --- a/src/app/+search-page/search-labels/search-label/search-label.component.spec.ts +++ b/src/app/shared/search/search-labels/search-label/search-label.component.spec.ts @@ -6,11 +6,11 @@ import { FormsModule } from '@angular/forms'; import { Observable, of as observableOf } from 'rxjs'; import { Params } from '@angular/router'; import { SearchLabelComponent } from './search-label.component'; -import { ObjectKeysPipe } from '../../../shared/utils/object-keys-pipe'; -import { SearchService } from '../../search-service/search.service'; -import { SEARCH_CONFIG_SERVICE } from '../../../+my-dspace-page/my-dspace-page.component'; -import { SearchServiceStub } from '../../../shared/testing/search-service-stub'; -import { SearchConfigurationServiceStub } from '../../../shared/testing/search-configuration-service-stub'; +import { ObjectKeysPipe } from '../../../utils/object-keys-pipe'; +import { SEARCH_CONFIG_SERVICE } from '../../../../+my-dspace-page/my-dspace-page.component'; +import { SearchServiceStub } from '../../../testing/search-service-stub'; +import { SearchConfigurationServiceStub } from '../../../testing/search-configuration-service-stub'; +import { SearchService } from '../../../../core/shared/search/search.service'; describe('SearchLabelComponent', () => { let comp: SearchLabelComponent; diff --git a/src/app/+search-page/search-labels/search-label/search-label.component.ts b/src/app/shared/search/search-labels/search-label/search-label.component.ts similarity index 93% rename from src/app/+search-page/search-labels/search-label/search-label.component.ts rename to src/app/shared/search/search-labels/search-label/search-label.component.ts index 2f44f91a35..e821af19c9 100644 --- a/src/app/+search-page/search-labels/search-label/search-label.component.ts +++ b/src/app/shared/search/search-labels/search-label/search-label.component.ts @@ -1,9 +1,9 @@ import { Component, Input, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { Params } from '@angular/router'; -import { SearchService } from '../../search-service/search.service'; import { map } from 'rxjs/operators'; -import { hasValue, isNotEmpty } from '../../../shared/empty.util'; +import { hasValue, isNotEmpty } from '../../../empty.util'; +import { SearchService } from '../../../../core/shared/search/search.service'; @Component({ selector: 'ds-search-label', diff --git a/src/app/shared/search/search-labels/search-labels.component.ts b/src/app/shared/search/search-labels/search-labels.component.ts index eafbbf00ac..154b888269 100644 --- a/src/app/shared/search/search-labels/search-labels.component.ts +++ b/src/app/shared/search/search-labels/search-labels.component.ts @@ -1,5 +1,8 @@ import { Component, Inject, Input } from '@angular/core'; import { SEARCH_CONFIG_SERVICE } from '../../../+my-dspace-page/my-dspace-page.component'; +import { Observable } from 'rxjs'; +import { Params, Router } from '@angular/router'; +import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; @Component({ selector: 'ds-search-labels', diff --git a/src/app/shared/search/search-result.model.ts b/src/app/shared/search/search-result.model.ts index c8325d7bb2..8d26395021 100644 --- a/src/app/shared/search/search-result.model.ts +++ b/src/app/shared/search/search-result.model.ts @@ -2,6 +2,7 @@ import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { MetadataMap } from '../../core/shared/metadata.models'; import { ListableObject } from '../object-collection/shared/listable-object.model'; import { excludeFromEquals, fieldsForEquals } from '../../core/utilities/equals.decorators'; +import { GenericConstructor } from '../../core/shared/generic-constructor'; /** * Represents a search result object of a certain () DSpaceObject @@ -18,4 +19,11 @@ export class SearchResult extends ListableObject { */ @excludeFromEquals hitHighlights: MetadataMap; + + /** + * Method that returns as which type of object this object should be rendered + */ + getRenderTypes(): Array> { + return [this.constructor as GenericConstructor]; + } } diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index e731fde22c..e21291dabd 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -133,7 +133,6 @@ import { DsDynamicLookupRelationModalComponent } from './form/builder/ds-dynamic import { SearchResultsComponent } from './search/search-results/search-results.component'; import { SearchSidebarComponent } from './search/search-sidebar/search-sidebar.component'; import { SearchSettingsComponent } from './search/search-settings/search-settings.component'; -import { ItemSearchResultGridElementComponent } from './object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component'; import { CollectionSearchResultGridElementComponent } from './object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component'; import { CommunitySearchResultGridElementComponent } from './object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component'; import { SearchFiltersComponent } from './search/search-filters/search-filters.component'; @@ -166,9 +165,7 @@ import { ListableObjectComponentLoaderComponent } from './object-collection/shar import { PublicationSearchResultListElementComponent } from './object-list/search-result-list-element/item-search-result/item-types/publication/publication-search-result-list-element.component'; import { PublicationSearchResultGridElementComponent } from './object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component'; import { ListableObjectDirective } from './object-collection/shared/listable-object/listable-object.directive'; -import { ItemSearchResultListElementComponent } from './object-list/search-result-list-element/item-search-result/item-search-result-list-element.component'; -import { TypedItemSearchResultListElementComponent } from './object-list/item-list-element/item-types/typed-item-search-result-list-element.component'; -import { ItemTypeSwitcherComponent } from './items/switcher/item-type-switcher.component'; +import { SearchLabelComponent } from './search/search-labels/search-label/search-label.component'; const MODULES = [ // Do NOT include UniversalModule, HttpModule, or JsonpModule here @@ -285,20 +282,17 @@ const COMPONENTS = [ EditItemSelectorComponent, CommunitySearchResultListElementComponent, CollectionSearchResultListElementComponent, - ItemSearchResultListElementComponent, - TypedItemSearchResultListElementComponent, - ItemTypeSwitcherComponent, BrowseByComponent, SearchResultsComponent, SearchSidebarComponent, SearchSettingsComponent, - ItemSearchResultGridElementComponent, CollectionSearchResultGridElementComponent, CommunitySearchResultGridElementComponent, SearchFiltersComponent, SearchFilterComponent, SearchFacetFilterComponent, SearchLabelsComponent, + SearchLabelComponent, SearchFacetFilterComponent, SearchFacetFilterWrapperComponent, SearchRangeFilterComponent, @@ -370,7 +364,6 @@ const ENTRY_COMPONENTS = [ ItemMetadataListElementComponent, MetadataRepresentationListElementComponent, SearchResultsComponent, - ItemSearchResultGridElementComponent, CollectionSearchResultGridElementComponent, CommunitySearchResultGridElementComponent, SearchFacetFilterComponent, diff --git a/src/app/shared/view-mode-switch/view-mode-switch.component.ts b/src/app/shared/view-mode-switch/view-mode-switch.component.ts index dfbda51733..4feb8927c2 100644 --- a/src/app/shared/view-mode-switch/view-mode-switch.component.ts +++ b/src/app/shared/view-mode-switch/view-mode-switch.component.ts @@ -6,7 +6,6 @@ import { SearchService } from '../../core/shared/search/search.service'; import { ViewMode } from '../../core/shared/view-mode.model'; import { isEmpty } from '../empty.util'; import { currentPath } from '../utils/route.utils'; -import { RouteService } from '../services/route.service'; import { Router } from '@angular/router'; /** 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 index 91383f8b6a..f1098f8b87 100644 --- 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 @@ -18,7 +18,7 @@
@@ -63,21 +63,21 @@