19783: Fix advanced search "limit to project" option
[arvados.git] / src / views-components / projects-tree-picker / public-favorites-tree-picker.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { connect } from 'react-redux';
6 import { ProjectsTreePicker, ProjectsTreePickerProps } from 'views-components/projects-tree-picker/generic-projects-tree-picker';
7 import { Dispatch } from 'redux';
8 import { PublicFavoriteIcon } from 'components/icon/icon';
9 import { loadPublicFavoritesProject } from 'store/tree-picker/tree-picker-actions';
10
11 export const PublicFavoritesTreePicker = connect(() => ({
12     rootItemIcon: PublicFavoriteIcon,
13 }), (dispatch: Dispatch): Pick<ProjectsTreePickerProps, 'loadRootItem'> => ({
14     loadRootItem: (_, pickerId, includeCollections, includeFiles, options) => {
15         dispatch<any>(loadPublicFavoritesProject({ pickerId, includeCollections, includeFiles, options }));
16     },
17 }))(ProjectsTreePicker);