Commit 9f5cec02 authored by Stan Hu's avatar Stan Hu

Merge branch 'ce-to-ee-2018-09-06' into 'master'

CE upstream - 2018-09-06 15:24 UTC

See merge request gitlab-org/gitlab-ee!7271
parents 6bcefd66 ca8dfd8f
import initSettingsPanels from '~/settings_panels'; import initSettingsPanels from '~/settings_panels';
import projectSelect from '~/project_select'; import projectSelect from '~/project_select';
import UsagePingPayload from './usage_ping_payload';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
// Initialize expandable settings panels // Initialize expandable settings panels
initSettingsPanels(); initSettingsPanels();
projectSelect(); projectSelect();
new UsagePingPayload(
document.querySelector('.js-usage-ping-payload-trigger'),
document.querySelector('.js-usage-ping-payload'),
).init();
}); });
import axios from '../../../lib/utils/axios_utils';
import { __ } from '../../../locale';
import flash from '../../../flash';
export default class UsagePingPayload {
constructor(trigger, container) {
this.trigger = trigger;
this.container = container;
this.isVisible = false;
this.isInserted = false;
}
init() {
this.spinner = this.trigger.querySelector('.js-spinner');
this.text = this.trigger.querySelector('.js-text');
this.trigger.addEventListener('click', event => {
event.preventDefault();
if (this.isVisible) return this.hidePayload();
return this.requestPayload();
});
}
requestPayload() {
if (this.isInserted) return this.showPayload();
this.spinner.classList.add('d-inline');
return axios
.get(this.container.dataset.endpoint, {
responseType: 'text',
})
.then(({ data }) => {
this.spinner.classList.remove('d-inline');
this.insertPayload(data);
})
.catch(() => {
this.spinner.classList.remove('d-inline');
flash(__('Error fetching usage ping data.'));
});
}
hidePayload() {
this.isVisible = false;
this.container.classList.add('d-none');
this.text.textContent = __('Preview payload');
}
showPayload() {
this.isVisible = true;
this.container.classList.remove('d-none');
this.text.textContent = __('Hide payload');
}
insertPayload(data) {
this.isInserted = true;
this.container.innerHTML = data;
this.showPayload();
}
}
import initUsagePing from './usage_ping';
document.addEventListener('DOMContentLoaded', initUsagePing);
import axios from '../../../lib/utils/axios_utils';
import { __ } from '../../../locale';
import flash from '../../../flash';
export default function UsagePing() {
const el = document.querySelector('.usage-data');
axios.get(el.dataset.endpoint, {
responseType: 'text',
}).then(({ data }) => {
el.innerHTML = data;
}).catch(() => flash(__('Error fetching usage ping data.')));
}
...@@ -4,3 +4,7 @@ ...@@ -4,3 +4,7 @@
padding-bottom: 46px; padding-bottom: 46px;
} }
} }
.usage-data {
max-height: 400px;
}
# frozen_string_literal: true # frozen_string_literal: true
class InstanceStatistics::CohortsController < InstanceStatistics::ApplicationController class InstanceStatistics::CohortsController < InstanceStatistics::ApplicationController
before_action :authenticate_usage_ping_enabled_or_admin!
def index def index
if Gitlab::CurrentSettings.usage_ping_enabled if Gitlab::CurrentSettings.usage_ping_enabled
cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do
...@@ -10,4 +12,8 @@ class InstanceStatistics::CohortsController < InstanceStatistics::ApplicationCon ...@@ -10,4 +12,8 @@ class InstanceStatistics::CohortsController < InstanceStatistics::ApplicationCon
@cohorts = CohortsSerializer.new.represent(cohorts_results) @cohorts = CohortsSerializer.new.represent(cohorts_results)
end end
end end
def authenticate_usage_ping_enabled_or_admin!
render_404 unless Gitlab::CurrentSettings.usage_ping_enabled || current_user.admin?
end
end end
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group .form-group.mb-2
.form-check .form-check
= f.check_box :version_check_enabled, class: 'form-check-input' = f.check_box :version_check_enabled, class: 'form-check-input'
= f.label :version_check_enabled, class: 'form-check-label' do = f.label :version_check_enabled, class: 'form-check-label' do
...@@ -16,23 +16,26 @@ ...@@ -16,23 +16,26 @@
.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 usage ping')
.form-text.text-muted .form-text.text-muted
- if can_be_configured - if can_be_configured
To help improve GitLab and its user experience, GitLab will %p.mb-2= _('To help improve GitLab and its user experience, GitLab will periodically collect usage information.')
periodically collect usage information.
= link_to 'Learn more', help_page_path("user/admin_area/settings/usage_statistics", anchor: "usage-ping") - usage_ping_path = help_page_path('user/admin_area/settings/usage_statistics', anchor: 'usage-ping')
about what information is shared with GitLab Inc. Visit - usage_ping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: usage_ping_path }
= link_to _('Cohorts'), instance_statistics_cohorts_path(anchor: 'usage-ping') %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 }
to see the JSON payload sent.
%button.btn.js-usage-ping-payload-trigger{ type: 'button' }
.js-spinner.d-none= icon('spinner spin')
.js-text.d-inline= _('Preview payload')
%pre.usage-data.js-usage-ping-payload.js-syntax-highlight.code.highlight.mt-2.d-none{ data: { endpoint: usage_data_admin_application_settings_path(format: :html) } }
- else - else
The usage ping is disabled, and cannot be configured through this = _('The usage ping is disabled, and cannot be configured through this form.')
form. For more information, see the documentation on - deactivating_usage_ping_path = help_page_path('user/admin_area/settings/usage_statistics', anchor: 'deactivate-the-usage-ping')
= succeed '.' do - deactivating_usage_ping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: deactivating_usage_ping_path }
= link_to 'deactivating the usage ping', help_page_path('user/admin_area/settings/usage_statistics', anchor: 'deactivate-the-usage-ping') = 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 }
.form-group .form-group.mt-3
= f.label :instance_statistics_visibility_private, _('Instance Statistics visibility') = f.label :instance_statistics_visibility_private, _('Instance Statistics visibility')
= f.select :instance_statistics_visibility_private, options_for_select({_('All users') => false, _('Only admins') => true}, Gitlab::CurrentSettings.instance_statistics_visibility_private?), {}, class: 'form-control' = f.select :instance_statistics_visibility_private, options_for_select({_('All users') => false, _('Only admins') => true}, Gitlab::CurrentSettings.instance_statistics_visibility_private?), {}, class: 'form-control'
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
- breadcrumb_title "Cohorts" - breadcrumb_title _("Cohorts")
- @no_container = true - @no_container = true
%div{ class: container_class } %div{ class: container_class }
- if @cohorts - if @cohorts
= render 'cohorts_table' = render 'cohorts_table'
= render 'usage_ping'
- else - else
.bs-callout.bs-callout-warning.clearfix .bs-callout.bs-callout-warning.clearfix
%p %p
User cohorts are only shown when the - usage_ping_path = help_page_path('user/admin_area/settings/usage_statistics', anchor: 'usage-ping')
= link_to 'usage ping', help_page_path('user/admin_area/settings/usage_statistics', anchor: 'usage-ping'), target: '_blank' - usage_ping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: usage_ping_path }
is enabled. To enable it and see user cohorts, = s_('User Cohorts are only shown when the %{usage_ping_link_start}usage ping%{usage_ping_link_end} is enabled.').html_safe % { usage_ping_link_start: usage_ping_link_start, usage_ping_link_end: '</a>'.html_safe }
visit - if current_user.admin?
= succeed '.' do - application_settings_path = admin_application_settings_path(anchor: 'usage-statistics')
= link_to 'application settings', admin_application_settings_path(anchor: 'usage-statistics') - application_settings_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: application_settings_path }
= s_('To enable it and see User Cohorts, visit %{application_settings_link_start}application settings%{application_settings_link_end}.').html_safe % { application_settings_link_start: application_settings_link_start, application_settings_link_end: '</a>'.html_safe }
.container.convdev-empty .container.convdev-empty
.col-sm-12.justify-content-center.text-center .col-sm-12.justify-content-center.text-center
= custom_icon('convdev_no_index') = custom_icon('convdev_no_index')
%h4 Usage ping is not enabled %h4= _('Usage ping is not enabled')
%p - if !current_user.admin?
ConvDev is only shown when the %p
= link_to 'usage ping', help_page_path('user/admin_area/settings/usage_statistics'), target: '_blank' - usage_ping_path = help_page_path('user/admin_area/settings/usage_statistics', anchor: 'usage-ping')
is enabled. Enable usage ping to get an overview of how you are using GitLab from a feature perspective - usage_ping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: usage_ping_path }
= link_to 'Enable usage ping', admin_application_settings_path(anchor: 'usage-statistics'), class: 'btn btn-primary' = s_('In order to enable instance-level analytics, please ask an admin to enable %{usage_ping_link_start}usage ping%{usage_ping_link_end}.').html_safe % { usage_ping_link_start: usage_ping_link_start, usage_ping_link_end: '</a>'.html_safe }
- if current_user.admin?
%p
= _('Enable usage ping to get an overview of how you are using GitLab from a feature perspective.')
- if current_user.admin?
= link_to _('Enable usage ping'), admin_application_settings_path(anchor: 'usage-statistics'), class: 'btn btn-primary'
- @no_container = true - @no_container = true
- page_title 'ConvDev Index' - page_title _('ConvDev Index')
- usage_ping_enabled = Gitlab::CurrentSettings.usage_ping_enabled
.container .container
- if show_callout?('convdev_intro_callout_dismissed') - if usage_ping_enabled && show_callout?('convdev_intro_callout_dismissed')
= render 'callout' = render 'callout'
.prepend-top-default .prepend-top-default
- if !Gitlab::CurrentSettings.usage_ping_enabled - if !usage_ping_enabled
= render 'disabled' = render 'disabled'
- elsif @metric.blank? - elsif @metric.blank?
= render 'no_data' = render 'no_data'
......
...@@ -18,16 +18,17 @@ ...@@ -18,16 +18,17 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('ConvDev Index') = _('ConvDev Index')
= nav_link(controller: :cohorts) do - if Gitlab::CurrentSettings.usage_ping_enabled
= link_to instance_statistics_cohorts_path do = nav_link(controller: :cohorts) do
.nav-icon-container = link_to instance_statistics_cohorts_path do
= sprite_icon('users') .nav-icon-container
%span.nav-item-name = sprite_icon('users')
= _('Cohorts') %span.nav-item-name
%ul.sidebar-sub-level-items.is-fly-out-only = _('Cohorts')
= nav_link(controller: :cohorts, html_options: { class: "fly-out-top-item" } ) do %ul.sidebar-sub-level-items.is-fly-out-only
= link_to instance_statistics_cohorts_path do = nav_link(controller: :cohorts, html_options: { class: "fly-out-top-item" } ) do
%strong.fly-out-top-item-name = link_to instance_statistics_cohorts_path do
= _('Cohorts') %strong.fly-out-top-item-name
= _('Cohorts')
= render 'shared/sidebar_toggle_button' = render 'shared/sidebar_toggle_button'
---
title: Recognize 'UNLICENSE' license files
merge_request: 21508
author: J.D. Bean
type: added
---
title: Move usage ping payload from User Cohorts page to admin application settings
merge_request: 21343
author:
type: other
---
title: Fix closing issue default pattern
merge_request: 21531
author: Samuele Kaplun
type: fixed
...@@ -94,7 +94,7 @@ production: &base ...@@ -94,7 +94,7 @@ production: &base
# This happens when the commit is pushed or merged into the default branch of a project. # This happens when the commit is pushed or merged into the default branch of a project.
# When not specified the default issue_closing_pattern as specified below will be used. # When not specified the default issue_closing_pattern as specified below will be used.
# Tip: you can test your closing pattern at http://rubular.com. # Tip: you can test your closing pattern at http://rubular.com.
# issue_closing_pattern: '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e[sd]|ing)?|[Rr]esolv(?:e[sd]?|ing)|[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?)|([A-Z][A-Z0-9_]+-\d+))+)' # issue_closing_pattern: '\b((?:[Cc]los(?:e[sd]?|ing)|\b[Ff]ix(?:e[sd]|ing)?|\b[Rr]esolv(?:e[sd]?|ing)|\b[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?)|([A-Z][A-Z0-9_]+-\d+))+)'
## Default project features settings ## Default project features settings
default_projects_features: default_projects_features:
......
...@@ -143,7 +143,7 @@ Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled']. ...@@ -143,7 +143,7 @@ Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled'].
Settings.gitlab['signin_enabled'] ||= true if Settings.gitlab['signin_enabled'].nil? Settings.gitlab['signin_enabled'] ||= true if Settings.gitlab['signin_enabled'].nil?
Settings.gitlab['restricted_visibility_levels'] = Settings.__send__(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], []) Settings.gitlab['restricted_visibility_levels'] = Settings.__send__(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], [])
Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil? Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
Settings.gitlab['issue_closing_pattern'] = '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e[sd]|ing)?|[Rr]esolv(?:e[sd]?|ing)|[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?: *,? +and +| *,? *)?)|([A-Z][A-Z0-9_]+-\d+))+)' if Settings.gitlab['issue_closing_pattern'].nil? Settings.gitlab['issue_closing_pattern'] = '\b((?:[Cc]los(?:e[sd]?|ing)|\b[Ff]ix(?:e[sd]|ing)?|\b[Rr]esolv(?:e[sd]?|ing)|\b[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?: *,? +and +| *,? *)?)|([A-Z][A-Z0-9_]+-\d+))+)' if Settings.gitlab['issue_closing_pattern'].nil?
Settings.gitlab['default_projects_features'] ||= {} Settings.gitlab['default_projects_features'] ||= {}
Settings.gitlab['webhook_timeout'] ||= 10 Settings.gitlab['webhook_timeout'] ||= 10
Settings.gitlab['max_attachment_size'] ||= 10 Settings.gitlab['max_attachment_size'] ||= 10
......
...@@ -28,7 +28,7 @@ Because Rubular doesn't understand `%{issue_ref}`, you can replace this by ...@@ -28,7 +28,7 @@ Because Rubular doesn't understand `%{issue_ref}`, you can replace this by
expression of your liking: expression of your liking:
```ruby ```ruby
gitlab_rails['gitlab_issue_closing_pattern'] = "((?:[Cc]los(?:e[sd]|ing)|[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?))+)" gitlab_rails['gitlab_issue_closing_pattern'] = "\b((?:[Cc]los(?:e[sd]|ing)|\b[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?))+)"
``` ```
1. [Reconfigure] GitLab for the changes to take effect. 1. [Reconfigure] GitLab for the changes to take effect.
...@@ -38,7 +38,7 @@ Because Rubular doesn't understand `%{issue_ref}`, you can replace this by ...@@ -38,7 +38,7 @@ Because Rubular doesn't understand `%{issue_ref}`, you can replace this by
1. Change the value of `issue_closing_pattern`: 1. Change the value of `issue_closing_pattern`:
```yaml ```yaml
issue_closing_pattern: "((?:[Cc]los(?:e[sd]|ing)|[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?))+)" issue_closing_pattern: "\b((?:[Cc]los(?:e[sd]|ing)|\b[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?))+)"
``` ```
1. [Restart] GitLab for the changes to take effect. 1. [Restart] GitLab for the changes to take effect.
......
...@@ -10,9 +10,6 @@ and can be accessed via the top bar. ...@@ -10,9 +10,6 @@ and can be accessed via the top bar.
![Instance Statistics button](img/instance_statistics_button.png) ![Instance Statistics button](img/instance_statistics_button.png)
For the statistics to show up, [usage ping must be enabled](../admin_area/settings/usage_statistics.md#usage-ping)
by an admin in the admin settings area.
There are two kinds of statistics: There are two kinds of statistics:
- [Conversational Development (ConvDev) Index](convdev.md): Provides an overview of your entire instance's feature usage. - [Conversational Development (ConvDev) Index](convdev.md): Provides an overview of your entire instance's feature usage.
......
...@@ -8,7 +8,7 @@ module Gitlab ...@@ -8,7 +8,7 @@ module Gitlab
# Project files # Project files
readme: %r{\Areadme[^/]*\z}i, readme: %r{\Areadme[^/]*\z}i,
changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i, changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i,
license: %r{\A(licen[sc]e|copying)(\.[^/]+)?\z}i, license: %r{\A((un)?licen[sc]e|copying)(\.[^/]+)?\z}i,
contributing: %r{\Acontributing[^/]*\z}i, contributing: %r{\Acontributing[^/]*\z}i,
version: 'version', version: 'version',
avatar: /\Alogo\.(png|jpg|gif)\z/, avatar: /\Alogo\.(png|jpg|gif)\z/,
......
...@@ -191,6 +191,9 @@ msgstr[1] "" ...@@ -191,6 +191,9 @@ msgstr[1] ""
msgid "%{unstaged} unstaged and %{staged} staged changes" msgid "%{unstaged} unstaged and %{staged} staged changes"
msgstr "" msgstr ""
msgid "%{usage_ping_link_start}Learn more%{usage_ping_link_end} about what information is shared with GitLab Inc."
msgstr ""
msgid "+ %{count} more" msgid "+ %{count} more"
msgstr "" msgstr ""
...@@ -2837,6 +2840,12 @@ msgstr "" ...@@ -2837,6 +2840,12 @@ msgstr ""
msgid "Enable the Performance Bar for a given group." msgid "Enable the Performance Bar for a given group."
msgstr "" msgstr ""
msgid "Enable usage ping"
msgstr ""
msgid "Enable usage ping to get an overview of how you are using GitLab from a feature perspective."
msgstr ""
msgid "Enabled" msgid "Enabled"
msgstr "" msgstr ""
...@@ -3248,6 +3257,9 @@ msgstr "" ...@@ -3248,6 +3257,9 @@ msgstr ""
msgid "For more information, go to the " msgid "For more information, go to the "
msgstr "" msgstr ""
msgid "For more information, see the documentation on %{deactivating_usage_ping_link_start}deactivating the usage ping%{deactivating_usage_ping_link_end}."
msgstr ""
msgid "For private projects, any member (guest or higher) can view pipelines and access job details (output logs and artifacts)" msgid "For private projects, any member (guest or higher) can view pipelines and access job details (output logs and artifacts)"
msgstr "" msgstr ""
...@@ -3881,6 +3893,9 @@ msgstr "" ...@@ -3881,6 +3893,9 @@ msgstr ""
msgid "Hide host keys manual input" msgid "Hide host keys manual input"
msgstr "" msgstr ""
msgid "Hide payload"
msgstr ""
msgid "Hide value" msgid "Hide value"
msgid_plural "Hide values" msgid_plural "Hide values"
msgstr[0] "" msgstr[0] ""
...@@ -4045,6 +4060,9 @@ msgstr "" ...@@ -4045,6 +4060,9 @@ msgstr ""
msgid "Improve search with Advanced Global Search and GitLab Enterprise Edition." msgid "Improve search with Advanced Global Search and GitLab Enterprise Edition."
msgstr "" msgstr ""
msgid "In order to enable instance-level analytics, please ask an admin to enable %{usage_ping_link_start}usage ping%{usage_ping_link_end}."
msgstr ""
msgid "In the next step, you'll be able to select the projects you want to import." msgid "In the next step, you'll be able to select the projects you want to import."
msgstr "" msgstr ""
...@@ -5522,6 +5540,9 @@ msgstr "" ...@@ -5522,6 +5540,9 @@ msgstr ""
msgid "Preview" msgid "Preview"
msgstr "" msgstr ""
msgid "Preview payload"
msgstr ""
msgid "Primary" msgid "Primary"
msgstr "" msgstr ""
...@@ -7176,6 +7197,9 @@ msgstr "" ...@@ -7176,6 +7197,9 @@ msgstr ""
msgid "The update action will time out after %{number_of_minutes} minutes. For big repositories, use a clone/push combination." msgid "The update action will time out after %{number_of_minutes} minutes. For big repositories, use a clone/push combination."
msgstr "" msgstr ""
msgid "The usage ping is disabled, and cannot be configured through this form."
msgstr ""
msgid "The user map is a JSON document mapping the Google Code users that participated on your projects to the way their email addresses and usernames will be imported into GitLab. You can change this by changing the value on the right hand side of <code>:</code>. Be sure to preserve the surrounding double quotes, other punctuation and the email address or username on the left hand side." msgid "The user map is a JSON document mapping the Google Code users that participated on your projects to the way their email addresses and usernames will be imported into GitLab. You can change this by changing the value on the right hand side of <code>:</code>. Be sure to preserve the surrounding double quotes, other punctuation and the email address or username on the left hand side."
msgstr "" msgstr ""
...@@ -7579,12 +7603,18 @@ msgstr "" ...@@ -7579,12 +7603,18 @@ msgstr ""
msgid "To define internal users, first enable new users set to external" msgid "To define internal users, first enable new users set to external"
msgstr "" msgstr ""
msgid "To enable it and see User Cohorts, visit %{application_settings_link_start}application settings%{application_settings_link_end}."
msgstr ""
msgid "To get started you enter your FogBugz URL and login information below. In the next steps, you'll be able to map users and select the projects you want to import." msgid "To get started you enter your FogBugz URL and login information below. In the next steps, you'll be able to map users and select the projects you want to import."
msgstr "" msgstr ""
msgid "To get started, please enter your Gitea Host URL and a %{link_to_personal_token}." msgid "To get started, please enter your Gitea Host URL and a %{link_to_personal_token}."
msgstr "" msgstr ""
msgid "To help improve GitLab and its user experience, GitLab will periodically collect usage information."
msgstr ""
msgid "To import GitHub repositories, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import." msgid "To import GitHub repositories, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import."
msgstr "" msgstr ""
...@@ -7798,6 +7828,9 @@ msgstr "" ...@@ -7798,6 +7828,9 @@ msgstr ""
msgid "Upvotes" msgid "Upvotes"
msgstr "" msgstr ""
msgid "Usage ping is not enabled"
msgstr ""
msgid "Usage statistics" msgid "Usage statistics"
msgstr "" msgstr ""
...@@ -7825,6 +7858,9 @@ msgstr "" ...@@ -7825,6 +7858,9 @@ msgstr ""
msgid "Used by members to sign in to your group in GitLab" msgid "Used by members to sign in to your group in GitLab"
msgstr "" msgstr ""
msgid "User Cohorts are only shown when the %{usage_ping_link_start}usage ping%{usage_ping_link_end} is enabled."
msgstr ""
msgid "User Settings" msgid "User Settings"
msgstr "" msgstr ""
......
...@@ -3,5 +3,19 @@ ...@@ -3,5 +3,19 @@
require 'spec_helper' require 'spec_helper'
describe InstanceStatistics::CohortsController do describe InstanceStatistics::CohortsController do
let(:user) { create(:user) }
before do
sign_in(user)
end
it_behaves_like 'instance statistics availability' it_behaves_like 'instance statistics availability'
it 'renders a 404 when the usage ping is disabled' do
stub_application_setting(usage_ping_enabled: false)
get :index
expect(response).to have_gitlab_http_status(:not_found)
end
end end
...@@ -361,6 +361,15 @@ describe 'Admin updates settings' do ...@@ -361,6 +361,15 @@ describe 'Admin updates settings' do
expect(find_field('ED25519 SSH keys').value).to eq(forbidden) expect(find_field('ED25519 SSH keys').value).to eq(forbidden)
end end
it 'loads usage ping payload on click', :js do
expect(page).to have_button 'Preview payload'
find('.js-usage-ping-payload-trigger').click
expect(page).to have_selector '.js-usage-ping-payload'
expect(page).to have_button 'Hide payload'
end
def check_all_events def check_all_events
page.check('Active') page.check('Active')
page.check('Push') page.check('Push')
......
...@@ -12,12 +12,4 @@ describe 'Cohorts page' do ...@@ -12,12 +12,4 @@ describe 'Cohorts page' do
expect(page).to have_content("#{Time.now.strftime('%b %Y')} 3 0") expect(page).to have_content("#{Time.now.strftime('%b %Y')} 3 0")
end end
it 'shows usage data', :js do
visit instance_statistics_cohorts_path
wait_for_requests
expect(find('.js-syntax-highlight').text).not_to eq('')
end
end end
...@@ -16,13 +16,21 @@ describe 'Conversational Development Index' do ...@@ -16,13 +16,21 @@ describe 'Conversational Development Index' do
end end
context 'when usage ping is disabled' do context 'when usage ping is disabled' do
it 'shows empty state' do before do
stub_application_setting(usage_ping_enabled: false) stub_application_setting(usage_ping_enabled: false)
end
it 'shows empty state' do
visit instance_statistics_conversational_development_index_index_path visit instance_statistics_conversational_development_index_index_path
expect(page).to have_content('Usage ping is not enabled') expect(page).to have_content('Usage ping is not enabled')
end end
it 'hides the intro callout' do
visit instance_statistics_conversational_development_index_index_path
expect(page).not_to have_content 'Introducing Your Conversational Development Index'
end
end end
context 'when there is no data to display' do context 'when there is no data to display' do
......
require 'rails_helper'
describe 'Cohorts page', :js do
before do
sign_in(create(:admin))
end
it 'hides cohorts nav button when usage ping is disabled' do
stub_application_setting(usage_ping_enabled: false)
visit instance_statistics_root_path
expect(find('.nav-sidebar')).not_to have_content('Cohorts')
end
it 'shows cohorts nav button when usage ping is enabled' do
stub_application_setting(usage_ping_enabled: true)
visit instance_statistics_root_path
expect(find('.nav-sidebar')).to have_content('Cohorts')
end
end
...@@ -338,6 +338,13 @@ describe Gitlab::ClosingIssueExtractor do ...@@ -338,6 +338,13 @@ describe Gitlab::ClosingIssueExtractor do
end end
end end
context "with an invalid keyword such as suffix insted of fix" do
it do
message = "suffix #{reference}"
expect(subject.closed_by_message(message)).to eq([])
end
end
context 'with multiple references' do context 'with multiple references' do
let(:other_issue) { create(:issue, project: project) } let(:other_issue) { create(:issue, project: project) }
let(:third_issue) { create(:issue, project: project) } let(:third_issue) { create(:issue, project: project) }
......
...@@ -29,11 +29,15 @@ describe Gitlab::FileDetector do ...@@ -29,11 +29,15 @@ describe Gitlab::FileDetector do
end end
it 'returns the type of a license file' do it 'returns the type of a license file' do
%w(LICENSE LICENCE COPYING).each do |file| %w(LICENSE LICENCE COPYING UNLICENSE UNLICENCE).each do |file|
expect(described_class.type_of(file)).to eq(:license) expect(described_class.type_of(file)).to eq(:license)
end end
end end
it 'returns nil for an UNCOPYING file' do
expect(described_class.type_of('UNCOPYING')).to be_nil
end
it 'returns the type of a version file' do it 'returns the type of a version file' do
expect(described_class.type_of('VERSION')).to eq(:version) expect(described_class.type_of('VERSION')).to eq(:version)
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