1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-28 16:17:02 +00:00

Optimize/seasearch filters (#7723)

* update seasearch filters

* seasearch support filter by owner and search_filename_only

---------

Co-authored-by: zhouwenxuan <aries@Mac.local>
This commit is contained in:
Aries
2025-04-09 17:02:16 +08:00
committed by GitHub
parent 951698555d
commit 3ec8c646b1
7 changed files with 24 additions and 32 deletions

View File

@@ -9,12 +9,12 @@ import './index.css';
const SCROLLABLE_CONTAINER_HEIGHT = 44;
const SearchFilters = ({ repoID, onChange, hasFileSearch }) => {
const SearchFilters = ({ repoID, onChange }) => {
return (
<div className="search-filters-container" style={{ height: hasFileSearch && SCROLLABLE_CONTAINER_HEIGHT }}>
{hasFileSearch && <FilterByText onSelect={onChange} />}
{hasFileSearch && <FilterByCreator repoID={repoID} onSelect={onChange} />}
{hasFileSearch && <FilterByDate onSelect={onChange} />}
<div className="search-filters-container" style={{ height: SCROLLABLE_CONTAINER_HEIGHT }}>
<FilterByText onSelect={onChange} />
<FilterByCreator repoID={repoID} onSelect={onChange} />
<FilterByDate onSelect={onChange} />
<FilterBySuffix onSelect={onChange} />
</div>
);
@@ -23,7 +23,6 @@ const SearchFilters = ({ repoID, onChange, hasFileSearch }) => {
SearchFilters.propTypes = {
repoID: PropTypes.string,
onChange: PropTypes.func,
hasFileSearch: PropTypes.bool,
};
export default SearchFilters;

View File

@@ -22,7 +22,6 @@ const propTypes = {
onSearchedClick: PropTypes.func.isRequired,
isPublic: PropTypes.bool,
isViewFile: PropTypes.bool,
hasFileSearch: PropTypes.bool,
};
const PER_PAGE = 20;
@@ -798,7 +797,6 @@ class Search extends Component {
<SearchFilters
repoID={this.props.repoID}
onChange={this.handleFiltersChange}
hasFileSearch={this.props.hasFileSearch}
/>
}
<div