Alerting: Adding color option for slack receiver (#99615)
This commit is contained in:
@@ -227,6 +227,7 @@ type SlackIntegration struct {
|
||||
MentionChannel *string `json:"mentionChannel,omitempty" yaml:"mentionChannel,omitempty" hcl:"mention_channel"`
|
||||
MentionUsers *string `json:"mentionUsers,omitempty" yaml:"mentionUsers,omitempty" hcl:"mention_users"`
|
||||
MentionGroups *string `json:"mentionGroups,omitempty" yaml:"mentionGroups,omitempty" hcl:"mention_groups"`
|
||||
Color *string `json:"color,omitempty" yaml:"color,omitempty" hcl:"color"`
|
||||
}
|
||||
|
||||
type TelegramIntegration struct {
|
||||
|
||||
@@ -331,7 +331,7 @@ func TestReceiver_Fingerprint(t *testing.T) {
|
||||
completelyDifferentReceiver.Integrations[0].Config = IntegrationConfig{Type: completelyDifferentReceiver.Integrations[0].Config.Type} // Remove all fields except Type.
|
||||
|
||||
t.Run("stable across code changes", func(t *testing.T) {
|
||||
expectedFingerprint := "a3402fdaba03030c" // If this is a valid fingerprint generation change, update the expected value.
|
||||
expectedFingerprint := "c0c82936be34b183" // If this is a valid fingerprint generation change, update the expected value.
|
||||
assert.Equal(t, expectedFingerprint, baseReceiver.Fingerprint())
|
||||
})
|
||||
t.Run("stable across clones", func(t *testing.T) {
|
||||
|
||||
@@ -691,6 +691,14 @@ func GetAvailableNotifiers() []*NotifierPlugin {
|
||||
Placeholder: "Slack endpoint url",
|
||||
PropertyName: "endpointUrl",
|
||||
},
|
||||
{
|
||||
Label: "Color",
|
||||
Element: ElementTypeInput,
|
||||
InputType: InputTypeText,
|
||||
Description: "Templated color of the slack message",
|
||||
Placeholder: alertingTemplates.DefaultMessageColor,
|
||||
PropertyName: "color",
|
||||
},
|
||||
{ // New in 8.0.
|
||||
Label: "Title",
|
||||
Element: ElementTypeInput,
|
||||
|
||||
Reference in New Issue
Block a user