Commit 737c506c authored by Robert Speicher's avatar Robert Speicher

Merge branch 'ce-to-ee-2018-01-24' into 'master'

CE upstream - Wednesday

See merge request gitlab-org/gitlab-ee!4225
parents 98edfff4 7c0a061b
...@@ -299,6 +299,13 @@ const gfmRules = { ...@@ -299,6 +299,13 @@ const gfmRules = {
export class CopyAsGFM { export class CopyAsGFM {
constructor() { constructor() {
// iOS currently does not support clipboardData.setData(). This bug should
// be fixed in iOS 12, but for now we'll disable this for all iOS browsers
// ref: https://trac.webkit.org/changeset/222228/webkit
const userAgent = (typeof navigator !== 'undefined' && navigator.userAgent) || '';
const isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent);
if (isIOS) return;
$(document).on('copy', '.md, .wiki', (e) => { CopyAsGFM.copyAsGFM(e, CopyAsGFM.transformGFMSelection); }); $(document).on('copy', '.md, .wiki', (e) => { CopyAsGFM.copyAsGFM(e, CopyAsGFM.transformGFMSelection); });
$(document).on('copy', 'pre.code.highlight, .diff-content .line_content', (e) => { CopyAsGFM.copyAsGFM(e, CopyAsGFM.transformCodeSelection); }); $(document).on('copy', 'pre.code.highlight, .diff-content .line_content', (e) => { CopyAsGFM.copyAsGFM(e, CopyAsGFM.transformCodeSelection); });
$(document).on('paste', '.js-gfm-input', CopyAsGFM.pasteGFM); $(document).on('paste', '.js-gfm-input', CopyAsGFM.pasteGFM);
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
<div v-else-if="hasKeys"> <div v-else-if="hasKeys">
<keys-panel <keys-panel
title="Enabled deploy keys for this project" title="Enabled deploy keys for this project"
class="qa-project-deploy-keys"
:keys="keys.enabled_keys" :keys="keys.enabled_keys"
:store="store" :store="store"
:endpoint="endpoint" :endpoint="endpoint"
......
---
title: Fix copy/paste on iOS devices due to a bug in webkit
merge_request: 15804
author:
type: fixed
...@@ -4,6 +4,12 @@ module QA ...@@ -4,6 +4,12 @@ module QA
class DeployKey < Factory::Base class DeployKey < Factory::Base
attr_accessor :title, :key attr_accessor :title, :key
product :title do
Page::Project::Settings::Repository.act do
expand_deploy_keys(&:key_title)
end
end
dependency Factory::Resource::Project, as: :project do |project| dependency Factory::Resource::Project, as: :project do |project|
project.name = 'project-to-deploy' project.name = 'project-to-deploy'
project.description = 'project for adding deploy key test' project.description = 'project for adding deploy key test'
......
...@@ -10,6 +10,7 @@ module QA ...@@ -10,6 +10,7 @@ module QA
view 'app/assets/javascripts/deploy_keys/components/app.vue' do view 'app/assets/javascripts/deploy_keys/components/app.vue' do
element :deploy_keys_section, /class=".*deploy\-keys.*"/ element :deploy_keys_section, /class=".*deploy\-keys.*"/
element :project_deploy_keys, 'class="qa-project-deploy-keys"'
end end
view 'app/assets/javascripts/deploy_keys/components/key.vue' do view 'app/assets/javascripts/deploy_keys/components/key.vue' do
...@@ -29,9 +30,9 @@ module QA ...@@ -29,9 +30,9 @@ module QA
click_on 'Add key' click_on 'Add key'
end end
def has_key_title?(title) def key_title
page.within('.deploy-keys') do page.within('.qa-project-deploy-keys') do
page.find('.title', text: title) page.find('.title').text
end end
end end
end end
......
...@@ -7,16 +7,12 @@ module QA ...@@ -7,16 +7,12 @@ module QA
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
Factory::Resource::DeployKey.fabricate! do |deploy_key| deploy_key = Factory::Resource::DeployKey.fabricate! do |resource|
deploy_key.title = deploy_key_title resource.title = deploy_key_title
deploy_key.key = deploy_key_value resource.key = deploy_key_value
end end
Page::Project::Settings::Repository.perform do |setting| expect(deploy_key.title).to eq(deploy_key_title)
setting.expand_deploy_keys do |page|
expect(page).to have_key_title(deploy_key_title)
end
end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment