Commit 4806c858 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-09-20

# Conflicts:
#	app/controllers/admin/application_settings_controller.rb
#	config/routes/admin.rb
#	locale/gitlab.pot
#	spec/features/admin/admin_settings_spec.rb

[ci skip]
parents 62314647 00057a75
......@@ -100,7 +100,10 @@ export default {
discussionsData.forEach(discussion => {
if (discussion.diff_file) {
Object.assign(discussion, { fileHash: discussion.diff_file.file_hash });
Object.assign(discussion, {
fileHash: discussion.diff_file.file_hash,
truncated_diff_lines: discussion.truncated_diff_lines || [],
});
}
// To support legacy notes, should be very rare case.
......
class Admin::ApplicationSettingsController < Admin::ApplicationController
include InternalRedirect
<<<<<<< HEAD
prepend EE::Admin::ApplicationSettingsController
=======
>>>>>>> upstream/master
before_action :set_application_setting
def show
......
---
title: Split admin settings into multiple sub pages
merge_request: 21467
author:
type: other
......@@ -125,11 +125,14 @@ namespace :admin do
put :reset_health_check_token
put :clear_repository_check_states
get :integrations, :repository, :templates, :ci_cd, :reporting, :metrics_and_profiling, :network, :geo, :preferences
<<<<<<< HEAD
end
## EE-specific
resource :license, only: [:show, :new, :create, :destroy] do
get :download, on: :member
=======
>>>>>>> upstream/master
end
resources :geo_nodes, only: [:index, :create, :new, :edit, :update]
......
......@@ -1280,9 +1280,12 @@ msgstr ""
msgid "CI / CD Settings"
msgstr ""
<<<<<<< HEAD
msgid "CI will run using the credentials assigned above."
msgstr ""
=======
>>>>>>> upstream/master
msgid "CI/CD"
msgstr ""
......@@ -3347,6 +3350,7 @@ msgstr ""
msgid "Geo"
msgstr ""
<<<<<<< HEAD
msgid "Geo Nodes"
msgstr ""
......@@ -3623,6 +3627,8 @@ msgstr ""
msgid "Get a free instance review"
msgstr ""
=======
>>>>>>> upstream/master
msgid "Git"
msgstr ""
......@@ -4681,9 +4687,12 @@ msgstr ""
msgid "Metrics and profiling"
msgstr ""
<<<<<<< HEAD
msgid "Metrics|Business"
msgstr ""
=======
>>>>>>> upstream/master
msgid "Metrics|Check out the CI/CD documentation on deploying to an environment"
msgstr ""
......@@ -6307,9 +6316,12 @@ msgstr ""
msgid "Reply to this email directly or %{view_it_on_gitlab}."
msgstr ""
<<<<<<< HEAD
msgid "Repo by URL"
msgstr ""
=======
>>>>>>> upstream/master
msgid "Reporting"
msgstr ""
......
......@@ -80,9 +80,15 @@ describe 'Admin updates settings' do
select 'Are forbidden', from: 'ED25519 SSH keys'
click_on 'Save changes'
end
<<<<<<< HEAD
forbidden = ApplicationSetting::FORBIDDEN_KEY_VALUE.to_s
=======
forbidden = ApplicationSetting::FORBIDDEN_KEY_VALUE.to_s
>>>>>>> upstream/master
expect(page).to have_content 'Application settings saved successfully'
expect(find_field('RSA SSH keys').value).to eq(forbidden)
expect(find_field('DSA SSH keys').value).to eq('0')
......@@ -192,6 +198,7 @@ describe 'Admin updates settings' do
end
end
<<<<<<< HEAD
describe 'LDAP settings' do
context 'with LDAP enabled' do
it 'Change allow group owners to manage ldap' do
......@@ -257,6 +264,60 @@ describe 'Admin updates settings' do
end
end
context 'CI/CD page' do
it 'Change CI/CD settings' do
visit ci_cd_admin_application_settings_path
page.within('.as-ci-cd') do
check 'Default to Auto DevOps pipeline for all projects'
fill_in 'Auto devops domain', with: 'domain.com'
click_button 'Save changes'
end
expect(Gitlab::CurrentSettings.auto_devops_enabled?).to be true
expect(Gitlab::CurrentSettings.auto_devops_domain).to eq('domain.com')
expect(page).to have_content "Application settings saved successfully"
=======
context 'Integrations page' do
before do
visit integrations_admin_application_settings_path
end
it 'Enable hiding third party offers' do
page.within('.as-third-party-offers') do
check 'Do not display offers from third parties within GitLab'
click_button 'Save changes'
end
expect(page).to have_content "Application settings saved successfully"
expect(Gitlab::CurrentSettings.hide_third_party_offers).to be true
end
it 'Change Slack Notifications Service template settings' do
first(:link, 'Service Templates').click
click_link 'Slack notifications'
fill_in 'Webhook', with: 'http://localhost'
fill_in 'Username', with: 'test_user'
fill_in 'service_push_channel', with: '#test_channel'
page.check('Notify only broken pipelines')
page.check('Notify only default branch')
check_all_events
click_on 'Save'
expect(page).to have_content 'Application settings saved successfully'
click_link 'Slack notifications'
page.all('input[type=checkbox]').each do |checkbox|
expect(checkbox).to be_checked
end
expect(find_field('Webhook').value).to eq 'http://localhost'
expect(find_field('Username').value).to eq 'test_user'
expect(find('#service_push_channel').value).to eq '#test_channel'
end
end
context 'CI/CD page' do
it 'Change CI/CD settings' do
visit ci_cd_admin_application_settings_path
......@@ -291,6 +352,32 @@ describe 'Admin updates settings' do
end
end
context 'Metrics and profiling page' do
before do
visit metrics_and_profiling_admin_application_settings_path
>>>>>>> upstream/master
end
end
context 'Reporting page' do
it 'Change Spam settings' do
visit reporting_admin_application_settings_path
<<<<<<< HEAD
page.within('.as-spam') do
check 'Enable reCAPTCHA'
fill_in 'reCAPTCHA Site Key', with: 'key'
fill_in 'reCAPTCHA Private Key', with: 'key'
fill_in 'IPs per user', with: 15
click_button 'Save changes'
end
expect(page).to have_content "Application settings saved successfully"
expect(Gitlab::CurrentSettings.recaptcha_enabled).to be true
expect(Gitlab::CurrentSettings.unique_ips_limit_per_user).to eq(15)
end
end
context 'Metrics and profiling page' do
before do
visit metrics_and_profiling_admin_application_settings_path
......@@ -334,6 +421,46 @@ describe 'Admin updates settings' do
click_on 'Save changes'
end
=======
it 'Change Influx settings' do
page.within('.as-influx') do
check 'Enable InfluxDB Metrics'
click_button 'Save changes'
end
expect(Gitlab::CurrentSettings.metrics_enabled?).to be true
expect(page).to have_content "Application settings saved successfully"
end
it 'Change Prometheus settings' do
page.within('.as-prometheus') do
check 'Enable Prometheus Metrics'
click_button 'Save changes'
end
expect(Gitlab::CurrentSettings.prometheus_metrics_enabled?).to be true
expect(page).to have_content "Application settings saved successfully"
end
it 'Change Performance bar settings' do
group = create(:group)
page.within('.as-performance-bar') do
check 'Enable the Performance Bar'
fill_in 'Allowed group', with: group.path
click_on 'Save changes'
end
expect(page).to have_content "Application settings saved successfully"
expect(find_field('Enable the Performance Bar')).to be_checked
expect(find_field('Allowed group').value).to eq group.path
page.within('.as-performance-bar') do
uncheck 'Enable the Performance Bar'
click_on 'Save changes'
end
>>>>>>> upstream/master
expect(page).to have_content 'Application settings saved successfully'
expect(find_field('Enable the Performance Bar')).not_to be_checked
expect(find_field('Allowed group').value).to be_nil
......@@ -381,6 +508,21 @@ describe 'Admin updates settings' do
expect(Gitlab::CurrentSettings.help_page_support_url).to eq "http://example.com/help"
expect(page).to have_content "Application settings saved successfully"
end
<<<<<<< HEAD
it 'Change Pages settings' do
page.within('.as-pages') do
fill_in 'Maximum size of pages (MB)', with: 15
check 'Require users to prove ownership of custom domains'
click_button 'Save changes'
end
expect(Gitlab::CurrentSettings.max_pages_size).to eq 15
expect(Gitlab::CurrentSettings.pages_domain_verification_enabled?).to be_truthy
expect(page).to have_content "Application settings saved successfully"
end
=======
it 'Change Pages settings' do
page.within('.as-pages') do
......@@ -394,6 +536,7 @@ describe 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
>>>>>>> upstream/master
it 'Change Background jobs settings' do
page.within('.as-background') do
fill_in 'Throttling Factor', with: 1
......
......@@ -156,6 +156,41 @@ describe('Notes Store mutations', () => {
expect(state.discussions[2].notes[0].note).toBe(legacyNote.notes[1].note);
expect(state.discussions.length).toEqual(3);
});
it('adds truncated_diff_lines if discussion is a diffFile', () => {
const state = {
discussions: [],
};
mutations.SET_INITIAL_DISCUSSIONS(state, [
{
...note,
diff_file: {
file_hash: 'a',
},
truncated_diff_lines: ['a'],
},
]);
expect(state.discussions[0].truncated_diff_lines).toEqual(['a']);
});
it('adds empty truncated_diff_lines when not in discussion', () => {
const state = {
discussions: [],
};
mutations.SET_INITIAL_DISCUSSIONS(state, [
{
...note,
diff_file: {
file_hash: 'a',
},
},
]);
expect(state.discussions[0].truncated_diff_lines).toEqual([]);
});
});
describe('SET_LAST_FETCHED_AT', () => {
......
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