@@ -44,10 +44,10 @@ const MainSearchBar = (props: Props) => {
@@ -58,11 +58,6 @@ const MainSearchBar = (props: Props) => {
export default connect(
(state: any) => ({
- appliedFilter: state.getIn(['search', 'instance']),
- savedSearch: state.getIn(['search', 'savedSearch']),
- site: state.getIn(['site', 'siteId']),
- }),
- {
- clearSearch,
- }
-)(MainSearchBar);
+ site: state.getIn(['site', 'siteId'])
+ })
+)(observer(MainSearchBar));
diff --git a/frontend/app/components/shared/MainSearchBar/components/TagList.tsx b/frontend/app/components/shared/MainSearchBar/components/TagList.tsx
index 983622a32..d48652eed 100644
--- a/frontend/app/components/shared/MainSearchBar/components/TagList.tsx
+++ b/frontend/app/components/shared/MainSearchBar/components/TagList.tsx
@@ -1,7 +1,5 @@
import { Tag } from 'App/services/TagWatchService';
import { useModal } from 'Components/Modal';
-import { refreshFilterOptions, addFilterByKeyAndValue } from 'Duck/search';
-import { connect } from 'react-redux';
import React from 'react';
import { useStore } from 'App/mstore';
import { observer } from 'mobx-react-lite';
@@ -11,11 +9,8 @@ import { Icon, confirm } from 'UI';
import { Button, Typography } from 'antd';
import { toast } from 'react-toastify';
-function TagList(props: {
- refreshFilterOptions: typeof refreshFilterOptions;
- addFilterByKeyAndValue: typeof addFilterByKeyAndValue;
-}) {
- const { refreshFilterOptions, addFilterByKeyAndValue } = props;
+function TagList() {
+ const { searchStore } = useStore();
const { tagWatchStore } = useStore();
const { showModal, hideModal } = useModal();
@@ -27,29 +22,29 @@ function TagList(props: {
FilterKey.TAGGED_ELEMENT,
tags.map((tag) => ({ label: tag.name, value: tag.tagId.toString() }))
);
- refreshFilterOptions();
+ searchStore.refreshFilterOptions();
}
});
}
}, []);
const addTag = (tagId: number) => {
- addFilterByKeyAndValue(FilterKey.TAGGED_ELEMENT, tagId.toString());
+ searchStore.addFilterByKeyAndValue(FilterKey.TAGGED_ELEMENT, tagId.toString());
hideModal();
};
const openModal = () => {
showModal(, {
right: true,
- width: 400,
+ width: 400
});
};
return (
-
- ),
+ )
}));
if (isAdmin) {
menuItems.unshift({
@@ -99,7 +98,7 @@ function ProjectDropdown(props: Props) {