Skip to content

Commit 71720e8

Browse files
committed
[DSC-1864] Fix issue with missing scope provider
1 parent cdd2263 commit 71720e8

7 files changed

Lines changed: 29 additions & 8 deletions

File tree

src/app/shared/search/search-charts/search-chart/search-chart-wrapper/search-chart-wrapper.component.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
3-
import { FILTER_CONFIG, IN_PLACE_SEARCH } from '../../../../../core/shared/search/search-filter.service';
3+
import { FILTER_CONFIG, IN_PLACE_SEARCH, SCOPE } from '../../../../../core/shared/search/search-filter.service';
44
import { FilterType } from '../../../models/filter-type.model';
55
import { SearchFilterConfig } from '../../../models/search-filter-config.model';
66
import { SearchChartFilterWrapperComponent } from './search-chart-wrapper.component';
@@ -20,7 +20,7 @@ xdescribe('SearchChartFilterWrapperComponent', () => {
2020

2121
const inPlaceSearch: any = '';
2222

23-
beforeEach(async(() => {
23+
beforeEach(waitForAsync(() => {
2424
TestBed.configureTestingModule({
2525
imports: [
2626
BrowserAnimationsModule
@@ -30,7 +30,8 @@ xdescribe('SearchChartFilterWrapperComponent', () => {
3030
],
3131
providers: [
3232
{ provide: FILTER_CONFIG, userValue: mockFilterConfig},
33-
{ provide: IN_PLACE_SEARCH, userValue: inPlaceSearch}
33+
{ provide: IN_PLACE_SEARCH, userValue: inPlaceSearch},
34+
{ provide: SCOPE, userValue: ''}
3435
]
3536
})
3637
.compileComponents();

src/app/shared/search/search-charts/search-chart/search-chart-wrapper/search-chart-wrapper.component.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { GenericConstructor } from '../../../../../core/shared/generic-construct
44
import {
55
FILTER_CONFIG,
66
IN_PLACE_SEARCH,
7-
REFRESH_FILTER
7+
REFRESH_FILTER,
8+
SCOPE
89
} from '../../../../../core/shared/search/search-filter.service';
910
import { FilterType } from '../../../models/filter-type.model';
1011
import { SearchFilterConfig } from '../../../models/search-filter-config.model';
@@ -37,6 +38,11 @@ export class SearchChartFilterWrapperComponent implements OnInit {
3738
*/
3839
@Input() refreshFilters: BehaviorSubject<boolean>;
3940

41+
/**
42+
* The scope of the search.
43+
*/
44+
@Input() scope: string;
45+
4046
/**
4147
* The constructor of the search facet filter that should be rendered, based on the filter config's type
4248
*/
@@ -59,7 +65,8 @@ export class SearchChartFilterWrapperComponent implements OnInit {
5965
providers: [
6066
{ provide: FILTER_CONFIG, useFactory: () => (this.filterConfig), deps: [] },
6167
{ provide: IN_PLACE_SEARCH, useFactory: () => (this.inPlaceSearch), deps: [] },
62-
{ provide: REFRESH_FILTER, useFactory: () => (this.refreshFilters), deps: [] }
68+
{ provide: REFRESH_FILTER, useFactory: () => (this.refreshFilters), deps: [] },
69+
{ provide: SCOPE, useFactory: () => (this.scope), deps: [] }
6370
],
6471
parent: this.injector
6572
});
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<div class="facet-filter mb-3 p-3">
22
<ds-search-chart-wrapper [filterConfig]="filter"
33
[inPlaceSearch]="inPlaceSearch"
4-
[refreshFilters]="refreshFilters"></ds-search-chart-wrapper>
4+
[refreshFilters]="refreshFilters"
5+
[scope]="scope"></ds-search-chart-wrapper>
56
<p class="mt-3 mb-0" *ngIf="showCaption">{{caption}}</p>
67
</div>

src/app/shared/search/search-charts/search-chart/search-chart.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export class SearchChartComponent implements OnInit {
3636
*/
3737
@Input() refreshFilters: BehaviorSubject<boolean>;
3838

39+
/**
40+
* The scope of the search
41+
*/
42+
@Input() scope: string;
43+
3944
/**
4045
* Emits all currently selected values for this filter
4146
*/

src/app/shared/search/search-charts/search-charts.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ <h2 class="m-0 text-break">{{'search.filters.applied.charts.' + ((configuration
2424
<div *ngIf="(canShowChart(selectedFilter) | async)">
2525
<ds-search-chart [filter]="selectedFilter"
2626
[inPlaceSearch]="inPlaceSearch"
27-
[refreshFilters]="refreshFilters"></ds-search-chart>
27+
[refreshFilters]="refreshFilters"
28+
[scope]="scope"></ds-search-chart>
2829
</div>
2930
</div>
3031
</div>

src/app/shared/search/search-charts/search-charts.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ export class SearchChartsComponent implements OnInit {
5454
*/
5555
@Input() showChartsToggle = false;
5656

57+
/**
58+
* The scope of the search
59+
*/
60+
@Input() scope: string;
61+
5762
/**
5863
* The selected chart to show
5964
*/

src/app/shared/search/search.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
[filters]="chartFiltersRD$.asObservable()"
1313
[inPlaceSearch]="inPlaceSearch"
1414
[refreshFilters]="refreshFilters"
15+
[scope]="scope"
1516
[showChartsToggle]="showChartsToggle"></ds-search-charts>
1617

1718
<div *ngIf="!showSidebar && (initialized$ | async)">

0 commit comments

Comments
 (0)