diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 00:08:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 00:08:57 +0300 |
commit | 22f0adb0e722aab66281a572008e01816b90af5b (patch) | |
tree | 59a79e16093c455394a515d74d70e9e451b75da3 /app | |
parent | 3f0db3db2ad99a74c3969bf2e930814004ccf1ec (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
9 files changed, 32 insertions, 16 deletions
diff --git a/app/assets/javascripts/pages/admin/abuse_reports/index.js b/app/assets/javascripts/pages/admin/abuse_reports/index.js index a88d35796f7..ab29f9149f7 100644 --- a/app/assets/javascripts/pages/admin/abuse_reports/index.js +++ b/app/assets/javascripts/pages/admin/abuse_reports/index.js @@ -5,4 +5,4 @@ import AbuseReports from './abuse_reports'; new AbuseReports(); /* eslint-disable-line no-new */ new UsersSelect(); /* eslint-disable-line no-new */ -document.addEventListener('DOMContentLoaded', initDeprecatedRemoveRowBehavior); +initDeprecatedRemoveRowBehavior(); diff --git a/app/assets/javascripts/pages/admin/application_settings/metrics_and_profiling/index.js b/app/assets/javascripts/pages/admin/application_settings/metrics_and_profiling/index.js index a2fca238613..a5305777dd5 100644 --- a/app/assets/javascripts/pages/admin/application_settings/metrics_and_profiling/index.js +++ b/app/assets/javascripts/pages/admin/application_settings/metrics_and_profiling/index.js @@ -1,3 +1,3 @@ import setup from '~/admin/application_settings/setup_metrics_and_profiling'; -document.addEventListener('DOMContentLoaded', setup); +setup(); diff --git a/app/assets/javascripts/pages/admin/integrations/edit/index.js b/app/assets/javascripts/pages/admin/integrations/edit/index.js index ba4b271f09e..8002fa8bf78 100644 --- a/app/assets/javascripts/pages/admin/integrations/edit/index.js +++ b/app/assets/javascripts/pages/admin/integrations/edit/index.js @@ -1,7 +1,7 @@ import IntegrationSettingsForm from '~/integrations/integration_settings_form'; import PrometheusMetrics from '~/prometheus_metrics/prometheus_metrics'; -document.addEventListener('DOMContentLoaded', () => { +function initIntegrations() { const prometheusSettingsWrapper = document.querySelector('.js-prometheus-metrics-monitoring'); const integrationSettingsForm = new IntegrationSettingsForm('.js-integration-settings-form'); integrationSettingsForm.init(); @@ -10,4 +10,6 @@ document.addEventListener('DOMContentLoaded', () => { const prometheusMetrics = new PrometheusMetrics('.js-prometheus-metrics-monitoring'); prometheusMetrics.loadActiveMetrics(); } -}); +} + +initIntegrations(); diff --git a/app/assets/javascripts/pages/admin/jobs/index/index.js b/app/assets/javascripts/pages/admin/jobs/index/index.js index 46ddb95299d..a4d89889d57 100644 --- a/app/assets/javascripts/pages/admin/jobs/index/index.js +++ b/app/assets/javascripts/pages/admin/jobs/index/index.js @@ -5,7 +5,7 @@ import stopJobsModal from './components/stop_jobs_modal.vue'; Vue.use(Translate); -document.addEventListener('DOMContentLoaded', () => { +function initJobs() { const buttonId = 'js-stop-jobs-button'; const modalId = 'stop-jobs-modal'; const stopJobsButton = document.getElementById(buttonId); @@ -31,4 +31,6 @@ document.addEventListener('DOMContentLoaded', () => { }, }); } -}); +} + +initJobs(); diff --git a/app/assets/javascripts/pages/admin/labels/index/index.js b/app/assets/javascripts/pages/admin/labels/index/index.js index 17ee7c03ed6..0ceab3b922f 100644 --- a/app/assets/javascripts/pages/admin/labels/index/index.js +++ b/app/assets/javascripts/pages/admin/labels/index/index.js @@ -1,4 +1,4 @@ -document.addEventListener('DOMContentLoaded', () => { +function initLabels() { const pagination = document.querySelector('.labels .gl-pagination'); const emptyState = document.querySelector('.labels .nothing-here-block.hidden'); @@ -18,4 +18,6 @@ document.addEventListener('DOMContentLoaded', () => { document.querySelectorAll('.js-remove-label').forEach((row) => { row.addEventListener('ajax:success', removeLabelSuccessCallback); }); -}); +} + +initLabels(); diff --git a/app/assets/javascripts/pages/admin/spam_logs/index.js b/app/assets/javascripts/pages/admin/spam_logs/index.js index e5ab5d43bbf..ac850a6467b 100644 --- a/app/assets/javascripts/pages/admin/spam_logs/index.js +++ b/app/assets/javascripts/pages/admin/spam_logs/index.js @@ -1,3 +1,3 @@ import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior'; -document.addEventListener('DOMContentLoaded', initDeprecatedRemoveRowBehavior); +initDeprecatedRemoveRowBehavior(); diff --git a/app/graphql/types/project_type.rb b/app/graphql/types/project_type.rb index 7e4c0c03dd6..968635f9e6e 100644 --- a/app/graphql/types/project_type.rb +++ b/app/graphql/types/project_type.rb @@ -59,8 +59,6 @@ module Types field :visibility, GraphQL::STRING_TYPE, null: true, description: 'Visibility of the project.' - field :container_registry_enabled, GraphQL::BOOLEAN_TYPE, null: true, - description: 'Indicates if the project stores Docker container images in a container registry.' field :shared_runners_enabled, GraphQL::BOOLEAN_TYPE, null: true, description: 'Indicates if shared runners are enabled for the project.' field :lfs_enabled, GraphQL::BOOLEAN_TYPE, null: true, @@ -77,9 +75,15 @@ module Types field :avatar_url, GraphQL::STRING_TYPE, null: true, calls_gitaly: true, description: 'URL to avatar image file of the project.' - %i[issues merge_requests wiki snippets].each do |feature| + { + issues: "Issues are", + merge_requests: "Merge Requests are", + wiki: 'Wikis are', + snippets: 'Snippets are', + container_registry: 'Container Registry is' + }.each do |feature, name_string| field "#{feature}_enabled", GraphQL::BOOLEAN_TYPE, null: true, - description: "Indicates if #{feature.to_s.titleize.pluralize} are enabled for the current user" + description: "Indicates if #{name_string} enabled for the current user" define_method "#{feature}_enabled" do object.feature_available?(feature, context[:current_user]) diff --git a/app/models/project.rb b/app/models/project.rb index 6d99fa31c3d..9e6e29aadda 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -417,7 +417,7 @@ class Project < ApplicationRecord delegate :scheduled?, :started?, :in_progress?, :failed?, :finished?, prefix: :import, to: :import_state, allow_nil: true delegate :squash_always?, :squash_never?, :squash_enabled_by_default?, :squash_readonly?, to: :project_setting - delegate :squash_option, to: :project_setting + delegate :squash_option, :squash_option=, to: :project_setting delegate :previous_default_branch, :previous_default_branch=, to: :project_setting delegate :no_import?, to: :import_state, allow_nil: true delegate :name, to: :owner, allow_nil: true, prefix: true diff --git a/app/services/projects/lfs_pointers/lfs_download_service.rb b/app/services/projects/lfs_pointers/lfs_download_service.rb index cf52b47a15e..fe9dce26029 100644 --- a/app/services/projects/lfs_pointers/lfs_download_service.rb +++ b/app/services/projects/lfs_pointers/lfs_download_service.rb @@ -61,8 +61,10 @@ module Projects def download_and_save_file!(file) digester = Digest::SHA256.new fetch_file do |fragment| - digester << fragment - file.write(fragment) + if digest_fragment?(fragment) + digester << fragment + file.write(fragment) + end raise_size_error! if file.size > lfs_size end @@ -71,6 +73,10 @@ module Projects raise_oid_error! if digester.hexdigest != lfs_oid end + def digest_fragment?(fragment) + fragment.http_response.is_a?(Net::HTTPSuccess) + end + def download_options http_options = { headers: lfs_headers, stream_body: true } |