提交 de7d93e3 编写于 作者: D Dmitriy Zaporozhets

Merge branch 'branch-creation-flow' into 'master'

Branch creation flow

To improve user experience with web editing I did next improvements:

* when create branch via ui - redirect to tree view so you start add/edit files
* when click on branch name - redirect to tree view instead of commits so you can immedialty add/edit files
......@@ -17,9 +17,9 @@ class Projects::BranchesController < Projects::ApplicationController
end
def create
CreateBranchService.new.execute(project, params[:branch_name], params[:ref], current_user)
@branch = CreateBranchService.new.execute(project, params[:branch_name], params[:ref], current_user)
redirect_to project_branches_path(@project)
redirect_to project_tree_path(@project, @branch.name)
end
def destroy
......
- commit = @repository.commit(branch.target)
%li
%h4
= link_to project_commits_path(@project, branch.name) do
= link_to project_tree_path(@project, branch.name) do
%strong= truncate(branch.name, length: 60)
- if branch.name == @repository.root_ref
%span.label.label-info default
......
%div.tree-ref-holder
= render 'shared/ref_switcher', destination: 'tree', path: @path
- if can? current_user, :download_code, @project
= render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small tree-ref-holder pull-right', split_button: true
= render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small pull-right', split_button: true
%div#tree-holder.tree-holder
= render "tree", tree: @tree
......@@ -44,7 +44,7 @@ class ProjectBrowseBranches < Spinach::FeatureSteps
end
step 'I should see new branch created' do
within '.all-branches' do
within '.tree-ref-holder' do
page.should have_content 'deploy_keys'
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册