Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add View History link in QA #1331

Merged
merged 6 commits into from
Jan 30, 2025
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
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[v#.#.#] ([month] [YYYY])
- Hera: Add new layout with redesigned navigation
- QA: Add View History link when viewing Issues/Content blocks
- Upgraded gems:
- [gem]
- Bugs fixes:
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/hera/modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
}

&:last-of-type {
margin: 0 0.75rem;
margin-left: 0.25rem;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/revisions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ class RevisionsController < AuthenticatedController
before_action :load_record, except: [ :trash, :recover ]

def index
redirect_to action: :show, id: @record.versions.last.try(:id) || 0
redirect_to action: :show, id: @record.versions.last.try(:id) || 0, qa: params[:qa] == 'true'
end

def show
# Use `reorder`, not `order`, to override Paper Trail's default scope
@revisions = @record.versions.includes(:item).reorder('created_at DESC')
@revision = @revisions.find(params[:id])
@qa = params[:qa] == 'true'

if @revision.event == 'update'
@diffed_revision = DiffedRevision.new(@revision, @record)
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/revisions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def record_revision_path(record, revision, params = {})
when Card
project_board_list_card_revision_path(current_project, @board, @list, record, revision)
when Issue
project_issue_revision_path(current_project, record, revision)
project_issue_revision_path(current_project, record, revision, qa: params[:qa])
when Note
project_node_note_revision_path(current_project, record.node, record, revision)
when Evidence
Expand Down
5 changes: 5 additions & 0 deletions app/views/qa/issues/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<i class="fa-solid fa-pencil fa-fw"></i> Edit
<% end %>
</span>
<span class="action">
<%= link_to project_issue_revisions_path(current_project, @issue, qa: true) do %>
<i class="fa-solid fa-history fa-fw"></i> View History
<% end %>
</span>
</span>
</h4>
<%= render partial: 'shared/textile_content', locals: { record: @issue, preview_path: preview_project_issue_path(current_project, @issue) } %>
Expand Down
9 changes: 7 additions & 2 deletions app/views/revisions/_breadcrumbs.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@
<li class="breadcrumb-item"><%= link_to @record.node.label, project_node_path(current_project, @record.node, tab: 'evidence-tab') %></li>
<li class="breadcrumb-item"><%= link_to @record.title, project_node_evidence_path(current_project, @record.node, @record) %></li>
<% when Issue %>
<li class="breadcrumb-item"><%= link_to 'All issues', project_issues_path(current_project) %></li>
<li class="breadcrumb-item"><%= link_to @record.title, project_issue_path(current_project, @record) %></li>
<% if qa %>
<li class="breadcrumb-item"><%= link_to 'QA', project_qa_issues_path(current_project) %></li>
<li class="breadcrumb-item"><%= link_to @record.title, project_qa_issue_path(current_project, @record) %></li>
<% else %>
<li class="breadcrumb-item"><%= link_to 'All issues', project_issues_path(current_project) %></li>
<li class="breadcrumb-item"><%= link_to @record.title, project_issue_path(current_project, @record) %></li>
<% end %>
<% when Note %>
<li class="breadcrumb-item"><a href="javascript:void(0)" data-behavior="sidebar-toggle">Nodes</a></li>
<li class="breadcrumb-item"><%= link_to @record.node.label, project_node_path(current_project, @record.node, tab: 'notes-tab') %></li>
Expand Down
4 changes: 2 additions & 2 deletions app/views/revisions/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% content_for :title, "#{@record.class.model_name} ##{@record.id} - comparing revisions" %>

<% content_for :breadcrumbs do %>
<%= render partial: 'breadcrumbs' %>
<%= render partial: 'breadcrumbs', locals: { qa: @qa } %>
<% end %>

<% if @node %>
Expand Down Expand Up @@ -43,7 +43,7 @@
<% if revision == @revision %>
Currently Viewing
<% elsif revision.event == "update" %>
<%= link_to "View Changes", record_revision_path(@record, revision) %>
<%= link_to "View Changes", record_revision_path(@record, revision, qa: @qa) %>
<% end %>
<% end %>
</td>
Expand Down
Loading