From b8c9c00d47c4858d33e3f9afe16e6fce1fcf78c7 Mon Sep 17 00:00:00 2001 From: Marcia Ramos <marcia@gitlab.com> Date: Tue, 27 Jul 2021 13:01:36 +0000 Subject: [PATCH] TW OKR: Review UI text Pushover integration --- app/models/integrations/pushover.rb | 51 +++++++++++++++---- locale/gitlab.pot | 26 ++++++---- .../services/user_activates_pushover_spec.rb | 2 +- 3 files changed, 57 insertions(+), 22 deletions(-) diff --git a/app/models/integrations/pushover.rb b/app/models/integrations/pushover.rb index b0cadc7ef4e9d..db39a4c68bd12 100644 --- a/app/models/integrations/pushover.rb +++ b/app/models/integrations/pushover.rb @@ -21,18 +21,46 @@ def self.to_param def fields [ - { type: 'text', name: 'api_key', title: _('API key'), placeholder: s_('PushoverService|Your application key'), required: true }, - { type: 'text', name: 'user_key', placeholder: s_('PushoverService|Your user key'), required: true }, - { type: 'text', name: 'device', placeholder: s_('PushoverService|Leave blank for all active devices') }, - { type: 'select', name: 'priority', required: true, choices: + { + type: 'text', + name: 'api_key', + title: _('API key'), + help: s_('PushoverService|Enter your application key.'), + placeholder: '', + required: true + }, + { + type: 'text', + name: 'user_key', + title: _('User key'), + help: s_('PushoverService|Enter your user key.'), + placeholder: '', + required: true + }, + { + type: 'text', + name: 'device', + title: _('Devices (optional)'), + help: s_('PushoverService|Leave blank for all active devices.'), + placeholder: '' + }, + { + type: 'select', + name: 'priority', + required: true, + choices: [ - [s_('PushoverService|Lowest Priority'), -2], - [s_('PushoverService|Low Priority'), -1], - [s_('PushoverService|Normal Priority'), 0], - [s_('PushoverService|High Priority'), 1] + [s_('PushoverService|Lowest priority'), -2], + [s_('PushoverService|Low priority'), -1], + [s_('PushoverService|Normal priority'), 0], + [s_('PushoverService|High priority'), 1] ], - default_choice: 0 }, - { type: 'select', name: 'sound', choices: + default_choice: 0 + }, + { + type: 'select', + name: 'sound', + choices: [ ['Device default sound', nil], ['Pushover (default)', 'pushover'], @@ -57,7 +85,8 @@ def fields ['Pushover Echo (long)', 'echo'], ['Up Down (long)', 'updown'], ['None (silent)', 'none'] - ] } + ] + } ] end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 1adb3cefe79a4..594a2cf01dc15 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -11222,6 +11222,9 @@ msgstr "" msgid "DevOps adoption" msgstr "" +msgid "Devices (optional)" +msgstr "" + msgid "DevopsAdoption|%{adoptedCount}/%{featuresCount} %{title} features adopted" msgstr "" @@ -26804,34 +26807,34 @@ msgstr "" msgid "PushoverService|%{user_name} pushed new branch \"%{ref}\"." msgstr "" -msgid "PushoverService|Get real-time notifications on your device." +msgid "PushoverService|Enter your application key." msgstr "" -msgid "PushoverService|High Priority" +msgid "PushoverService|Enter your user key." msgstr "" -msgid "PushoverService|Leave blank for all active devices" +msgid "PushoverService|Get real-time notifications on your device." msgstr "" -msgid "PushoverService|Low Priority" +msgid "PushoverService|High priority" msgstr "" -msgid "PushoverService|Lowest Priority" +msgid "PushoverService|Leave blank for all active devices." msgstr "" -msgid "PushoverService|Normal Priority" +msgid "PushoverService|Low priority" msgstr "" -msgid "PushoverService|See project %{project_full_name}" +msgid "PushoverService|Lowest priority" msgstr "" -msgid "PushoverService|Total commits count: %{total_commits_count}" +msgid "PushoverService|Normal priority" msgstr "" -msgid "PushoverService|Your application key" +msgid "PushoverService|See project %{project_full_name}" msgstr "" -msgid "PushoverService|Your user key" +msgid "PushoverService|Total commits count: %{total_commits_count}" msgstr "" msgid "Quarters" @@ -35682,6 +35685,9 @@ msgstr "" msgid "User is not allowed to resolve thread" msgstr "" +msgid "User key" +msgstr "" + msgid "User key was successfully removed." msgstr "" diff --git a/spec/features/projects/services/user_activates_pushover_spec.rb b/spec/features/projects/services/user_activates_pushover_spec.rb index 97003ab7c2a03..d92f69e700aeb 100644 --- a/spec/features/projects/services/user_activates_pushover_spec.rb +++ b/spec/features/projects/services/user_activates_pushover_spec.rb @@ -14,7 +14,7 @@ fill_in('API key', with: 'verySecret') fill_in('User key', with: 'verySecret') fill_in('Device', with: 'myDevice') - select('High Priority', from: 'Priority') + select('High priority', from: 'Priority') select('Bike', from: 'Sound') click_test_then_save_integration(expect_test_to_fail: false) -- GitLab