Project

General

Profile

Feature #44552 » 0002-Show-the-history-tab-when-the-journal-linked-from-an.patch

Go MAEDA, 2026-10-03 11:16

View differences:

app/javascript/controllers/issue_journal_link_controller.js
import { Controller } from "@hotwired/stimulus";
export default class extends Controller {
// Shows the history tab if the target note is hidden by the selected tab,
// so that the browser can jump to the note
show() {
const note = document.getElementById(this.element.hash.slice(1));
if (!note || note.getClientRects().length > 0) return;
const historyTab = document.getElementById("tab-history");
if (!historyTab) return;
showIssueHistory("history", historyTab.href);
}
}
app/views/attachments/_links.html.erb
<% anchor = "#note-#{journal.indice}" %>
<%= link_to sprite_icon('chevrons-down', anchor), anchor,
:title => anchor,
:class => 'icon-only icon-chevrons-down' %>
:class => 'icon-only icon-chevrons-down',
:data => {:controller => 'issue-journal-link', :action => 'issue-journal-link#show'} %>
<% end %>
</span>
<% end %>
test/system/issues_test.rb
assert page.has_no_css?('#add_notes')
end
def test_attachment_note_link_should_show_history_tab_if_note_is_hidden
# Journal 3 added attachment 4 to issue 2. Without notes, it is hidden in the notes tab
Journal.find(3).update_column(:notes, '')
Journal.create!(:journalized => Issue.find(2), :user_id => 2, :notes => 'A note')
log_user('jsmith', 'jsmith')
visit '/issues/2?tab=notes'
assert_selector '#tab-notes.selected'
assert_no_selector '#note-1'
find('div.attachments span.attachment-journal a').click
assert_selector '#tab-history.selected'
assert_selector '#note-1'
end
def test_preview_custom_field_on_bulk_edit_across_projects
field = IssueCustomField.create!(
:field_format => 'text',
(3-3/3)