mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
[Alerting] - make rule groups the default view (#58271)
This commit is contained in:
parent
40ba2ba18d
commit
97df6e682e
@ -34,8 +34,8 @@ export const GrafanaRules: FC<Props> = ({ namespaces, expandAll }) => {
|
||||
const loading = prom.loading || ruler.loading;
|
||||
const hasResult = !!prom.result || !!ruler.result;
|
||||
|
||||
const wantsGroupedView = queryParams['view'] === 'grouped';
|
||||
const namespacesFormat = wantsGroupedView ? namespaces : flattenGrafanaManagedRules(namespaces);
|
||||
const wantsListView = queryParams['view'] === 'list';
|
||||
const namespacesFormat = wantsListView ? flattenGrafanaManagedRules(namespaces) : namespaces;
|
||||
|
||||
const groupsWithNamespaces = useCombinedGroupNamespace(namespacesFormat);
|
||||
|
||||
@ -58,7 +58,7 @@ export const GrafanaRules: FC<Props> = ({ namespaces, expandAll }) => {
|
||||
key={`${namespace.name}-${group.name}`}
|
||||
namespace={namespace}
|
||||
expandAll={expandAll}
|
||||
viewMode={wantsGroupedView ? 'grouped' : 'list'}
|
||||
viewMode={wantsListView ? 'list' : 'grouped'}
|
||||
/>
|
||||
))}
|
||||
{hasResult && namespacesFormat?.length === 0 && <p>No rules found.</p>}
|
||||
|
@ -14,16 +14,16 @@ import { getFiltersFromUrlParams } from '../../utils/misc';
|
||||
import { alertStateToReadable } from '../../utils/rules';
|
||||
|
||||
const ViewOptions: SelectableValue[] = [
|
||||
{
|
||||
icon: 'list-ul',
|
||||
label: 'List',
|
||||
value: 'list',
|
||||
},
|
||||
{
|
||||
icon: 'folder',
|
||||
label: 'Grouped',
|
||||
value: 'grouped',
|
||||
},
|
||||
{
|
||||
icon: 'list-ul',
|
||||
label: 'List',
|
||||
value: 'list',
|
||||
},
|
||||
{
|
||||
icon: 'heart-rate',
|
||||
label: 'State',
|
||||
|
Loading…
Reference in New Issue
Block a user