Context sensitive search (#2102)

Extend global search to search context-sensitive in repositories and namespaces.
This commit is contained in:
Eduard Heimbuch
2022-08-04 11:29:05 +02:00
parent 6c82142643
commit 550ebefd93
34 changed files with 1061 additions and 308 deletions

View File

@@ -93,6 +93,15 @@ export function getQueryStringFromLocation(location: { search?: string }): strin
}
}
export function getValueStringFromLocationByKey(location: { search?: string }, key: string): string | undefined {
if (location.search) {
const value = queryString.parse(location.search)[key];
if (value && !Array.isArray(value)) {
return value;
}
}
}
export function stripEndingSlash(url: string) {
if (url.endsWith("/")) {
return url.substring(0, url.length - 1);