Keep search context for search results pagination (#2115)

This commit is contained in:
Eduard Heimbuch
2022-09-09 09:41:37 +02:00
committed by GitHub
parent 61676c6dd4
commit 30e26b8d4e
2 changed files with 6 additions and 9 deletions

View 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))

View File

@@ -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={