Commit db8e2c3b authored by Axel García's avatar Axel García

Rename usage ping to service ping

For the following sections:

- Service Ping consent alert
- Usage statistics settings

Changelog: changed
parent 2fca139b
...@@ -31,7 +31,7 @@ import initFrequentItemDropdowns from './frequent_items'; ...@@ -31,7 +31,7 @@ import initFrequentItemDropdowns from './frequent_items';
import initBreadcrumbs from './breadcrumb'; import initBreadcrumbs from './breadcrumb';
import initPersistentUserCallouts from './persistent_user_callouts'; import initPersistentUserCallouts from './persistent_user_callouts';
import { initUserTracking, initDefaultTrackers } from './tracking'; import { initUserTracking, initDefaultTrackers } from './tracking';
import initUsagePingConsent from './usage_ping_consent'; import initServicePingConsent from './service_ping_consent';
import GlFieldErrors from './gl_field_errors'; import GlFieldErrors from './gl_field_errors';
import initUserPopovers from './user_popovers'; import initUserPopovers from './user_popovers';
import initBroadcastNotifications from './broadcast_notification'; import initBroadcastNotifications from './broadcast_notification';
...@@ -86,7 +86,7 @@ function deferredInitialisation() { ...@@ -86,7 +86,7 @@ function deferredInitialisation() {
initBreadcrumbs(); initBreadcrumbs();
initTodoToggle(); initTodoToggle();
initLogoAnimation(); initLogoAnimation();
initUsagePingConsent(); initServicePingConsent();
initUserPopovers(); initUserPopovers();
initBroadcastNotifications(); initBroadcastNotifications();
initFrequentItemDropdowns(); initFrequentItemDropdowns();
......
...@@ -5,19 +5,20 @@ import { parseBoolean } from './lib/utils/common_utils'; ...@@ -5,19 +5,20 @@ import { parseBoolean } from './lib/utils/common_utils';
import { __ } from './locale'; import { __ } from './locale';
export default () => { export default () => {
$('body').on('click', '.js-usage-consent-action', (e) => { $('body').on('click', '.js-service-ping-consent-action', (e) => {
e.preventDefault(); e.preventDefault();
e.stopImmediatePropagation(); // overwrite rails listener e.stopImmediatePropagation(); // overwrite rails listener
const { url, checkEnabled, pingEnabled } = e.target.dataset; const { url, checkEnabled, servicePingEnabled } = e.target.dataset;
const data = { const data = {
application_setting: { application_setting: {
version_check_enabled: parseBoolean(checkEnabled), version_check_enabled: parseBoolean(checkEnabled),
usage_ping_enabled: parseBoolean(pingEnabled), service_ping_enabled: parseBoolean(servicePingEnabled),
}, },
}; };
const hideConsentMessage = () => hideFlash(document.querySelector('.ping-consent-message')); const hideConsentMessage = () =>
hideFlash(document.querySelector('.service-ping-consent-message'));
axios axios
.put(url, data) .put(url, data)
......
.usage-data { .service-data-payload-container {
max-height: 400px; max-height: 400px;
} }
- payload_class = 'js-usage-ping-payload' - payload_class = 'js-service-ping-payload'
= form_for @application_setting, url: metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings'), html: { class: 'fieldset-form' } do |f| = form_for @application_setting, url: metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
...@@ -17,23 +17,23 @@ ...@@ -17,23 +17,23 @@
.form-check .form-check
= f.check_box :usage_ping_enabled, disabled: !can_be_configured, class: 'form-check-input' = f.check_box :usage_ping_enabled, disabled: !can_be_configured, class: 'form-check-input'
= f.label :usage_ping_enabled, class: 'form-check-label' do = f.label :usage_ping_enabled, class: 'form-check-label' do
= _('Enable usage ping') = _('Enable service ping')
.form-text.text-muted .form-text.text-muted
- if can_be_configured - if can_be_configured
%p.mb-2= _('To help improve GitLab and its user experience, GitLab will periodically collect usage information.') %p.mb-2= _('To help improve GitLab and its user experience, GitLab will periodically collect usage information.')
- usage_ping_path = help_page_path('user/admin_area/settings/usage_statistics', anchor: 'usage-ping') - service_ping_path = help_page_path('user/admin_area/settings/usage_statistics', anchor: 'usage-ping')
- usage_ping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: usage_ping_path } - service_ping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: service_ping_path }
%p.mb-2= s_('%{usage_ping_link_start}Learn more%{usage_ping_link_end} about what information is shared with GitLab Inc.').html_safe % { usage_ping_link_start: usage_ping_link_start, usage_ping_link_end: '</a>'.html_safe } %p.mb-2= s_('%{service_ping_link_start}Learn more%{service_ping_link_end} about what information is shared with GitLab Inc.').html_safe % { service_ping_link_start: service_ping_link_start, service_ping_link_end: '</a>'.html_safe }
%button.gl-button.btn.btn-default.js-payload-preview-trigger{ type: 'button', data: { payload_selector: ".#{payload_class}" } } %button.gl-button.btn.btn-default.js-payload-preview-trigger{ type: 'button', data: { payload_selector: ".#{payload_class}" } }
.gl-spinner.js-spinner.gl-display-none.gl-mr-2 .gl-spinner.js-spinner.gl-display-none.gl-mr-2
.js-text.d-inline= _('Preview payload') .js-text.d-inline= _('Preview payload')
%pre.usage-data.js-syntax-highlight.code.highlight.mt-2.d-none{ class: payload_class, data: { endpoint: usage_data_admin_application_settings_path(format: :html) } } %pre.service-data-payload-container.js-syntax-highlight.code.highlight.mt-2.d-none{ class: payload_class, data: { endpoint: usage_data_admin_application_settings_path(format: :html) } }
- else - else
= _('The usage ping is disabled, and cannot be configured through this form.') = _('Service ping is disabled, and cannot be configured through this form.')
- deactivating_usage_ping_path = help_page_path('development/usage_ping/index.md', anchor: 'disable-usage-ping') - deactivating_service_ping_path = help_page_path('development/usage_ping/index.md', anchor: 'disable-usage-ping')
- deactivating_usage_ping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: deactivating_usage_ping_path } - deactivating_service_ping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: deactivating_service_ping_path }
= s_('For more information, see the documentation on %{deactivating_usage_ping_link_start}deactivating the usage ping%{deactivating_usage_ping_link_end}.').html_safe % { deactivating_usage_ping_link_start: deactivating_usage_ping_link_start, deactivating_usage_ping_link_end: '</a>'.html_safe } = s_('For more information, see the documentation on %{deactivating_service_ping_link_start}deactivating service ping%{deactivating_service_ping_link_end}.').html_safe % { deactivating_service_ping_link_start: deactivating_service_ping_link_start, deactivating_service_ping_link_end: '</a>'.html_safe }
= f.submit _('Save changes'), class: "gl-button btn btn-confirm" = f.submit _('Save changes'), class: "gl-button btn btn-confirm"
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
= expanded_by_default? ? _('Collapse') : _('Expand') = expanded_by_default? ? _('Collapse') : _('Expand')
%p %p
= _('Enable or disable version check and usage ping.') = _('Enable or disable version check and service ping.')
.settings-content .settings-content
= render 'usage' = render 'usage'
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
= render "layouts/header/service_templates_deprecation_callout" = render "layouts/header/service_templates_deprecation_callout"
= render "layouts/nav/classification_level_banner" = render "layouts/nav/classification_level_banner"
= yield :flash_message = yield :flash_message
= render "shared/ping_consent" = render "shared/service_ping_consent"
= render_account_recovery_regular_check = render_account_recovery_regular_check
= render_if_exists "layouts/header/ee_subscribable_banner" = render_if_exists "layouts/header/ee_subscribable_banner"
= render_if_exists "shared/namespace_storage_limit_alert" = render_if_exists "shared/namespace_storage_limit_alert"
......
- if session[:ask_for_usage_stats_consent] - if session[:ask_for_usage_stats_consent]
.ping-consent-message.gl-alert.gl-alert-info .service-ping-consent-message.gl-alert.gl-alert-info
= sprite_icon('information-o', css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title') = sprite_icon('information-o', css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title')
%button.js-close.gl-alert-dismiss{ type: 'button', 'aria-label' => _('Dismiss') } %button.js-close.gl-alert-dismiss{ type: 'button', 'aria-label' => _('Dismiss') }
= sprite_icon('close', css_class: 'gl-icon') = sprite_icon('close', css_class: 'gl-icon')
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
- settings_link = link_to _('your settings'), metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings'), class: 'gl-link' - settings_link = link_to _('your settings'), metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings'), class: 'gl-link'
= s_('To help improve GitLab, we would like to periodically %{docs_link}. This can be changed at any time in %{settings_link}.').html_safe % { docs_link: docs_link, settings_link: settings_link } = s_('To help improve GitLab, we would like to periodically %{docs_link}. This can be changed at any time in %{settings_link}.').html_safe % { docs_link: docs_link, settings_link: settings_link }
.gl-alert-actions.gl-mt-3 .gl-alert-actions.gl-mt-3
- send_usage_data_path = admin_application_settings_path(application_setting: { version_check_enabled: 1, usage_ping_enabled: 1 }) - send_service_data_path = admin_application_settings_path(application_setting: { version_check_enabled: 1, usage_ping_enabled: 1 })
- not_now_path = admin_application_settings_path(application_setting: { version_check_enabled: 0, usage_ping_enabled: 0 }) - not_now_path = admin_application_settings_path(application_setting: { version_check_enabled: 0, usage_ping_enabled: 0 })
= link_to _("Send usage data"), send_usage_data_path, 'data-url' => admin_application_settings_path, method: :put, 'data-check-enabled': true, 'data-ping-enabled': true, class: 'js-usage-consent-action alert-link btn gl-button btn-info' = link_to _("Send service data"), send_service_data_path, 'data-url' => admin_application_settings_path, method: :put, 'data-check-enabled': true, 'data-service-ping-enabled': true, class: 'js-service-ping-consent-action alert-link btn gl-button btn-info'
= link_to _("Don't send usage data"), not_now_path, 'data-url' => admin_application_settings_path, method: :put, 'data-check-enabled': false, 'data-ping-enabled': false, class: 'js-usage-consent-action alert-link btn gl-button btn-default gl-ml-2' = link_to _("Don't send service data"), not_now_path, 'data-url' => admin_application_settings_path, method: :put, 'data-check-enabled': false, 'data-service-ping-enabled': false, class: 'js-service-ping-consent-action alert-link btn gl-button btn-default gl-ml-2'
...@@ -839,6 +839,9 @@ msgid_plural "%{securityScanner} results are not available because a pipeline ha ...@@ -839,6 +839,9 @@ msgid_plural "%{securityScanner} results are not available because a pipeline ha
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "%{service_ping_link_start}Learn more%{service_ping_link_end} about what information is shared with GitLab Inc."
msgstr ""
msgid "%{size} %{unit}" msgid "%{size} %{unit}"
msgstr "" msgstr ""
...@@ -972,9 +975,6 @@ msgstr "" ...@@ -972,9 +975,6 @@ msgstr ""
msgid "%{total} warnings found: showing first %{warningsDisplayed}" msgid "%{total} warnings found: showing first %{warningsDisplayed}"
msgstr "" msgstr ""
msgid "%{usage_ping_link_start}Learn more%{usage_ping_link_end} about what information is shared with GitLab Inc."
msgstr ""
msgid "%{userName} (cannot merge)" msgid "%{userName} (cannot merge)"
msgstr "" msgstr ""
...@@ -11482,7 +11482,7 @@ msgstr "" ...@@ -11482,7 +11482,7 @@ msgstr ""
msgid "Don't paste the private part of the GPG key. Paste the public part which begins with '-----BEGIN PGP PUBLIC KEY BLOCK-----'." msgid "Don't paste the private part of the GPG key. Paste the public part which begins with '-----BEGIN PGP PUBLIC KEY BLOCK-----'."
msgstr "" msgstr ""
msgid "Don't send usage data" msgid "Don't send service data"
msgstr "" msgstr ""
msgid "Don't show again" msgid "Don't show again"
...@@ -12034,7 +12034,7 @@ msgstr "" ...@@ -12034,7 +12034,7 @@ msgstr ""
msgid "Enable or disable the Pseudonymizer data collection." msgid "Enable or disable the Pseudonymizer data collection."
msgstr "" msgstr ""
msgid "Enable or disable version check and usage ping." msgid "Enable or disable version check and service ping."
msgstr "" msgstr ""
msgid "Enable protected paths rate limit" msgid "Enable protected paths rate limit"
...@@ -12052,6 +12052,9 @@ msgstr "" ...@@ -12052,6 +12052,9 @@ msgstr ""
msgid "Enable reCAPTCHA, Invisible Captcha, Akismet and set IP limits. For reCAPTCHA, we currently only support %{recaptcha_v2_link_start}v2%{recaptcha_v2_link_end}" msgid "Enable reCAPTCHA, Invisible Captcha, Akismet and set IP limits. For reCAPTCHA, we currently only support %{recaptcha_v2_link_start}v2%{recaptcha_v2_link_end}"
msgstr "" msgstr ""
msgid "Enable service ping"
msgstr ""
msgid "Enable shared runners for all projects and subgroups in this group." msgid "Enable shared runners for all projects and subgroups in this group."
msgstr "" msgstr ""
...@@ -12076,9 +12079,6 @@ msgstr "" ...@@ -12076,9 +12079,6 @@ msgstr ""
msgid "Enable unauthenticated request rate limit" msgid "Enable unauthenticated request rate limit"
msgstr "" msgstr ""
msgid "Enable usage ping"
msgstr ""
msgid "Enable version check" msgid "Enable version check"
msgstr "" msgstr ""
...@@ -14065,7 +14065,7 @@ msgstr "" ...@@ -14065,7 +14065,7 @@ msgstr ""
msgid "For more information, see the File Hooks documentation." msgid "For more information, see the File Hooks documentation."
msgstr "" msgstr ""
msgid "For more information, see the documentation on %{deactivating_usage_ping_link_start}deactivating the usage ping%{deactivating_usage_ping_link_end}." msgid "For more information, see the documentation on %{deactivating_service_ping_link_start}deactivating service ping%{deactivating_service_ping_link_end}."
msgstr "" msgstr ""
msgid "Forgot your password?" msgid "Forgot your password?"
...@@ -29339,7 +29339,7 @@ msgstr "" ...@@ -29339,7 +29339,7 @@ msgstr ""
msgid "Send report" msgid "Send report"
msgstr "" msgstr ""
msgid "Send usage data" msgid "Send service data"
msgstr "" msgstr ""
msgid "Sentry API URL" msgid "Sentry API URL"
...@@ -29465,6 +29465,9 @@ msgstr "" ...@@ -29465,6 +29465,9 @@ msgstr ""
msgid "Service URL" msgid "Service URL"
msgstr "" msgstr ""
msgid "Service ping is disabled, and cannot be configured through this form."
msgstr ""
msgid "ServiceDesk|Enable Service Desk" msgid "ServiceDesk|Enable Service Desk"
msgstr "" msgstr ""
...@@ -32538,9 +32541,6 @@ msgstr "" ...@@ -32538,9 +32541,6 @@ msgstr ""
msgid "The uploaded file was invalid. Supported file extensions are %{extensions}." msgid "The uploaded file was invalid. Supported file extensions are %{extensions}."
msgstr "" msgstr ""
msgid "The usage ping is disabled, and cannot be configured through this form."
msgstr ""
msgid "The user is being deleted." msgid "The user is being deleted."
msgstr "" msgstr ""
......
...@@ -567,7 +567,7 @@ RSpec.describe 'Admin updates settings' do ...@@ -567,7 +567,7 @@ RSpec.describe 'Admin updates settings' do
wait_for_requests wait_for_requests
expect(page).to have_selector '.js-usage-ping-payload' expect(page).to have_selector '.js-service-ping-payload'
expect(page).to have_button 'Hide payload' expect(page).to have_button 'Hide payload'
expect(page).to have_content expected_payload_content expect(page).to have_content expected_payload_content
end end
......
...@@ -27,7 +27,7 @@ RSpec.describe 'Usage stats consent' do ...@@ -27,7 +27,7 @@ RSpec.describe 'Usage stats consent' do
expect(page).to have_content(message) expect(page).to have_content(message)
click_link 'Send usage data' click_link 'Send service data'
expect(page).not_to have_content(message) expect(page).not_to have_content(message)
expect(page).to have_content('Application settings saved successfully') expect(page).to have_content('Application settings saved successfully')
......
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