diff --git a/.rubocop_manual_todo.yml b/.rubocop_manual_todo.yml index f47e76b858d..73fbbcb3909 100644 --- a/.rubocop_manual_todo.yml +++ b/.rubocop_manual_todo.yml @@ -2562,7 +2562,6 @@ Style/OpenStructUse: - 'lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb' - 'lib/gitlab/testing/request_inspector_middleware.rb' - 'lib/mattermost/session.rb' - - 'spec/bin/feature_flag_spec.rb' - 'spec/controllers/admin/clusters_controller_spec.rb' - 'spec/controllers/groups/clusters_controller_spec.rb' - 'spec/controllers/import/fogbugz_controller_spec.rb' @@ -2580,8 +2579,6 @@ Style/OpenStructUse: - 'spec/graphql/mutations/clusters/agents/delete_spec.rb' - 'spec/graphql/mutations/commits/create_spec.rb' - 'spec/graphql/mutations/merge_requests/accept_spec.rb' - - 'spec/graphql/mutations/merge_requests/create_spec.rb' - - 'spec/graphql/types/range_input_type_spec.rb' - 'spec/helpers/application_settings_helper_spec.rb' - 'spec/helpers/profiles_helper_spec.rb' - 'spec/initializers/doorkeeper_spec.rb' @@ -2590,7 +2587,6 @@ Style/OpenStructUse: - 'spec/lib/gitlab/database/migrations/runner_spec.rb' - 'spec/lib/gitlab/gitaly_client/blobs_stitcher_spec.rb' - 'spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb' - - 'spec/lib/gitlab/graphql/pagination/keyset/connection_generic_keyset_spec.rb' - 'spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb' - 'spec/lib/gitlab/legacy_github_import/project_creator_spec.rb' - 'spec/lib/gitlab/quick_actions/command_definition_spec.rb' diff --git a/app/assets/javascripts/repository/components/blob_button_group.vue b/app/assets/javascripts/repository/components/blob_button_group.vue index e2ba5cea6cc..de6156d48dc 100644 --- a/app/assets/javascripts/repository/components/blob_button_group.vue +++ b/app/assets/javascripts/repository/components/blob_button_group.vue @@ -53,6 +53,10 @@ export default { type: Boolean, required: true, }, + canPushToBranch: { + type: Boolean, + required: true, + }, emptyRepo: { type: Boolean, required: true, @@ -126,6 +130,7 @@ export default { :target-branch="targetBranch || ref" :original-branch="originalBranch || ref" :can-push-code="canPushCode" + :can-push-to-branch="canPushToBranch" :empty-repo="emptyRepo" /> diff --git a/app/assets/javascripts/repository/components/blob_content_viewer.vue b/app/assets/javascripts/repository/components/blob_content_viewer.vue index 2cc5a8a79d2..cea95645fa4 100644 --- a/app/assets/javascripts/repository/components/blob_content_viewer.vue +++ b/app/assets/javascripts/repository/components/blob_content_viewer.vue @@ -106,6 +106,7 @@ export default { ideForkAndEditPath: '', storedExternally: false, canModifyBlob: false, + canCurrentUserPushToBranch: false, rawPath: '', externalStorageUrl: '', replacePath: '', @@ -266,6 +267,7 @@ export default { :replace-path="blobInfo.replacePath" :delete-path="blobInfo.webPath" :can-push-code="project.userPermissions.pushCode" + :can-push-to-branch="blobInfo.canCurrentUserPushToBranch" :empty-repo="project.repository.empty" :project-path="projectPath" :is-locked="isLocked" diff --git a/app/assets/javascripts/repository/components/delete_blob_modal.vue b/app/assets/javascripts/repository/components/delete_blob_modal.vue index e15f9b01c62..0d3dc06c2c8 100644 --- a/app/assets/javascripts/repository/components/delete_blob_modal.vue +++ b/app/assets/javascripts/repository/components/delete_blob_modal.vue @@ -71,6 +71,10 @@ export default { type: Boolean, required: true, }, + canPushToBranch: { + type: Boolean, + required: true, + }, emptyRepo: { type: Boolean, required: true, @@ -176,9 +180,12 @@ export default {