From 83dc5f936290cd928362c56959a40b906a2acd15 Mon Sep 17 00:00:00 2001 From: randx Date: Mon, 22 Oct 2012 21:21:34 +0300 Subject: [PATCH 1/8] Fix issue with removing group --- app/controllers/admin/groups_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb index bfde6548..0bba0199 100644 --- a/app/controllers/admin/groups_controller.rb +++ b/app/controllers/admin/groups_controller.rb @@ -64,7 +64,7 @@ class Admin::GroupsController < AdminController def destroy @group.destroy - redirect_to groups_url, notice: 'Group was successfully deleted.' + redirect_to admin_groups_path, notice: 'Group was successfully deleted.' end private From 42abdf69d59ecf28688af5994ff2e324c50a6d33 Mon Sep 17 00:00:00 2001 From: randx Date: Mon, 22 Oct 2012 21:42:06 +0300 Subject: [PATCH 2/8] More group tests with spinach --- features/admin/groups.feature | 10 ++++++++ features/group/group.feature | 10 ++++++++ features/steps/admin/admin_groups.rb | 24 ++++++++++++++++++ features/steps/group/group.rb | 38 +++++++++++++++++++++++++--- features/steps/shared/paths.rb | 20 +++++++++++++++ 5 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 features/admin/groups.feature create mode 100644 features/steps/admin/admin_groups.rb diff --git a/features/admin/groups.feature b/features/admin/groups.feature new file mode 100644 index 00000000..e5eab8e6 --- /dev/null +++ b/features/admin/groups.feature @@ -0,0 +1,10 @@ +Feature: Admin Groups + Background: + Given I sign in as an admin + And I visit admin groups page + + Scenario: Create a group + When I click new group link + And submit form with new group info + Then I should be redirected to group page + And I should see newly created group diff --git a/features/group/group.feature b/features/group/group.feature index dbddb92c..07308112 100644 --- a/features/group/group.feature +++ b/features/group/group.feature @@ -7,3 +7,13 @@ Feature: Groups When I visit group page Then I should see projects list And I should see projects activity feed + + Scenario: I should see group issues list + Given project from group has issues assigned to me + When I visit group issues page + Then I should see issues from this group assigned to me + + Scenario: I should see group merge requests list + Given project from group has merge requests assigned to me + When I visit group merge requests page + Then I should see merge requests from this group assigned to me diff --git a/features/steps/admin/admin_groups.rb b/features/steps/admin/admin_groups.rb new file mode 100644 index 00000000..e1759013 --- /dev/null +++ b/features/steps/admin/admin_groups.rb @@ -0,0 +1,24 @@ +class AdminGroups < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedActiveTab + + When 'I click new group link' do + click_link "New Group" + end + + And 'submit form with new group info' do + fill_in 'group_name', :with => 'gitlab' + fill_in 'group_code', :with => 'gitlab' + click_button "Save group" + end + + Then 'I should see newly created group' do + page.should have_content "Group: gitlab" + end + + Then 'I should be redirected to group page' do + current_path.should == admin_group_path(Group.last) + end +end + diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb index 798c62c3..51581a1e 100644 --- a/features/steps/group/group.rb +++ b/features/steps/group/group.rb @@ -2,10 +2,6 @@ class Groups < Spinach::FeatureSteps include SharedAuthentication include SharedPaths - When 'I visit group page' do - visit group_path(current_group) - end - Then 'I should see projects list' do current_user.projects.each do |project| page.should have_link project.name @@ -24,9 +20,43 @@ class Groups < Spinach::FeatureSteps page.should have_content 'closed issue' end + Then 'I should see issues from this group assigned to me' do + assigned_to_me(:issues).each do |issue| + page.should have_content issue.title + end + end + + Then 'I should see merge requests from this group assigned to me' do + assigned_to_me(:merge_requests).each do |issue| + page.should have_content issue.title + end + end + + Given 'project from group has issues assigned to me' do + create :issue, + project: project, + assignee: current_user, + author: current_user + end + + Given 'project from group has merge requests assigned to me' do + create :merge_request, + project: project, + assignee: current_user, + author: current_user + end + protected def current_group @group ||= Group.first end + + def project + current_group.projects.first + end + + def assigned_to_me key + project.send(key).where(assignee_id: current_user.id) + end end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index eda5ab94..b4e4b810 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -5,6 +5,22 @@ module SharedPaths visit new_project_path end + # ---------------------------------------- + # Group + # ---------------------------------------- + + When 'I visit group page' do + visit group_path(current_group) + end + + When 'I visit group issues page' do + visit issues_group_path(current_group) + end + + When 'I visit group merge requests page' do + visit merge_requests_group_path(current_group) + end + # ---------------------------------------- # Dashboard # ---------------------------------------- @@ -85,6 +101,10 @@ module SharedPaths visit admin_resque_path end + And 'I visit admin groups page' do + visit admin_groups_path + end + # ---------------------------------------- # Generic Project # ---------------------------------------- From e51b2d58e7e751b62d1d924e3c494117fd9d0604 Mon Sep 17 00:00:00 2001 From: randx Date: Mon, 22 Oct 2012 23:37:50 +0300 Subject: [PATCH 3/8] Restyled last push widget. Increased line-height for td in tables --- .../stylesheets/gitlab_bootstrap/buttons.scss | 16 ++++++++++++++ .../stylesheets/gitlab_bootstrap/tables.scss | 8 +++++++ app/assets/stylesheets/sections/events.scss | 15 +++++++++---- app/assets/stylesheets/sections/tree.scss | 1 + app/views/admin/groups/index.html.haml | 4 ++++ app/views/dashboard/index.html.haml | 2 +- app/views/events/_event_last_push.html.haml | 22 ++++++++++--------- app/views/groups/show.html.haml | 2 +- app/views/keys/_show.html.haml | 3 +-- app/views/projects/files.html.haml | 5 ++--- app/views/team_members/_team.html.haml | 2 +- features/steps/dashboard/dashboard.rb | 2 +- 12 files changed, 59 insertions(+), 23 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss index 380fc3e3..4f631a3e 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss @@ -24,6 +24,22 @@ } } + &.btn-info { + background:#5aB9C3; + border-color: $blue_link; + color:#fff; + text-shadow: 0 1px 1px #268; + &:hover { + background:$blue_link; + color:#fff; + } + + &.disabled { + color:#fff; + background:#29B; + } + } + &.success { @extend .btn-success; diff --git a/app/assets/stylesheets/gitlab_bootstrap/tables.scss b/app/assets/stylesheets/gitlab_bootstrap/tables.scss index b9220792..7a3bda2b 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/tables.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/tables.scss @@ -5,6 +5,12 @@ table { border:1px solid #bbb; width:100%; + &.low { + td { + line-height:18px; + } + } + th { font-weight: bold; vertical-align: middle; @@ -26,6 +32,8 @@ table { td { border-color:#f1f1f1; + line-height:28px; + &:first-child { border-left:1px solid #bbb; } diff --git a/app/assets/stylesheets/sections/events.scss b/app/assets/stylesheets/sections/events.scss index b7a482fd..17df600c 100644 --- a/app/assets/stylesheets/sections/events.scss +++ b/app/assets/stylesheets/sections/events.scss @@ -97,14 +97,21 @@ * */ .event_lp { - @extend .ui-box; color:#777; - margin-bottom:20px; - padding:8px; - @include border-radius(4px); + padding:10px; min-height:22px; + border-left: 5px solid #5AB9C3; + margin-bottom:20px; + background:#f9f9f9; .avatar { width:24px; } + + .btn-new-mr { + @extend .btn-info; + @extend .small; + @extend .right; + margin: -3px; + } } diff --git a/app/assets/stylesheets/sections/tree.scss b/app/assets/stylesheets/sections/tree.scss index 9f78a6b6..e17487fd 100644 --- a/app/assets/stylesheets/sections/tree.scss +++ b/app/assets/stylesheets/sections/tree.scss @@ -48,6 +48,7 @@ padding: 2px 10px; } td { + line-height:20px; background:#fafafa; } } diff --git a/app/views/admin/groups/index.html.haml b/app/views/admin/groups/index.html.haml index 25efc9ee..6a0794cf 100644 --- a/app/views/admin/groups/index.html.haml +++ b/app/views/admin/groups/index.html.haml @@ -1,6 +1,10 @@ = render 'admin/shared/projects_head' %h3.page_title Groups + %small + allows you to keep projects organized. + Use groups for uniting related projects. + = link_to 'New Group', new_admin_group_path, class: "btn small right" %br = form_tag admin_groups_path, method: :get, class: 'form-inline' do diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index dc520a22..6c4ff96b 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -1,6 +1,7 @@ - if @projects.any? .projects .activities.span8 + = render "events/event_last_push", event: @last_push = render 'shared/no_ssh' - if @events.any? .content_list= render @events @@ -8,7 +9,6 @@ %h4.nothing_here_message Projects activity will be displayed here .loading.hide .side - = render "events/event_last_push", event: @last_push - if @groups.present? = render "groups", groups: @groups = render "projects", projects: @projects diff --git a/app/views/events/_event_last_push.html.haml b/app/views/events/_event_last_push.html.haml index d70be70c..e15f1ac0 100644 --- a/app/views/events/_event_last_push.html.haml +++ b/app/views/events/_event_last_push.html.haml @@ -1,13 +1,15 @@ - if show_last_push_widget?(event) .event_lp - %div - = image_tag gravatar_icon(event.author_email), class: "avatar" - %span You pushed to - = event.ref_type - = link_to project_commits_path(event.project, event.ref_name) do - %strong= truncate(event.ref_name, length: 28) - at - %strong= link_to event.project.name, event.project + = image_tag "event_push.png" +   + %span You pushed to + = link_to project_commits_path(event.project, event.ref_name) do + %strong= truncate(event.ref_name, length: 28) + at + %strong= link_to event.project.name, event.project + %span + = time_ago_in_words(event.created_at) + ago. - = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn very_small" do - Create Merge Request + = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-new-mr" do + Create Merge Request diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index cd86a01f..72d7ad9a 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -1,5 +1,6 @@ .projects .activities.span8 + = render "events/event_last_push", event: @last_push = link_to dashboard_path, class: 'btn very_small' do ← To dashboard   @@ -12,7 +13,6 @@ %h4.nothing_here_message Projects activity will be displayed here .loading.hide .side - = render "events/event_last_push", event: @last_push = render "projects", projects: @projects %div %span.rss-icon diff --git a/app/views/keys/_show.html.haml b/app/views/keys/_show.html.haml index a0af8eea..9d4485cf 100644 --- a/app/views/keys/_show.html.haml +++ b/app/views/keys/_show.html.haml @@ -1,8 +1,7 @@ %tr %td = link_to key_path(key) do - %p - %strong= key.title + %strong= key.title %td %span.cgray Added diff --git a/app/views/projects/files.html.haml b/app/views/projects/files.html.haml index ce8ba876..9f7efcdc 100644 --- a/app/views/projects/files.html.haml +++ b/app/views/projects/files.html.haml @@ -4,14 +4,13 @@ %thead %tr %th File name - %th + %th - @notes.each do |note| %tr %td %a{href: note.attachment.url} - = image_tag gravatar_icon(note.author_email), class: "left", width: 16 -   + = image_tag gravatar_icon(note.author_email), class: "avatar s24" = note.attachment_identifier %td Added diff --git a/app/views/team_members/_team.html.haml b/app/views/team_members/_team.html.haml index a0c88b59..26d13533 100644 --- a/app/views/team_members/_team.html.haml +++ b/app/views/team_members/_team.html.haml @@ -1,5 +1,5 @@ - grouper_project_members(@project).each do |access, members| - %table + %table.low %thead %tr %th.span7 diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index a9416f73..b22b2465 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -16,7 +16,7 @@ class Dashboard < Spinach::FeatureSteps end Then 'I should see last push widget' do - page.should have_content "You pushed to branch new_design" + page.should have_content "You pushed to new_design" page.should have_link "Create Merge Request" end From 9902f1af6edc0b6c0a935fb3578715d20636d76e Mon Sep 17 00:00:00 2001 From: randx Date: Mon, 22 Oct 2012 23:49:21 +0300 Subject: [PATCH 4/8] Reduce line-height for commits diff lines --- app/assets/stylesheets/sections/commits.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/sections/commits.scss b/app/assets/stylesheets/sections/commits.scss index 1da81275..139d7347 100644 --- a/app/assets/stylesheets/sections/commits.scss +++ b/app/assets/stylesheets/sections/commits.scss @@ -101,6 +101,11 @@ } } + table { + td { + line-height:18px; + } + } } .diff_file_content_image { background:#eee; From b2df61d85ab295a9ba4585f667537a9afc3efc6a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 23 Oct 2012 11:29:47 +0300 Subject: [PATCH 5/8] Fix 500 error on admin project if empty --- app/roles/repository.rb | 2 ++ app/views/admin/projects/show.html.haml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/roles/repository.rb b/app/roles/repository.rb index 882ec310..8942eaea 100644 --- a/app/roles/repository.rb +++ b/app/roles/repository.rb @@ -137,6 +137,8 @@ module Repository def has_commits? !!commit + rescue Grit::NoSuchPathError + false end def root_ref diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index f85b6e4b..c742fb33 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -5,7 +5,7 @@ %i.icon-edit Edit -- if !@admin_project.has_post_receive_file? && @admin_project.commit +- if !@admin_project.has_post_receive_file? && @admin_project.has_commits? %br .alert.alert-error %span From e09bff082eade2ce35e6ef8af3e265b37f6a0483 Mon Sep 17 00:00:00 2001 From: Saito Date: Wed, 24 Oct 2012 16:28:32 +0800 Subject: [PATCH 6/8] Update doc/installation.md Git Smart HTTP protocol runs on `gitlab:gitlab`. --- doc/installation.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/installation.md b/doc/installation.md index 282cad95..b04a324d 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -157,6 +157,10 @@ Add your user to the `git` group: sudo usermod -a -G git gitlab +Add `git` user to `gitlab` group: + + sudo usermod -a -G gitlab git + Generate key: sudo -H -u gitlab ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa From 9f7ba5bca06e4c3d1f9880ba8c13ba9408ed2947 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 24 Oct 2012 12:39:53 +0300 Subject: [PATCH 7/8] Fix schema.rb --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index ec4729c0..a7037811 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20121002151033) do +ActiveRecord::Schema.define(:version => 20121009205010) do create_table "events", :force => true do |t| t.string "target_type" From 012d62b19828ab1f94ae743c92233f48c714cf8b Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 24 Oct 2012 12:41:47 +0300 Subject: [PATCH 8/8] v3.0.2 --- CHANGELOG | 5 +++++ VERSION | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index b9332c9d..56733013 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +v 3.0.2 + - Fixed gitlab:app:setup + - Fixed application error on empty project in admin area + - Restyled last push widget + v 3.0.1 - Fixed git over http diff --git a/VERSION b/VERSION index cb2b00e4..b5021469 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.1 +3.0.2