Skip to content
Snippets Groups Projects
Commit 217dab1e authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Remove automatic datasets selection => DONE

parent 36c098b1
No related branches found
No related tags found
2 merge requests!147Develop,!146Resolve "[Search Multiple] Unselect all datasets by default"
......@@ -62,22 +62,22 @@ export class SearchMultipleEffects {
})
);
@Effect()
loadDatasetSearchMetaSuccessAction$ = this.actions$.pipe(
ofType(datasetActions.LOAD_DATASET_SEARCH_META_SUCCESS),
withLatestFrom(this.store$),
switchMap(([action, state]) => {
if (state.searchMultiple.selectedDatasets.length === 0) {
const loadDatasetSearchMetaSuccessAction = action as datasetActions.LoadDatasetSearchMetaSuccessAction;
const datasetWithConeSearchList: Dataset[] = loadDatasetSearchMetaSuccessAction.payload[1]
.filter(d => d.config.cone_search && d.config.cone_search.enabled === true);
const selectedDatasets: string[] = datasetWithConeSearchList.map(d => d.name);
return of(new searchMultipleActions.InitSelectedDatasetsAction(selectedDatasets));
} else {
return of({ type: '[No Action] ' + searchMultipleActions.INIT_SELECTED_DATASETS });
}
})
);
// @Effect()
// loadDatasetSearchMetaSuccessAction$ = this.actions$.pipe(
// ofType(datasetActions.LOAD_DATASET_SEARCH_META_SUCCESS),
// withLatestFrom(this.store$),
// switchMap(([action, state]) => {
// if (state.searchMultiple.selectedDatasets.length === 0) {
// const loadDatasetSearchMetaSuccessAction = action as datasetActions.LoadDatasetSearchMetaSuccessAction;
// const datasetWithConeSearchList: Dataset[] = loadDatasetSearchMetaSuccessAction.payload[1]
// .filter(d => d.config.cone_search && d.config.cone_search.enabled === true);
// const selectedDatasets: string[] = datasetWithConeSearchList.map(d => d.name);
// return of(new searchMultipleActions.InitSelectedDatasetsAction(selectedDatasets));
// } else {
// return of({ type: '[No Action] ' + searchMultipleActions.INIT_SELECTED_DATASETS });
// }
// })
// );
@Effect()
retrieveDatasetsCountAction$ = this.actions$.pipe(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment