Fix dynamic labels & multi-label extraction labels (#3753)

# What this PR does

Fix dynamic labels & multi-label extraction labels

## Which issue(s) this PR fixes

https://github.com/grafana/oncall/issues/3750

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
This commit is contained in:
Maxim Mordasov 2024-01-29 12:23:21 +03:00 committed by GitHub
parent c5917f4d32
commit bb7ce3d133
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

View file

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed too frequent retry of `perform_notification` task on Telegram ratelimit error by @Ferril ([#3744](https://github.com/grafana/oncall/pull/3744))
- Dynamic labels & multi-label extraction label are broken ([#3750](https://github.com/grafana/oncall/issues/3750))
- Add check whether organization has Slack connection on update Slack related field using public api endpoints
by @Ferril ([#3751](https://github.com/grafana/oncall/pull/3751))

View file

@ -206,9 +206,10 @@ const IntegrationLabelsForm = observer((props: IntegrationLabelsFormProps) => {
templates={templates}
templateBody={alertGroupLabels.custom[customLabelIndexToShowTemplateEditor].value.name}
onHide={() => setCustomLabelIndexToShowTemplateEditor(undefined)}
onUpdateTemplates={({ alert_group_labels }) => {
onUpdateTemplates={(templates) => {
const newCustom = [...alertGroupLabels.custom];
newCustom[customLabelIndexToShowTemplateEditor].value.name = alert_group_labels;
newCustom[customLabelIndexToShowTemplateEditor].value.name =
templates[LabelTemplateOptions.AlertGroupDynamicLabel.key];
setAlertGroupLabels({
...alertGroupLabels,
@ -229,10 +230,10 @@ const IntegrationLabelsForm = observer((props: IntegrationLabelsFormProps) => {
templates={templates}
templateBody={alertGroupLabels.template}
onHide={() => setShowTemplateEditor(false)}
onUpdateTemplates={({ alert_group_labels }) => {
onUpdateTemplates={(templates) => {
setAlertGroupLabels({
...alertGroupLabels,
template: alert_group_labels,
template: templates[LabelTemplateOptions.AlertGroupMultiLabel.key],
});
setShowTemplateEditor(undefined);

View file

@ -177,6 +177,7 @@ const OutgoingWebhookForm = observer((props: OutgoingWebhookFormProps) => {
preset: selectedPreset?.id,
trigger_type: null,
http_method: 'POST',
forward_all: true,
};
} else if (isNewOrCopy) {
data = { ...outgoingWebhookStore.items[id], is_legacy: false, name: '' };