Commit 1c393959 authored by tiagonbotelho's avatar tiagonbotelho

refactors the search to enable users to filter and sort branches at the

same time and writes tests accordingly

changes schema.db

removes duplicate field inside CHANGELOG

fix db/schema
parent 3ec01e57
......@@ -8,7 +8,6 @@ v 8.10.0 (unreleased)
- Add the functionality to be able to rename a file. !5049 (tiagonbotelho)
- Disable PostgreSQL statement timeout during migrations
- Fix projects dropdown loading performance with a simplified api cal. !5113 (tiagonbotelho)
- User can now filter branches by name on /branches page. !5144 (tiagonbotelho)
- Fix commit builds API, return all builds for all pipelines for given commit. !4849
- Replace Haml with Hamlit to make view rendering faster. !3666
- Refresh the branch cache after `git gc` runs
......
......@@ -125,10 +125,6 @@ class Repository
commits
end
def find_similar_branches(search)
raw_repository.branches.select { |branch| branch.name.include?(search) }
end
def find_branch(name)
raw_repository.branches.find { |branch| branch.name == name }
end
......
......@@ -27,7 +27,6 @@
= sort_title_recently_updated
= link_to filter_branches_path(sort: 'last_updated') do
= sort_title_oldest_updated
= link_to new_namespace_project_branch_path(@project.namespace, @project), class: 'btn btn-create' do
New branch
- if @branches.any?
......
......@@ -84,10 +84,10 @@ ActiveRecord::Schema.define(version: 20160716115710) do
t.string "health_check_access_token"
t.boolean "send_user_confirmation_email", default: false
t.integer "container_registry_token_expire_delay", default: 5
t.boolean "user_default_external", default: false, null: false
t.text "after_sign_up_text"
t.string "repository_storage", default: "default"
t.string "enabled_git_access_protocol"
t.boolean "user_default_external", default: false, null: false
end
create_table "audit_events", force: :cascade do |t|
......
......@@ -17,6 +17,7 @@ describe BranchesFinder do
it 'sorts by recently_updated' do
branches_finder = described_class.new(repository, { sort: 'recently_updated' })
result = branches_finder.execute
expect(result.first.name).to eq('expand-collapse-lines')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment