Commit 847af0cd authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Add reset cone search button => DONE

parent 6fdf626d
......@@ -4,6 +4,9 @@
<p class="border-bottom bg-light text-primary mb-0 py-4 pl-4">Cone Search</p>
<div class="p-4">
<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>
......
......@@ -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 datasetActions from '../../metamodel/action/dataset.action';
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 { SearchMultipleQueryParams } from '../store/model';
import { ScrollTopService } from '../../shared/service/sroll-top.service';
......@@ -99,4 +100,12 @@ describe('[SearchMultiple] Container: PositionComponent', () => {
expect(spy).toHaveBeenCalledTimes(1);
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';
import * as fromMetamodel from '../../metamodel/reducers';
import * as metamodelSelector from '../../metamodel/selectors';
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 { ConeSearch } from '../../shared/cone-search/store/model';
import { ScrollTopService } from '../../shared/service/sroll-top.service';
......@@ -63,4 +64,8 @@ export class PositionComponent implements OnInit {
checkStep(): void {
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