diff options
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/assets/javascripts/issue.js.coffee | 16 | ||||
-rw-r--r-- | app/assets/javascripts/merge_request.js.coffee | 16 | ||||
-rw-r--r-- | app/assets/javascripts/notes.js.coffee | 1 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/issuable.scss | 5 | ||||
-rw-r--r-- | app/controllers/abuse_reports_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/projects/issues_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/projects/snippets_controller.rb | 2 | ||||
-rw-r--r-- | app/models/abuse_report.rb | 2 | ||||
-rw-r--r-- | app/views/abuse_reports/new.html.haml | 2 | ||||
-rw-r--r-- | app/views/users/show.html.haml | 2 | ||||
-rw-r--r-- | doc/integration/saml.md | 16 | ||||
-rw-r--r-- | doc/workflow/importing/import_projects_from_github.md | 20 | ||||
-rw-r--r-- | lib/tasks/gitlab/task_helpers.rake | 3 | ||||
-rw-r--r-- | spec/models/abuse_report_spec.rb | 2 |
16 files changed, 72 insertions, 20 deletions
diff --git a/CHANGELOG b/CHANGELOG index 3995c3aa8e7..a15bbfbc49e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -57,6 +57,7 @@ v 8.4.0 (unreleased) - Autosize Markdown textareas - Import GitHub wiki into GitLab - Add reporters ability to download and browse build artifacts (Andrew Johnson) + - Autofill referring url in message box when reporting user abuse. (Josh Frye) v 8.3.4 - Use gitlab-workhorse 0.5.4 (fixes API routing bug) diff --git a/app/assets/javascripts/issue.js.coffee b/app/assets/javascripts/issue.js.coffee index 0d26c58a81d..cbc70cd846c 100644 --- a/app/assets/javascripts/issue.js.coffee +++ b/app/assets/javascripts/issue.js.coffee @@ -6,11 +6,25 @@ class @Issue constructor: -> # Prevent duplicate event bindings @disableTaskList() - + @fixAffixScroll() if $('a.btn-close').length @initTaskList() @initIssueBtnEventListeners() + fixAffixScroll: -> + fixAffix = -> + $discussion = $('.issuable-discussion') + $sidebar = $('.issuable-sidebar') + if $sidebar.hasClass('no-affix') + $sidebar.removeClass(['affix-top','affix']) + discussionHeight = $discussion.height() + sidebarHeight = $sidebar.height() + if sidebarHeight > discussionHeight + $discussion.height(sidebarHeight + 50) + $sidebar.addClass('no-affix') + $(window).on('resize', fixAffix) + fixAffix() + initTaskList: -> $('.detail-page-description .js-task-list-container').taskList('enable') $(document).on 'tasklist:changed', '.detail-page-description .js-task-list-container', @updateTaskList diff --git a/app/assets/javascripts/merge_request.js.coffee b/app/assets/javascripts/merge_request.js.coffee index 1f46e331427..6af5a48a0bb 100644 --- a/app/assets/javascripts/merge_request.js.coffee +++ b/app/assets/javascripts/merge_request.js.coffee @@ -15,6 +15,8 @@ class @MergeRequest this.$('.show-all-commits').on 'click', => this.showAllCommits() + @fixAffixScroll(); + @initTabs() # Prevent duplicate event bindings @@ -28,6 +30,20 @@ class @MergeRequest $: (selector) -> this.$el.find(selector) + fixAffixScroll: -> + fixAffix = -> + $discussion = $('.issuable-discussion') + $sidebar = $('.issuable-sidebar') + if $sidebar.hasClass('no-affix') + $sidebar.removeClass(['affix-top','affix']) + discussionHeight = $discussion.height() + sidebarHeight = $sidebar.height() + if sidebarHeight > discussionHeight + $discussion.height(sidebarHeight + 50) + $sidebar.addClass('no-affix') + $(window).on('resize', fixAffix) + fixAffix() + initTabs: -> if @opts.action != 'new' # `MergeRequests#new` has no tab-persisting or lazy-loading behavior diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 8866d81c925..2bfc5cb2d9c 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -320,6 +320,7 @@ class @Notes form.show() textarea = form.find("textarea") textarea.focus() + autosize(textarea) # HACK (rspeicher/DouweM): Work around a Chrome 43 bug(?). # The textarea has the correct value, Chrome just won't show it unless we diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index eae3590a189..977ada0ff38 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -20,6 +20,11 @@ position: fixed; top: 70px; margin-right: 35px; + + &.no-affix { + position: relative; + top: 0; + } } } } diff --git a/app/controllers/abuse_reports_controller.rb b/app/controllers/abuse_reports_controller.rb index 38814459f66..2eac0cabf7a 100644 --- a/app/controllers/abuse_reports_controller.rb +++ b/app/controllers/abuse_reports_controller.rb @@ -2,6 +2,7 @@ class AbuseReportsController < ApplicationController def new @abuse_report = AbuseReport.new @abuse_report.user_id = params[:user_id] + @ref_url = params.fetch(:ref_url, '') end def create diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index f476afb2d92..68244883803 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -49,7 +49,7 @@ class Projects::IssuesController < Projects::ApplicationController assignee_id: "" ) - @issue = @project.issues.new(issue_params) + @issue = @noteable = @project.issues.new(issue_params) respond_with(@issue) end diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index de948d271c8..a6284a24223 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -90,6 +90,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController def new params[:merge_request] ||= ActionController::Parameters.new(source_project: @project) @merge_request = MergeRequests::BuildService.new(project, current_user, merge_request_params).execute + @noteable = @merge_request @target_branches = if @merge_request.target_project @merge_request.target_project.repository.branch_names diff --git a/app/controllers/projects/snippets_controller.rb b/app/controllers/projects/snippets_controller.rb index 2104c7a7a71..92b0caa2efb 100644 --- a/app/controllers/projects/snippets_controller.rb +++ b/app/controllers/projects/snippets_controller.rb @@ -25,7 +25,7 @@ class Projects::SnippetsController < Projects::ApplicationController end def new - @snippet = @project.snippets.build + @snippet = @noteable = @project.snippets.build end def create diff --git a/app/models/abuse_report.rb b/app/models/abuse_report.rb index 2bc15c60d57..cc59aa4e911 100644 --- a/app/models/abuse_report.rb +++ b/app/models/abuse_report.rb @@ -17,7 +17,7 @@ class AbuseReport < ActiveRecord::Base validates :reporter, presence: true validates :user, presence: true validates :message, presence: true - validates :user_id, uniqueness: true + validates :user_id, uniqueness: { message: 'has already been reported' } def remove_user user.block diff --git a/app/views/abuse_reports/new.html.haml b/app/views/abuse_reports/new.html.haml index 3e5cdd2ce4a..f125ecf7be5 100644 --- a/app/views/abuse_reports/new.html.haml +++ b/app/views/abuse_reports/new.html.haml @@ -16,7 +16,7 @@ .form-group = f.label :message, class: 'control-label' .col-sm-10 - = f.text_area :message, class: "form-control js-quick-submit", rows: 2, required: true + = f.text_area :message, class: "form-control js-quick-submit", rows: 2, required: true, value: sanitize(@ref_url) .help-block Explain the problem with this user. If appropriate, provide a link to the relevant issue or comment. diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 849304ee2b6..3bfd781e51d 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -20,7 +20,7 @@ data: { toggle: 'tooltip', placement: 'left', container: 'body' }} = icon('exclamation-circle') - else - = link_to new_abuse_report_path(user_id: @user.id), class: 'btn btn-gray', + = link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referrer), class: 'btn btn-gray', title: 'Report abuse', data: {toggle: 'tooltip', placement: 'left', container: 'body'} do = icon('exclamation-circle') - if current_user diff --git a/doc/integration/saml.md b/doc/integration/saml.md index 1632e42f701..8841dbdb7c6 100644 --- a/doc/integration/saml.md +++ b/doc/integration/saml.md @@ -78,6 +78,18 @@ On the sign in page there should now be a SAML button below the regular sign in ## Troubleshooting -If you see a "500 error" in GitLab when you are redirected back from the SAML sign in page, this likely indicates that GitLab could not get the email address for the SAML user. +If you see a "500 error" in GitLab when you are redirected back from the SAML sign in page, +this likely indicates that GitLab could not get the email address for the SAML user. -Make sure the IdP provides a claim containing the user's email address, using claim name 'email' or 'mail'. The email will be used to automatically generate the GitLab username.
\ No newline at end of file +Make sure the IdP provides a claim containing the user's email address, using claim name +'email' or 'mail'. The email will be used to automatically generate the GitLab username. + +If after signing in into your SAML server you are redirected back to the sign in page and +no error is displayed, check your `production.log` file. It will most likely contain the +message `Can't verify CSRF token authenticity`. This means that there is an error during +the SAML request, but this error never reaches GitLab due to the CSRF check. + +To bypass this you can add `skip_before_action :verify_authenticity_token` to the +`omniauth_callbacks_controller.rb` file. This will allow the error to hit GitLab, +where it can then be seen in the usual logs, or as a flash message in the login +screen.
\ No newline at end of file diff --git a/doc/workflow/importing/import_projects_from_github.md b/doc/workflow/importing/import_projects_from_github.md index 77fb7ea7cd6..f693f430a42 100644 --- a/doc/workflow/importing/import_projects_from_github.md +++ b/doc/workflow/importing/import_projects_from_github.md @@ -5,11 +5,15 @@ enable the [GitHub integration][gh-import] in your GitLab instance._ At its current state, GitHub importer can import:
-- the repository description
-- the git repository data
-- the issues
-- the pull requests
-- the wiki pages
+- the repository description (introduced in GitLab 7.7)
+- the git repository data (introduced in GitLab 7.7)
+- the issues (introduced in GitLab 7.7)
+- the pull requests (introduced in GitLab 8.4)
+- the wiki pages (introduced in GitLab 8.4)
+
+It is not yet possible to import your labels, milestones and cross-repository
+pull requests (those from forks). We are working on improving this in the near
+future.
The importer page is visible when you [create a new project][new-project].
Click on the **GitHub** link and you will be redirected to GitHub for
@@ -35,12 +39,6 @@ The importer will create any new namespaces if they don't exist or in the case the namespace is taken, the project will be imported on the user's
namespace.
-### Note
-
-When you import your projects from GitHub, it is not possible to keep your
-labels, milestones, and cross-repository pull requests. We are working on
-improving this in the near future.
-
[gh-import]: ../../integration/github.md "GitHub integration"
[ee-gh]: http://doc.gitlab.com/ee/integration/github.html "GitHub integration for GitLab EE"
[new-project]: ../../gitlab-basics/create-project.md "How to create a new project in GitLab"
diff --git a/lib/tasks/gitlab/task_helpers.rake b/lib/tasks/gitlab/task_helpers.rake index 8c63877e51c..d33b5b31e18 100644 --- a/lib/tasks/gitlab/task_helpers.rake +++ b/lib/tasks/gitlab/task_helpers.rake @@ -4,6 +4,9 @@ end String.disable_colorization = true unless STDOUT.isatty +# Prevent StateMachine warnings from outputting during a cron task +StateMachines::Machine.ignore_method_conflicts = true if ENV['CRON'] + namespace :gitlab do # Ask if the user wants to continue diff --git a/spec/models/abuse_report_spec.rb b/spec/models/abuse_report_spec.rb index f9be8fcbcfe..4799bbaa57c 100644 --- a/spec/models/abuse_report_spec.rb +++ b/spec/models/abuse_report_spec.rb @@ -26,7 +26,7 @@ RSpec.describe AbuseReport, type: :model do it { is_expected.to validate_presence_of(:reporter) } it { is_expected.to validate_presence_of(:user) } it { is_expected.to validate_presence_of(:message) } - it { is_expected.to validate_uniqueness_of(:user_id) } + it { is_expected.to validate_uniqueness_of(:user_id).with_message('has already been reported') } end describe '#remove_user' do |