Skip to content

Commit

Permalink
[webui] add branch destination information
Browse files Browse the repository at this point in the history
Show (and link to if it already exists) resulting project on the
'Branch Confirmation' Dialog.

Fixes openSUSE#2171
  • Loading branch information
agraul committed Nov 30, 2017
1 parent e74a09f commit df8ceca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/api/app/helpers/webui/package_helper.rb
Expand Up @@ -88,4 +88,10 @@ def binaries?(xml_hash)
def repo_type_and_priority(repository)
[repository.repo_type, repository.priority].compact.join(', Priority: ')
end

def package_link_dest(pack, opts = {})
opts[:project] = User.current.branch_project_name(pack.project.name)
opts[:short] = true
project_or_package_link(opts)
end
end
3 changes: 2 additions & 1 deletion src/api/app/views/webui/package/_branch_dialog.html.erb
Expand Up @@ -3,7 +3,8 @@
<h2 class="box-header">Branch Confirmation</h2>
<div class="dialog-content">
<p>
Do you really want to branch <%= package_link(@package) %>?<br /><br />
Do you want to branch <%= package_link(@package) %>
into <%= package_link_dest(@package) %>?<br /><br />
<a data-target="#branching-options" data-hidetext="[-] Hide options" data-showtext="[+] More options" class="show-hide">[+] More options</a>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/features/webui/maintenance_workflow_spec.rb
Expand Up @@ -34,7 +34,7 @@
visit package_show_path(project: update_project, package: package)

click_link('Branch package')
expect(page).to have_text('Do you really want to branch package')
expect(page).to have_text('Do you want to branch package')

click_button('Ok')
expect(page).to have_text('Successfully branched package')
Expand Down

0 comments on commit df8ceca

Please sign in to comment.