Commit 4116e383 authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Merge branch '132-search-multiple-add-reset-position-option' into 'develop'

Resolve "[Search Multiple] Add reset position option"

Closes #132

See merge request !144
parents 6fdf626d 847af0cd
Pipeline #3159 passed with stages
in 8 minutes and 33 seconds
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<p class="border-bottom bg-light text-primary mb-0 py-4 pl-4">Cone Search</p> <p class="border-bottom bg-light text-primary mb-0 py-4 pl-4">Cone Search</p>
<div class="p-4"> <div class="p-4">
<app-cone-search></app-cone-search> <app-cone-search></app-cone-search>
<div class=" pt-3 text-center">
<button class="btn btn-outline-secondary" (click)="resetConeSearch()">Reset cone search</button>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -10,6 +10,7 @@ import * as searchMultipleActions from '../store/search-multiple.action'; ...@@ -10,6 +10,7 @@ import * as searchMultipleActions from '../store/search-multiple.action';
import * as fromConeSearch from '../../shared/cone-search/store/cone-search.reducer'; import * as fromConeSearch from '../../shared/cone-search/store/cone-search.reducer';
import * as datasetActions from '../../metamodel/action/dataset.action'; import * as datasetActions from '../../metamodel/action/dataset.action';
import { Dataset, Project } from '../../metamodel/model'; import { Dataset, Project } from '../../metamodel/model';
import * as coneSearchActions from '../../shared/cone-search/store/cone-search.action';
import { ConeSearch } from '../../shared/cone-search/store/model'; import { ConeSearch } from '../../shared/cone-search/store/model';
import { SearchMultipleQueryParams } from '../store/model'; import { SearchMultipleQueryParams } from '../store/model';
import { ScrollTopService } from '../../shared/service/sroll-top.service'; import { ScrollTopService } from '../../shared/service/sroll-top.service';
...@@ -99,4 +100,12 @@ describe('[SearchMultiple] Container: PositionComponent', () => { ...@@ -99,4 +100,12 @@ describe('[SearchMultiple] Container: PositionComponent', () => {
expect(spy).toHaveBeenCalledTimes(1); expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith(positionCheckedAction); expect(spy).toHaveBeenCalledWith(positionCheckedAction);
}); });
it('#resetConeSearch() should dispatch DeleteConeSearchAction', () => {
const deleteConeSearchAction = new coneSearchActions.DeleteConeSearchAction();
const spy = spyOn(store, 'dispatch');
component.resetConeSearch();
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith(deleteConeSearchAction);
});
}); });
...@@ -11,6 +11,7 @@ import * as datasetActions from '../../metamodel/action/dataset.action'; ...@@ -11,6 +11,7 @@ import * as datasetActions from '../../metamodel/action/dataset.action';
import * as fromMetamodel from '../../metamodel/reducers'; import * as fromMetamodel from '../../metamodel/reducers';
import * as metamodelSelector from '../../metamodel/selectors'; import * as metamodelSelector from '../../metamodel/selectors';
import { Dataset, Project } from '../../metamodel/model'; import { Dataset, Project } from '../../metamodel/model';
import * as coneSearchActions from '../../shared/cone-search/store/cone-search.action';
import * as coneSearchSelector from '../../shared/cone-search/store/cone-search.selector'; import * as coneSearchSelector from '../../shared/cone-search/store/cone-search.selector';
import { ConeSearch } from '../../shared/cone-search/store/model'; import { ConeSearch } from '../../shared/cone-search/store/model';
import { ScrollTopService } from '../../shared/service/sroll-top.service'; import { ScrollTopService } from '../../shared/service/sroll-top.service';
...@@ -63,4 +64,8 @@ export class PositionComponent implements OnInit { ...@@ -63,4 +64,8 @@ export class PositionComponent implements OnInit {
checkStep(): void { checkStep(): void {
this.store.dispatch(new searchMultipleActions.PositionCheckedAction()); this.store.dispatch(new searchMultipleActions.PositionCheckedAction());
} }
resetConeSearch(): void {
this.store.dispatch(new coneSearchActions.DeleteConeSearchAction());
}
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment