Commit de7d93e31fd2a35488113cac7d6f56c2c2a88306
Exists in
spb-stable
and in
2 other branches
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
Showing
4 changed files
with
5 additions
and
5 deletions
Show diff stats
app/controllers/projects/branches_controller.rb
... | ... | @@ -17,9 +17,9 @@ class Projects::BranchesController < Projects::ApplicationController |
17 | 17 | end |
18 | 18 | |
19 | 19 | def create |
20 | - CreateBranchService.new.execute(project, params[:branch_name], params[:ref], current_user) | |
20 | + @branch = CreateBranchService.new.execute(project, params[:branch_name], params[:ref], current_user) | |
21 | 21 | |
22 | - redirect_to project_branches_path(@project) | |
22 | + redirect_to project_tree_path(@project, @branch.name) | |
23 | 23 | end |
24 | 24 | |
25 | 25 | def destroy | ... | ... |
app/views/projects/branches/_branch.html.haml
1 | 1 | - commit = @repository.commit(branch.target) |
2 | 2 | %li |
3 | 3 | %h4 |
4 | - = link_to project_commits_path(@project, branch.name) do | |
4 | + = link_to project_tree_path(@project, branch.name) do | |
5 | 5 | %strong= truncate(branch.name, length: 60) |
6 | 6 | - if branch.name == @repository.root_ref |
7 | 7 | %span.label.label-info default | ... | ... |
app/views/projects/tree/show.html.haml
1 | 1 | %div.tree-ref-holder |
2 | 2 | = render 'shared/ref_switcher', destination: 'tree', path: @path |
3 | 3 | - if can? current_user, :download_code, @project |
4 | - = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small tree-ref-holder pull-right', split_button: true | |
4 | + = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small pull-right', split_button: true | |
5 | 5 | %div#tree-holder.tree-holder |
6 | 6 | = render "tree", tree: @tree | ... | ... |
features/steps/project/browse_branches.rb