Skip to content

Commit

Permalink
Do not untilize wizard=true in the url (#1758)
Browse files Browse the repository at this point in the history
It no longer works, sodo not use it

Co-authored-by: Hector Correa <[email protected]>
  • Loading branch information
carolyncole and hectorcorrea authored Apr 12, 2024
1 parent 42c9a0c commit c77fde6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions app/decorators/work_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ def show_migrate_button?
draft? && migrated && current_user_is_admin?
end

def wizard_mode?
draft? && !migrated
def edit_path
if draft? && !migrated # wizard mode
edit_work_wizard_path(work)
else
edit_work_path(work)
end
end

def file_list_path
Expand Down
2 changes: 1 addition & 1 deletion app/views/works/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<div class="row">
<div class="col-8">
<% if @work.editable_in_current_state?(current_user) %>
<%= link_to("Edit", edit_work_path(@work, wizard: @work_decorator.wizard_mode?), class: "btn btn-primary") %>
<%= link_to("Edit", @work_decorator.edit_path, class: "btn btn-primary") %>
<% end %>
<% if @work_decorator.show_approve_button? %>
<%= button_to("Approve Dataset", approve_work_path(@work), class: "btn btn-secondary", method: :post, id: "approve-button") %>
Expand Down
2 changes: 1 addition & 1 deletion spec/system/work_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def value_for(label)
it "uses the wizard if the work is in draft" do
sign_in user
visit work_path(draft_work)
expect(page.html.include?("/works/#{draft_work.id}/edit?wizard=true")).to be true
expect(page.html.include?("/works/#{draft_work.id}/edit-wizard")).to be true
end

context "work is awaiting approval" do
Expand Down

0 comments on commit c77fde6

Please sign in to comment.