summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--app/assets/javascripts/application.js.coffee5
-rw-r--r--app/models/ability.rb2
-rw-r--r--features/project/project.feature5
-rw-r--r--features/steps/project/project.rb4
-rw-r--r--features/steps/shared/project.rb5
6 files changed, 20 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 87fb959a1ec..7d7b8e0aef8 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -11,6 +11,7 @@ v 7.12.0 (unreleased)
- Add web hook support for note events (Stan Hu)
- Disable "New Issue" and "New Merge Request" buttons when features are disabled in project settings (Stan Hu)
- Remove Rack Attack monkey patches and bump to version 4.3.0 (Stan Hu)
+ - Fix clone URL losing selection after a single click in Safari and Chrome (Stan Hu)
- Allow to configure location of the `.gitlab_shell_secret` file. (Jakub Jirutka)
- Disabled expansion of top/bottom blobs for new file diffs
- Update Asciidoctor gem to version 1.5.2. (Jakub Jirutka)
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index caf18c0d860..ea2a4b97101 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -116,7 +116,10 @@ window.addEventListener "hashchange", shiftWindow
$ ->
# Click a .js-select-on-focus field, select the contents
- $(".js-select-on-focus").on "focusin", -> $(this).select()
+ $(".js-select-on-focus").on "focusin", ->
+ # Prevent a mouseup event from deselecting the input
+ $(this).select().one 'mouseup', (e) ->
+ e.preventDefault()
$('.remove-row').bind 'ajax:success', ->
$(this).closest('li').fadeOut()
diff --git a/app/models/ability.rb b/app/models/ability.rb
index e166b4197fd..4e6c60dc8ca 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -115,7 +115,7 @@ class Ability
end
unless project.snippets_enabled
- rules -= named_abilities('snippet')
+ rules -= named_abilities('project_snippet')
end
unless project.wiki_enabled
diff --git a/features/project/project.feature b/features/project/project.feature
index ef11bceed11..56ae5c78d01 100644
--- a/features/project/project.feature
+++ b/features/project/project.feature
@@ -68,3 +68,8 @@ Feature: Project
When I visit project "Shop" page
Then I should not see "New Issue" button
And I should not see "New Merge Request" button
+
+ Scenario: I should not see Project snippets
+ Given I disable snippets in project
+ When I visit project "Shop" page
+ Then I should not see "Snippets" button
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
index 93fea693f89..fcc15aacc21 100644
--- a/features/steps/project/project.rb
+++ b/features/steps/project/project.rb
@@ -110,4 +110,8 @@ class Spinach::Features::Project < Spinach::FeatureSteps
step 'I should not see "New Merge Request" button' do
page.should_not have_link 'New Merge Request'
end
+
+ step 'I should not see "Snippets" button' do
+ page.should_not have_link 'Snippets'
+ end
end
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index 24136fe421c..3059c4ee041 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -14,6 +14,11 @@ module SharedProject
@project.team << [@user, :master]
end
+ step 'I disable snippets in project' do
+ @project.snippets_enabled = false
+ @project.save
+ end
+
step 'I disable issues and merge requests in project' do
@project.issues_enabled = false
@project.merge_requests_enabled = false