mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
Alerting: Small cleanup to remove mute timing as inheritable property (#79680)
This commit is contained in:
parent
c58ed41d50
commit
d0714a5303
@ -589,8 +589,6 @@ const routePropertyToLabel = (key: keyof InhertitableProperties | string): strin
|
||||
return 'Group interval';
|
||||
case 'group_wait':
|
||||
return 'Group wait';
|
||||
case 'mute_time_intervals':
|
||||
return 'Mute timings';
|
||||
case 'repeat_interval':
|
||||
return 'Repeat interval';
|
||||
default:
|
||||
|
@ -18,6 +18,10 @@ interface LabelMatchResult {
|
||||
matcher: ObjectMatcher | null;
|
||||
}
|
||||
|
||||
export const INHERITABLE_KEYS = ['receiver', 'group_by', 'group_wait', 'group_interval', 'repeat_interval'] as const;
|
||||
export type InheritableKeys = typeof INHERITABLE_KEYS;
|
||||
export type InhertitableProperties = Pick<Route, InheritableKeys[number]>;
|
||||
|
||||
type LabelsMatch = Map<Label, LabelMatchResult>;
|
||||
|
||||
interface MatchingResult {
|
||||
@ -150,11 +154,6 @@ function findMatchingAlertGroups(
|
||||
}, matchingGroups);
|
||||
}
|
||||
|
||||
export type InhertitableProperties = Pick<
|
||||
Route,
|
||||
'receiver' | 'group_by' | 'group_wait' | 'group_interval' | 'repeat_interval' | 'mute_time_intervals'
|
||||
>;
|
||||
|
||||
// inherited properties are config properties that exist on the parent route (or its inherited properties) but not on the child route
|
||||
function getInheritedProperties(
|
||||
parentRoute: Route,
|
||||
@ -163,13 +162,7 @@ function getInheritedProperties(
|
||||
) {
|
||||
const fullParentProperties = merge({}, parentRoute, propertiesParentInherited);
|
||||
|
||||
const inheritableProperties: InhertitableProperties = pick(fullParentProperties, [
|
||||
'receiver',
|
||||
'group_by',
|
||||
'group_wait',
|
||||
'group_interval',
|
||||
'repeat_interval',
|
||||
]);
|
||||
const inheritableProperties: InhertitableProperties = pick(fullParentProperties, INHERITABLE_KEYS);
|
||||
|
||||
// TODO how to solve this TypeScript mystery?
|
||||
const inherited = reduce(
|
||||
|
Loading…
Reference in New Issue
Block a user