Alerting: Integrate alerts with folders (#45763)

* Add Alert rules tab

* Add pagination and a simple name-based filtering

* Add name and label based filtering

* Improve pagination, handle the no results case

* Add tests for alerts folder view

* Add label filtering by clicking a tag

* Add tests for matcher to string method

* Add sorting, improve styles

* Use simple Select component for sorting

* Update default page size

* Remove unused code

* Use existingc thunk

* chore: update swagger spec

* Revert "chore: update swagger spec"

This reverts commit ee79ec7341.

* Code cleanup

* Fix ts

Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
This commit is contained in:
Konrad Lalik
2022-03-14 15:21:29 +01:00
committed by GitHub
parent e512029afb
commit 2409405c34
10 changed files with 503 additions and 4 deletions

View File

@@ -46,3 +46,13 @@ function getRefId(num: number): string {
return getRefId(Math.floor(num / letters.length) - 1) + letters[num % letters.length];
}
}
/**
* Returns the input value for non empty string and undefined otherwise
*
* It is inadvisable to set a query param to an empty string as it will be added to the URL.
* It is better to keep it undefined so the param won't be added to the URL at all.
*/
export function getQueryParamValue(value: string | undefined | null): string | undefined {
return value || undefined;
}