Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
anis
anis-client
Commits
217dab1e
Commit
217dab1e
authored
Oct 12, 2020
by
Tifenn Guillas
Browse files
Remove automatic datasets selection => DONE
parent
36c098b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/app/search-multiple/store/search-multiple.effects.ts
View file @
217dab1e
...
...
@@ -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
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment