diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-29 19:57:17 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-29 19:57:17 +0000 |
commit | 37e3c3bb33c3d331fceb2840cf3c1d3c466dcfa9 (patch) | |
tree | 9d3739f627b491b42ede6424acd11b589beed25f /app | |
parent | b55baf593e63db9be3f446ea0cca0281a69dd2e2 (diff) | |
download | gitlab-ce-37e3c3bb33c3d331fceb2840cf3c1d3c466dcfa9.tar.gz |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'app')
5 files changed, 10 insertions, 8 deletions
diff --git a/app/assets/javascripts/jira_import/components/jira_import_app.vue b/app/assets/javascripts/jira_import/components/jira_import_app.vue index 6222bd28c9d..60ddacd49dd 100644 --- a/app/assets/javascripts/jira_import/components/jira_import_app.vue +++ b/app/assets/javascripts/jira_import/components/jira_import_app.vue @@ -104,7 +104,6 @@ export default { variables: { input: { projectPath: this.projectPath, - startAt: 1, }, }, }) diff --git a/app/graphql/mutations/jira_import/import_users.rb b/app/graphql/mutations/jira_import/import_users.rb index c7225e1a99c..0d59537b903 100644 --- a/app/graphql/mutations/jira_import/import_users.rb +++ b/app/graphql/mutations/jira_import/import_users.rb @@ -19,10 +19,10 @@ module Mutations required: false, description: 'The index of the record the import should started at, default 0 (50 records returned)' - def resolve(project_path:, start_at:) + def resolve(project_path:, start_at: 0) project = authorized_find!(full_path: project_path) - service_response = ::JiraImport::UsersImporter.new(context[:current_user], project, start_at).execute + service_response = ::JiraImport::UsersImporter.new(context[:current_user], project, start_at.to_i).execute { jira_users: service_response.payload, diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index aa118a9bc45..ddaac37e7ed 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -262,7 +262,7 @@ module ApplicationSettingsHelper :login_recaptcha_protection_enabled, :receive_max_input_size, :repository_checks_enabled, - :repository_storages, + :repository_storages_weighted, :require_two_factor_authentication, :restricted_visibility_levels, :rsa_key_restriction, diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 425a0e05c7d..25b81aef45f 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -283,10 +283,6 @@ class ApplicationSetting < ApplicationRecord validates :allowed_key_types, presence: true - repository_storages_weighted_attributes.each do |attribute| - validates attribute, allow_nil: true, numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 100 } - end - validates_each :restricted_visibility_levels do |record, attr, value| value&.each do |level| unless Gitlab::VisibilityLevel.options.value?(level) diff --git a/app/models/application_setting_implementation.rb b/app/models/application_setting_implementation.rb index c489d11d462..73554ee8457 100644 --- a/app/models/application_setting_implementation.rb +++ b/app/models/application_setting_implementation.rb @@ -451,6 +451,13 @@ module ApplicationSettingImplementation invalid = repository_storages_weighted.keys - Gitlab.config.repositories.storages.keys errors.add(:repository_storages_weighted, "can't include: %{invalid_storages}" % { invalid_storages: invalid.join(", ") }) unless invalid.empty? + + repository_storages_weighted.each do |key, val| + next unless val.present? + + errors.add(:"repository_storages_weighted_#{key}", "value must be an integer") unless val.is_a?(Integer) + errors.add(:"repository_storages_weighted_#{key}", "value must be between 0 and 100") unless val.between?(0, 100) + end end def terms_exist |