Commit 07e3cbd2 authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Merge branch '129-search-multiple-unselect-all-datasets-by-default' into 'develop'

Resolve "[Search Multiple] Unselect all datasets by default"

Closes #129

See merge request !146
parents 36c098b1 217dab1e
Pipeline #3165 passed with stages
in 8 minutes and 21 seconds
...@@ -62,22 +62,22 @@ export class SearchMultipleEffects { ...@@ -62,22 +62,22 @@ export class SearchMultipleEffects {
}) })
); );
@Effect() // @Effect()
loadDatasetSearchMetaSuccessAction$ = this.actions$.pipe( // loadDatasetSearchMetaSuccessAction$ = this.actions$.pipe(
ofType(datasetActions.LOAD_DATASET_SEARCH_META_SUCCESS), // ofType(datasetActions.LOAD_DATASET_SEARCH_META_SUCCESS),
withLatestFrom(this.store$), // withLatestFrom(this.store$),
switchMap(([action, state]) => { // switchMap(([action, state]) => {
if (state.searchMultiple.selectedDatasets.length === 0) { // if (state.searchMultiple.selectedDatasets.length === 0) {
const loadDatasetSearchMetaSuccessAction = action as datasetActions.LoadDatasetSearchMetaSuccessAction; // const loadDatasetSearchMetaSuccessAction = action as datasetActions.LoadDatasetSearchMetaSuccessAction;
const datasetWithConeSearchList: Dataset[] = loadDatasetSearchMetaSuccessAction.payload[1] // const datasetWithConeSearchList: Dataset[] = loadDatasetSearchMetaSuccessAction.payload[1]
.filter(d => d.config.cone_search && d.config.cone_search.enabled === true); // .filter(d => d.config.cone_search && d.config.cone_search.enabled === true);
const selectedDatasets: string[] = datasetWithConeSearchList.map(d => d.name); // const selectedDatasets: string[] = datasetWithConeSearchList.map(d => d.name);
return of(new searchMultipleActions.InitSelectedDatasetsAction(selectedDatasets)); // return of(new searchMultipleActions.InitSelectedDatasetsAction(selectedDatasets));
} else { // } else {
return of({ type: '[No Action] ' + searchMultipleActions.INIT_SELECTED_DATASETS }); // return of({ type: '[No Action] ' + searchMultipleActions.INIT_SELECTED_DATASETS });
} // }
}) // })
); // );
@Effect() @Effect()
retrieveDatasetsCountAction$ = this.actions$.pipe( retrieveDatasetsCountAction$ = this.actions$.pipe(
......
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