From d417287d8684c2cdf3554da5a77ff2b597886ed4 Mon Sep 17 00:00:00 2001 From: "M. Ricketts" Date: Wed, 10 Feb 2016 15:02:58 +0000 Subject: [PATCH 01/21] Add instructions for pushing tags as well as branches --- doc/workflow/importing/migrating_from_svn.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/workflow/importing/migrating_from_svn.md b/doc/workflow/importing/migrating_from_svn.md index b355a91b5a6..4828bb5dce6 100644 --- a/doc/workflow/importing/migrating_from_svn.md +++ b/doc/workflow/importing/migrating_from_svn.md @@ -69,6 +69,7 @@ branches and tags. ```bash git remote add origin git@gitlab.com:/.git git push --all origin +git push --tags origin ``` ## Contribute to this guide From 81ab172a25a29bdc2907fdd0d681e6cddb7c31a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Finn=20Gl=C3=B6e?= Date: Sat, 13 Feb 2016 20:42:48 +0000 Subject: [PATCH 02/21] Fixed ~git beeing displayed as link to issues tagged with git [ci skip] --- doc/development/architecture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/development/architecture.md b/doc/development/architecture.md index 6101a71a8de..12e33406cb6 100644 --- a/doc/development/architecture.md +++ b/doc/development/architecture.md @@ -42,7 +42,7 @@ Gitlab-shell communicates with Sidekiq via the “communication board” (Redis) ## System Layout -When referring to ~git in the pictures it means the home directory of the git user which is typically /home/git. +When referring to `~git` in the pictures it means the home directory of the git user which is typically /home/git. GitLab is primarily installed within the `/home/git` user home directory as `git` user. Within the home directory is where the gitlabhq server software resides as well as the repositories (though the repository location is configurable). From c37e5bc69d2b6f679c53d5edbc1bea27dbc262ac Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Tue, 26 Jan 2016 19:09:55 -0500 Subject: [PATCH 03/21] Sidebar overlaps content when screen is below 1200px. When screen is below 1200px, the sidebar overlaps. When screen is above 1200px, the sidebar pushes content out. z-index change to make sure hamburger stays on top. Fixes #12717 --- app/assets/javascripts/application.js.coffee | 6 +- app/assets/stylesheets/framework/header.scss | 2 +- app/assets/stylesheets/framework/sidebar.scss | 81 ++++--------------- 3 files changed, 22 insertions(+), 67 deletions(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 367bd098bfd..dde71f33d2e 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -188,9 +188,13 @@ $ -> $container.remove() $('.navbar-toggle').on 'click', -> + $this = $(this); $('.header-content .title').toggle() $('.header-content .navbar-collapse').toggle() - $('.navbar-toggle').toggleClass('active') + if $this.toggleClass('active').hasClass('active') + $this.closest('header').css('z-index',100) + else + $this.closest('header').css('z-index',99) # Show/hide comments on diff $("body").on "click", ".js-toggle-diff-comments", (e) -> diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index a81e258573d..93d74bf30f1 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -23,7 +23,7 @@ header { &.navbar-gitlab { padding: 0 20px; - z-index: 100; + z-index: 99; margin-bottom: 0; min-height: $header-height; background-color: #fff; diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss index b141928f706..194bd803930 100644 --- a/app/assets/stylesheets/framework/sidebar.scss +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -45,19 +45,6 @@ overflow: hidden; transition-duration: .3s; - .home { - z-index: 1; - position: absolute; - left: 0px; - } - - #logo { - z-index: 2; - position: absolute; - width: 58px; - cursor: pointer; - } - a { float: left; height: $header-height; @@ -83,7 +70,7 @@ width: 158px; float: left; margin: 0; - margin-left: 50px; + margin-left: 14px; font-size: 19px; line-height: 41px; font-weight: normal; @@ -192,7 +179,16 @@ } @mixin expanded-sidebar { - padding-left: $sidebar_width; + + // when the screen is small enough + @media (max-width: $screen-md-max) { + padding-left: $sidebar_collapsed_width; + } + + // when the screen is big enough + @media(min-width: $screen-md-max) { + padding-left: $sidebar_width; + } .sidebar-wrapper { width: $sidebar_width; @@ -213,14 +209,6 @@ } } -@mixin expanded-gutter { - padding-right: $gutter_width; -} - -@mixin collapsed-gutter { - padding-right: $sidebar_collapsed_width; -} - @mixin collapsed-sidebar { padding-left: $sidebar_collapsed_width; @@ -287,47 +275,10 @@ background: #f2f6f7; } -// page is small enough -@media (max-width: $screen-md-max) { - .page-sidebar-collapsed { - @include collapsed-sidebar; - } - - .page-sidebar-expanded { - @include collapsed-sidebar; - } - - .page-gutter { - &.right-sidebar-collapsed { - @include collapsed-gutter; - } - &.right-sidebar-expanded { - @include expanded-gutter; - } - } - - .collapse-nav { - display: none; - } +.page-sidebar-collapsed { + @include collapsed-sidebar; } -// page is large enough -@media(min-width: $screen-md-max) { - - .page-gutter { - &.right-sidebar-collapsed { - @include collapsed-gutter; - } - &.right-sidebar-expanded { - @include expanded-gutter; - } - } - - .page-sidebar-collapsed { - @include collapsed-sidebar; - } - - .page-sidebar-expanded { - @include expanded-sidebar; - } -} \ No newline at end of file +.page-sidebar-expanded { + @include expanded-sidebar; +} From 9f0a71f4fe0eade788c1c722c70873b319492dbe Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Fri, 5 Feb 2016 17:07:57 -0500 Subject: [PATCH 04/21] Shrink on diff view Shrinks when navigating to diff view. Shrinks when refreshing on diff view. Expandable at anytime. --- app/assets/javascripts/application.js.coffee | 10 ++++++++++ app/helpers/nav_helper.rb | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 367bd098bfd..d1bef0bd151 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -225,6 +225,16 @@ $ -> if $gutterIcon.hasClass('fa-angle-double-right') $gutterIcon.closest('a').trigger('click') + $(document) + .off 'shown.bs.tab', '.merge-request-tabs a[data-toggle="tab"]' + .on 'shown.bs.tab', '.merge-request-tabs a[data-toggle="tab"]', (e) -> + action = $(e.target).attr("data-action") + if action is 'diffs' + $gutterIcon = $('.gutter-toggle').find('i') + if $gutterIcon.hasClass('fa-angle-double-right') + $gutterIcon.closest('a').trigger('click') + + $(document) .off 'click', 'aside .gutter-toggle' .on 'click', 'aside .gutter-toggle', (e) -> diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index 29cb753e62c..921912ce802 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -3,6 +3,20 @@ module NavHelper cookies[:collapsed_nav] == 'true' end + def sidebar_gutter_collapsed_class + if current_path?('merge_requests#diffs') || + cookies[:collapsed_gutter] == 'true' + "right-sidebar-collapsed" + else + "right-sidebar-expanded" + end + end + + def sidebar_gutter_collapsed? + current_path?('merge_requests#diffs') || + cookies[:collapsed_gutter] == 'true' + end + def nav_sidebar_class if nav_menu_collapsed? "sidebar-collapsed" @@ -29,6 +43,8 @@ module NavHelper else "page-gutter right-sidebar-expanded" end + elsif current_path?('merge_requests#diffs') + "page-gutter right-sidebar-collapsed" end end From 2325e3be0793aa29412bc00281df39ed483a841e Mon Sep 17 00:00:00 2001 From: David Alexander Date: Wed, 17 Feb 2016 17:13:06 +0000 Subject: [PATCH 05/21] Reformats confusing '[named here]' section for 3rd party code attribution --- doc/legal/individual_contributor_license_agreement.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/legal/individual_contributor_license_agreement.md b/doc/legal/individual_contributor_license_agreement.md index f97c252fd7c..59803aea080 100644 --- a/doc/legal/individual_contributor_license_agreement.md +++ b/doc/legal/individual_contributor_license_agreement.md @@ -18,7 +18,7 @@ You accept and agree to the following terms and conditions for Your present and 6. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. -7. Should You wish to submit work that is not Your original creation, You may submit it to GitLab B.V. separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [[]named here]". +7. Should You wish to submit work that is not Your original creation, You may submit it to GitLab B.V. separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [insert_name_here]". 8. You agree to notify GitLab B.V. of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. From bea6aa3377dfc685ed2d6427609e17318279e8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20K=C3=B6hler?= Date: Thu, 21 Jan 2016 21:17:16 +0100 Subject: [PATCH 06/21] Show test coverage on project builds page --- app/views/projects/builds/index.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml index 5e3bd14565e..14f1d3226bb 100644 --- a/app/views/projects/builds/index.html.haml +++ b/app/views/projects/builds/index.html.haml @@ -51,9 +51,11 @@ %th Name %th Duration %th Finished at + - if @project.build_coverage_enabled? + %th Coverage %th - @builds.each do |build| - = render 'projects/commit_statuses/commit_status', commit_status: build, commit_sha: true, stage: true, allow_retry: true + = render 'projects/commit_statuses/commit_status', commit_status: build, commit_sha: true, stage: true, coverage: @project.build_coverage_enabled?, allow_retry: true = paginate @builds, theme: 'gitlab' From f36fde94d0f72bc86abf4a424710f9e5c72cfc30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 4 Feb 2016 11:08:58 +0100 Subject: [PATCH 07/21] Add a spec for coverage indicator in project's builds list --- CHANGELOG | 1 + features/project/builds/summary.feature | 2 ++ features/steps/project/builds/summary.rb | 6 ++++++ features/steps/shared/builds.rb | 6 +++++- spec/factories/ci/builds.rb | 6 +++++- 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7fcb4628058..51b43669b93 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.6.0 (unreleased) + - Add build coverage in project's builds page (Steffen Köhler) v 8.5.0 - Fix duplicate "me" in tooltip of the "thumbsup" awards Emoji (Stan Hu) diff --git a/features/project/builds/summary.feature b/features/project/builds/summary.feature index 4f3fd194d00..3c029a973df 100644 --- a/features/project/builds/summary.feature +++ b/features/project/builds/summary.feature @@ -3,6 +3,7 @@ Feature: Project Builds Summary Given I sign in as a user And I own a project And project has CI enabled + And project has coverage enabled And project has a recent build Scenario: I browse build details page @@ -12,6 +13,7 @@ Feature: Project Builds Summary Scenario: I browse project builds page When I visit project builds page + Then I see coverage Then I see button to CI Lint Scenario: I erase a build diff --git a/features/steps/project/builds/summary.rb b/features/steps/project/builds/summary.rb index 4688a0e2096..e9e2359146e 100644 --- a/features/steps/project/builds/summary.rb +++ b/features/steps/project/builds/summary.rb @@ -4,6 +4,12 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps include SharedBuilds include RepoHelpers + step 'I see coverage' do + page.within('td.coverage') do + expect(page).to have_content "99.9%" + end + end + step 'I see button to CI Lint' do page.within('.nav-controls') do ci_lint_tool_link = page.find_link('CI Lint') diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb index 0bd5d93b997..f33ed7834fe 100644 --- a/features/steps/shared/builds.rb +++ b/features/steps/shared/builds.rb @@ -5,9 +5,13 @@ module SharedBuilds @project.enable_ci end + step 'project has coverage enabled' do + @project.update_attribute(:build_coverage_regex, /Coverage (\d+)%/) + end + step 'project has a recent build' do @ci_commit = create(:ci_commit, project: @project, sha: @project.commit.sha) - @build = create(:ci_build, commit: @ci_commit) + @build = create(:ci_build_with_coverage, commit: @ci_commit) end step 'recent build is successful' do diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index a46466798d6..a7a54d44521 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -53,6 +53,10 @@ FactoryGirl.define do tag true end + factory :ci_build_with_coverage do + coverage 99.9 + end + trait :trace do after(:create) do |build, evaluator| build.trace = 'BUILD TRACE' @@ -68,7 +72,7 @@ FactoryGirl.define do build.artifacts_metadata = fixture_file_upload(Rails.root.join('spec/fixtures/ci_build_artifacts_metadata.gz'), 'application/x-gzip') - + build.save! end end From 7b785fd77374596277098f06b953352af8404732 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 23 Feb 2016 16:13:12 +0100 Subject: [PATCH 08/21] Update commit status permissions [ci skip] --- doc/permissions/permissions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/permissions/permissions.md b/doc/permissions/permissions.md index 168e7d143ee..f717b30c12e 100644 --- a/doc/permissions/permissions.md +++ b/doc/permissions/permissions.md @@ -26,6 +26,7 @@ documentation](../workflow/add-user/add-user.md). | Create code snippets | | ✓ | ✓ | ✓ | ✓ | | Manage issue tracker | | ✓ | ✓ | ✓ | ✓ | | Manage labels | | ✓ | ✓ | ✓ | ✓ | +| See a commit status | | ✓ | ✓ | ✓ | ✓ | | Manage merge requests | | | ✓ | ✓ | ✓ | | Create new merge request | | | ✓ | ✓ | ✓ | | Create new branches | | | ✓ | ✓ | ✓ | @@ -35,6 +36,7 @@ documentation](../workflow/add-user/add-user.md). | Add tags | | | ✓ | ✓ | ✓ | | Write a wiki | | | ✓ | ✓ | ✓ | | Cancel and retry builds | | | ✓ | ✓ | ✓ | +| Create or update commit status | | | ✓ | ✓ | ✓ | | Create new milestones | | | | ✓ | ✓ | | Add new team members | | | | ✓ | ✓ | | Push to protected branches | | | | ✓ | ✓ | From 13047483b3180c0966fffdb60dfe687820a72818 Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Tue, 16 Feb 2016 17:04:01 -0500 Subject: [PATCH 09/21] Update scrollbars after toggle sidebar --- app/assets/javascripts/sidebar.js.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/sidebar.js.coffee b/app/assets/javascripts/sidebar.js.coffee index ae59480af9e..cff309c5972 100644 --- a/app/assets/javascripts/sidebar.js.coffee +++ b/app/assets/javascripts/sidebar.js.coffee @@ -8,4 +8,10 @@ $(document).on("click", '.toggle-nav-collapse', (e) -> $('.sidebar-wrapper').toggleClass("sidebar-collapsed sidebar-expanded") $('.toggle-nav-collapse i').toggleClass("fa-angle-right fa-angle-left") $.cookie("collapsed_nav", $('.page-with-sidebar').hasClass(collapsed), { path: '/' }) + + setTimeout ( -> + niceScrollBars = $('.nicescroll').niceScroll(); + niceScrollBars.updateScrollBar(); + ), 300 + ) From c684bcc8b7b9361e65197841db69d82176206b88 Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Tue, 23 Feb 2016 15:15:24 -0500 Subject: [PATCH 10/21] Fixes padding when right sidebar is not present --- app/assets/stylesheets/framework/sidebar.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss index 194bd803930..e2b978b50bd 100644 --- a/app/assets/stylesheets/framework/sidebar.scss +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -12,6 +12,10 @@ height: 100%; transition-duration: .3s; } + + &.right-sidebar-expanded { + padding-right: $gutter_width; + } } .sidebar-wrapper { @@ -179,6 +183,9 @@ } @mixin expanded-sidebar { + &.right-sidebar-collapsed { + padding-right: $sidebar_collapsed_width; + } // when the screen is small enough @media (max-width: $screen-md-max) { @@ -212,6 +219,10 @@ @mixin collapsed-sidebar { padding-left: $sidebar_collapsed_width; + &.right-sidebar-collapsed { + padding-right: $sidebar_collapsed_width; + } + .sidebar-wrapper { width: $sidebar_collapsed_width; From a3713050f712c4bb80b496186e8499a4fc879d5e Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Tue, 23 Feb 2016 15:28:21 -0500 Subject: [PATCH 11/21] Ability to toggle sidebar on smaller screens --- app/assets/javascripts/application.js.coffee | 10 +++------- app/assets/stylesheets/framework/header.scss | 10 +++++++--- app/assets/stylesheets/framework/sidebar.scss | 12 ++---------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index dde71f33d2e..0651bd20d26 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -188,13 +188,9 @@ $ -> $container.remove() $('.navbar-toggle').on 'click', -> - $this = $(this); $('.header-content .title').toggle() $('.header-content .navbar-collapse').toggle() - if $this.toggleClass('active').hasClass('active') - $this.closest('header').css('z-index',100) - else - $this.closest('header').css('z-index',99) + $('.navbar-toggle').toggleClass('active') # Show/hide comments on diff $("body").on "click", ".js-toggle-diff-comments", (e) -> @@ -214,7 +210,7 @@ $ -> $this = $(this) $this.attr 'value', $this.val() return - + $(document) .off 'keyup', 'input[type="search"]' .on 'keyup', 'input[type="search"]' , (e) -> @@ -257,7 +253,7 @@ $ -> $('.page-with-sidebar') .removeClass('right-sidebar-collapsed') .addClass('right-sidebar-expanded') - $.cookie("collapsed_gutter", + $.cookie("collapsed_gutter", $('.right-sidebar') .hasClass('right-sidebar-collapsed'), { path: '/' }) diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index 93d74bf30f1..c2676cd1cc3 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -23,7 +23,7 @@ header { &.navbar-gitlab { padding: 0 20px; - z-index: 99; + z-index: 100; margin-bottom: 0; min-height: $header-height; background-color: #fff; @@ -141,9 +141,13 @@ header { } @media (max-width: $screen-md-max) { - .header-collapsed, .header-expanded { - @include collapsed-header; + .header-collapsed { + margin-left: $sidebar_collapsed_width; } + + .header-expanded { + margin-left: $sidebar_width; + } } @media(min-width: $screen-md-max) { diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss index e2b978b50bd..e0ccd6f100f 100644 --- a/app/assets/stylesheets/framework/sidebar.scss +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -183,20 +183,12 @@ } @mixin expanded-sidebar { + padding-left: $sidebar_width; + &.right-sidebar-collapsed { padding-right: $sidebar_collapsed_width; } - // when the screen is small enough - @media (max-width: $screen-md-max) { - padding-left: $sidebar_collapsed_width; - } - - // when the screen is big enough - @media(min-width: $screen-md-max) { - padding-left: $sidebar_width; - } - .sidebar-wrapper { width: $sidebar_width; From 78bf02e93dfece32767b49737f3dd1a40afb70af Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Mon, 22 Feb 2016 15:32:45 -0500 Subject: [PATCH 12/21] Set window_size to 1366*768 --- features/support/capybara.rb | 2 +- spec/support/capybara.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/support/capybara.rb b/features/support/capybara.rb index 38069ff8835..f33379f76c9 100644 --- a/features/support/capybara.rb +++ b/features/support/capybara.rb @@ -6,7 +6,7 @@ timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 90 : 15 Capybara.javascript_driver = :poltergeist Capybara.register_driver :poltergeist do |app| - Capybara::Poltergeist::Driver.new(app, js_errors: true, timeout: timeout) + Capybara::Poltergeist::Driver.new(app, js_errors: true, timeout: timeout, window_size: [1366, 768]) end Capybara.default_wait_time = timeout diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index a698f484df1..65d59e6813c 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -7,7 +7,7 @@ timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 90 : 10 Capybara.javascript_driver = :poltergeist Capybara.register_driver :poltergeist do |app| - Capybara::Poltergeist::Driver.new(app, js_errors: true, timeout: timeout) + Capybara::Poltergeist::Driver.new(app, js_errors: true, timeout: timeout, window_size: [1366, 768]) end Capybara.default_wait_time = timeout From 5507c24ffd249c52a9673c618eed525b34174cde Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Mon, 22 Feb 2016 19:59:22 -0500 Subject: [PATCH 13/21] Fix failing spec --- features/project/shortcuts.feature | 1 - 1 file changed, 1 deletion(-) diff --git a/features/project/shortcuts.feature b/features/project/shortcuts.feature index 10e7c234610..1144ea2e133 100644 --- a/features/project/shortcuts.feature +++ b/features/project/shortcuts.feature @@ -12,7 +12,6 @@ Feature: Project Shortcuts @javascript Scenario: Navigate to commits tab - Given I visit my project's files page Given I press "g" and "c" Then the active main tab should be Commits From be0f97a6d4a170aaf181f00078367b356015292e Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Tue, 23 Feb 2016 20:04:20 -0500 Subject: [PATCH 14/21] Initialize navigation shortcuts on project's files page --- app/assets/javascripts/dispatcher.js.coffee | 1 + features/project/shortcuts.feature | 1 + 2 files changed, 2 insertions(+) diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee index b17f8e51470..67a92d822e0 100644 --- a/app/assets/javascripts/dispatcher.js.coffee +++ b/app/assets/javascripts/dispatcher.js.coffee @@ -88,6 +88,7 @@ class Dispatcher when 'groups:new', 'groups:edit', 'admin:groups:edit', 'admin:groups:new' new GroupAvatar() when 'projects:tree:show' + shortcut_handler = new ShortcutsNavigation() new TreeView() when 'projects:find_file:show' shortcut_handler = true diff --git a/features/project/shortcuts.feature b/features/project/shortcuts.feature index 1144ea2e133..10e7c234610 100644 --- a/features/project/shortcuts.feature +++ b/features/project/shortcuts.feature @@ -12,6 +12,7 @@ Feature: Project Shortcuts @javascript Scenario: Navigate to commits tab + Given I visit my project's files page Given I press "g" and "c" Then the active main tab should be Commits From 4d23af7507e4f7f82de07d8274b85dccc0a62536 Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Wed, 24 Feb 2016 15:39:56 -0500 Subject: [PATCH 15/21] Move script inside of MergeRequestTabs class --- app/assets/javascripts/application.js.coffee | 14 ++------------ .../javascripts/merge_request_tabs.js.coffee | 8 ++++++++ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index d1bef0bd151..0651bd20d26 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -210,7 +210,7 @@ $ -> $this = $(this) $this.attr 'value', $this.val() return - + $(document) .off 'keyup', 'input[type="search"]' .on 'keyup', 'input[type="search"]' , (e) -> @@ -225,16 +225,6 @@ $ -> if $gutterIcon.hasClass('fa-angle-double-right') $gutterIcon.closest('a').trigger('click') - $(document) - .off 'shown.bs.tab', '.merge-request-tabs a[data-toggle="tab"]' - .on 'shown.bs.tab', '.merge-request-tabs a[data-toggle="tab"]', (e) -> - action = $(e.target).attr("data-action") - if action is 'diffs' - $gutterIcon = $('.gutter-toggle').find('i') - if $gutterIcon.hasClass('fa-angle-double-right') - $gutterIcon.closest('a').trigger('click') - - $(document) .off 'click', 'aside .gutter-toggle' .on 'click', 'aside .gutter-toggle', (e) -> @@ -263,7 +253,7 @@ $ -> $('.page-with-sidebar') .removeClass('right-sidebar-collapsed') .addClass('right-sidebar-expanded') - $.cookie("collapsed_gutter", + $.cookie("collapsed_gutter", $('.right-sidebar') .hasClass('right-sidebar-collapsed'), { path: '/' }) diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee index 6f569f9e1aa..e6e502cf6b6 100644 --- a/app/assets/javascripts/merge_request_tabs.js.coffee +++ b/app/assets/javascripts/merge_request_tabs.js.coffee @@ -70,6 +70,7 @@ class @MergeRequestTabs @loadCommits($target.attr('href')) else if action == 'diffs' @loadDiff($target.attr('href')) + @shrinkView() else if action == 'builds' @loadBuilds($target.attr('href')) @@ -185,3 +186,10 @@ class @MergeRequestTabs expandViewContainer: -> $('.container-fluid').removeClass('container-limited') + + shrinkView: -> + $gutterIcon = $('.gutter-toggle i') + + # Only when sidebar is collapsed + if $gutterIcon.is('.fa-angle-double-right') + $gutterIcon.closest('a').trigger('click') From 7fdc29715adc34acdfe7671f3452a38b93e32392 Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Wed, 24 Feb 2016 15:40:36 -0500 Subject: [PATCH 16/21] Remove unused methods --- app/helpers/nav_helper.rb | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index 309425559e8..5d86bd490a8 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -3,20 +3,6 @@ module NavHelper cookies[:collapsed_nav] == 'true' end - def sidebar_gutter_collapsed_class - if current_path?('merge_requests#diffs') || - cookies[:collapsed_gutter] == 'true' - "right-sidebar-collapsed" - else - "right-sidebar-expanded" - end - end - - def sidebar_gutter_collapsed? - current_path?('merge_requests#diffs') || - cookies[:collapsed_gutter] == 'true' - end - def nav_sidebar_class if nav_menu_collapsed? "sidebar-collapsed" @@ -44,8 +30,6 @@ module NavHelper else "page-gutter right-sidebar-expanded" end - elsif current_path?('merge_requests#diffs') - "page-gutter right-sidebar-collapsed" end end From ccabbaa9b348ed839e4cfb12427671676bc15c8a Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Wed, 24 Feb 2016 15:53:39 -0500 Subject: [PATCH 17/21] Wait until listeners are set before triggering a 'click' event --- app/assets/javascripts/merge_request_tabs.js.coffee | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee index e6e502cf6b6..40cfa59a229 100644 --- a/app/assets/javascripts/merge_request_tabs.js.coffee +++ b/app/assets/javascripts/merge_request_tabs.js.coffee @@ -190,6 +190,10 @@ class @MergeRequestTabs shrinkView: -> $gutterIcon = $('.gutter-toggle i') - # Only when sidebar is collapsed - if $gutterIcon.is('.fa-angle-double-right') - $gutterIcon.closest('a').trigger('click') + # Wait until listeners are set + setTimeout( -> + # Only when sidebar is collapsed + if $gutterIcon.is('.fa-angle-double-right') + $gutterIcon.closest('a').trigger('click') + , 0) + From c1482943c4b77e2195fc4e64cc804302807335b9 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Wed, 24 Feb 2016 21:06:32 -0300 Subject: [PATCH 18/21] Does not create a todo when commenting on commit or project snippet --- CHANGELOG | 3 +++ app/services/notes/create_service.rb | 1 - app/services/todo_service.rb | 4 ++-- spec/services/todo_service_spec.rb | 10 ++++++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7fcb4628058..0f2de74659e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,9 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.6.0 (unreleased) +v 8.5.2 + - Fix error 500 when commenting on a commit + v 8.5.0 - Fix duplicate "me" in tooltip of the "thumbsup" awards Emoji (Stan Hu) - Cache various Repository methods to improve performance (Yorick Peterse) diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index b970439b921..2bb312bb252 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -13,6 +13,5 @@ module Notes note end - end end diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb index dc270602ebc..4392e2d17fe 100644 --- a/app/services/todo_service.rb +++ b/app/services/todo_service.rb @@ -130,8 +130,8 @@ class TodoService end def handle_note(note, author) - # Skip system notes, like status changes and cross-references - return if note.system + # Skip system notes, notes on commit, and notes on project snippet + return if note.system? || ['Commit', 'Snippet'].include?(note.noteable_type) project = note.project target = note.noteable diff --git a/spec/services/todo_service_spec.rb b/spec/services/todo_service_spec.rb index df3aa955f24..96420acb31d 100644 --- a/spec/services/todo_service_spec.rb +++ b/spec/services/todo_service_spec.rb @@ -110,6 +110,8 @@ describe TodoService, services: true do let!(:first_todo) { create(:todo, :assigned, user: john_doe, project: project, target: issue, author: author) } let!(:second_todo) { create(:todo, :assigned, user: john_doe, project: project, target: issue, author: author) } let(:note) { create(:note, project: project, noteable: issue, author: john_doe, note: mentions) } + let(:note_on_commit) { create(:note_on_commit, project: project, author: john_doe, note: mentions) } + let(:note_on_project_snippet) { create(:note_on_project_snippet, project: project, author: john_doe, note: mentions) } let(:award_note) { create(:note, :award, project: project, noteable: issue, author: john_doe, note: 'thumbsup') } let(:system_note) { create(:system_note, project: project, noteable: issue) } @@ -145,6 +147,14 @@ describe TodoService, services: true do should_not_create_todo(user: john_doe, target: issue, author: john_doe, action: Todo::MENTIONED, note: note) should_not_create_todo(user: stranger, target: issue, author: john_doe, action: Todo::MENTIONED, note: note) end + + it 'does not create todo when leaving a note on commit' do + should_not_create_any_todo { service.new_note(note_on_commit, john_doe) } + end + + it 'does not create todo when leaving a note on snippet' do + should_not_create_any_todo { service.new_note(note_on_project_snippet, john_doe) } + end end end From 77603c3ec2de15bf939cddddc93faea4d89b5b37 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 25 Feb 2016 12:46:06 +0100 Subject: [PATCH 19/21] Fix order in Gemfile.lock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7a1b94cff6c..c48c733f5a1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -960,8 +960,8 @@ DEPENDENCIES mysql2 (~> 0.3.16) nested_form (~> 0.3.2) net-ssh (~> 3.0.1) - nokogiri (~> 1.6.7, >= 1.6.7.2) newrelic_rpm (~> 3.14) + nokogiri (~> 1.6.7, >= 1.6.7.2) nprogress-rails (~> 0.1.6.7) oauth2 (~> 1.0.0) octokit (~> 3.8.0) From 3973ce0fb4712414d9fd4b3f32feac0f5d9b5af9 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 25 Feb 2016 11:04:00 -0500 Subject: [PATCH 20/21] Update CHANGELOG [ci skip] --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 4abe86f8ced..6087868f673 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -100,6 +100,9 @@ v 8.5.0 - Show label row when filtering issues or merge requests by label (Nuttanart Pornprasitsakul) - Add Todos +v 8.4.5 + - No CE-specific changes + v 8.4.4 - Update omniauth-saml gem to 1.4.2 - Prevent long-running backup tasks from timing out the database connection From b2c641de219d3aba8f1fce758b2f05ca8233e2d6 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Fri, 26 Feb 2016 13:22:35 +0100 Subject: [PATCH 21/21] Fix syntax error in autosave coffeescript. --- app/assets/javascripts/autosave.js.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/autosave.js.coffee b/app/assets/javascripts/autosave.js.coffee index 5d3fe81da74..28f8e103664 100644 --- a/app/assets/javascripts/autosave.js.coffee +++ b/app/assets/javascripts/autosave.js.coffee @@ -16,11 +16,11 @@ class @Autosave try text = window.localStorage.getItem @key - catch + catch e return @field.val text if text?.length > 0 - @field.trigger "input" + @field.trigger "input" save: -> return unless window.localStorage? @@ -35,5 +35,5 @@ class @Autosave reset: -> return unless window.localStorage? - try + try window.localStorage.removeItem @key