Fix import/export messing with Policy tests
This commit is contained in:
committed by
Tom Ratcliffe
parent
bd06607a51
commit
5fbca0962e
@@ -33,7 +33,7 @@ const VIEWS = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// make sure we ask for 1 more so we show the "show x more" button
|
// make sure we ask for 1 more so we show the "show x more" button
|
||||||
export const LIMIT_ALERTS = INSTANCES_DISPLAY_LIMIT + 1;
|
const LIMIT_ALERTS = INSTANCES_DISPLAY_LIMIT + 1;
|
||||||
|
|
||||||
const RuleList = withErrorBoundary(
|
const RuleList = withErrorBoundary(
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ import {
|
|||||||
Stack,
|
Stack,
|
||||||
} from '@grafana/ui';
|
} from '@grafana/ui';
|
||||||
import { useAppNotification } from 'app/core/copy/appNotification';
|
import { useAppNotification } from 'app/core/copy/appNotification';
|
||||||
import { LIMIT_ALERTS } from 'app/features/alerting/unified/RuleList';
|
|
||||||
import { alertRuleApi } from 'app/features/alerting/unified/api/alertRuleApi';
|
import { alertRuleApi } from 'app/features/alerting/unified/api/alertRuleApi';
|
||||||
|
import { INSTANCES_DISPLAY_LIMIT } from 'app/features/alerting/unified/components/rules/RuleDetails';
|
||||||
import { useRulesFilter } from 'app/features/alerting/unified/hooks/useFilteredRules';
|
import { useRulesFilter } from 'app/features/alerting/unified/hooks/useFilteredRules';
|
||||||
import { useDispatch } from 'app/types';
|
import { useDispatch } from 'app/types';
|
||||||
import { CombinedRule, RuleIdentifier, RulesSource } from 'app/types/unified-alerting';
|
import { CombinedRule, RuleIdentifier, RulesSource } from 'app/types/unified-alerting';
|
||||||
@@ -107,7 +107,9 @@ export const RuleActionsButtons = ({ rule, rulesSource }: Props) => {
|
|||||||
|
|
||||||
await updateRule({ nameSpaceUID: rule.namespace.uid!, payload }).unwrap();
|
await updateRule({ nameSpaceUID: rule.namespace.uid!, payload }).unwrap();
|
||||||
|
|
||||||
const limitAlerts = hasActiveFilters ? undefined : LIMIT_ALERTS;
|
// Uses INSTANCES_DISPLAY_LIMIT + 1 here as exporting LIMIT_ALERTS from RuleList has the side effect
|
||||||
|
// of breaking some unrelated tests in Policy.test.tsx due to mocking approach
|
||||||
|
const limitAlerts = hasActiveFilters ? undefined : INSTANCES_DISPLAY_LIMIT + 1;
|
||||||
// Trigger a re-fetch of the rules table
|
// Trigger a re-fetch of the rules table
|
||||||
// TODO: Migrate rules table functionality to RTK Query, so we instead rely
|
// TODO: Migrate rules table functionality to RTK Query, so we instead rely
|
||||||
// on tag invalidation (or optimistic cache updates) for this
|
// on tag invalidation (or optimistic cache updates) for this
|
||||||
|
|||||||
Reference in New Issue
Block a user