summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-04-21 16:16:33 -0700
committerStan Hu <stanhu@gmail.com>2019-04-21 16:34:02 -0700
commitfd1bc613b4aa1bb4f580240d50fc1abf40a3d1d7 (patch)
tree354c30b3da5bbcb51aae3d68a638b15596e9a060
parent10bf3bbc904c96d5d7633f58cb93cf6927e18c8e (diff)
downloadgitlab-ce-sh-fix-autocomplete-mirror-repo.tar.gz
Disable password autocomplete in mirror repository formsh-fix-autocomplete-mirror-repo
Chrome and other browsers ignore `autocomplete=false` and `autocomplete=off` now. This likely caused the mirroring section to expand whenever a user clicked "Expand" in the protected branches settings. https://developers.google.com/web/fundamentals/design-and-ux/input/forms/?hl=en recommends using `new-password` as the new field to prevent automatic filling. This is similar to https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8477. Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/11237
-rw-r--r--app/views/projects/mirrors/_mirror_repos.html.haml4
-rw-r--r--changelogs/unreleased/sh-fix-autocomplete-mirror-repo.yml5
2 files changed, 7 insertions, 2 deletions
diff --git a/app/views/projects/mirrors/_mirror_repos.html.haml b/app/views/projects/mirrors/_mirror_repos.html.haml
index c031815200b..a1ec2c887c2 100644
--- a/app/views/projects/mirrors/_mirror_repos.html.haml
+++ b/app/views/projects/mirrors/_mirror_repos.html.haml
@@ -11,7 +11,7 @@
= link_to _('Read more'), help_page_path('workflow/repository_mirroring'), target: '_blank'
.settings-content
- = form_for @project, url: project_mirror_path(@project), html: { class: 'gl-show-field-errors js-mirror-form', autocomplete: 'false', data: mirrors_form_data_attributes } do |f|
+ = form_for @project, url: project_mirror_path(@project), html: { class: 'gl-show-field-errors js-mirror-form', autocomplete: 'new-password', data: mirrors_form_data_attributes } do |f|
.panel.panel-default
.panel-heading
%h3.panel-title= _('Mirror a repository')
@@ -20,7 +20,7 @@
.form-group.has-feedback
= label_tag :url, _('Git repository URL'), class: 'label-light'
- = text_field_tag :url, nil, class: 'form-control js-mirror-url js-repo-url qa-mirror-repository-url-input', placeholder: _('Input your repository URL'), required: true, pattern: "(#{protocols}):\/\/.+"
+ = text_field_tag :url, nil, class: 'form-control js-mirror-url js-repo-url qa-mirror-repository-url-input', placeholder: _('Input your repository URL'), required: true, pattern: "(#{protocols}):\/\/.+", autocomplete: 'new-password'
= render 'projects/mirrors/instructions'
diff --git a/changelogs/unreleased/sh-fix-autocomplete-mirror-repo.yml b/changelogs/unreleased/sh-fix-autocomplete-mirror-repo.yml
new file mode 100644
index 00000000000..e855684bab1
--- /dev/null
+++ b/changelogs/unreleased/sh-fix-autocomplete-mirror-repo.yml
@@ -0,0 +1,5 @@
+---
+title: Disable password autocomplete in mirror repository form
+merge_request: 27542
+author:
+type: fixed