From 5ba2d53cfa1704b7ab76d3ac5dda2a880fa55c57 Mon Sep 17 00:00:00 2001 From: karen Carias Date: Mon, 10 Aug 2015 16:56:02 -0700 Subject: fixed text --- doc/workflow/importing/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/workflow/importing/README.md b/doc/workflow/importing/README.md index cd98d1b9852..c14709b6b6b 100644 --- a/doc/workflow/importing/README.md +++ b/doc/workflow/importing/README.md @@ -8,5 +8,6 @@ ### Note * If you'd like to migrate from a self-hosted GitLab instance to GitLab.com, you can copy your repos by changing the remote and pushing to the new server; but issues and merge requests can't be imported. -* Repositories are imported to GitLab via HTTP. -If the repository is too large, it can timeout. We have a soft limit of 10GB. +* You can import any Git repository via HTTP from the New Project page. +If the repository is too large, it can timeout. We have a soft limit of +10GB. -- cgit v1.2.3 From 10491b5438d1a41628bbb732f58329fb1b6270a3 Mon Sep 17 00:00:00 2001 From: karen Carias Date: Mon, 17 Aug 2015 14:42:34 -0700 Subject: deleted line --- doc/workflow/importing/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/workflow/importing/README.md b/doc/workflow/importing/README.md index c14709b6b6b..5cde90993d2 100644 --- a/doc/workflow/importing/README.md +++ b/doc/workflow/importing/README.md @@ -9,5 +9,4 @@ * If you'd like to migrate from a self-hosted GitLab instance to GitLab.com, you can copy your repos by changing the remote and pushing to the new server; but issues and merge requests can't be imported. * You can import any Git repository via HTTP from the New Project page. -If the repository is too large, it can timeout. We have a soft limit of -10GB. +If the repository is too large, it can timeout. -- cgit v1.2.3 From 001c8cd0ee6e70cc96727cc37eedf263b916d24b Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Fri, 14 Aug 2015 22:21:22 -0700 Subject: Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries Closes https://github.com/gitlabhq/gitlabhq/issues/9560 --- CHANGELOG | 1 + app/workers/emails_on_push_worker.rb | 33 +++++++++++++++++------------ spec/workers/emails_on_push_worker_spec.rb | 34 ++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 14 deletions(-) create mode 100644 spec/workers/emails_on_push_worker_spec.rb diff --git a/CHANGELOG b/CHANGELOG index 8214e57aaa7..6872ec16aa5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ v 8.0.0 (unreleased) - Faster merge - Ability to fetch merge requests from refs/merge-requests/:id - Allow displaying of archived projects in the admin interface (Artem Sidorenko) + - Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries (Stan Hu) v 7.14.0 (unreleased) - Update default robots.txt rules to disallow crawling of irrelevant pages (Ben Bodenmiller) diff --git a/app/workers/emails_on_push_worker.rb b/app/workers/emails_on_push_worker.rb index 1d21addece6..916a99bb273 100644 --- a/app/workers/emails_on_push_worker.rb +++ b/app/workers/emails_on_push_worker.rb @@ -4,7 +4,7 @@ class EmailsOnPushWorker def perform(project_id, recipients, push_data, options = {}) options.symbolize_keys! options.reverse_merge!( - send_from_committer_email: false, + send_from_committer_email: false, disable_diffs: false ) send_from_committer_email = options[:send_from_committer_email] @@ -16,9 +16,9 @@ class EmailsOnPushWorker ref = push_data["ref"] author_id = push_data["user_id"] - action = + action = if Gitlab::Git.blank_ref?(before_sha) - :create + :create elsif Gitlab::Git.blank_ref?(after_sha) :delete else @@ -42,17 +42,22 @@ class EmailsOnPushWorker end recipients.split(" ").each do |recipient| - Notify.repository_push_email( - project_id, - recipient, - author_id: author_id, - ref: ref, - action: action, - compare: compare, - reverse_compare: reverse_compare, - send_from_committer_email: send_from_committer_email, - disable_diffs: disable_diffs - ).deliver + begin + Notify.repository_push_email( + project_id, + recipient, + author_id: author_id, + ref: ref, + action: action, + compare: compare, + reverse_compare: reverse_compare, + send_from_committer_email: send_from_committer_email, + disable_diffs: disable_diffs + ).deliver + # These are input errors and won't be corrected even if Sidekiq retries + rescue Net::SMTPFatalError, Net::SMTPSyntaxError => e + logger.info("Failed to send e-mail for project '#{project.name_with_namespace}' to #{recipient}: #{e}") + end end ensure compare = nil diff --git a/spec/workers/emails_on_push_worker_spec.rb b/spec/workers/emails_on_push_worker_spec.rb new file mode 100644 index 00000000000..3600c771075 --- /dev/null +++ b/spec/workers/emails_on_push_worker_spec.rb @@ -0,0 +1,34 @@ +require 'spec_helper' + +describe EmailsOnPushWorker do + include RepoHelpers + + let(:project) { create(:project) } + let(:user) { create(:user) } + let(:data) { Gitlab::PushDataBuilder.build_sample(project, user) } + + subject { EmailsOnPushWorker.new } + + before do + allow(Project).to receive(:find).and_return(project) + end + + describe "#perform" do + it "sends mail" do + subject.perform(project.id, user.email, data.stringify_keys) + + email = ActionMailer::Base.deliveries.last + expect(email.subject).to include('Change some files') + expect(email.to).to eq([user.email]) + end + + it "gracefully handles an input SMTP error" do + ActionMailer::Base.deliveries.clear + allow(Notify).to receive(:repository_push_email).and_raise(Net::SMTPFatalError) + + subject.perform(project.id, user.email, data.stringify_keys) + + expect(ActionMailer::Base.deliveries.count).to eq(0) + end + end +end -- cgit v1.2.3 From 4016a4577c6f41354e9261e08fe94d917bc9edc2 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sun, 23 Aug 2015 13:31:02 -0700 Subject: Only include base URL in OmniAuth full_host parameter Closes #2335 --- CHANGELOG | 1 + config/initializers/1_settings.rb | 26 ++++++++++++++++++-------- config/initializers/7_omniauth.rb | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 44ffb56d5fd..ae7a8dba9d4 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.0.0 (unreleased) + - Only include base URL in OmniAuth full_host parameter (Stan Hu) - Only show recent push event if the branch still exists or a recent merge request has not been created (Stan Hu) - Remove satellites - Better performance for web editor (switched from satellites to rugged) diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index bd26ac1da20..c47e5dab27c 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -8,7 +8,7 @@ class Settings < Settingslogic def gitlab_on_standard_port? gitlab.port.to_i == (gitlab.https ? 443 : 80) end - + # get host without www, thanks to http://stackoverflow.com/a/6674363/1233435 def get_host_without_www(url) url = URI.encode(url) @@ -32,14 +32,12 @@ class Settings < Settingslogic end end + def build_base_gitlab_url + base_gitlab_url.join('') + end + def build_gitlab_url - custom_port = gitlab_on_standard_port? ? nil : ":#{gitlab.port}" - [ gitlab.protocol, - "://", - gitlab.host, - custom_port, - gitlab.relative_url_root - ].join('') + (base_gitlab_url + [gitlab.relative_url_root]).join('') end # check that values in `current` (string or integer) is a contant in `modul`. @@ -64,6 +62,17 @@ class Settings < Settingslogic end value end + + private + + def base_gitlab_url + custom_port = gitlab_on_standard_port? ? nil : ":#{gitlab.port}" + [ gitlab.protocol, + "://", + gitlab.host, + custom_port + ] + end end end @@ -123,6 +132,7 @@ Settings.gitlab['email_enabled'] ||= true if Settings.gitlab['email_enabled'].ni Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}" Settings.gitlab['email_display_name'] ||= "GitLab" Settings.gitlab['email_reply_to'] ||= "noreply@#{Settings.gitlab.host}" +Settings.gitlab['base_url'] ||= Settings.send(:build_base_gitlab_url) Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url) Settings.gitlab['user'] ||= 'git' Settings.gitlab['user_home'] ||= begin diff --git a/config/initializers/7_omniauth.rb b/config/initializers/7_omniauth.rb index 7f73546ac89..70ed10e8275 100644 --- a/config/initializers/7_omniauth.rb +++ b/config/initializers/7_omniauth.rb @@ -11,7 +11,7 @@ if Gitlab::LDAP::Config.enabled? end end -OmniAuth.config.full_host = Settings.gitlab['url'] +OmniAuth.config.full_host = Settings.gitlab['base_url'] OmniAuth.config.allowed_request_methods = [:post] #In case of auto sign-in, the GET method is used (users don't get to click on a button) OmniAuth.config.allowed_request_methods << :get if Gitlab.config.omniauth.auto_sign_in_with_provider.present? -- cgit v1.2.3 From 6318a7631131074d5d65775f92097b9c1e3f04d6 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sun, 23 Aug 2015 16:52:29 -0700 Subject: Upgrade browser gem to 1.0.0 to avoid warning in IE11 compatibilty mode Closes #2271 --- CHANGELOG | 1 + Gemfile | 2 +- Gemfile.lock | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7eb6ab81dd9..99df3c7a838 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.0.0 (unreleased) + - Upgrade browser gem to 1.0.0 to avoid warning in IE11 compatibilty mode (Stan Hu) - Remove user OAuth tokens from the database and request new tokens each session (Stan Hu) - Only show recent push event if the branch still exists or a recent merge request has not been created (Stan Hu) - Remove satellites diff --git a/Gemfile b/Gemfile index 3aa3c72e088..fa54a72f025 100644 --- a/Gemfile +++ b/Gemfile @@ -34,7 +34,7 @@ gem 'rqrcode-rails3' gem 'attr_encrypted', '1.3.4' # Browser detection -gem "browser", '~> 0.8.0' +gem "browser", '~> 1.0.0' # Extracting information from a git repository # Provide access to Gitlab::Git library diff --git a/Gemfile.lock b/Gemfile.lock index 5278fe243a8..a7cfe6b7511 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -76,7 +76,7 @@ GEM ruby_parser (~> 3.5.0) sass (~> 3.0) terminal-table (~> 1.4) - browser (0.8.0) + browser (1.0.0) builder (3.2.2) byebug (3.2.0) columnize (~> 0.8) @@ -755,7 +755,7 @@ DEPENDENCIES binding_of_caller bootstrap-sass (~> 3.0) brakeman - browser (~> 0.8.0) + browser (~> 1.0.0) byebug cal-heatmap-rails (~> 0.0.1) capybara (~> 2.4.0) -- cgit v1.2.3 From 208888038375d48cc91cf481a3f8509d63d8e1ad Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 24 Aug 2015 10:57:35 -0700 Subject: Ignore empty incoming messages. --- app/mailers/email_rejection_mailer.rb | 2 ++ app/workers/email_receiver_worker.rb | 2 ++ config/mail_room.yml.example | 2 ++ doc/reply_by_email/README.md | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/app/mailers/email_rejection_mailer.rb b/app/mailers/email_rejection_mailer.rb index 89aceda82d1..883f1c73ad4 100644 --- a/app/mailers/email_rejection_mailer.rb +++ b/app/mailers/email_rejection_mailer.rb @@ -3,6 +3,8 @@ class EmailRejectionMailer < BaseMailer @reason = reason @original_message = Mail::Message.new(original_raw) + return unless @original_message.from + headers = { to: @original_message.from, subject: "[Rejected] #{@original_message.subject}" diff --git a/app/workers/email_receiver_worker.rb b/app/workers/email_receiver_worker.rb index a588a1f45ee..8cfb96ef376 100644 --- a/app/workers/email_receiver_worker.rb +++ b/app/workers/email_receiver_worker.rb @@ -18,6 +18,8 @@ class EmailReceiverWorker def handle_failure(raw, e) Rails.logger.warn("Email can not be processed: #{e}\n\n#{raw}") + return unless raw.present? + can_retry = false reason = nil diff --git a/config/mail_room.yml.example b/config/mail_room.yml.example index 28366eb7394..dd8edfc42eb 100644 --- a/config/mail_room.yml.example +++ b/config/mail_room.yml.example @@ -14,6 +14,8 @@ # :name: "inbox" # # Always "sidekiq". # :delivery_method: sidekiq + # # Always true. + # :delete_after_delivery: true # :delivery_options: # # The URL to the Redis server used by Sidekiq. Should match the URL in config/resque.yml. # :redis_url: redis://localhost:6379 diff --git a/doc/reply_by_email/README.md b/doc/reply_by_email/README.md index 91eea956e52..5d36f5121d1 100644 --- a/doc/reply_by_email/README.md +++ b/doc/reply_by_email/README.md @@ -59,6 +59,8 @@ In this example, we'll use the Gmail address `gitlab-replies@gmail.com`. If you' :name: "inbox" # Always "sidekiq". :delivery_method: sidekiq + # Always true. + :delete_after_delivery: true :delivery_options: # The URL to the Redis server used by Sidekiq. Should match the URL in config/resque.yml. :redis_url: redis://localhost:6379 @@ -144,6 +146,8 @@ TODO :name: "inbox" # Always "sidekiq". :delivery_method: sidekiq + # Always true. + :delete_after_delivery: true :delivery_options: # The URL to the Redis server used by Sidekiq. Should match the URL in config/resque.yml. :redis_url: redis://localhost:6379 -- cgit v1.2.3 From eeac2aafbc444b1fe5ada430b15058b30628b364 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 24 Aug 2015 12:07:14 -0700 Subject: Move full_host fix changelog entry to 7.14.1 [ci skip] --- CHANGELOG | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index f22c337b726..5137879d318 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,7 +3,6 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.0.0 (unreleased) - Fix Error 500 in API when accessing a group that has an avatar (Stan Hu) - Remove user OAuth tokens from the database and request new tokens each session (Stan Hu) - - Only include base URL in OmniAuth full_host parameter (Stan Hu) - Only show recent push event if the branch still exists or a recent merge request has not been created (Stan Hu) - Remove satellites - Better performance for web editor (switched from satellites to rugged) @@ -15,6 +14,9 @@ v 8.0.0 (unreleased) - Create cross-reference for closing references on commits pushed to non-default branches (Maël Valais) - Ability to search milestones +v 7.14.1 (unreleased) + - Only include base URL in OmniAuth full_host parameter (Stan Hu) + v 7.14.0 - Fix bug where non-project members of the target project could set labels on new merge requests. - Update default robots.txt rules to disallow crawling of irrelevant pages (Ben Bodenmiller) -- cgit v1.2.3 From 451873963a4c41e0edeb066545cafcb9a0df9c19 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 24 Aug 2015 12:27:02 -0700 Subject: Move changelog entry to 7.14.1 [ci skip] --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 5137879d318..5940d586d88 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,6 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.0.0 (unreleased) - - Fix Error 500 in API when accessing a group that has an avatar (Stan Hu) - Remove user OAuth tokens from the database and request new tokens each session (Stan Hu) - Only show recent push event if the branch still exists or a recent merge request has not been created (Stan Hu) - Remove satellites @@ -16,6 +15,7 @@ v 8.0.0 (unreleased) v 7.14.1 (unreleased) - Only include base URL in OmniAuth full_host parameter (Stan Hu) + - Fix Error 500 in API when accessing a group that has an avatar (Stan Hu) v 7.14.0 - Fix bug where non-project members of the target project could set labels on new merge requests. -- cgit v1.2.3 From 646c1f0324650c5736e85db0deb55dceb943fa7a Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 24 Aug 2015 18:56:01 -0700 Subject: Re-enable the "links with adjacent text" UserReferenceFilter spec --- spec/lib/gitlab/markdown/user_reference_filter_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/lib/gitlab/markdown/user_reference_filter_spec.rb b/spec/lib/gitlab/markdown/user_reference_filter_spec.rb index a5405e14a73..02d923b036c 100644 --- a/spec/lib/gitlab/markdown/user_reference_filter_spec.rb +++ b/spec/lib/gitlab/markdown/user_reference_filter_spec.rb @@ -121,7 +121,6 @@ module Gitlab::Markdown end it 'links with adjacent text' do - skip "TODO (rspeicher): Re-enable when usernames can't end in periods." doc = filter("Mention me (#{reference}.)") expect(doc.to_html).to match(/\(#{reference}<\/a>\.\)/) end -- cgit v1.2.3 From 3bee4a6712a654abeba4ce07eb17235c3240b487 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 24 Aug 2015 23:35:26 -0700 Subject: Fix "Reload with full diff" URL button in compare branch view This button worked when viewing merge requests because the JavaScript stripped the .html in the Ajax request. However, it left the .html suffix in the compare branch view. --- CHANGELOG | 1 + app/views/projects/diffs/_warning.html.haml | 2 +- features/project/commits/commits.feature | 1 + features/steps/project/commits/commits.rb | 6 ++++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 7eb6ab81dd9..4e165362692 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.0.0 (unreleased) + - Fix "Reload with full diff" URL button in compare branch view (Stan Hu) - Remove user OAuth tokens from the database and request new tokens each session (Stan Hu) - Only show recent push event if the branch still exists or a recent merge request has not been created (Stan Hu) - Remove satellites diff --git a/app/views/projects/diffs/_warning.html.haml b/app/views/projects/diffs/_warning.html.haml index caed0e69dc8..f99bc9a85eb 100644 --- a/app/views/projects/diffs/_warning.html.haml +++ b/app/views/projects/diffs/_warning.html.haml @@ -3,7 +3,7 @@ Too many changes to show. .pull-right - unless diff_hard_limit_enabled? - = link_to "Reload with full diff", url_for(params.merge(force_show_diff: true, format: :html)), class: "btn btn-sm btn-warning" + = link_to "Reload with full diff", url_for(params.merge(force_show_diff: true, format: nil)), class: "btn btn-sm btn-warning" - if current_controller?(:commit) or current_controller?(:merge_requests) - if current_controller?(:commit) diff --git a/features/project/commits/commits.feature b/features/project/commits/commits.feature index c4b206edc95..3ebc8a39aae 100644 --- a/features/project/commits/commits.feature +++ b/features/project/commits/commits.feature @@ -41,6 +41,7 @@ Feature: Project Commits Scenario: I browse big commit Given I visit big commit page Then I see big commit warning + And I see "Reload with full diff" link Scenario: I browse a commit with an image Given I visit a commit with an image that changed diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index e6330ec457e..a8532cc18d8 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -79,6 +79,12 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps expect(page).to have_content "Too many changes" end + step 'I see "Reload with full diff" link' do + link = find_link('Reload with full diff') + expect(link[:href]).to end_with('?force_show_diff=true') + expect(link[:href]).not_to include('.html') + end + step 'I visit a commit with an image that changed' do visit namespace_project_commit_path(@project.namespace, @project, sample_image_commit.id) end -- cgit v1.2.3 From e02b7bf4435d0ff151239ac790849994066c0bc1 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 25 Aug 2015 10:52:10 +0200 Subject: Improve abuse reports management * Link to user profile instead of user admin page * One button for remove user and report * Remove user and report with page reloading Signed-off-by: Dmitriy Zaporozhets --- app/assets/javascripts/application.js.coffee | 6 ++++++ app/controllers/admin/abuse_reports_controller.rb | 9 +++++++-- app/views/admin/abuse_reports/_abuse_report.html.haml | 11 +++++++---- app/views/admin/abuse_reports/index.html.haml | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index bb0a0c51fd4..c263912b7ea 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -116,6 +116,12 @@ $ -> $('.remove-row').bind 'ajax:success', -> $(this).closest('li').fadeOut() + $('.js-remove-tr').bind 'ajax:before', -> + $(this).hide() + + $('.js-remove-tr').bind 'ajax:success', -> + $(this).closest('tr').fadeOut() + # Initialize select2 selects $('select.select2').select2(width: 'resolve', dropdownAutoWidth: true) diff --git a/app/controllers/admin/abuse_reports_controller.rb b/app/controllers/admin/abuse_reports_controller.rb index 34f37bca4ad..38a5a9fca08 100644 --- a/app/controllers/admin/abuse_reports_controller.rb +++ b/app/controllers/admin/abuse_reports_controller.rb @@ -4,8 +4,13 @@ class Admin::AbuseReportsController < Admin::ApplicationController end def destroy - AbuseReport.find(params[:id]).destroy + abuse_report = AbuseReport.find(params[:id]) - redirect_to admin_abuse_reports_path, notice: 'Report was removed' + if params[:remove_user] + abuse_report.user.destroy + end + + abuse_report.destroy + render nothing: true end end diff --git a/app/views/admin/abuse_reports/_abuse_report.html.haml b/app/views/admin/abuse_reports/_abuse_report.html.haml index 4449721ae38..785ce4b759e 100644 --- a/app/views/admin/abuse_reports/_abuse_report.html.haml +++ b/app/views/admin/abuse_reports/_abuse_report.html.haml @@ -3,7 +3,7 @@ %tr %td - if reporter - = link_to reporter.name, [:admin, reporter] + = link_to reporter.name, reporter - else (removed) %td @@ -12,12 +12,15 @@ = abuse_report.message %td - if user - = link_to user.name, [:admin, user] + = link_to user.name, user - else (removed) %td - if user - = link_to 'Block', block_admin_user_path(user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-xs btn-warning" - = link_to 'Remove user', [:admin, user], data: { confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?" }, method: :delete, class: "btn btn-xs btn-remove" + = link_to 'Remove user & report', admin_abuse_report_path(abuse_report, remove_user: true), + data: { confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?" }, remote: true, method: :delete, class: "btn btn-xs btn-remove js-remove-tr" + %td + - if user + = link_to 'Block user', block_admin_user_path(user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-xs btn-warning" = link_to 'Remove report', [:admin, abuse_report], method: :delete, class: "btn btn-xs btn-close" diff --git a/app/views/admin/abuse_reports/index.html.haml b/app/views/admin/abuse_reports/index.html.haml index 4a25848f156..2e8746146d1 100644 --- a/app/views/admin/abuse_reports/index.html.haml +++ b/app/views/admin/abuse_reports/index.html.haml @@ -9,7 +9,7 @@ %th Reported at %th Message %th User - %th + %th Primary action %th = render @abuse_reports = paginate @abuse_reports -- cgit v1.2.3 From 13f8fc97843d3bb0f8c498835f740e44b1306395 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 25 Aug 2015 10:57:56 +0200 Subject: Fix remove report button Signed-off-by: Dmitriy Zaporozhets --- CHANGELOG | 1 + app/views/admin/abuse_reports/_abuse_report.html.haml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5940d586d88..40b8ccb62f4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ v 8.0.0 (unreleased) - Search for comments should be case insensetive - Create cross-reference for closing references on commits pushed to non-default branches (Maël Valais) - Ability to search milestones + - Improve abuse reports management from admin area v 7.14.1 (unreleased) - Only include base URL in OmniAuth full_host parameter (Stan Hu) diff --git a/app/views/admin/abuse_reports/_abuse_report.html.haml b/app/views/admin/abuse_reports/_abuse_report.html.haml index 785ce4b759e..d3afc658cd6 100644 --- a/app/views/admin/abuse_reports/_abuse_report.html.haml +++ b/app/views/admin/abuse_reports/_abuse_report.html.haml @@ -22,5 +22,5 @@ %td - if user - = link_to 'Block user', block_admin_user_path(user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-xs btn-warning" - = link_to 'Remove report', [:admin, abuse_report], method: :delete, class: "btn btn-xs btn-close" + = link_to 'Block user', block_admin_user_path(user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-xs" + = link_to 'Remove report', [:admin, abuse_report], remote: true, method: :delete, class: "btn btn-xs btn-close js-remove-tr" -- cgit v1.2.3 From 8f68c38746639d8714ff5aa12fe9a0fd362f4419 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 25 Aug 2015 14:13:04 +0200 Subject: Dashboard activity as separate page Signed-off-by: Dmitriy Zaporozhets --- app/assets/javascripts/dispatcher.js.coffee | 1 + app/controllers/dashboard_controller.rb | 22 +++++++++++++++------- app/views/dashboard/activity.html.haml | 6 ++++++ app/views/dashboard/show.html.haml | 9 +-------- app/views/layouts/nav/_dashboard.html.haml | 7 ++++++- config/routes.rb | 1 + 6 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 app/views/dashboard/activity.html.haml diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee index 81e73799271..539041c2862 100644 --- a/app/assets/javascripts/dispatcher.js.coffee +++ b/app/assets/javascripts/dispatcher.js.coffee @@ -51,6 +51,7 @@ class Dispatcher MergeRequests.init() when 'dashboard:show', 'root:show' new Dashboard() + when 'dashboard:activity' new Activities() when 'dashboard:projects:starred' new Activities() diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index d2f0c43929f..d745131694b 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -1,6 +1,6 @@ class DashboardController < Dashboard::ApplicationController before_action :load_projects - before_action :event_filter, only: :show + before_action :event_filter, only: :activity respond_to :html @@ -10,13 +10,8 @@ class DashboardController < Dashboard::ApplicationController respond_to do |format| format.html - - format.json do - load_events - pager_json("events/_events", @events.count) - end - format.atom do + event_filter load_events render layout: false end @@ -40,6 +35,19 @@ class DashboardController < Dashboard::ApplicationController end end + def activity + @last_push = current_user.recent_push + + respond_to do |format| + format.html + + format.json do + load_events + pager_json("events/_events", @events.count) + end + end + end + protected def load_projects diff --git a/app/views/dashboard/activity.html.haml b/app/views/dashboard/activity.html.haml new file mode 100644 index 00000000000..7a5a093add5 --- /dev/null +++ b/app/views/dashboard/activity.html.haml @@ -0,0 +1,6 @@ += content_for :meta_tags do + - if current_user + = auto_discovery_link_tag(:atom, dashboard_url(format: :atom, private_token: current_user.private_token), title: "All activity") + +%section.activities + = render 'activities' diff --git a/app/views/dashboard/show.html.haml b/app/views/dashboard/show.html.haml index a3a32b6932f..1b6ea3d5963 100644 --- a/app/views/dashboard/show.html.haml +++ b/app/views/dashboard/show.html.haml @@ -5,13 +5,6 @@ = render 'dashboard/projects_head' - if @projects.any? - = render 'shared/show_aside' - - .dashboard.row - %section.activities.col-md-8 - = render 'activities' - %aside.col-md-4 - = render 'sidebar' - + = render 'sidebar' - else = render "zero_authorized_projects" diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml index 8f010196d1a..154fd418399 100644 --- a/app/views/layouts/nav/_dashboard.html.haml +++ b/app/views/layouts/nav/_dashboard.html.haml @@ -1,9 +1,14 @@ %ul.nav.nav-sidebar = nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do = link_to (current_user ? root_path : explore_root_path), title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do - = icon('dashboard fw') + = icon('home fw') %span Projects + = nav_link(path: 'dashboard#activity') do + = link_to activity_dashboard_path, title: 'Activity', data: {placement: 'right'} do + = icon('dashboard fw') + %span + Activity = nav_link(controller: :groups) do = link_to (current_user ? dashboard_groups_path : explore_groups_path), title: 'Groups', data: {placement: 'right'} do = icon('group fw') diff --git a/config/routes.rb b/config/routes.rb index d7307a61ede..8ba439f08b8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -261,6 +261,7 @@ Gitlab::Application.routes.draw do member do get :issues get :merge_requests + get :activity end scope module: :dashboard do -- cgit v1.2.3 From c11e43145f87436062f3840d16a9fcf97286265a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 25 Aug 2015 15:23:25 +0200 Subject: Make some visual improvements to dashboard page after we moved activity Signed-off-by: Dmitriy Zaporozhets --- app/assets/javascripts/projects_list.js.coffee | 2 +- app/assets/stylesheets/pages/dashboard.scss | 38 +------------------------- app/assets/stylesheets/pages/projects.scss | 31 +++++++++++++++++++++ app/views/dashboard/_projects.html.haml | 9 ++++-- app/views/dashboard/show.html.haml | 2 +- app/views/groups/_projects.html.haml | 2 +- app/views/shared/_project.html.haml | 6 +++- 7 files changed, 46 insertions(+), 44 deletions(-) diff --git a/app/assets/javascripts/projects_list.js.coffee b/app/assets/javascripts/projects_list.js.coffee index c0e36d1ccc5..db5faf71faf 100644 --- a/app/assets/javascripts/projects_list.js.coffee +++ b/app/assets/javascripts/projects_list.js.coffee @@ -8,7 +8,7 @@ class @ProjectsList $(".projects-list-filter").keyup -> terms = $(this).val() - uiBox = $(this).closest('.panel') + uiBox = $(this).closest('.projects-list-holder') if terms == "" || terms == undefined uiBox.find(".projects-list li").show() else diff --git a/app/assets/stylesheets/pages/dashboard.scss b/app/assets/stylesheets/pages/dashboard.scss index 9a3b543ad10..c1103a1c2e6 100644 --- a/app/assets/stylesheets/pages/dashboard.scss +++ b/app/assets/stylesheets/pages/dashboard.scss @@ -23,41 +23,6 @@ } } -.project-row, .group-row { - padding: 0 !important; - font-size: 14px; - line-height: 24px; - - a { - display: block; - padding: 8px 15px; - } - - .project-name, .group-name { - font-weight: 500; - } - - .arrow { - float: right; - margin: 0; - font-size: 20px; - } - - .last-activity { - float: right; - font-size: 12px; - color: #AAA; - display: block; - .date { - color: #777; - } - } -} - -.project-description { - overflow: hidden; -} - .project-access-icon { margin-left: 10px; float: left; @@ -73,10 +38,9 @@ float: left; .avatar { - margin-top: -8px; - margin-left: -15px; @include border-radius(0px); } + .identicon { line-height: 40px; } diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 29d3dbc25eb..1e138651d52 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -316,3 +316,34 @@ table.table.protected-branches-list tr.no-border { pre.light-well { border-color: #f1f1f1; } + +.projects-search-form { + max-width: 600px; + margin: 0 auto; + margin-bottom: 20px; + + input { + border-color: #BBB; + } +} + +.project-row { + .project-full-name { + font-weight: bold; + font-size: 15px; + } + + .project-description { + color: #888; + font-size: 13px; + + p { + margin-bottom: 0; + color: #888; + } + } +} + +.my-projects .project-row { + padding: 10px 0; +} diff --git a/app/views/dashboard/_projects.html.haml b/app/views/dashboard/_projects.html.haml index d676576067c..dc83d5343f2 100644 --- a/app/views/dashboard/_projects.html.haml +++ b/app/views/dashboard/_projects.html.haml @@ -1,5 +1,5 @@ -.panel.panel-default - .panel-heading.clearfix +.projects-list-holder + .projects-search-form .input-group = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control' - if current_user.can_create_project? @@ -7,4 +7,7 @@ = link_to new_project_path, class: 'btn btn-success' do New project - = render 'shared/projects_list', projects: @projects, projects_limit: 20 + %ul.projects-list.bordered-list.my-projects + - @projects.each do |project| + %li.project-row + = render partial: 'shared/project', locals: { project: project, avatar: true, stars: true } diff --git a/app/views/dashboard/show.html.haml b/app/views/dashboard/show.html.haml index 1b6ea3d5963..44372b921cf 100644 --- a/app/views/dashboard/show.html.haml +++ b/app/views/dashboard/show.html.haml @@ -5,6 +5,6 @@ = render 'dashboard/projects_head' - if @projects.any? - = render 'sidebar' + = render 'projects' - else = render "zero_authorized_projects" diff --git a/app/views/groups/_projects.html.haml b/app/views/groups/_projects.html.haml index 4f8aec1c67e..2ae51a1c8c0 100644 --- a/app/views/groups/_projects.html.haml +++ b/app/views/groups/_projects.html.haml @@ -1,4 +1,4 @@ -.panel.panel-default +.panel.panel-default.projects-list-holder .panel-heading.clearfix .input-group = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control' diff --git a/app/views/shared/_project.html.haml b/app/views/shared/_project.html.haml index 6bd61455d21..15df97b1333 100644 --- a/app/views/shared/_project.html.haml +++ b/app/views/shared/_project.html.haml @@ -3,7 +3,7 @@ - if avatar .dash-project-avatar = project_icon(project, alt: '', class: 'avatar project-avatar s40') - %span.str-truncated + %span.str-truncated.project-full-name %span.namespace-name - if project.namespace = project.namespace.human_name @@ -14,3 +14,7 @@ %span.pull-right.light %i.fa.fa-star = project.star_count + - if project.description.present? + .project-description + .str-truncated + = markdown(project.description, pipeline: :description) -- cgit v1.2.3 From 7569010bc3918af0098e00eb56fce1a18d8ca72e Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 25 Aug 2015 16:36:54 +0200 Subject: Fix tests and last push widget Signed-off-by: Dmitriy Zaporozhets --- CHANGELOG | 1 + app/views/dashboard/projects/starred.html.haml | 2 +- app/views/dashboard/show.html.haml | 3 +++ app/views/events/_event_last_push.html.haml | 2 +- features/dashboard/dashboard.feature | 8 ++++++-- features/dashboard/event_filters.feature | 8 ++++---- features/steps/shared/paths.rb | 4 ++++ 7 files changed, 20 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 35b5803d341..cf3ce803e0b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,7 @@ v 8.0.0 (unreleased) - Create cross-reference for closing references on commits pushed to non-default branches (Maël Valais) - Ability to search milestones - Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries (Stan Hu) + - Move dashboard activity to separate page v 7.14.1 (unreleased) - Only include base URL in OmniAuth full_host parameter (Stan Hu) diff --git a/app/views/dashboard/projects/starred.html.haml b/app/views/dashboard/projects/starred.html.haml index 98b8cde4766..027387028b9 100644 --- a/app/views/dashboard/projects/starred.html.haml +++ b/app/views/dashboard/projects/starred.html.haml @@ -8,7 +8,7 @@ %section.activities.col-md-8 = render 'dashboard/activities' %aside.col-md-4 - .panel.panel-default + .panel.panel-default.projects-list-holder .panel-heading.clearfix .input-group = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control' diff --git a/app/views/dashboard/show.html.haml b/app/views/dashboard/show.html.haml index 44372b921cf..4cf2feb9aa6 100644 --- a/app/views/dashboard/show.html.haml +++ b/app/views/dashboard/show.html.haml @@ -4,6 +4,9 @@ = render 'dashboard/projects_head' +- if @last_push + = render "events/event_last_push", event: @last_push + - if @projects.any? = render 'projects' - else diff --git a/app/views/events/_event_last_push.html.haml b/app/views/events/_event_last_push.html.haml index 501412642db..6a0c6cba41b 100644 --- a/app/views/events/_event_last_push.html.haml +++ b/app/views/events/_event_last_push.html.haml @@ -9,6 +9,6 @@ #{time_ago_with_tooltip(event.created_at)} .pull-right - = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-create btn-sm" do + = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-info btn-sm" do Create Merge Request %hr diff --git a/features/dashboard/dashboard.feature b/features/dashboard/dashboard.feature index 1959d327082..392d4235eff 100644 --- a/features/dashboard/dashboard.feature +++ b/features/dashboard/dashboard.feature @@ -10,6 +10,10 @@ Feature: Dashboard Scenario: I should see projects list Then I should see "New Project" link Then I should see "Shop" project link + + @javascript + Scenario: I should see activity list + And I visit dashboard activity page Then I should see project "Shop" activity feed Scenario: I should see groups list @@ -26,12 +30,12 @@ Feature: Dashboard @javascript Scenario: I should see User joined Project event Given user with name "John Doe" joined project "Shop" - When I visit dashboard page + When I visit dashboard activity page Then I should see "John Doe joined project Shop" event @javascript Scenario: I should see User left Project event Given user with name "John Doe" joined project "Shop" And user with name "John Doe" left project "Shop" - When I visit dashboard page + When I visit dashboard activity page Then I should see "John Doe left project Shop" event diff --git a/features/dashboard/event_filters.feature b/features/dashboard/event_filters.feature index ec5680caba6..96399ea21a6 100644 --- a/features/dashboard/event_filters.feature +++ b/features/dashboard/event_filters.feature @@ -6,7 +6,7 @@ Feature: Event Filters And this project has push event And this project has new member event And this project has merge request event - And I visit dashboard page + And I visit dashboard activity page @javascript Scenario: I should see all events @@ -16,7 +16,7 @@ Feature: Event Filters @javascript Scenario: I should see only pushed events - When I click "push" event filter + When I click "push" event filter Then I should see push event And I should not see new member event And I should not see merge request event @@ -38,11 +38,11 @@ Feature: Event Filters @javascript Scenario: I should see only selected events while page reloaded When I click "push" event filter - And I visit dashboard page + And I visit dashboard activity page Then I should see push event And I should not see new member event When I click "team" event filter - And I visit dashboard page + And I visit dashboard activity page Then I should see push event And I should see new member event And I should not see merge request event diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index ca8fbb49101..b4deccb6520 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -71,6 +71,10 @@ module SharedPaths visit dashboard_path end + step 'I visit dashboard activity page' do + visit activity_dashboard_path + end + step 'I visit dashboard projects page' do visit projects_dashboard_path end -- cgit v1.2.3 From 4a4d9fe16e371c4c5d4423a285758abe1d04d84d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Rosen=C3=B6gger?= <123haynes@gmail.com> Date: Tue, 25 Aug 2015 17:58:29 +0200 Subject: UI Improvement for the project page This commit improves the positioning of the dropdown menu on the project page. --- CHANGELOG | 1 + app/assets/stylesheets/pages/projects.scss | 4 ++++ app/views/projects/buttons/_dropdown.html.haml | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index a66e898652c..8048ca13733 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.0.0 (unreleased) + - Improve dropdown positioning on the project home page (Hannes Rosenögger) - Upgrade browser gem to 1.0.0 to avoid warning in IE11 compatibilty mode (Stan Hu) - Fix "Reload with full diff" URL button in compare branch view (Stan Hu) - Remove user OAuth tokens from the database and request new tokens each session (Stan Hu) diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 29d3dbc25eb..505b93b3bc5 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -30,6 +30,10 @@ } } + .project-home-dropdown { + margin: 11px 3px 0; + } + .project-home-desc { h1 { margin: 0; diff --git a/app/views/projects/buttons/_dropdown.html.haml b/app/views/projects/buttons/_dropdown.html.haml index cade930c8cc..bc7625e8989 100644 --- a/app/views/projects/buttons/_dropdown.html.haml +++ b/app/views/projects/buttons/_dropdown.html.haml @@ -2,7 +2,7 @@ %span.dropdown %a.dropdown-toggle.btn.btn-new{href: '#', "data-toggle" => "dropdown"} = icon('plus') - %ul.dropdown-menu + %ul.dropdown-menu.dropdown-menu-right.project-home-dropdown - if can?(current_user, :create_issue, @project) %li = link_to url_for_new_issue do -- cgit v1.2.3 From 084da5253b699b0734e17839f6ffebd4dc414320 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 25 Aug 2015 18:20:06 +0200 Subject: Re-use project partial for rendering explore projects Signed-off-by: Dmitriy Zaporozhets --- app/views/explore/projects/_project.html.haml | 24 ------------------------ app/views/explore/projects/_projects.html.haml | 6 ++++++ app/views/explore/projects/index.html.haml | 9 ++------- app/views/explore/projects/starred.html.haml | 5 +---- app/views/explore/projects/trending.html.haml | 4 +--- app/views/layouts/nav/_dashboard.html.haml | 2 +- 6 files changed, 11 insertions(+), 39 deletions(-) delete mode 100644 app/views/explore/projects/_project.html.haml create mode 100644 app/views/explore/projects/_projects.html.haml diff --git a/app/views/explore/projects/_project.html.haml b/app/views/explore/projects/_project.html.haml deleted file mode 100644 index 1e8a89e3661..00000000000 --- a/app/views/explore/projects/_project.html.haml +++ /dev/null @@ -1,24 +0,0 @@ -%li - %h4.project-title - .project-access-icon - = visibility_level_icon(project.visibility_level) - = link_to project.name_with_namespace, [project.namespace.becomes(Namespace), project] - %span.pull-right - %i.fa.fa-star - = project.star_count - - .project-info - - if project.description.present? - .project-description.str-truncated - = markdown(project.description, pipeline: :description) - - .repo-info - - unless project.empty_repo? - = link_to pluralize(round_commit_count(project), 'commit'), namespace_project_commits_path(project.namespace, project, project.default_branch) - · - = link_to pluralize(project.repository.branch_names.count, 'branch'), namespace_project_branches_path(project.namespace, project) - · - = link_to pluralize(project.repository.tag_names.count, 'tag'), namespace_project_tags_path(project.namespace, project) - - else - %i.fa.fa-exclamation-triangle - Empty repository diff --git a/app/views/explore/projects/_projects.html.haml b/app/views/explore/projects/_projects.html.haml new file mode 100644 index 00000000000..22cc541115c --- /dev/null +++ b/app/views/explore/projects/_projects.html.haml @@ -0,0 +1,6 @@ +%ul.projects-list.bordered-list.my-projects.public-projects + - projects.each do |project| + %li.project-row + = render partial: 'shared/project', locals: { project: project, avatar: true, stars: true } +- unless projects.present? + .nothing-here-block No such projects diff --git a/app/views/explore/projects/index.html.haml b/app/views/explore/projects/index.html.haml index 4956081e1ed..0cfdf5cfd15 100644 --- a/app/views/explore/projects/index.html.haml +++ b/app/views/explore/projects/index.html.haml @@ -4,10 +4,5 @@ .clearfix = render 'filter' %br -.public-projects - %ul.bordered-list.top-list - = render @projects - - unless @projects.present? - .nothing-here-block No public projects - - = paginate @projects, theme: "gitlab" += render 'projects', projects: @projects += paginate @projects, theme: "gitlab" diff --git a/app/views/explore/projects/starred.html.haml b/app/views/explore/projects/starred.html.haml index fdccbe5692f..4a9fcae4bed 100644 --- a/app/views/explore/projects/starred.html.haml +++ b/app/views/explore/projects/starred.html.haml @@ -7,8 +7,5 @@ See most starred projects .pull-right = render 'explore/projects/dropdown' - .public-projects - %ul.bordered-list - = render @starred_projects - + = render 'projects', projects: @starred_projects = paginate @starred_projects, theme: 'gitlab' diff --git a/app/views/explore/projects/trending.html.haml b/app/views/explore/projects/trending.html.haml index 98a4174b426..4c7e7d44733 100644 --- a/app/views/explore/projects/trending.html.haml +++ b/app/views/explore/projects/trending.html.haml @@ -13,6 +13,4 @@ See most discussed projects for last month .pull-right = render 'explore/projects/dropdown' - .public-projects - %ul.bordered-list - = render @trending_projects + = render 'projects', projects: @trending_projects diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml index 154fd418399..d620c022273 100644 --- a/app/views/layouts/nav/_dashboard.html.haml +++ b/app/views/layouts/nav/_dashboard.html.haml @@ -34,7 +34,7 @@ %span.count= current_user.assigned_merge_requests.opened.count = nav_link(controller: :snippets) do = link_to (current_user ? user_snippets_path(current_user) : snippets_path), title: 'Your snippets', data: {placement: 'right'} do - = icon('dashboard fw') + = icon('clipboard fw') %span Snippets - if current_user -- cgit v1.2.3 From ad85f1f560224a3f276e57dcf638a6e41eb231eb Mon Sep 17 00:00:00 2001 From: Josef Kufner Date: Wed, 13 May 2015 12:51:47 +0200 Subject: Change plots to bar graphs --- app/views/projects/graphs/commits.html.haml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/views/projects/graphs/commits.html.haml b/app/views/projects/graphs/commits.html.haml index 141acbdcf72..a357736bf52 100644 --- a/app/views/projects/graphs/commits.html.haml +++ b/app/views/projects/graphs/commits.html.haml @@ -50,39 +50,42 @@ datasets : [{ fillColor : "rgba(220,220,220,0.5)", strokeColor : "rgba(220,220,220,1)", - pointColor : "rgba(220,220,220,1)", - pointStrokeColor : "#EEE", + barStrokeWidth: 1, + barValueSpacing: 1, + barDatasetSpacing: 1, data : #{@commits_per_time.values.to_json} }] } ctx = $("#hour-chart").get(0).getContext("2d"); - new Chart(ctx).Line(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2}) + new Chart(ctx).Bar(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2}) data = { labels : #{@commits_per_week_days.keys.to_json}, datasets : [{ fillColor : "rgba(220,220,220,0.5)", strokeColor : "rgba(220,220,220,1)", - pointColor : "rgba(220,220,220,1)", - pointStrokeColor : "#EEE", + barStrokeWidth: 1, + barValueSpacing: 1, + barDatasetSpacing: 1, data : #{@commits_per_week_days.values.to_json} }] } ctx = $("#weekday-chart").get(0).getContext("2d"); - new Chart(ctx).Line(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2}) + new Chart(ctx).Bar(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2}) data = { labels : #{@commits_per_month.keys.to_json}, datasets : [{ fillColor : "rgba(220,220,220,0.5)", strokeColor : "rgba(220,220,220,1)", - pointColor : "rgba(220,220,220,1)", - pointStrokeColor : "#EEE", + barStrokeWidth: 1, + barValueSpacing: 1, + barDatasetSpacing: 1, data : #{@commits_per_month.values.to_json} }] } ctx = $("#month-chart").get(0).getContext("2d"); - new Chart(ctx).Line(data, {"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2}) + new Chart(ctx).Bar(data, {"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2}) -- cgit v1.2.3 From fa65db9aa876289bcb5974edfdd15f181c9a1ac5 Mon Sep 17 00:00:00 2001 From: Josef Kufner Date: Mon, 24 Aug 2015 23:51:50 +0200 Subject: Add changelog entry --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 5222ab1e3e1..3ccb096214a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -306,6 +306,7 @@ v 7.11.0 - Protect OmniAuth request phase against CSRF. - Don't send notifications to mentioned users that don't have access to the project in question. - Add search issues/MR by number + - Change plots to bar graphs in commit statistics screen - Move snippets UI to fluid layout - Improve UI for sidebar. Increase separation between navigation and content - Improve new project command options (Ben Bodenmiller) -- cgit v1.2.3 From 02e7b00a54ebfebc51acab0a7f7e15adc93f4bb0 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 25 Aug 2015 12:03:58 -0700 Subject: Fix init script for Reply by email --- lib/support/init.d/gitlab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab index 41a2f254db6..457bd31e23b 100755 --- a/lib/support/init.d/gitlab +++ b/lib/support/init.d/gitlab @@ -288,7 +288,7 @@ print_status() { fi if [ "$mail_room_enabled" = true ]; then if [ "$mail_room_status" = "0" ]; then - echo "The GitLab MailRoom email processor with pid $spid is running." + echo "The GitLab MailRoom email processor with pid $mpid is running." else printf "The GitLab MailRoom email processor is \033[31mnot running\033[0m.\n" fi -- cgit v1.2.3 From 5ddf38e1881b515149738647e42f2d0a96d8df14 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 26 Aug 2015 10:21:51 +0200 Subject: Improve project name/description look on project page Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/pages/projects.scss | 3 +++ app/views/projects/_home_panel.html.haml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 1e138651d52..6e40cbdd02f 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -35,9 +35,12 @@ margin: 0; margin-bottom: 10px; font-size: 26px; + font-weight: bold; } p { + font-size: 18px; + color: #666; display: inline; } } diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index bec40ec27a5..b93036e78e6 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -2,7 +2,7 @@ .project-home-panel.clearfix{:class => ("empty-project" if empty_repo)} .project-identicon-holder = project_icon(@project, alt: '', class: 'project-avatar avatar s90') - .project-home-desc.lead + .project-home-desc %h1= @project.name - if @project.description.present? = markdown(@project.description, pipeline: :description) -- cgit v1.2.3 From 735978388f62787dc69c97cd267359693fde6415 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 26 Aug 2015 10:36:08 +0200 Subject: Increase width of sidebar for several pages Signed-off-by: Dmitriy Zaporozhets --- app/views/dashboard/projects/starred.html.haml | 4 ++-- app/views/groups/show.html.haml | 4 ++-- app/views/users/show.html.haml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/dashboard/projects/starred.html.haml b/app/views/dashboard/projects/starred.html.haml index 027387028b9..6dcfd497ed2 100644 --- a/app/views/dashboard/projects/starred.html.haml +++ b/app/views/dashboard/projects/starred.html.haml @@ -5,9 +5,9 @@ = render 'shared/show_aside' .dashboard.row - %section.activities.col-md-8 + %section.activities.col-md-7 = render 'dashboard/activities' - %aside.col-md-4 + %aside.col-md-5 .panel.panel-default.projects-list-holder .panel-heading.clearfix .input-group diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index d31dae7d648..0577f4ec142 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -17,7 +17,7 @@ = render 'shared/show_aside' .row - %section.activities.col-md-8 + %section.activities.col-md-7 .hidden-xs - if current_user = render "events/event_last_push", event: @last_push @@ -33,5 +33,5 @@ .content_list = spinner - %aside.side.col-md-4 + %aside.side.col-md-5 = render "projects", projects: @projects diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 64b7f25ad37..aa4e8722fb1 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -7,7 +7,7 @@ = render 'shared/show_aside' .row - %section.col-md-8 + %section.col-md-7 .header-with-avatar = link_to avatar_icon(@user.email, 400), target: '_blank' do = image_tag avatar_icon(@user.email, 90), class: "avatar avatar-tile s90", alt: '' @@ -59,7 +59,7 @@ .content_list = spinner - %aside.col-md-4 + %aside.col-md-5 = render 'profile', user: @user = render 'projects', projects: @projects, contributed_projects: @contributed_projects -- cgit v1.2.3 From 0276e9032a5c31548844e76e913d9c50039cf054 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 26 Aug 2015 11:51:28 +0200 Subject: Limit content width for big screens except certain pages Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/base/layout.scss | 5 +++++ app/assets/stylesheets/base/variables.scss | 2 +- app/assets/stylesheets/pages/issuable.scss | 6 ------ app/assets/stylesheets/pages/tree.scss | 1 - app/helpers/page_layout_helper.rb | 8 ++++++++ app/views/layouts/_page.html.haml | 2 +- app/views/layouts/header/_default.html.haml | 12 ------------ app/views/projects/deploy_keys/index.html.haml | 1 + app/views/projects/diffs/_diffs.html.haml | 3 +++ app/views/projects/merge_requests/_show.html.haml | 3 +++ 10 files changed, 22 insertions(+), 21 deletions(-) diff --git a/app/assets/stylesheets/base/layout.scss b/app/assets/stylesheets/base/layout.scss index 690d89a5c16..734b95e26c0 100644 --- a/app/assets/stylesheets/base/layout.scss +++ b/app/assets/stylesheets/base/layout.scss @@ -20,3 +20,8 @@ html { .navless-container { margin-top: 30px; } + + +.container-limited { + max-width: $fixed-layout-width; +} diff --git a/app/assets/stylesheets/base/variables.scss b/app/assets/stylesheets/base/variables.scss index cb439a0e0bf..26d0a1e5363 100644 --- a/app/assets/stylesheets/base/variables.scss +++ b/app/assets/stylesheets/base/variables.scss @@ -13,7 +13,7 @@ $code_line_height: 1.5; $border-color: #E5E5E5; $background-color: #f5f5f5; $header-height: 50px; -$readable-width: 1100px; +$fixed-layout-width: 1200px; /* diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index 3f617e72b02..586e7b5f8da 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -45,9 +45,3 @@ .btn { font-size: 13px; } } - -.issuable-details { - .description { - max-width: $readable-width; - } -} diff --git a/app/assets/stylesheets/pages/tree.scss b/app/assets/stylesheets/pages/tree.scss index 5f1a3db4fb6..81e2aa7bb9c 100644 --- a/app/assets/stylesheets/pages/tree.scss +++ b/app/assets/stylesheets/pages/tree.scss @@ -117,7 +117,6 @@ .readme-holder { margin: 0 auto; - max-width: $readable-width; .readme-file-title { font-size: 14px; diff --git a/app/helpers/page_layout_helper.rb b/app/helpers/page_layout_helper.rb index 01b6a63552c..8473d6d75d0 100644 --- a/app/helpers/page_layout_helper.rb +++ b/app/helpers/page_layout_helper.rb @@ -23,4 +23,12 @@ module PageLayoutHelper @sidebar end end + + def fluid_layout(enabled = false) + if @fluid_layout.nil? + @fluid_layout = enabled + else + @fluid_layout + end + end end diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index 96e15783a36..3d58f993cac 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -13,7 +13,7 @@ .username = current_user.username .content-wrapper - .container-fluid + %div{ class: fluid_layout ? "container-fluid" : "container-fluid container-limited" } .content = render "layouts/flash" .clearfix diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 12ddbe6f1b7..6086f36f07e 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -17,15 +17,6 @@ %li.visible-sm.visible-xs = link_to search_path, title: 'Search', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('search') - -#%li.hidden-xs - = link_to help_path, title: 'Help', data: {toggle: 'tooltip', placement: 'bottom'} do - = icon('question-circle fw') - -#%li - = link_to explore_root_path, title: 'Explore', data: {toggle: 'tooltip', placement: 'bottom'} do - = icon('globe fw') - -#%li - = link_to user_snippets_path(current_user), title: 'Your snippets', data: {toggle: 'tooltip', placement: 'bottom'} do - = icon('clipboard fw') - if current_user.is_admin? %li = link_to admin_root_path, title: 'Admin area', data: {toggle: 'tooltip', placement: 'bottom'} do @@ -34,9 +25,6 @@ %li.hidden-xs = link_to new_project_path, title: 'New project', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('plus fw') - -#%li - = link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do - = icon('cog fw') %li = link_to destroy_user_session_path, class: 'logout', method: :delete, title: 'Sign out', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('sign-out') diff --git a/app/views/projects/deploy_keys/index.html.haml b/app/views/projects/deploy_keys/index.html.haml index 2e9c5dc08c8..8e24c778b7c 100644 --- a/app/views/projects/deploy_keys/index.html.haml +++ b/app/views/projects/deploy_keys/index.html.haml @@ -1,4 +1,5 @@ - page_title "Deploy Keys" + %h3.page-title Deploy keys allow read-only access to the repository diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml index 52c1e03040c..30943f49bba 100644 --- a/app/views/projects/diffs/_diffs.html.haml +++ b/app/views/projects/diffs/_diffs.html.haml @@ -1,3 +1,6 @@ +- if params[:view] == 'parallel' + - fluid_layout true + .prepend-top-20.append-bottom-20 .pull-right .btn-group diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml index 007f6c6a787..ec1838eb489 100644 --- a/app/views/projects/merge_requests/_show.html.haml +++ b/app/views/projects/merge_requests/_show.html.haml @@ -1,4 +1,7 @@ - page_title "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests" +- if params[:view] == 'parallel' + - fluid_layout true + .merge-request{'data-url' => merge_request_path(@merge_request)} .merge-request-details.issuable-details = render "projects/merge_requests/show/mr_title" -- cgit v1.2.3 From 2fa560d658ec7c49df97daadae443568bc72bdce Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 26 Aug 2015 13:15:02 +0200 Subject: Align header with content container Signed-off-by: Dmitriy Zaporozhets --- CHANGELOG | 1 + app/assets/stylesheets/generic/header.scss | 66 +++---------------------- app/assets/stylesheets/generic/sidebar.scss | 43 ++++++++++++++++ app/assets/stylesheets/themes/gitlab-theme.scss | 26 +++++----- app/views/layouts/_page.html.haml | 5 ++ app/views/layouts/header/_default.html.haml | 7 +-- 6 files changed, 67 insertions(+), 81 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5222ab1e3e1..5ab0b5c3faf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,7 @@ v 8.0.0 (unreleased) - Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries (Stan Hu) - Improve abuse reports management from admin area - Move dashboard activity to separate page + - Limit content width to 1200px for most of pages to improve readability on big screens v 7.14.1 (unreleased) - Only include base URL in OmniAuth full_host parameter (Stan Hu) diff --git a/app/assets/stylesheets/generic/header.scss b/app/assets/stylesheets/generic/header.scss index 31e2ad86691..6a29b32e196 100644 --- a/app/assets/stylesheets/generic/header.scss +++ b/app/assets/stylesheets/generic/header.scss @@ -20,16 +20,16 @@ header { } &.navbar-gitlab { + padding: 0 20px; z-index: 100; margin-bottom: 0; min-height: $header-height; border: none; - width: 100%; + border-bottom: 1px solid #EEE; - .container { + .container-fluid { background: #FFF; width: 100% !important; - padding: 0; filter: none; .nav > li > a { @@ -64,55 +64,11 @@ header { } } - .header-logo { - border-bottom: 1px solid transparent; - float: left; - height: $header-height; - width: $sidebar_width; - overflow: hidden; - transition-duration: .3s; - - a { - float: left; - height: $header-height; - width: 100%; - padding: ($header-height - 36 ) / 2 8px; - overflow: hidden; - - img { - width: 36px; - height: 36px; - float: left; - } - - .gitlab-text-container { - width: 230px; - - h3 { - width: 158px; - float: left; - margin: 0; - margin-left: 14px; - font-size: 18px; - line-height: $header-height - 14; - font-weight: normal; - } - } - } - - &:hover { - background-color: #EEE; - } - } - .header-content { - border-bottom: 1px solid #EEE; - padding-right: 35px; height: $header-height; .title { margin: 0; - padding: 0 15px 0 35px; overflow: hidden; font-size: 18px; line-height: $header-height; @@ -168,15 +124,7 @@ header { } @mixin collapsed-header { - .header-logo { - width: $sidebar_collapsed_width; - } - - .header-content { - .title { - margin-left: 30px; - } - } + margin-left: $sidebar_collapsed_width; } @media (max-width: $screen-md-max) { @@ -191,16 +139,14 @@ header { } .header-expanded { + margin-left: $sidebar_width; } } @media (max-width: $screen-xs-max) { - header .container { + header .container-fluid { font-size: 18px; - .title { - } - .navbar-nav { margin: 0px; float: none !important; diff --git a/app/assets/stylesheets/generic/sidebar.scss b/app/assets/stylesheets/generic/sidebar.scss index b96664d30db..320bdb1c765 100644 --- a/app/assets/stylesheets/generic/sidebar.scss +++ b/app/assets/stylesheets/generic/sidebar.scss @@ -188,3 +188,46 @@ width: $sidebar_width - 2 * 10px; } } + +.sidebar-wrapper { + .header-logo { + border-bottom: 1px solid transparent; + float: left; + height: $header-height; + width: $sidebar_width; + overflow: hidden; + transition-duration: .3s; + + a { + float: left; + height: $header-height; + width: 100%; + padding: ($header-height - 36 ) / 2 8px; + overflow: hidden; + + img { + width: 36px; + height: 36px; + float: left; + } + + .gitlab-text-container { + width: 230px; + + h3 { + width: 158px; + float: left; + margin: 0; + margin-left: 14px; + font-size: 18px; + line-height: $header-height - 14; + font-weight: normal; + } + } + } + + &:hover { + background-color: #EEE; + } + } +} diff --git a/app/assets/stylesheets/themes/gitlab-theme.scss b/app/assets/stylesheets/themes/gitlab-theme.scss index 3589cb88d03..77b62c3153f 100644 --- a/app/assets/stylesheets/themes/gitlab-theme.scss +++ b/app/assets/stylesheets/themes/gitlab-theme.scss @@ -7,27 +7,23 @@ * $color-dark - */ @mixin gitlab-theme($color-light, $color, $color-darker, $color-dark) { - header { - &.navbar-gitlab { - .header-logo { - background-color: $color-darker; - border-color: $color-darker; + .page-with-sidebar { + .header-logo { + background-color: $color-darker; + border-color: $color-darker; - a { - color: $color-light; - } + a { + color: $color-light; + } - &:hover { - background-color: $color-dark; - a { - color: #FFF; - } + &:hover { + background-color: $color-dark; + a { + color: #FFF; } } } - } - .page-with-sidebar { .collapse-nav a { color: #FFF; background: $color; diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index 3d58f993cac..0104d7198df 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -1,6 +1,11 @@ .page-with-sidebar{ class: nav_sidebar_class } = render "layouts/broadcast" .sidebar-wrapper.nicescroll + .header-logo + = link_to root_path, class: 'home', title: 'Dashboard', id: 'js-shortcuts-home', data: {toggle: 'tooltip', placement: 'bottom'} do + = brand_header_logo + .gitlab-text-container + %h3 GitLab - if defined?(sidebar) && sidebar = render "layouts/nav/#{sidebar}" - elsif current_user diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 6086f36f07e..0b630b55c70 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -1,10 +1,5 @@ %header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class } - .container - .header-logo - = link_to root_path, class: 'home', title: 'Dashboard', id: 'js-shortcuts-home', data: {toggle: 'tooltip', placement: 'bottom'} do - = brand_header_logo - .gitlab-text-container - %h3 GitLab + %div{ class: fluid_layout ? "container-fluid" : "container-fluid container-limited" } .header-content %button.navbar-toggle{type: 'button'} %span.sr-only Toggle navigation -- cgit v1.2.3 From bafffb2d14e1924154d5b7c74c7b3cbcf8c898fd Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Tue, 11 Aug 2015 09:59:40 +0300 Subject: Enable SSL verification for Webhooks --- CHANGELOG | 1 + app/controllers/admin/hooks_controller.rb | 2 +- app/controllers/projects/hooks_controller.rb | 3 ++- app/controllers/projects/services_controller.rb | 2 +- app/models/hooks/web_hook.rb | 5 +++-- app/models/project_services/buildkite_service.rb | 9 +++++++-- app/models/project_services/gitlab_ci_service.rb | 6 ++++-- app/views/admin/hooks/index.html.haml | 8 ++++++++ app/views/projects/hooks/index.html.haml | 8 ++++++++ db/migrate/20150824002011_add_enable_ssl_verification.rb | 5 +++++ db/schema.rb | 15 ++++++++------- features/admin/hooks.feature | 9 +++++++++ features/project/hooks.feature | 5 +++++ features/steps/admin/hooks.rb | 15 +++++++++++++++ features/steps/project/hooks.rb | 13 +++++++++++++ 15 files changed, 90 insertions(+), 16 deletions(-) create mode 100644 db/migrate/20150824002011_add_enable_ssl_verification.rb create mode 100644 features/admin/hooks.feature create mode 100644 features/steps/admin/hooks.rb diff --git a/CHANGELOG b/CHANGELOG index 7ec1dabcf95..2c1b1a53fe9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ v 8.0.0 (unreleased) - Search for comments should be case insensetive - Create cross-reference for closing references on commits pushed to non-default branches (Maël Valais) - Ability to search milestones + - Ability to enable SSL verification for Webhooks v 7.14.0 - Fix bug where non-project members of the target project could set labels on new merge requests. diff --git a/app/controllers/admin/hooks_controller.rb b/app/controllers/admin/hooks_controller.rb index 690096bdbcf..d670386f8c6 100644 --- a/app/controllers/admin/hooks_controller.rb +++ b/app/controllers/admin/hooks_controller.rb @@ -39,6 +39,6 @@ class Admin::HooksController < Admin::ApplicationController end def hook_params - params.require(:hook).permit(:url) + params.require(:hook).permit(:url, :enable_ssl_verification) end end diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb index 76062446c92..4e5b4125f5a 100644 --- a/app/controllers/projects/hooks_controller.rb +++ b/app/controllers/projects/hooks_controller.rb @@ -53,6 +53,7 @@ class Projects::HooksController < Projects::ApplicationController end def hook_params - params.require(:hook).permit(:url, :push_events, :issues_events, :merge_requests_events, :tag_push_events, :note_events) + params.require(:hook).permit(:url, :push_events, :issues_events, + :merge_requests_events, :tag_push_events, :note_events, :enable_ssl_verification) end end diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb index 01105532479..b0cf5866d41 100644 --- a/app/controllers/projects/services_controller.rb +++ b/app/controllers/projects/services_controller.rb @@ -8,7 +8,7 @@ class Projects::ServicesController < Projects::ApplicationController :push_events, :issues_events, :merge_requests_events, :tag_push_events, :note_events, :send_from_committer_email, :disable_diffs, :external_wiki_url, :notify, :color, - :server_host, :server_port, :default_irc_uri] + :server_host, :server_port, :default_irc_uri, :enable_ssl_verification] # Authorize before_action :authorize_admin_project! before_action :service, only: [:edit, :update, :test] diff --git a/app/models/hooks/web_hook.rb b/app/models/hooks/web_hook.rb index 46fb85336e5..9a8251bdad5 100644 --- a/app/models/hooks/web_hook.rb +++ b/app/models/hooks/web_hook.rb @@ -25,6 +25,7 @@ class WebHook < ActiveRecord::Base default_value_for :note_events, false default_value_for :merge_requests_events, false default_value_for :tag_push_events, false + default_value_for :enable_ssl_verification, false # HTTParty timeout default_timeout Gitlab.config.gitlab.webhook_timeout @@ -41,7 +42,7 @@ class WebHook < ActiveRecord::Base "Content-Type" => "application/json", "X-Gitlab-Event" => hook_name.singularize.titleize }, - verify: false) + verify: enable_ssl_verification) else post_url = url.gsub("#{parsed_url.userinfo}@", "") auth = { @@ -54,7 +55,7 @@ class WebHook < ActiveRecord::Base "Content-Type" => "application/json", "X-Gitlab-Event" => hook_name.singularize.titleize }, - verify: false, + verify: enable_ssl_verification, basic_auth: auth) end rescue SocketError, Errno::ECONNRESET, Errno::ECONNREFUSED, Net::OpenTimeout => e diff --git a/app/models/project_services/buildkite_service.rb b/app/models/project_services/buildkite_service.rb index a714bc82246..9e5da6f45d2 100644 --- a/app/models/project_services/buildkite_service.rb +++ b/app/models/project_services/buildkite_service.rb @@ -23,7 +23,7 @@ require "addressable/uri" class BuildkiteService < CiService ENDPOINT = "https://buildkite.com" - prop_accessor :project_url, :token + prop_accessor :project_url, :token, :enable_ssl_verification validates :project_url, presence: true, if: :activated? validates :token, presence: true, if: :activated? @@ -37,6 +37,7 @@ class BuildkiteService < CiService def compose_service_hook hook = service_hook || build_service_hook hook.url = webhook_url + hook.enable_ssl_verification = enable_ssl_verification hook.save end @@ -96,7 +97,11 @@ class BuildkiteService < CiService { type: 'text', name: 'project_url', - placeholder: "#{ENDPOINT}/example/project" } + placeholder: "#{ENDPOINT}/example/project" }, + + { type: 'checkbox', + name: 'enable_ssl_verification', + title: "Enable SSL verification" } ] end diff --git a/app/models/project_services/gitlab_ci_service.rb b/app/models/project_services/gitlab_ci_service.rb index ecdcd48ae60..acbbc9935b6 100644 --- a/app/models/project_services/gitlab_ci_service.rb +++ b/app/models/project_services/gitlab_ci_service.rb @@ -21,7 +21,7 @@ class GitlabCiService < CiService API_PREFIX = "api/v1" - prop_accessor :project_url, :token + prop_accessor :project_url, :token, :enable_ssl_verification validates :project_url, presence: true, format: { with: /\A#{URI.regexp(%w(http https))}\z/, message: "should be a valid url" }, if: :activated? @@ -34,6 +34,7 @@ class GitlabCiService < CiService def compose_service_hook hook = service_hook || build_service_hook hook.url = [project_url, "/build", "?token=#{token}"].join("") + hook.enable_ssl_verification = enable_ssl_verification hook.save end @@ -136,7 +137,8 @@ class GitlabCiService < CiService def fields [ { type: 'text', name: 'token', placeholder: 'GitLab CI project specific token' }, - { type: 'text', name: 'project_url', placeholder: 'http://ci.gitlabhq.com/projects/3' } + { type: 'text', name: 'project_url', placeholder: 'http://ci.gitlabhq.com/projects/3' }, + { type: 'checkbox', name: 'enable_ssl_verification', title: "Enable SSL verification" } ] end diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index e74e1e85f41..b120f4dea67 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -18,6 +18,13 @@ = f.label :url, "URL:", class: 'control-label' .col-sm-10 = f.text_field :url, class: "form-control" + .form-group + = f.label :enable_ssl_verification, "SSL verification", class: 'control-label checkbox' + .col-sm-10 + .checkbox + = f.label :enable_ssl_verification do + = f.check_box :enable_ssl_verification + %strong Enable SSL verification .form-actions = f.submit "Add System Hook", class: "btn btn-create" %hr @@ -32,6 +39,7 @@ .list-item-name = link_to admin_hook_path(hook) do %strong= hook.url + %p SSL Verification: #{hook.enable_ssl_verification ? "enabled" : "disabled"} .pull-right = link_to 'Test Hook', admin_hook_test_path(hook), class: "btn btn-sm" diff --git a/app/views/projects/hooks/index.html.haml b/app/views/projects/hooks/index.html.haml index eadbf61fdd4..85dbfd67862 100644 --- a/app/views/projects/hooks/index.html.haml +++ b/app/views/projects/hooks/index.html.haml @@ -55,6 +55,13 @@ %strong Merge Request events %p.light This url will be triggered when a merge request is created + .form-group + = f.label :enable_ssl_verification, "SSL verification", class: 'control-label checkbox' + .col-sm-10 + .checkbox + = f.label :enable_ssl_verification do + = f.check_box :enable_ssl_verification + %strong Enable SSL verification .form-actions = f.submit "Add Web Hook", class: "btn btn-create" @@ -74,3 +81,4 @@ - %w(push_events tag_push_events issues_events note_events merge_requests_events).each do |trigger| - if hook.send(trigger) %span.label.label-gray= trigger.titleize + SSL Verification: #{hook.enable_ssl_verification ? "enabled" : "disabled"} diff --git a/db/migrate/20150824002011_add_enable_ssl_verification.rb b/db/migrate/20150824002011_add_enable_ssl_verification.rb new file mode 100644 index 00000000000..093c068fbde --- /dev/null +++ b/db/migrate/20150824002011_add_enable_ssl_verification.rb @@ -0,0 +1,5 @@ +class AddEnableSslVerification < ActiveRecord::Migration + def change + add_column :web_hooks, :enable_ssl_verification, :boolean, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 108c48bf321..7ee1c6e2146 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150818213832) do +ActiveRecord::Schema.define(version: 20150824002011) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -566,13 +566,14 @@ ActiveRecord::Schema.define(version: 20150818213832) do t.integer "project_id" t.datetime "created_at" t.datetime "updated_at" - t.string "type", default: "ProjectHook" + t.string "type", default: "ProjectHook" t.integer "service_id" - t.boolean "push_events", default: true, null: false - t.boolean "issues_events", default: false, null: false - t.boolean "merge_requests_events", default: false, null: false - t.boolean "tag_push_events", default: false - t.boolean "note_events", default: false, null: false + t.boolean "push_events", default: true, null: false + t.boolean "issues_events", default: false, null: false + t.boolean "merge_requests_events", default: false, null: false + t.boolean "tag_push_events", default: false + t.boolean "note_events", default: false, null: false + t.boolean "enable_ssl_verification", default: false end add_index "web_hooks", ["created_at", "id"], name: "index_web_hooks_on_created_at_and_id", using: :btree diff --git a/features/admin/hooks.feature b/features/admin/hooks.feature new file mode 100644 index 00000000000..5ca332d9f1c --- /dev/null +++ b/features/admin/hooks.feature @@ -0,0 +1,9 @@ +@admin +Feature: Admin Hooks + Background: + Given I sign in as an admin + + Scenario: On Admin Hooks + Given I visit admin hooks page + Then I submit the form with enabled SSL verification + And I see new hook with enabled SSL verification \ No newline at end of file diff --git a/features/project/hooks.feature b/features/project/hooks.feature index 1a60846a23e..627738004c4 100644 --- a/features/project/hooks.feature +++ b/features/project/hooks.feature @@ -13,6 +13,11 @@ Feature: Project Hooks When I submit new hook Then I should see newly created hook + Scenario: I add new hook with SSL verification enabled + Given I visit project hooks page + When I submit new hook with SSL verification enabled + Then I should see newly created hook with SSL verification enabled + Scenario: I test hook Given project has hook And I visit project hooks page diff --git a/features/steps/admin/hooks.rb b/features/steps/admin/hooks.rb new file mode 100644 index 00000000000..541e25fcb70 --- /dev/null +++ b/features/steps/admin/hooks.rb @@ -0,0 +1,15 @@ +class Spinach::Features::AdminHooks < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedAdmin + + step "I submit the form with enabled SSL verification" do + fill_in 'hook_url', with: 'http://google.com' + check "Enable SSL verification" + click_on "Add System Hook" + end + + step "I see new hook with enabled SSL verification" do + expect(page).to have_content "SSL Verification: enabled" + end +end diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb index 04e3bf78ede..df4a23a3716 100644 --- a/features/steps/project/hooks.rb +++ b/features/steps/project/hooks.rb @@ -28,11 +28,24 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1) end + step 'I submit new hook with SSL verification enabled' do + @url = FFaker::Internet.uri("http") + fill_in "hook_url", with: @url + check "hook_enable_ssl_verification" + expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1) + end + step 'I should see newly created hook' do expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project) expect(page).to have_content(@url) end + step 'I should see newly created hook with SSL verification enabled' do + expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project) + expect(page).to have_content(@url) + expect(page).to have_content("SSL Verification: enabled") + end + step 'I click test hook button' do stub_request(:post, @hook.url).to_return(status: 200) click_link 'Test Hook' -- cgit v1.2.3 From 99b2be7625fe7849aa0559356beef86c1840fb65 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Wed, 26 Aug 2015 16:39:55 +0300 Subject: Improve perofrmance of git blame --- CHANGELOG | 1 + app/views/projects/blame/show.html.haml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index be99941b4cd..dc1d88bf61e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -18,6 +18,7 @@ v 8.0.0 (unreleased) - Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries (Stan Hu) - Improve abuse reports management from admin area - Move dashboard activity to separate page + - Improve performance of git blame v 7.14.1 (unreleased) - Only include base URL in OmniAuth full_host parameter (Stan Hu) diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml index a3ff7ce2f1f..c1ec42aefca 100644 --- a/app/views/projects/blame/show.html.haml +++ b/app/views/projects/blame/show.html.haml @@ -27,7 +27,7 @@ .light = commit_author_link(commit, avatar: false) authored - #{time_ago_with_tooltip(commit.committed_date)} + #{time_ago_with_tooltip(commit.committed_date, skip_js: true)} %td.lines.blame-numbers %pre - line_count = blame_group[:lines].count -- cgit v1.2.3 From 468d29251da81bb3a16380b4465becf35db2ba23 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 26 Aug 2015 16:00:37 +0200 Subject: Fix header for anonymous users too Signed-off-by: Dmitriy Zaporozhets --- app/views/layouts/header/_public.html.haml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/views/layouts/header/_public.html.haml b/app/views/layouts/header/_public.html.haml index 15c2e292be3..af4b9ba58f6 100644 --- a/app/views/layouts/header/_public.html.haml +++ b/app/views/layouts/header/_public.html.haml @@ -1,10 +1,5 @@ %header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class } - .container - .header-logo - = link_to explore_root_path, class: "home" do - = brand_header_logo - .gitlab-text-container - %h3 GitLab + %div{ class: fluid_layout ? "container-fluid" : "container-fluid container-limited" } .header-content - unless current_controller?('sessions') .pull-right -- cgit v1.2.3 From c1fe98e0b9dbe40d564dc5ddad23e14dd0e6e462 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 26 Aug 2015 07:38:33 -0700 Subject: Prevent too many redirects error when home page URL set to external_urll Many users naively set the home page URL setting to external_url (e.g. https://mydomain.com). When an unauthenticated user signs in, this causes endless redirections. For example, this is occuring: 1. Unauthenticated user attempts to access https://mydomain.com/dashboard 2. Application redirects to the home page URL: https://mydomain.com 3. Repeat step 2 In step 3, ApplicationController should have redirected the user to https://mydomain.com/users/sign_in. Disabling the redirection if home page URL is the same as external_url prevents users from messing up. Closes https://github.com/gitlabhq/gitlabhq/issues/8843 Closes #2057 --- CHANGELOG | 1 + app/controllers/application_controller.rb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index a93558fb10d..92793b6be24 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.0.0 (unreleased) + - Prevent too many redirects upon login when home page URL is set to external_url (Stan Hu) - Improve dropdown positioning on the project home page (Hannes Rosenögger) - Upgrade browser gem to 1.0.0 to avoid warning in IE11 compatibilty mode (Stan Hu) - Fix "Reload with full diff" URL button in compare branch view (Stan Hu) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 12d439b0b31..ef1170e16da 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -55,7 +55,9 @@ class ApplicationController < ActionController::Base def authenticate_user!(*args) # If user is not signed-in and tries to access root_path - redirect him to landing page - if current_application_settings.home_page_url.present? + # Don't redirect to the default URL to prevent endless redirections + if current_application_settings.home_page_url.present? && + current_application_settings.home_page_url.chomp('/') != Gitlab.config.gitlab['url'].chomp('/') if current_user.nil? && root_path == request.path redirect_to current_application_settings.home_page_url and return end -- cgit v1.2.3 From 5ea15fc7b556d1e5e3a778d2f100b903904e8c6a Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 26 Aug 2015 07:53:26 -0700 Subject: Update CHANGELOG for released 7.14.1 [ci skip] --- CHANGELOG | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index dc1d88bf61e..6743b93f58c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,7 +3,6 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.0.0 (unreleased) - Improve dropdown positioning on the project home page (Hannes Rosenögger) - Upgrade browser gem to 1.0.0 to avoid warning in IE11 compatibilty mode (Stan Hu) - - Fix "Reload with full diff" URL button in compare branch view (Stan Hu) - Remove user OAuth tokens from the database and request new tokens each session (Stan Hu) - Only show recent push event if the branch still exists or a recent merge request has not been created (Stan Hu) - Remove satellites @@ -16,11 +15,12 @@ v 8.0.0 (unreleased) - Create cross-reference for closing references on commits pushed to non-default branches (Maël Valais) - Ability to search milestones - Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries (Stan Hu) - - Improve abuse reports management from admin area - Move dashboard activity to separate page - Improve performance of git blame -v 7.14.1 (unreleased) +v 7.14.1 + - Improve abuse reports management from admin area + - Fix "Reload with full diff" URL button in compare branch view (Stan Hu) - Only include base URL in OmniAuth full_host parameter (Stan Hu) - Fix Error 500 in API when accessing a group that has an avatar (Stan Hu) -- cgit v1.2.3 From bc683a590402b6ce017a613616623b65b6823ec4 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Wed, 26 Aug 2015 08:58:46 -0700 Subject: Update mail_room --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index fa54a72f025..4696a961e82 100644 --- a/Gemfile +++ b/Gemfile @@ -273,6 +273,6 @@ gem "newrelic_rpm" gem 'octokit', '3.7.0' -gem "mail_room", "~> 0.4.0" +gem "mail_room", "~> 0.4.1" gem 'email_reply_parser' diff --git a/Gemfile.lock b/Gemfile.lock index a7cfe6b7511..814249c7ff6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -372,7 +372,7 @@ GEM systemu (~> 2.6.2) mail (2.6.3) mime-types (>= 1.16, < 3) - mail_room (0.4.0) + mail_room (0.4.1) method_source (0.8.2) mime-types (1.25.1) mimemagic (0.3.0) @@ -808,7 +808,7 @@ DEPENDENCIES jquery-ui-rails kaminari (~> 0.15.1) letter_opener - mail_room (~> 0.4.0) + mail_room (~> 0.4.1) minitest (~> 5.3.0) mousetrap-rails mysql2 -- cgit v1.2.3