mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-04 19:30:51 +01:00
Keep search context for search results pagination (#2115)
This commit is contained in:
2
gradle/changelog/search_pagination.yaml
Normal file
2
gradle/changelog/search_pagination.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
- type: fixed
|
||||
description: Keep search context for search results pagination ([#2115](https://github.com/scm-manager/scm-manager/pull/2115))
|
||||
@@ -172,6 +172,8 @@ const Search: FC = () => {
|
||||
...searchCounts,
|
||||
};
|
||||
|
||||
const contextQuery = `${query}${namespace ? "&namespace=" + namespace : ""}${name ? "&name=" + name : ""}`;
|
||||
|
||||
return (
|
||||
<Page
|
||||
title={t("search.title")}
|
||||
@@ -183,7 +185,7 @@ const Search: FC = () => {
|
||||
{data ? (
|
||||
<CustomQueryFlexWrappedColumns>
|
||||
<PrimaryContentColumn>
|
||||
<Results result={data} query={query} page={page} type={selectedType} />
|
||||
<Results result={data} query={contextQuery} page={page} type={selectedType} />
|
||||
</PrimaryContentColumn>
|
||||
<SecondaryNavigation label={t("search.types")} collapsible={false}>
|
||||
{types.map((type) =>
|
||||
@@ -203,14 +205,7 @@ const Search: FC = () => {
|
||||
</DisabledNavLink>
|
||||
</li>
|
||||
) : (
|
||||
<NavLink
|
||||
key={type}
|
||||
to={`/search/${type}/?q=${query}${namespace ? "&namespace=" + namespace : ""}${
|
||||
name ? "&name=" + name : ""
|
||||
}`}
|
||||
label={type}
|
||||
activeOnlyWhenExact={false}
|
||||
>
|
||||
<NavLink key={type} to={`/search/${type}/?q=${contextQuery}`} label={type} activeOnlyWhenExact={false}>
|
||||
<Level
|
||||
left={t(`plugins:search.types.${type}.navItem`, type)}
|
||||
right={
|
||||
|
||||
Reference in New Issue
Block a user