mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-23 08:49:48 +01:00
Context sensitive search (#2102)
Extend global search to search context-sensitive in repositories and namespaces.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user