summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-10-03 08:31:03 +0000
committerPhil Hughes <me@iamphill.com>2018-10-03 08:31:03 +0000
commit474231eab20718699a416d7030aba995973df8c1 (patch)
tree83abfaa471bfcfb4173d71649bc2cfcedbfc2b19
parent09f38f8d13b19c48e52ba6771cd26f218feddab2 (diff)
parent8c1568d9766c674054f90af0816dbeebcdb8e2ce (diff)
downloadgitlab-ce-474231eab20718699a416d7030aba995973df8c1.tar.gz
Merge branch 'add-clipboard-button-to-application-id-and-secret' into 'master'
Add copy to clipboard button for application id and secret See merge request gitlab-org/gitlab-ce!21978
-rw-r--r--app/assets/stylesheets/pages/commits.scss1
-rw-r--r--app/views/admin/applications/show.html.haml21
-rw-r--r--app/views/doorkeeper/applications/show.html.haml19
-rw-r--r--changelogs/unreleased/add-clipboard-button-to-application-id-and-secret.yml5
-rw-r--r--locale/gitlab.pot13
-rw-r--r--spec/features/admin/admin_manage_applications_spec.rb4
-rw-r--r--spec/features/profiles/user_manages_applications_spec.rb4
7 files changed, 45 insertions, 22 deletions
diff --git a/app/assets/stylesheets/pages/commits.scss b/app/assets/stylesheets/pages/commits.scss
index 10764e0f3df..628a4ca38da 100644
--- a/app/assets/stylesheets/pages/commits.scss
+++ b/app/assets/stylesheets/pages/commits.scss
@@ -223,6 +223,7 @@
}
}
+.clipboard-group,
.commit-sha-group {
display: inline-flex;
diff --git a/app/views/admin/applications/show.html.haml b/app/views/admin/applications/show.html.haml
index 593a6d816e3..e69143abe45 100644
--- a/app/views/admin/applications/show.html.haml
+++ b/app/views/admin/applications/show.html.haml
@@ -1,4 +1,5 @@
- page_title @application.name, "Applications"
+
%h3.page-title
Application: #{@application.name}
@@ -6,23 +7,29 @@
%table.table
%tr
%td
- Application Id
+ = _('Application ID')
%td
- %code#application_id= @application.uid
+ .clipboard-group
+ .input-group
+ %input.label.label-monospace{ id: "application_id", type: "text", autocomplete: 'off', value: @application.uid, readonly: true }
+ .input-group-append
+ = clipboard_button(target: '#application_id', title: _("Copy ID to clipboard"), class: "btn btn btn-default")
%tr
%td
- Secret:
+ = _('Secret')
%td
- %code#secret= @application.secret
-
+ .clipboard-group
+ .input-group
+ %input.label.label-monospace{ id: "secret", type: "text", autocomplete: 'off', value: @application.secret, readonly: true }
+ .input-group-append
+ = clipboard_button(target: '#application_id', title: _("Copy secret to clipboard"), class: "btn btn btn-default")
%tr
%td
- Callback url
+ = _('Callback URL')
%td
- @application.redirect_uri.split.each do |uri|
%div
%span.monospace= uri
-
%tr
%td
Trusted
diff --git a/app/views/doorkeeper/applications/show.html.haml b/app/views/doorkeeper/applications/show.html.haml
index bb76ac6d5f6..776bbc36ec2 100644
--- a/app/views/doorkeeper/applications/show.html.haml
+++ b/app/views/doorkeeper/applications/show.html.haml
@@ -10,18 +10,25 @@
%table.table
%tr
%td
- = _('Application Id')
+ = _('Application ID')
%td
- %code#application_id= @application.uid
+ .clipboard-group
+ .input-group
+ %input.label.label-monospace{ id: "application_id", type: "text", autocomplete: 'off', value: @application.uid, readonly: true }
+ .input-group-append
+ = clipboard_button(target: '#application_id', title: _("Copy ID to clipboard"), class: "btn btn btn-default")
%tr
%td
- = _('Secret:')
+ = _('Secret')
%td
- %code#secret= @application.secret
-
+ .clipboard-group
+ .input-group
+ %input.label.label-monospace{ id: "secret", type: "text", autocomplete: 'off', value: @application.secret, readonly: true }
+ .input-group-append
+ = clipboard_button(target: '#application_id', title: _("Copy secret to clipboard"), class: "btn btn btn-default")
%tr
%td
- = _('Callback url')
+ = _('Callback URL')
%td
- @application.redirect_uri.split.each do |uri|
%div
diff --git a/changelogs/unreleased/add-clipboard-button-to-application-id-and-secret.yml b/changelogs/unreleased/add-clipboard-button-to-application-id-and-secret.yml
new file mode 100644
index 00000000000..7c707cfe5a0
--- /dev/null
+++ b/changelogs/unreleased/add-clipboard-button-to-application-id-and-secret.yml
@@ -0,0 +1,5 @@
+---
+title: Add copy to clipboard button for application id and secret
+merge_request: 21978
+author: George Tsiolis
+type: other
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index cc11577b624..646397b7757 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -598,7 +598,7 @@ msgstr ""
msgid "Application"
msgstr ""
-msgid "Application Id"
+msgid "Application ID"
msgstr ""
msgid "Application: %{name}"
@@ -1101,9 +1101,6 @@ msgstr ""
msgid "Callback URL"
msgstr ""
-msgid "Callback url"
-msgstr ""
-
msgid "Can't find HEAD commit for this branch"
msgstr ""
@@ -1930,6 +1927,9 @@ msgstr ""
msgid "Copy HTTPS clone URL"
msgstr ""
+msgid "Copy ID to clipboard"
+msgstr ""
+
msgid "Copy SSH clone URL"
msgstr ""
@@ -1951,6 +1951,9 @@ msgstr ""
msgid "Copy reference to clipboard"
msgstr ""
+msgid "Copy secret to clipboard"
+msgstr ""
+
msgid "Copy to clipboard"
msgstr ""
@@ -5318,7 +5321,7 @@ msgstr ""
msgid "Seconds to wait for a storage access attempt"
msgstr ""
-msgid "Secret:"
+msgid "Secret"
msgstr ""
msgid "Select"
diff --git a/spec/features/admin/admin_manage_applications_spec.rb b/spec/features/admin/admin_manage_applications_spec.rb
index f979d2f6090..a4904272706 100644
--- a/spec/features/admin/admin_manage_applications_spec.rb
+++ b/spec/features/admin/admin_manage_applications_spec.rb
@@ -16,7 +16,7 @@ RSpec.describe 'admin manage applications' do
check :doorkeeper_application_trusted
click_on 'Submit'
expect(page).to have_content('Application: test')
- expect(page).to have_content('Application Id')
+ expect(page).to have_content('Application ID')
expect(page).to have_content('Secret')
expect(page).to have_content('Trusted Y')
@@ -28,7 +28,7 @@ RSpec.describe 'admin manage applications' do
click_on 'Submit'
expect(page).to have_content('test_changed')
- expect(page).to have_content('Application Id')
+ expect(page).to have_content('Application ID')
expect(page).to have_content('Secret')
expect(page).to have_content('Trusted N')
diff --git a/spec/features/profiles/user_manages_applications_spec.rb b/spec/features/profiles/user_manages_applications_spec.rb
index 387584fef62..34aaab240cc 100644
--- a/spec/features/profiles/user_manages_applications_spec.rb
+++ b/spec/features/profiles/user_manages_applications_spec.rb
@@ -16,7 +16,7 @@ describe 'User manages applications' do
click_on 'Save application'
expect(page).to have_content 'Application: test'
- expect(page).to have_content 'Application Id'
+ expect(page).to have_content 'Application ID'
expect(page).to have_content 'Secret'
click_on 'Edit'
@@ -26,7 +26,7 @@ describe 'User manages applications' do
click_on 'Save application'
expect(page).to have_content 'test_changed'
- expect(page).to have_content 'Application Id'
+ expect(page).to have_content 'Application ID'
expect(page).to have_content 'Secret'
visit applications_profile_path