mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 19:13:08 +00:00
fixes after merge + tslint changes
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { FilteredSearchPageComponent } from './filtered-search-page.component';
|
import { FilteredSearchPageComponent } from './filtered-search-page.component';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { configureSearchComponentTestingModule } from './search.component.spec';
|
import { configureSearchComponentTestingModule } from './search.component.spec';
|
||||||
import { SearchConfigurationService } from './search-service/search-configuration.service';
|
import { SearchConfigurationService } from '../core/shared/search/search-configuration.service';
|
||||||
|
|
||||||
describe('FilteredSearchPageComponent', () => {
|
describe('FilteredSearchPageComponent', () => {
|
||||||
let comp: FilteredSearchPageComponent;
|
let comp: FilteredSearchPageComponent;
|
||||||
|
@@ -2,16 +2,17 @@ import { Component, Inject, OnInit } from '@angular/core';
|
|||||||
import { Angulartics2 } from 'angulartics2';
|
import { Angulartics2 } from 'angulartics2';
|
||||||
import { filter, map, switchMap } from 'rxjs/operators';
|
import { filter, map, switchMap } from 'rxjs/operators';
|
||||||
import { SearchComponent } from './search.component';
|
import { SearchComponent } from './search.component';
|
||||||
import { SearchService } from './search-service/search.service';
|
|
||||||
import { SidebarService } from '../shared/sidebar/sidebar.service';
|
import { SidebarService } from '../shared/sidebar/sidebar.service';
|
||||||
import { SearchConfigurationService } from './search-service/search-configuration.service';
|
|
||||||
import { HostWindowService } from '../shared/host-window.service';
|
import { HostWindowService } from '../shared/host-window.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../+my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../+my-dspace-page/my-dspace-page.component';
|
||||||
import { RouteService } from '../core/services/route.service';
|
import { RouteService } from '../core/services/route.service';
|
||||||
import { hasValue } from '../shared/empty.util';
|
import { hasValue } from '../shared/empty.util';
|
||||||
import { SearchQueryResponse } from './search-service/search-query-response.model';
|
|
||||||
import { SearchSuccessResponse } from '../core/cache/response.models';
|
import { SearchSuccessResponse } from '../core/cache/response.models';
|
||||||
import { PaginatedSearchOptions } from './paginated-search-options.model';
|
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';
|
||||||
|
import { SearchQueryResponse } from '../shared/search/search-query-response.model';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component triggers a page view statistic
|
* This component triggers a page view statistic
|
||||||
@@ -35,9 +36,10 @@ export class SearchTrackerComponent extends SearchComponent implements OnInit {
|
|||||||
protected windowService: HostWindowService,
|
protected windowService: HostWindowService,
|
||||||
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
|
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
|
||||||
protected routeService: RouteService,
|
protected routeService: RouteService,
|
||||||
public angulartics2:Angulartics2
|
public angulartics2: Angulartics2,
|
||||||
|
protected router: Router
|
||||||
) {
|
) {
|
||||||
super(service, sidebarService, windowService, searchConfigService, routeService);
|
super(service, sidebarService, windowService, searchConfigService, routeService, router);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
@@ -46,5 +46,9 @@
|
|||||||
[scopes]="(scopeListRD$ | async)"
|
[scopes]="(scopeListRD$ | async)"
|
||||||
[inPlaceSearch]="inPlaceSearch">
|
[inPlaceSearch]="inPlaceSearch">
|
||||||
</ds-search-form>
|
</ds-search-form>
|
||||||
|
<div class="row mb-3 mb-md-1">
|
||||||
|
<div class="labels col-sm-9 offset-sm-3">
|
||||||
<ds-search-labels *ngIf="searchEnabled" [inPlaceSearch]="inPlaceSearch"></ds-search-labels>
|
<ds-search-labels *ngIf="searchEnabled" [inPlaceSearch]="inPlaceSearch"></ds-search-labels>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
@@ -6,15 +6,17 @@ import { RemoteData } from '../core/data/remote-data';
|
|||||||
import { DSpaceObject } from '../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../core/shared/dspace-object.model';
|
||||||
import { pushInOut } from '../shared/animations/push';
|
import { pushInOut } from '../shared/animations/push';
|
||||||
import { HostWindowService } from '../shared/host-window.service';
|
import { HostWindowService } from '../shared/host-window.service';
|
||||||
import { PaginatedSearchOptions } from './paginated-search-options.model';
|
|
||||||
import { SearchResult } from './search-result.model';
|
|
||||||
import { SearchService } from './search-service/search.service';
|
|
||||||
import { SidebarService } from '../shared/sidebar/sidebar.service';
|
import { SidebarService } from '../shared/sidebar/sidebar.service';
|
||||||
import { hasValue, isNotEmpty } from '../shared/empty.util';
|
import { hasValue, isNotEmpty } from '../shared/empty.util';
|
||||||
import { SearchConfigurationService } from './search-service/search-configuration.service';
|
|
||||||
import { getSucceededRemoteData } from '../core/shared/operators';
|
import { getSucceededRemoteData } from '../core/shared/operators';
|
||||||
import { RouteService } from '../core/services/route.service';
|
import { RouteService } from '../core/services/route.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../+my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../+my-dspace-page/my-dspace-page.component';
|
||||||
|
import { PaginatedSearchOptions } from '../shared/search/paginated-search-options.model';
|
||||||
|
import { SearchResult } from '../shared/search/search-result.model';
|
||||||
|
import { SearchConfigurationService } from '../core/shared/search/search-configuration.service';
|
||||||
|
import { SearchService } from '../core/shared/search/search.service';
|
||||||
|
import { currentPath } from '../shared/utils/route.utils';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-search',
|
selector: 'ds-search',
|
||||||
@@ -96,7 +98,8 @@ export class SearchComponent implements OnInit {
|
|||||||
protected sidebarService: SidebarService,
|
protected sidebarService: SidebarService,
|
||||||
protected windowService: HostWindowService,
|
protected windowService: HostWindowService,
|
||||||
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
|
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
|
||||||
protected routeService: RouteService) {
|
protected routeService: RouteService,
|
||||||
|
protected router: Router) {
|
||||||
this.isXsOrSm$ = this.windowService.isXsOrSm();
|
this.isXsOrSm$ = this.windowService.isXsOrSm();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +162,7 @@ export class SearchComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
private getSearchLink(): string {
|
private getSearchLink(): string {
|
||||||
if (this.inPlaceSearch) {
|
if (this.inPlaceSearch) {
|
||||||
return './';
|
return currentPath(this.router);
|
||||||
}
|
}
|
||||||
return this.service.getSearchLink();
|
return this.service.getSearchLink();
|
||||||
}
|
}
|
||||||
|
@@ -22,11 +22,9 @@ import { getSucceededRemoteData } from '../shared/operators';
|
|||||||
* Service responsible for handling requests related to the Site object
|
* Service responsible for handling requests related to the Site object
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SiteDataService extends DataService<Site> {
|
export class SiteDataService extends DataService<Site> {
|
||||||
|
|
||||||
protected linkPath = 'sites';
|
protected linkPath = 'sites';
|
||||||
protected forceBypassCache = false;
|
protected forceBypassCache = false;
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected requestService: RequestService,
|
protected requestService: RequestService,
|
||||||
@@ -42,8 +40,6 @@ export class SiteDataService extends DataService<Site> {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the endpoint for browsing the site object
|
* Get the endpoint for browsing the site object
|
||||||
* @param {FindAllOptions} options
|
* @param {FindAllOptions} options
|
||||||
@@ -53,8 +49,6 @@ export class SiteDataService extends DataService<Site> {
|
|||||||
return this.halService.getEndpoint(this.linkPath);
|
return this.halService.getEndpoint(this.linkPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the Site Object
|
* Retrieve the Site Object
|
||||||
*/
|
*/
|
||||||
|
@@ -117,8 +117,7 @@ export class SearchService implements OnDestroy {
|
|||||||
* @param responseMsToLive The amount of milliseconds for the response to live in cache
|
* @param responseMsToLive The amount of milliseconds for the response to live in cache
|
||||||
* @returns {Observable<RequestEntry>} Emits an observable with the request entries
|
* @returns {Observable<RequestEntry>} Emits an observable with the request entries
|
||||||
*/
|
*/
|
||||||
searchEntries(searchOptions?: PaginatedSearchOptions, responseMsToLive?:number)
|
searchEntries(searchOptions?: PaginatedSearchOptions, responseMsToLive?: number): Observable<{searchOptions: PaginatedSearchOptions, requestEntry: RequestEntry}> {
|
||||||
:Observable<{searchOptions: PaginatedSearchOptions, requestEntry: RequestEntry}> {
|
|
||||||
|
|
||||||
const hrefObs = this.getEndpoint(searchOptions);
|
const hrefObs = this.getEndpoint(searchOptions);
|
||||||
|
|
||||||
@@ -152,8 +151,7 @@ export class SearchService implements OnDestroy {
|
|||||||
* @param searchEntries: The request entries from the search method
|
* @param searchEntries: The request entries from the search method
|
||||||
* @returns {Observable<RemoteData<PaginatedList<SearchResult<DSpaceObject>>>>} Emits a paginated list with all search results found
|
* @returns {Observable<RemoteData<PaginatedList<SearchResult<DSpaceObject>>>>} Emits a paginated list with all search results found
|
||||||
*/
|
*/
|
||||||
getPaginatedResults(searchEntries:Observable<{ searchOptions:PaginatedSearchOptions, requestEntry:RequestEntry }>)
|
getPaginatedResults(searchEntries: Observable<{ searchOptions: PaginatedSearchOptions, requestEntry: RequestEntry }>): Observable<RemoteData<PaginatedList<SearchResult<DSpaceObject>>>> {
|
||||||
:Observable<RemoteData<PaginatedList<SearchResult<DSpaceObject>>>> {
|
|
||||||
const requestEntryObs: Observable<RequestEntry> = searchEntries.pipe(
|
const requestEntryObs: Observable<RequestEntry> = searchEntries.pipe(
|
||||||
map((entry) => entry.requestEntry),
|
map((entry) => entry.requestEntry),
|
||||||
);
|
);
|
||||||
|
@@ -1,16 +1,11 @@
|
|||||||
import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core';
|
import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
import { MetadataRepresentation } from '../../../../../core/shared/metadata-representation/metadata-representation.model';
|
import { MetadataRepresentation } from '../../../../../core/shared/metadata-representation/metadata-representation.model';
|
||||||
import {
|
import { getAllSucceededRemoteData, getRemoteDataPayload } from '../../../../../core/shared/operators';
|
||||||
getAllSucceededRemoteData,
|
|
||||||
getRemoteDataPayload,
|
|
||||||
getSucceededRemoteData
|
|
||||||
} from '../../../../../core/shared/operators';
|
|
||||||
import { hasValue, isNotEmpty } from '../../../../empty.util';
|
import { hasValue, isNotEmpty } from '../../../../empty.util';
|
||||||
import { of as observableOf, Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { filter, map } from 'rxjs/operators';
|
import { filter } from 'rxjs/operators';
|
||||||
import { Relationship } from '../../../../../core/shared/item-relationships/relationship.model';
|
import { Relationship } from '../../../../../core/shared/item-relationships/relationship.model';
|
||||||
import { combineLatest as observableCombineLatest, of } from 'rxjs';
|
|
||||||
import { MetadataValue } from '../../../../../core/shared/metadata.models';
|
import { MetadataValue } from '../../../../../core/shared/metadata.models';
|
||||||
import { ItemMetadataRepresentation } from '../../../../../core/shared/metadata-representation/item/item-metadata-representation.model';
|
import { ItemMetadataRepresentation } from '../../../../../core/shared/metadata-representation/item/item-metadata-representation.model';
|
||||||
import { RelationshipOptions } from '../../models/relationship-options.model';
|
import { RelationshipOptions } from '../../models/relationship-options.model';
|
||||||
|
@@ -24,6 +24,7 @@ import { getSucceededRemoteData } from '../../../../../core/shared/operators';
|
|||||||
import { InputSuggestion } from '../../../../input-suggestions/input-suggestions.model';
|
import { InputSuggestion } from '../../../../input-suggestions/input-suggestions.model';
|
||||||
import { SearchOptions } from '../../../search-options.model';
|
import { SearchOptions } from '../../../search-options.model';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../../+my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../../+my-dspace-page/my-dspace-page.component';
|
||||||
|
import { currentPath } from '../../../../utils/route.utils';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-search-facet-filter',
|
selector: 'ds-search-facet-filter',
|
||||||
@@ -185,7 +186,7 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy {
|
|||||||
*/
|
*/
|
||||||
public getSearchLink(): string {
|
public getSearchLink(): string {
|
||||||
if (this.inPlaceSearch) {
|
if (this.inPlaceSearch) {
|
||||||
return '';
|
return currentPath(this.router);
|
||||||
}
|
}
|
||||||
return this.searchService.getSearchLink();
|
return this.searchService.getSearchLink();
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Params } from '@angular/router';
|
import { Params, Router } from '@angular/router';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { hasValue, isNotEmpty } from '../../../empty.util';
|
import { hasValue, isNotEmpty } from '../../../empty.util';
|
||||||
import { SearchService } from '../../../../core/shared/search/search.service';
|
import { SearchService } from '../../../../core/shared/search/search.service';
|
||||||
|
import { currentPath } from '../../../utils/route.utils';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-search-label',
|
selector: 'ds-search-label',
|
||||||
@@ -25,7 +26,7 @@ export class SearchLabelComponent implements OnInit {
|
|||||||
* Initialize the instance variable
|
* Initialize the instance variable
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private searchService: SearchService) {
|
private searchService: SearchService, private router: Router) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
@@ -55,7 +56,7 @@ export class SearchLabelComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
private getSearchLink(): string {
|
private getSearchLink(): string {
|
||||||
if (this.inPlaceSearch) {
|
if (this.inPlaceSearch) {
|
||||||
return './';
|
return currentPath(this.router);
|
||||||
}
|
}
|
||||||
return this.searchService.getSearchLink();
|
return this.searchService.getSearchLink();
|
||||||
}
|
}
|
||||||
|
@@ -70,6 +70,5 @@ describe('PageWithSidebarComponent', () => {
|
|||||||
it('should open the menu', () => {
|
it('should open the menu', () => {
|
||||||
expect(menu.classList).toContain('active');
|
expect(menu.classList).toContain('active');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -3,10 +3,9 @@ import { RequestService } from '../core/data/request.service';
|
|||||||
import { HALEndpointServiceStub } from '../shared/testing/hal-endpoint-service-stub';
|
import { HALEndpointServiceStub } from '../shared/testing/hal-endpoint-service-stub';
|
||||||
import { getMockRequestService } from '../shared/mocks/mock-request.service';
|
import { getMockRequestService } from '../shared/mocks/mock-request.service';
|
||||||
import { TrackRequest } from './track-request.model';
|
import { TrackRequest } from './track-request.model';
|
||||||
import { ResourceType } from '../core/shared/resource-type';
|
|
||||||
import { SearchOptions } from '../+search-page/search-options.model';
|
|
||||||
import { isEqual } from 'lodash';
|
import { isEqual } from 'lodash';
|
||||||
import { DSpaceObjectType } from '../core/shared/dspace-object-type.model';
|
import { DSpaceObjectType } from '../core/shared/dspace-object-type.model';
|
||||||
|
import { SearchOptions } from '../shared/search/search-options.model';
|
||||||
|
|
||||||
describe('StatisticsService', () => {
|
describe('StatisticsService', () => {
|
||||||
let service: StatisticsService;
|
let service: StatisticsService;
|
||||||
|
@@ -3,10 +3,10 @@ import { Injectable } from '@angular/core';
|
|||||||
import { DSpaceObject } from '../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../core/shared/dspace-object.model';
|
||||||
import { map, take } from 'rxjs/operators';
|
import { map, take } from 'rxjs/operators';
|
||||||
import { TrackRequest } from './track-request.model';
|
import { TrackRequest } from './track-request.model';
|
||||||
import { SearchOptions } from '../+search-page/search-options.model';
|
|
||||||
import { hasValue, isNotEmpty } from '../shared/empty.util';
|
import { hasValue, isNotEmpty } from '../shared/empty.util';
|
||||||
import { HALEndpointService } from '../core/shared/hal-endpoint.service';
|
import { HALEndpointService } from '../core/shared/hal-endpoint.service';
|
||||||
import { RestRequest } from '../core/data/request.models';
|
import { RestRequest } from '../core/data/request.models';
|
||||||
|
import { SearchOptions } from '../shared/search/search-options.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The statistics service
|
* The statistics service
|
||||||
|
@@ -114,6 +114,13 @@
|
|||||||
"parameter": "nospace",
|
"parameter": "nospace",
|
||||||
"property-declaration": "nospace",
|
"property-declaration": "nospace",
|
||||||
"variable-declaration": "nospace"
|
"variable-declaration": "nospace"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"call-signature": "onespace",
|
||||||
|
"index-signature": "onespace",
|
||||||
|
"parameter": "onespace",
|
||||||
|
"property-declaration": "onespace",
|
||||||
|
"variable-declaration": "onespace"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"unified-signatures": true,
|
"unified-signatures": true,
|
||||||
|
Reference in New Issue
Block a user