mirror of https://github.com/harness/drone.git
fix: [CODE-1573]: fix for breaking search page for org and account repositories (#1114)
parent
e7436eef80
commit
b772dca155
|
@ -98,7 +98,7 @@ export interface CODERoutes {
|
|||
toCODESettings: (
|
||||
args: RequiredField<Pick<CODEProps, 'repoPath' | 'settingSection' | 'ruleId' | 'settingSectionMode'>, 'repoPath'>
|
||||
) => string
|
||||
toCODEProjectSearch: (args: Required<Pick<CODEProps, 'space'>>) => string
|
||||
toCODESpaceSearch: (args: Required<Pick<CODEProps, 'space'>>) => string
|
||||
toCODERepositorySearch: (args: Required<Pick<CODEProps, 'repoPath'>>) => string
|
||||
toCODESemanticSearch: (args: Required<Pick<CODEProps, 'repoPath'>>) => string
|
||||
toCODEExecutions: (args: Required<Pick<CODEProps, 'repoPath' | 'pipeline'>>) => string
|
||||
|
@ -157,7 +157,7 @@ export const routes: CODERoutes = {
|
|||
`/${repoPath}/settings${settingSection ? '/' + settingSection : ''}${ruleId ? '/' + ruleId : ''}${
|
||||
settingSectionMode ? '/' + settingSectionMode : ''
|
||||
}`,
|
||||
toCODEProjectSearch: ({ space }) => `/${space}/search`,
|
||||
toCODESpaceSearch: ({ space }) => `/${space}/search`,
|
||||
toCODERepositorySearch: ({ repoPath }) => `/${repoPath}/search`,
|
||||
toCODESemanticSearch: ({ repoPath }) => `/${repoPath}/search/semantic`,
|
||||
toCODEWebhooks: ({ repoPath }) => `/${repoPath}/webhooks`,
|
||||
|
|
|
@ -294,7 +294,7 @@ export const RouteDestinations: React.FC = React.memo(function RouteDestinations
|
|||
</Route>
|
||||
|
||||
<Route
|
||||
path={[routes.toCODEProjectSearch({ space: pathProps.space }), routes.toCODERepositorySearch({ repoPath })]}
|
||||
path={[routes.toCODESpaceSearch({ space: pathProps.space }), routes.toCODERepositorySearch({ repoPath })]}
|
||||
exact>
|
||||
<LayoutWithSideNav title={getString('search')}>
|
||||
<CodeSearchPage />
|
||||
|
|
|
@ -63,7 +63,7 @@ const CodeSearch = ({ repoMetadata }: CodeSearchProps) => {
|
|||
})
|
||||
} else {
|
||||
history.push({
|
||||
pathname: routes.toCODEProjectSearch({
|
||||
pathname: routes.toCODESpaceSearch({
|
||||
space
|
||||
}),
|
||||
search: `q=${q}`
|
||||
|
|
|
@ -59,7 +59,7 @@ const KeywordSearch = ({ repoMetadata }: KeywordSearchProps) => {
|
|||
})
|
||||
} else {
|
||||
history.push({
|
||||
pathname: routes.toCODEProjectSearch({
|
||||
pathname: routes.toCODESpaceSearch({
|
||||
space
|
||||
}),
|
||||
search: `q=${q}`
|
||||
|
|
|
@ -177,7 +177,7 @@ export const DefaultMenu: React.FC = () => {
|
|||
icon="thinner-search"
|
||||
data-code-repo-section="search"
|
||||
label={getString('search')}
|
||||
to={routes.toCODEProjectSearch({ space: selectedSpace?.path as string })}
|
||||
to={routes.toCODESpaceSearch({ space: selectedSpace?.path as string })}
|
||||
/>
|
||||
</Render>
|
||||
|
||||
|
|
Loading…
Reference in New Issue