(ctx webhook.Context)
| 146 | } |
| 147 | |
| 148 | func metadataText(ctx webhook.Context) string { |
| 149 | parts := []string{} |
| 150 | if ctx.Project != nil && ctx.Project.Title != "" { |
| 151 | parts = append(parts, fmt.Sprintf("<b>Project:</b> %s", escapeText(ctx.Project.Title))) |
| 152 | } |
| 153 | if ctx.Issue != nil && ctx.Issue.Creator.Name != "" { |
| 154 | parts = append(parts, fmt.Sprintf("<b>Creator:</b> %s", escapeText(ctx.Issue.Creator.Name))) |
| 155 | } |
| 156 | if ctx.Environment != "" { |
| 157 | parts = append(parts, fmt.Sprintf("<b>Environment:</b> %s", escapeText(ctx.Environment))) |
| 158 | } |
| 159 | if ctx.ActorName != "" { |
| 160 | parts = append(parts, fmt.Sprintf("<b>By:</b> %s", escapeText(ctx.ActorName))) |
| 161 | } |
| 162 | return strings.Join(parts, "<br>") |
| 163 | } |
| 164 | |
| 165 | func textWidget(text string) Widget { |
| 166 | return textWidgetHTML(escapeText(text)) |
no test coverage detected