Skip to content
Snippets Groups Projects
Commit b6f9bb4d authored by François Agneray's avatar François Agneray
Browse files

Merge branch '17-remettre-a-zero-l-etat-de-la-recherche-si-nouvelle-selection' into 'develop'

#17 => done

Closes #17

See merge request !10
parents d9e4c2c6 b59cd2d4
No related branches found
No related tags found
2 merge requests!68Develop,!10#17 => done
Pipeline #1174 passed
......@@ -56,7 +56,7 @@ export class DatasetComponent implements OnInit {
}
selectDataset(datasetName: string): void {
this.store.dispatch(new searchActions.SelectDatasetAction(datasetName));
this.store.dispatch(new searchActions.NewSearchAction(datasetName));
this.store.dispatch(new criteriaActions.LoadDatasetAttributeListAction(datasetName));
// this.store.dispatch(new outputActions.LoadDatasetOutputFamilyAction(datasetName));
}
......
......@@ -4,6 +4,7 @@ import { Criterion, SearchMeta } from './model';
export const CHANGE_STEP = 'Change Search Step';
export const SELECT_DATASET = 'Select Dataset';
export const NEW_SEARCH = 'New Search';
export const CRITERIA_CHECKED = 'Criteria Checked';
export const OUTPUT_CHECKED = 'Output Checked';
export const RESULT_CHECKED = 'Result Checked';
......@@ -32,6 +33,12 @@ export class SelectDatasetAction implements Action {
constructor(public payload: string) { }
}
export class NewSearchAction implements Action {
type = NEW_SEARCH;
constructor(public payload: string) { }
}
export class CriteriaChecked implements Action {
type = CRITERIA_CHECKED;
......@@ -125,6 +132,7 @@ export class RetrieveDataFailedAction implements Action {
export type Actions
= ChangeStepAction
| SelectDatasetAction
| NewSearchAction
| UpdateDefaultCriteriaListAction
| UpdateCriteriaListAction
| AddCriterionAction
......
......@@ -21,6 +21,12 @@ export class SearchEffects {
private store$: Store<{search: fromSearch.State}>
) { }
@Effect()
newSearchAction$ = this.actions$.pipe(
ofType(searchActions.NEW_SEARCH),
map((action: searchActions.NewSearchAction) => new searchActions.SelectDatasetAction(action.payload))
);
@Effect()
loadDatasetAttributeListSuccessAction$ = this.actions$.pipe(
ofType(criteriaActions.LOAD_DATASET_ATTRIBUTE_LIST_SUCCESS),
......
......@@ -44,6 +44,9 @@ export function reducer(state: State = initialState, action: actions.Actions): S
datasetName
};
case actions.NEW_SEARCH:
return initialState;
case actions.CRITERIA_CHECKED:
return {
...state,
......
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