diff --git a/client/src/app/instance/cone-search/components/cone-search.component.html b/client/src/app/instance/cone-search/components/cone-search.component.html index ddec1bfaedd1e4eefd9d36ee6ec6f27e97f5b557..0d5da742daf22ff65c6820ed518922f0bb93613b 100644 --- a/client/src/app/instance/cone-search/components/cone-search.component.html +++ b/client/src/app/instance/cone-search/components/cone-search.component.html @@ -2,7 +2,6 @@ <div class="col"> <app-resolver [coneSearch]="coneSearch" - [resolver]="resolver" [resolverIsLoading]="resolverIsLoading" [resolverIsLoaded]="resolverIsLoaded" (retrieveCoordinates)="retrieveCoordinates.emit($event)"> @@ -11,7 +10,7 @@ </div> <div class="row"> <div class="col pb-4"> - <app-ra [form]="form" [unit]="unit" [resolver]="resolver"> + <app-ra [form]="form" [unit]="unit" [coneSearch]="coneSearch"> </app-ra> </div> <div class="col-auto p-0 align-self-center"> @@ -20,7 +19,7 @@ </button> </div> <div class="col"> - <app-dec [form]="form" [unit]="unit" [resolver]="resolver"> + <app-dec [form]="form" [unit]="unit" [coneSearch]="coneSearch"> </app-dec> </div> <div class="col-12"> diff --git a/client/src/app/instance/cone-search/components/cone-search.component.spec.ts b/client/src/app/instance/cone-search/components/cone-search.component.spec.ts index adbf2b5c31c59a361d185bf9eb7fe49a44091837..2b23602aea2aac00b3d22f404ae28ad57b74b667 100644 --- a/client/src/app/instance/cone-search/components/cone-search.component.spec.ts +++ b/client/src/app/instance/cone-search/components/cone-search.component.spec.ts @@ -91,7 +91,7 @@ describe('[Instance][ConeSearch][Components] ConeSearchComponent', () => { const spy = jest.spyOn(testedComponent, 'ngOnChanges'); testHostComponent.resolver = { name: 'myObject', ra: 1, dec: 2 }; testHostFixture.detectChanges(); - expect(spy).toHaveBeenCalledTimes(1); + expect(spy).toHaveBeenCalledTimes(0); expect(testedComponent.unit).toEqual('degree'); expect(testedComponent.form.controls.ra.enabled).toBeTruthy(); expect(testedComponent.form.controls.dec.enabled).toBeTruthy(); @@ -99,15 +99,15 @@ describe('[Instance][ConeSearch][Components] ConeSearchComponent', () => { testHostComponent.coneSearch = { ra: 1, dec: 2, radius: 3 }; testHostFixture.detectChanges(); - expect(spy).toHaveBeenCalledTimes(2); - expect(testedComponent.form.controls.ra.value).toEqual(1); - expect(testedComponent.form.controls.dec.value).toEqual(2); + expect(spy).toHaveBeenCalledTimes(1); + expect(testedComponent.form.controls.ra.value).toEqual(null); + expect(testedComponent.form.controls.dec.value).toEqual(null); expect(testedComponent.form.controls.radius.value).toEqual(3); testHostComponent.coneSearch = undefined; testedComponent.unit = 'hms'; testHostFixture.detectChanges(); - expect(spy).toHaveBeenCalledTimes(3); + expect(spy).toHaveBeenCalledTimes(2); expect(testedComponent.form.controls.ra_hms.enabled).toBeTruthy(); expect(testedComponent.form.controls.dec_dms.enabled).toBeTruthy(); }); diff --git a/client/src/app/instance/cone-search/components/cone-search.component.ts b/client/src/app/instance/cone-search/components/cone-search.component.ts index 72c5541ba8304780b1139b9fa91d6d677799cf3a..5ded610d50c5036e93c5f87b835e1861ae9bcf7f 100644 --- a/client/src/app/instance/cone-search/components/cone-search.component.ts +++ b/client/src/app/instance/cone-search/components/cone-search.component.ts @@ -12,7 +12,7 @@ import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms import { debounceTime, Subscription } from 'rxjs'; -import { ConeSearch, Resolver } from 'src/app/instance/store/models'; +import { ConeSearch } from 'src/app/instance/store/models'; import { nanValidator, rangeValidator } from '../validators'; /** @@ -27,7 +27,6 @@ import { nanValidator, rangeValidator } from '../validators'; }) export class ConeSearchComponent implements OnChanges, OnInit, OnDestroy { @Input() coneSearch: ConeSearch; - @Input() resolver: Resolver; @Input() resolverIsLoading: boolean; @Input() resolverIsLoaded: boolean; @Output() retrieveCoordinates: EventEmitter<string> = new EventEmitter(); @@ -65,10 +64,6 @@ export class ConeSearchComponent implements OnChanges, OnInit, OnDestroy { } ngOnChanges(changes: SimpleChanges): void { - if (changes.resolver && changes.resolver.currentValue) { - this.unit = 'degree'; - } - if (changes.coneSearch && !changes.coneSearch.currentValue) { if (this.unit == 'degree') { this.form.controls.ra.enable(); @@ -83,7 +78,8 @@ export class ConeSearchComponent implements OnChanges, OnInit, OnDestroy { } if (changes.coneSearch && changes.coneSearch.currentValue) { - this.form.patchValue(this.coneSearch); + const radius = changes.coneSearch.currentValue.radius; + this.form.controls.radius.setValue(radius); } } diff --git a/client/src/app/instance/cone-search/components/dec.component.spec.ts b/client/src/app/instance/cone-search/components/dec.component.spec.ts index ddc5a64bb830c6fe022afcdeb2834fe545ecabe1..407b3b1405dab94c7c06f97782b090120e5a6dbd 100644 --- a/client/src/app/instance/cone-search/components/dec.component.spec.ts +++ b/client/src/app/instance/cone-search/components/dec.component.spec.ts @@ -94,8 +94,8 @@ describe('[Instance][ConeSearch][Components] DecComponent', () => { expect(testedComponent.form.controls.dec.enabled).toBeTruthy(); testHostComponent.resolver = { ra: 1, dec: 2, name: 'myObject' }; testHostFixture.detectChanges(); - expect(spy).toHaveBeenCalledTimes(3); - expect(testedComponent.form.controls.dec.value).toEqual(2); + expect(spy).toHaveBeenCalledTimes(2); + expect(testedComponent.form.controls.dec.value).toEqual(32.87); }); it('#getDecDmsForm() should return DEC DMS form control', () => { diff --git a/client/src/app/instance/cone-search/components/dec.component.ts b/client/src/app/instance/cone-search/components/dec.component.ts index 501be2eacda2d6800032dd78ac1aab029f2628c8..7d8c3180b6f8aaf71c651477ecf8d7dc9735956f 100644 --- a/client/src/app/instance/cone-search/components/dec.component.ts +++ b/client/src/app/instance/cone-search/components/dec.component.ts @@ -13,7 +13,7 @@ import { UntypedFormGroup } from '@angular/forms'; import { Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { Resolver } from 'src/app/instance/store/models'; +import { ConeSearch } from 'src/app/instance/store/models'; /** * @class @@ -32,7 +32,7 @@ import { Resolver } from 'src/app/instance/store/models'; export class DecComponent implements OnInit, OnDestroy, OnChanges { @Input() form: UntypedFormGroup; @Input() unit: string; - @Input() resolver: Resolver; + @Input() coneSearch: ConeSearch; public decControlSubscription: Subscription public decDmsSubscription: Subscription; @@ -61,8 +61,10 @@ export class DecComponent implements OnInit, OnDestroy, OnChanges { } } - if (changes.resolver && changes.resolver.currentValue) { - this.form.controls.dec.setValue(changes.resolver.currentValue.dec); + if (changes.coneSearch && changes.coneSearch.currentValue) { + const dec = changes.coneSearch.currentValue.dec; + this.form.controls.dec.setValue(changes.coneSearch.currentValue.dec); + this.deg2DMS(dec); } } diff --git a/client/src/app/instance/cone-search/components/ra.component.spec.ts b/client/src/app/instance/cone-search/components/ra.component.spec.ts index 1ecb7b1631f6cc3c52f34fc92bd4cd3e395a8bda..7a05acd69eb0bf28238d71b2c2d5d0189fc383ba 100644 --- a/client/src/app/instance/cone-search/components/ra.component.spec.ts +++ b/client/src/app/instance/cone-search/components/ra.component.spec.ts @@ -94,8 +94,8 @@ describe('[Instance][ConeSearch][Components] RaComponent', () => { expect(testedComponent.form.controls.ra.enabled).toBeTruthy(); testHostComponent.resolver = { ra: 1, dec: 2, name: 'myObject' }; testHostFixture.detectChanges(); - expect(spy).toHaveBeenCalledTimes(3); - expect(testedComponent.form.controls.ra.value).toEqual(1); + expect(spy).toHaveBeenCalledTimes(2); + expect(testedComponent.form.controls.ra.value).toEqual(78.2); }); it('#getRaHmsForm() should return RA HMS form control', () => { diff --git a/client/src/app/instance/cone-search/components/ra.component.ts b/client/src/app/instance/cone-search/components/ra.component.ts index 6314f603c6b8e35570207a10ab75f84bfe6e8d5e..a177faac1169541cd5b3b5dcfd50924b977af26b 100644 --- a/client/src/app/instance/cone-search/components/ra.component.ts +++ b/client/src/app/instance/cone-search/components/ra.component.ts @@ -13,7 +13,7 @@ import { UntypedFormGroup } from '@angular/forms'; import { Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { Resolver } from 'src/app/instance/store/models'; +import { ConeSearch } from 'src/app/instance/store/models'; /** * @class @@ -32,7 +32,7 @@ import { Resolver } from 'src/app/instance/store/models'; export class RaComponent implements OnInit, OnDestroy, OnChanges { @Input() form: UntypedFormGroup; @Input() unit: string; - @Input() resolver: Resolver; + @Input() coneSearch: ConeSearch; public raControlSubscription: Subscription; public raHmsFormSubscription: Subscription; @@ -61,8 +61,10 @@ export class RaComponent implements OnInit, OnDestroy, OnChanges { } } - if (changes.resolver && changes.resolver.currentValue) { - this.form.controls.ra.setValue(changes.resolver.currentValue.ra); + if (changes.coneSearch && changes.coneSearch.currentValue) { + const ra = changes.coneSearch.currentValue.ra; + this.form.controls.ra.setValue(changes.coneSearch.currentValue.ra); + this.deg2HMS(ra); } } diff --git a/client/src/app/instance/cone-search/components/resolver.component.ts b/client/src/app/instance/cone-search/components/resolver.component.ts index d9add2b485a026fe42ad4a05b809c491e5a2673d..fab848211df15a8a6b5daeaec8e8ae86c0fc170f 100644 --- a/client/src/app/instance/cone-search/components/resolver.component.ts +++ b/client/src/app/instance/cone-search/components/resolver.component.ts @@ -23,7 +23,6 @@ import { ConeSearch, Resolver } from 'src/app/instance/store/models'; }) export class ResolverComponent { @Input() coneSearch: ConeSearch; - @Input() resolver: Resolver; @Input() resolverIsLoading: boolean; @Input() resolverIsLoaded: boolean; @Output() retrieveCoordinates: EventEmitter<string> = new EventEmitter(); diff --git a/client/src/app/instance/search-multiple/components/position/cone-search-panel.component.html b/client/src/app/instance/search-multiple/components/position/cone-search-panel.component.html index e36092290e12da6431d1fdbd6d721668d5a94e54..52e4398fbf5142c3e90a7728c9d5712546b304ab 100644 --- a/client/src/app/instance/search-multiple/components/position/cone-search-panel.component.html +++ b/client/src/app/instance/search-multiple/components/position/cone-search-panel.component.html @@ -6,7 +6,6 @@ <div class="col"> <app-cone-search [coneSearch]="coneSearch" - [resolver]="resolver" [resolverIsLoading]="resolverIsLoading" [resolverIsLoaded]="resolverIsLoaded" (retrieveCoordinates)="retrieveCoordinates.emit($event)" diff --git a/client/src/app/instance/search-multiple/components/position/cone-search-panel.component.ts b/client/src/app/instance/search-multiple/components/position/cone-search-panel.component.ts index a032eda07851d0321f2d1971dc6ac6e5bd1ccd0c..f2096f2602a4645d1c575ccdee31b8334642d633 100644 --- a/client/src/app/instance/search-multiple/components/position/cone-search-panel.component.ts +++ b/client/src/app/instance/search-multiple/components/position/cone-search-panel.component.ts @@ -18,7 +18,6 @@ import { ConeSearch, Resolver, coneSearchToString } from 'src/app/instance/store }) export class ConeSearchPanelComponent { @Input() coneSearch: ConeSearch; - @Input() resolver: Resolver; @Input() resolverIsLoading: boolean; @Input() resolverIsLoaded: boolean; @Output() addConeSearch: EventEmitter<ConeSearch> = new EventEmitter(); diff --git a/client/src/app/instance/search-multiple/containers/position.component.html b/client/src/app/instance/search-multiple/containers/position.component.html index 6557826011b22dcc1732c61cd7b85f73c04662d7..262c9e226df04a33bddb11bb6f43208dcb1de56a 100644 --- a/client/src/app/instance/search-multiple/containers/position.component.html +++ b/client/src/app/instance/search-multiple/containers/position.component.html @@ -9,7 +9,6 @@ <app-cone-search-panel [coneSearch]="coneSearch | async" - [resolver]="resolver | async" [resolverIsLoading]="resolverIsLoading | async" [resolverIsLoaded]="resolverIsLoaded | async" (addConeSearch)="addConeSearch($event)" diff --git a/client/src/app/instance/search-multiple/containers/position.component.ts b/client/src/app/instance/search-multiple/containers/position.component.ts index d1d57ebaf2c1a6904129c6a11b916c41857885ff..7d883f8c9e61906d45c4e40cd29cb08f04c6f0f6 100644 --- a/client/src/app/instance/search-multiple/containers/position.component.ts +++ b/client/src/app/instance/search-multiple/containers/position.component.ts @@ -30,13 +30,11 @@ import * as coneSearchSelector from '../../store/selectors/cone-search.selector' templateUrl: 'position.component.html' }) export class PositionComponent extends AbstractSearchMultipleComponent implements OnInit { - public resolver: Observable<Resolver>; public resolverIsLoading: Observable<boolean>; public resolverIsLoaded: Observable<boolean>; constructor(protected store: Store<{ }>) { super(store); - this.resolver = this.store.select(coneSearchSelector.selectResolver); this.resolverIsLoading = this.store.select(coneSearchSelector.selectResolverIsLoading); this.resolverIsLoaded = this.store.select(coneSearchSelector.selectResolverIsLoaded); } diff --git a/client/src/app/instance/search/components/criteria/cone-search-tab.component.html b/client/src/app/instance/search/components/criteria/cone-search-tab.component.html index 48eedf4b66cc9f7a865cfc6c740adc61ac24a47b..d0991f524b2f24c484a80b02db047d9481fd32cd 100644 --- a/client/src/app/instance/search/components/criteria/cone-search-tab.component.html +++ b/client/src/app/instance/search/components/criteria/cone-search-tab.component.html @@ -16,7 +16,6 @@ <div class="col"> <app-cone-search [coneSearch]="coneSearch" - [resolver]="resolver" [resolverIsLoading]="resolverIsLoading" [resolverIsLoaded]="resolverIsLoaded" (retrieveCoordinates)="retrieveCoordinates.emit($event)" diff --git a/client/src/app/instance/search/components/criteria/cone-search-tab.component.ts b/client/src/app/instance/search/components/criteria/cone-search-tab.component.ts index d7384306362436d0c962b5718e5f48ddc1b4738b..3df09dbacb60c300269a9f3bb840c87b3231e829 100644 --- a/client/src/app/instance/search/components/criteria/cone-search-tab.component.ts +++ b/client/src/app/instance/search/components/criteria/cone-search-tab.component.ts @@ -26,7 +26,6 @@ export class ConeSearchTabComponent { @Input() datasetList: Dataset[]; @Input() coneSearch: ConeSearch; @Input() coneSearchConfig: ConeSearchConfig; - @Input() resolver: Resolver; @Input() resolverIsLoading: boolean; @Input() resolverIsLoaded: boolean; @Output() addConeSearch: EventEmitter<ConeSearch> = new EventEmitter(); diff --git a/client/src/app/instance/search/containers/criteria.component.html b/client/src/app/instance/search/containers/criteria.component.html index 9da1006f101cc870ae056eeb1b33dd90af20939e..17e9d8473ecb7ba8257032a880a2cb9de3e118c9 100644 --- a/client/src/app/instance/search/containers/criteria.component.html +++ b/client/src/app/instance/search/containers/criteria.component.html @@ -22,7 +22,6 @@ [datasetList]="datasetList | async" [coneSearch]="coneSearch | async" [coneSearchConfig]="coneSearchConfig | async" - [resolver]="resolver | async" [resolverIsLoading]="resolverIsLoading | async" [resolverIsLoaded]="resolverIsLoaded | async" (addConeSearch)="addConeSearch($event)" diff --git a/client/src/app/instance/search/containers/criteria.component.ts b/client/src/app/instance/search/containers/criteria.component.ts index 4f4ad8eedba2deff5c848315aaa7d1f1fb52684a..cb0d816c590dccac354da5e5d02fd9b09d9f6a2c 100644 --- a/client/src/app/instance/search/containers/criteria.component.ts +++ b/client/src/app/instance/search/containers/criteria.component.ts @@ -34,7 +34,6 @@ import * as coneSearchConfigSelector from 'src/app/metamodel/selectors/cone-sear export class CriteriaComponent extends AbstractSearchComponent { public instance: Observable<Instance>; public dataset: Observable<Dataset>; - public resolver: Observable<Resolver>; public resolverIsLoading: Observable<boolean>; public resolverIsLoaded: Observable<boolean>; public coneSearchConfig: Observable<ConeSearchConfig>; @@ -45,7 +44,6 @@ export class CriteriaComponent extends AbstractSearchComponent { super(store); this.instance = store.select(instanceSelector.selectInstanceByRouteName); this.dataset = store.select(datasetSelector.selectDatasetByRouteName); - this.resolver = this.store.select(coneSearchSelector.selectResolver); this.resolverIsLoading = this.store.select(coneSearchSelector.selectResolverIsLoading); this.resolverIsLoaded = this.store.select(coneSearchSelector.selectResolverIsLoaded); this.coneSearchConfig = store.select(coneSearchConfigSelector.selectConeSearchConfig); diff --git a/client/src/app/instance/store/effects/cone-search.effects.spec.ts b/client/src/app/instance/store/effects/cone-search.effects.spec.ts index cf86c8d2c962b7957c25476a5aea93a839520ce1..1033c5b6063e8162dd82f39936268c8eeeb8efa9 100644 --- a/client/src/app/instance/store/effects/cone-search.effects.spec.ts +++ b/client/src/app/instance/store/effects/cone-search.effects.spec.ts @@ -2,6 +2,7 @@ import { TestBed } from '@angular/core/testing'; import { provideMockActions } from '@ngrx/effects/testing'; import { EffectsMetadata, getEffectsMetadata } from '@ngrx/effects'; +import { provideMockStore } from '@ngrx/store/testing'; import { Observable } from 'rxjs'; import { cold, hot } from 'jasmine-marbles'; import { ToastrService } from 'ngx-toastr'; @@ -10,6 +11,7 @@ import { ConeSearchEffects } from './cone-search.effects'; import { ConeSearchService } from '../services/cone-search.service'; import * as coneSearchActions from '../actions/cone-search.actions'; import { Resolver } from '../models'; +import * as fromConeSearch from 'src/app/instance/store/reducers/cone-search.reducer'; describe('[Instance][Store] ConeSearchEffects', () => { let actions = new Observable(); @@ -17,6 +19,9 @@ describe('[Instance][Store] ConeSearchEffects', () => { let metadata: EffectsMetadata<ConeSearchEffects>; let coneSearchService: ConeSearchService; let toastr: ToastrService; + const initialState = { + coneSearch: { ...fromConeSearch.initialState } + }; beforeEach(() => { TestBed.configureTestingModule({ @@ -24,7 +29,8 @@ describe('[Instance][Store] ConeSearchEffects', () => { ConeSearchEffects, { provide: ConeSearchService, useValue: { retrieveCoordinates: jest.fn() }}, { provide: ToastrService, useValue: { error: jest.fn() } }, - provideMockActions(() => actions) + provideMockActions(() => actions), + provideMockStore({ initialState }) ] }).compileComponents(); effects = TestBed.inject(ConeSearchEffects); diff --git a/client/src/app/instance/store/effects/cone-search.effects.ts b/client/src/app/instance/store/effects/cone-search.effects.ts index cf07473456a1f6fc83a62a79553ca5f033efff4a..d8606c24de6fd17699c754ea6e1d90cfa0375a0a 100644 --- a/client/src/app/instance/store/effects/cone-search.effects.ts +++ b/client/src/app/instance/store/effects/cone-search.effects.ts @@ -9,13 +9,15 @@ import { Injectable } from '@angular/core'; -import { Actions, createEffect, ofType } from '@ngrx/effects'; +import { Actions, createEffect, ofType, concatLatestFrom } from '@ngrx/effects'; +import { Store } from '@ngrx/store'; import { of } from 'rxjs'; import { map, tap, mergeMap, catchError } from 'rxjs/operators'; import { ToastrService } from 'ngx-toastr'; import * as coneSearchActions from '../actions/cone-search.actions'; import { ConeSearchService } from '../services/cone-search.service'; +import * as coneSearchSelector from '../selectors/cone-search.selector'; /** * @class @@ -23,14 +25,13 @@ import { ConeSearchService } from '../services/cone-search.service'; */ @Injectable() export class ConeSearchEffects { - /** * Calls actions to retrieve object coordinates. */ retrieveCoordinates$ = createEffect((): any => this.actions$.pipe( ofType(coneSearchActions.retrieveCoordinates), - mergeMap((action) => this.coneSearchService.retrieveCoordinates(action.name) + mergeMap(action => this.coneSearchService.retrieveCoordinates(action.name) .pipe( map(response => { const parser = new DOMParser(); @@ -42,7 +43,7 @@ export class ConeSearchEffects { const ra = +xml.getElementsByTagName('jradeg')[0].childNodes[0].nodeValue; const dec = +xml.getElementsByTagName('jdedeg')[0].childNodes[0].nodeValue; const resolver = { name, ra, dec }; - return coneSearchActions.retrieveCoordinatesSuccess({ resolver }); + return coneSearchActions.retrieveCoordinatesSuccess({ resolver }) }), catchError(() => of(coneSearchActions.retrieveCoordinatesFail())) ) @@ -50,6 +51,27 @@ export class ConeSearchEffects { ) ); + /** + * Calls actions to retrieve object coordinates. + */ + retrieveCoordinatesSuccess$ = createEffect((): any => + this.actions$.pipe( + ofType(coneSearchActions.retrieveCoordinatesSuccess), + concatLatestFrom(() => this.store.select(coneSearchSelector.selectConeSearch)), + map(([action, coneSearch]) => { + const radius = (coneSearch) ? coneSearch.radius : 2; + const updatedConeSearch = { + ra: action.resolver.ra, + dec: action.resolver.dec, + radius + }; + return coneSearchActions.updateConeSearch({ + coneSearch: updatedConeSearch + }); + }) + ) + ); + /** * Displays retrieve object coordinates error notification. */ @@ -63,6 +85,7 @@ export class ConeSearchEffects { constructor( private actions$: Actions, private coneSearchService: ConeSearchService, - private toastr: ToastrService + private toastr: ToastrService, + private store: Store<{ }> ) {} } diff --git a/client/src/app/instance/store/reducers/cone-search.reducer.spec.ts b/client/src/app/instance/store/reducers/cone-search.reducer.spec.ts index fefb4582eb5fde44b332f78a7ee00f8b52532d65..dabdd0737fb478657d4b7f8f52904d7f39b22e41 100644 --- a/client/src/app/instance/store/reducers/cone-search.reducer.spec.ts +++ b/client/src/app/instance/store/reducers/cone-search.reducer.spec.ts @@ -60,7 +60,6 @@ describe('[Instance][Store] ConeSearch reducer', () => { const state = fromConeSearch.coneSearchReducer(initialState, action); expect(state.coneSearch).toBeNull(); - expect(state.resolver).toBe(resolver); expect(state.resolverIsLoading).toBeFalsy(); expect(state.resolverIsLoaded).toBeTruthy(); expect(state).not.toBe(initialState); diff --git a/client/src/app/instance/store/reducers/cone-search.reducer.ts b/client/src/app/instance/store/reducers/cone-search.reducer.ts index 87d4d1f897e6b7ff0f24b38e1d95e5cba6a2b597..c76d862030ccf3a74ac8c853a4846688c3b992f0 100644 --- a/client/src/app/instance/store/reducers/cone-search.reducer.ts +++ b/client/src/app/instance/store/reducers/cone-search.reducer.ts @@ -42,17 +42,15 @@ export const coneSearchReducer = createReducer( coneSearch })), on(coneSearchActions.deleteConeSearch, state => ({ - ...state, - coneSearch: null + ...initialState })), on(coneSearchActions.retrieveCoordinates, state => ({ ...state, resolverIsLoading: true, resolverIsLoaded: false })), - on(coneSearchActions.retrieveCoordinatesSuccess, (state, { resolver }) => ({ + on(coneSearchActions.retrieveCoordinatesSuccess, state => ({ ...state, - resolver, resolverIsLoading: false, resolverIsLoaded: true })),