dmitri.shuralyov.com/app/changes/...

Add support for review request removed event.
dmitshur committed 7 years ago commit b24d5090f83a84dd6ef919ea5fc70c0ea67b6096
Collapse all
component/component.go
@@ -64,10 +64,12 @@ func (e Event) icon() *html.Node {
		icon = octiconssvg.Tag()
	case issues.CommentDeleted:
		icon = octiconssvg.X()
	case "ReviewRequestedEvent":
		icon = octiconssvg.Eye()
	case "ReviewRequestRemovedEvent":
		icon = octiconssvg.X()
	default:
		icon = octiconssvg.PrimitiveDot()
	}
	return &html.Node{
		Type: html.ElementNode, Data: atom.Span.String(),
@@ -102,10 +104,15 @@ func (e Event) text() []*html.Node {
	case "ReviewRequestedEvent":
		ns := []*html.Node{htmlg.Text("requested a review from ")}
		ns = append(ns, Avatar{User: e.Event.RequestedReviewer, Size: 16, Inline: true}.Render()...)
		ns = append(ns, User{e.Event.RequestedReviewer}.Render()...)
		return ns
	case "ReviewRequestRemovedEvent":
		ns := []*html.Node{htmlg.Text("removed the review request from ")}
		ns = append(ns, Avatar{User: e.Event.RequestedReviewer, Size: 16, Inline: true}.Render()...)
		ns = append(ns, User{e.Event.RequestedReviewer}.Render()...)
		return ns
	default:
		return []*html.Node{htmlg.Text(string(e.Event.Type))}
	}
}