fix(ui): escape label values in silence form

Fixes #3866
This commit is contained in:
Łukasz Mierzwa
2022-01-11 22:35:53 +00:00
committed by Łukasz Mierzwa
parent 8d41c67681
commit ce4a9c3e67
18 changed files with 434 additions and 73 deletions

View File

@@ -24,6 +24,7 @@ const AlertGroupCollapseConfiguration: FC<{
return {
label: settingsStore.alertGroupConfig.options[val].label,
value: val,
wasCreated: false,
};
};

View File

@@ -30,7 +30,11 @@ const AlertGroupSortConfiguration: FC<{
};
const valueToOption = (val: SortOrderT): OptionT => {
return { label: settingsStore.gridConfig.options[val].label, value: val };
return {
label: settingsStore.gridConfig.options[val].label,
value: val,
wasCreated: false,
};
};
const hideReverse =

View File

@@ -14,14 +14,15 @@ const disabledLabel = "Disable multi-grid";
const valueToOption = (v: string) => ({
label: v ? v : disabledLabel,
value: v,
wasCreated: false,
});
const staticValues = [
{ label: disabledLabel, value: "" },
{ label: "Automatic selection", value: "@auto" },
{ label: "@alertmanager", value: "@alertmanager" },
{ label: "@cluster", value: "@cluster" },
{ label: "@receiver", value: "@receiver" },
{ label: disabledLabel, value: "", wasCreated: false },
{ label: "Automatic selection", value: "@auto", wasCreated: false },
{ label: "@alertmanager", value: "@alertmanager", wasCreated: false },
{ label: "@cluster", value: "@cluster", wasCreated: false },
{ label: "@receiver", value: "@receiver", wasCreated: false },
];
const GridLabelName: FC<{
@@ -35,7 +36,7 @@ const GridLabelName: FC<{
const defaultValue =
settingsStore.multiGridConfig.config.gridLabel === "@auto"
? { label: "Automatic selection", value: "@auto" }
? { label: "Automatic selection", value: "@auto", wasCreated: false }
: valueToOption(settingsStore.multiGridConfig.config.gridLabel);
return (

View File

@@ -24,6 +24,7 @@ const ThemeConfiguration: FC<{
return {
label: settingsStore.themeConfig.options[val].label,
value: val,
wasCreated: false,
};
};