mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add a way to mark Conversation (code comment) resolved (#11037)
* Add a way to mark Conversation (code comment) resolved mark Conversation is a way to mark a Conversation is stale or be solved. when it's marked as stale, will be hided like stale. all Pull Request writer , Offical Reviewers and poster can add or remove Conversation resolved mark. Signed-off-by: a1012112796 <1012112796@qq.com> * fix lint * Apply suggestions from code review * Add ResolveDoer * fix ui Co-Authored-By: Lauris BH <lauris@nix.lv> Co-Authored-By: 6543 <6543@obermui.de> * change IsResolved to an function Add permission check in UpdateResolveConversation * Apply suggestions from code review * change return error for permisson check * add default message for deleted user * get issue message from comment * add migration for ``ResolveDoerID`` column another change: * block mark pending review as resolved because it's not necessary Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * change button color * resolve button size * fix code style * remove unusefull code Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
This commit is contained in:
@@ -147,32 +147,79 @@
|
||||
{{end}}
|
||||
</tr>
|
||||
{{if gt (len $line.Comments) 0}}
|
||||
{{$resolved := (index $line.Comments 0).IsResolved}}
|
||||
{{$resolveDoer := (index $line.Comments 0).ResolveDoer}}
|
||||
{{$isNotPending := (not (eq (index $line.Comments 0).Review.Type 0))}}
|
||||
<tr class="add-code-comment">
|
||||
<td class="lines-num"></td>
|
||||
<td class="lines-type-marker"></td>
|
||||
<td class="add-comment-left">
|
||||
{{if and $resolved (eq $line.GetCommentSide "previous")}}
|
||||
<div class="ui top attached header">
|
||||
<span class="ui grey text left"><b>{{$resolveDoer.Name}}</b> {{$.i18n.Tr "repo.issues.review.resolved_by"}}</span>
|
||||
<button id="show-outdated-{{(index $line.Comments 0).ID}}" data-comment="{{(index $line.Comments 0).ID}}" class="ui compact right labeled button show-outdated">
|
||||
{{svg "octicon-unfold" 16}}
|
||||
{{$.i18n.Tr "repo.issues.review.show_resolved"}}
|
||||
</button>
|
||||
<button id="hide-outdated-{{(index $line.Comments 0).ID}}" data-comment="{{(index $line.Comments 0).ID}}" class="hide ui compact right labeled button hide-outdated">
|
||||
{{svg "octicon-fold" 16}}
|
||||
{{$.i18n.Tr "repo.issues.review.hide_resolved"}}
|
||||
</button>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if eq $line.GetCommentSide "previous"}}
|
||||
<div class="field comment-code-cloud">
|
||||
<div id="code-comments-{{(index $line.Comments 0).ID}}" class="field comment-code-cloud {{if $resolved}}hide{{end}}">
|
||||
<div class="comment-list">
|
||||
<ui class="ui comments">
|
||||
{{ template "repo/diff/comments" dict "root" $ "comments" $line.Comments}}
|
||||
</ui>
|
||||
</div>
|
||||
{{template "repo/diff/comment_form_datahandler" dict "reply" (index $line.Comments 0).ReviewID "hidden" true "root" $ "comment" (index $line.Comments 0)}}
|
||||
{{if and $.CanMarkConversation $isNotPending}}
|
||||
<button class="ui icon tiny button resolve-conversation" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $line.Comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation" >
|
||||
{{if $resolved}}
|
||||
{{$.i18n.Tr "repo.issues.review.un_resolve_conversation"}}
|
||||
{{else}}
|
||||
{{$.i18n.Tr "repo.issues.review.resolve_conversation"}}
|
||||
{{end}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="lines-num"></td>
|
||||
<td class="lines-type-marker"></td>
|
||||
<td class="add-comment-right">
|
||||
{{if and $resolved (eq $line.GetCommentSide "proposed")}}
|
||||
<div class="ui top attached header">
|
||||
<span class="ui grey text left"><b>{{$resolveDoer.Name}}</b> {{$.i18n.Tr "repo.issues.review.resolved_by"}}</span>
|
||||
<button id="show-outdated-{{(index $line.Comments 0).ID}}" data-comment="{{(index $line.Comments 0).ID}}" class="ui compact right labeled button show-outdated">
|
||||
{{svg "octicon-unfold" 16}}
|
||||
{{$.i18n.Tr "repo.issues.review.show_resolved"}}
|
||||
</button>
|
||||
<button id="hide-outdated-{{(index $line.Comments 0).ID}}" data-comment="{{(index $line.Comments 0).ID}}" class="hide ui compact right labeled button hide-outdated">
|
||||
{{svg "octicon-fold" 16}}
|
||||
{{$.i18n.Tr "repo.issues.review.hide_resolved"}}
|
||||
</button>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if eq $line.GetCommentSide "proposed"}}
|
||||
<div class="field comment-code-cloud">
|
||||
<div id="code-comments-{{(index $line.Comments 0).ID}}" class="field comment-code-cloud {{if $resolved}}hide{{end}}">
|
||||
<div class="comment-list">
|
||||
<ui class="ui comments">
|
||||
{{ template "repo/diff/comments" dict "root" $ "comments" $line.Comments}}
|
||||
</ui>
|
||||
</div>
|
||||
{{template "repo/diff/comment_form_datahandler" dict "reply" (index $line.Comments 0).ReviewID "hidden" true "root" $ "comment" (index $line.Comments 0)}}
|
||||
{{if and $.CanMarkConversation $isNotPending}}
|
||||
<button class="ui icon tiny button resolve-conversation" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $line.Comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation" >
|
||||
{{if $resolved}}
|
||||
{{$.i18n.Tr "repo.issues.review.un_resolve_conversation"}}
|
||||
{{else}}
|
||||
{{$.i18n.Tr "repo.issues.review.resolve_conversation"}}
|
||||
{{end}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user