configuration-search-page.component.ts (dspace-angular-dspace-7.0) | : | configuration-search-page.component.ts (dspace-angular-dspace-7.1) | ||
---|---|---|---|---|
import { HostWindowService } from '../shared/host-window.service'; | import { HostWindowService } from '../shared/host-window.service'; | |||
import { SidebarService } from '../shared/sidebar/sidebar.service'; | import { SidebarService } from '../shared/sidebar/sidebar.service'; | |||
import { SearchComponent } from './search.component'; | import { SearchComponent } from './search.component'; | |||
import { | import { | |||
ChangeDetectionStrategy, | ChangeDetectionStrategy, | |||
Component, | Component, | |||
Inject, | Inject, | |||
Input, | Input, | |||
OnDestroy, | ||||
OnInit | OnInit | |||
} from '@angular/core'; | } from '@angular/core'; | |||
import { pushInOut } from '../shared/animations/push'; | import { pushInOut } from '../shared/animations/push'; | |||
import { SEARCH_CONFIG_SERVICE } from '../my-dspace-page/my-dspace-page.componen t'; | import { SEARCH_CONFIG_SERVICE } from '../my-dspace-page/my-dspace-page.componen t'; | |||
import { SearchConfigurationService } from '../core/shared/search/search-configu ration.service'; | import { SearchConfigurationService } from '../core/shared/search/search-configu ration.service'; | |||
import { hasValue } from '../shared/empty.util'; | import { hasValue } from '../shared/empty.util'; | |||
import { RouteService } from '../core/services/route.service'; | import { RouteService } from '../core/services/route.service'; | |||
import { SearchService } from '../core/shared/search/search.service'; | import { SearchService } from '../core/shared/search/search.service'; | |||
import { Router } from '@angular/router'; | import { Router } from '@angular/router'; | |||
skipping to change at line 37 | skipping to change at line 36 | |||
changeDetection: ChangeDetectionStrategy.OnPush, | changeDetection: ChangeDetectionStrategy.OnPush, | |||
animations: [pushInOut], | animations: [pushInOut], | |||
providers: [ | providers: [ | |||
{ | { | |||
provide: SEARCH_CONFIG_SERVICE, | provide: SEARCH_CONFIG_SERVICE, | |||
useClass: SearchConfigurationService | useClass: SearchConfigurationService | |||
} | } | |||
] | ] | |||
}) | }) | |||
export class ConfigurationSearchPageComponent extends SearchComponent implements OnInit, OnDestroy { | export class ConfigurationSearchPageComponent extends SearchComponent implements OnInit { | |||
/** | /** | |||
* The configuration to use for the search options | * The configuration to use for the search options | |||
* If empty, the configuration will be determined by the route parameter calle d 'configuration' | * If empty, the configuration will be determined by the route parameter calle d 'configuration' | |||
*/ | */ | |||
@Input() configuration: string; | @Input() configuration: string; | |||
/** | /** | |||
* The actual query for the fixed filter. | * The actual query for the fixed filter. | |||
* If empty, the query will be determined by the route parameter called 'filte r' | * If empty, the query will be determined by the route parameter called 'filte r' | |||
*/ | */ | |||
skipping to change at line 75 | skipping to change at line 74 | |||
*/ | */ | |||
ngOnInit(): void { | ngOnInit(): void { | |||
super.ngOnInit(); | super.ngOnInit(); | |||
if (hasValue(this.configuration)) { | if (hasValue(this.configuration)) { | |||
this.routeService.setParameter('configuration', this.configuration); | this.routeService.setParameter('configuration', this.configuration); | |||
} | } | |||
if (hasValue(this.fixedFilterQuery)) { | if (hasValue(this.fixedFilterQuery)) { | |||
this.routeService.setParameter('fixedFilterQuery', this.fixedFilterQuery); | this.routeService.setParameter('fixedFilterQuery', this.fixedFilterQuery); | |||
} | } | |||
} | } | |||
/** | ||||
* Reset the updated query/configuration set in ngOnInit() | ||||
*/ | ||||
ngOnDestroy(): void { | ||||
super.ngOnDestroy(); | ||||
if (hasValue(this.configuration)) { | ||||
this.routeService.setParameter('configuration', undefined); | ||||
} | ||||
if (hasValue(this.fixedFilterQuery)) { | ||||
this.routeService.setParameter('fixedFilterQuery', undefined); | ||||
} | ||||
} | ||||
} | } | |||
End of changes. 3 change blocks. | ||||
15 lines changed or deleted | 1 lines changed or added |