Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion extensions/MyDashboard/lib/WebService.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use base qw(Bugzilla::WebService Bugzilla::WebService::Bug);

use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Template;
use Bugzilla::Util qw(detaint_natural template_var datetime_from);
use Bugzilla::WebService::Util qw(validate);

Expand Down Expand Up @@ -72,7 +73,13 @@ sub run_last_changes {
if ($last_comment_id) {
my $comments = $self->comments({comment_ids => [$last_comment_id]});
my $comment = $comments->{comments}{$last_comment_id};
$last_changes->{comment} = $comment->{text};
my $text = $comment->{text};
my $bug = Bugzilla::Bug->check($params->{bug_id});
my $html
= Bugzilla->params->{use_markdown}
? Bugzilla->markdown->render_html($text, $bug)
: Bugzilla::Template::quoteUrls($text, $bug);
$last_changes->{comment_html} = $html;
$last_changes->{email} = $comment->{creator} if !$last_changes->{email};
my $datetime = datetime_from($comment->{creation_time});
$datetime->set_time_zone($user->timezone);
Expand Down
4 changes: 2 additions & 2 deletions extensions/MyDashboard/web/js/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ window.addEventListener('DOMContentLoaded', () => {
}

if (lastChangesCache[bug_id]) {
const { email, when, activity, comment } = lastChangesCache[bug_id];
const { email, when, activity, comment_html = '' } = lastChangesCache[bug_id];

$target.innerHTML = `
<div id="last_changes_${bug_id}">
Expand Down Expand Up @@ -157,7 +157,7 @@ window.addEventListener('DOMContentLoaded', () => {
`
: ``
}
${comment ? `<pre class='bz_comment_text'>${comment.htmlEncode()}</pre>` : ``}
${comment_html}
`
: `This is a new ${BUGZILLA.string.bug} and no changes have been made yet.`
}
Expand Down