Files
houston-be/pkg/slack/houston/design/blazeless_show_incidents_button_section.go
Shubham Kirve b974cb6bf3 TP-0000 | Initialize houston repo (#1)
* TP-0000 | intialize houston repo

* TP-0000 | intialize houston repo
2023-03-29 00:01:17 +05:30

30 lines
861 B
Go

package houston
import (
"houston/entity"
"github.com/slack-go/slack"
)
func GenerateModalForShowIncidentsButtonSection(incident []entity.IncidentSeverityTeamJoinEntity) []slack.Block {
contextBlock := slack.NewContextBlock("", slack.NewTextBlockObject("mrkdwn", ":eye: Only visible to you", false, false))
sectionBlocks := []*slack.SectionBlock{}
for i := 0; i < len(incident); i++ {
fields := []*slack.TextBlockObject{
slack.NewTextBlockObject("mrkdwn", "\n`"+incident[i].SeverityName+"` `"+incident[i].TeamsName+" Incident` \n "+incident[i].Title+"\n <#"+incident[i].SlackChannel+">", false, false),
}
sectionBlocks = append(sectionBlocks, slack.NewSectionBlock(nil, fields, nil))
}
blocks := []slack.Block{
contextBlock,
}
for i := 0; i < len(sectionBlocks); i++ {
blocks = append(blocks, sectionBlocks[i])
}
return blocks
}