diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-26 18:08:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-26 18:08:16 +0300 |
commit | e80e0dd64fbb04f60394cb1bb08e17dbcb22b8ce (patch) | |
tree | 9e538341b9b77e96737964813e10235dbecf47ff /app | |
parent | ef31adeb0fb9a02b2c6a4529ec4e38d7082a4b2b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/repository/components/table/row.vue | 2 | ||||
-rw-r--r-- | app/graphql/mutations/concerns/mutations/resolves_issuable.rb | 10 | ||||
-rw-r--r-- | app/models/clusters/applications/runner.rb | 2 | ||||
-rw-r--r-- | app/models/member.rb | 1 | ||||
-rw-r--r-- | app/models/user.rb | 8 |
5 files changed, 19 insertions, 4 deletions
diff --git a/app/assets/javascripts/repository/components/table/row.vue b/app/assets/javascripts/repository/components/table/row.vue index 9cf42b34974..a057913fd5a 100644 --- a/app/assets/javascripts/repository/components/table/row.vue +++ b/app/assets/javascripts/repository/components/table/row.vue @@ -141,7 +141,7 @@ export default { data-qa-selector="file_name_link" > <i - v-if="!loadingPath" + v-if="path !== loadingPath" :aria-label="type" role="img" :class="iconName" diff --git a/app/graphql/mutations/concerns/mutations/resolves_issuable.rb b/app/graphql/mutations/concerns/mutations/resolves_issuable.rb index 3a4db5ae18d..d63cc27a450 100644 --- a/app/graphql/mutations/concerns/mutations/resolves_issuable.rb +++ b/app/graphql/mutations/concerns/mutations/resolves_issuable.rb @@ -6,19 +6,25 @@ module Mutations include Mutations::ResolvesProject def resolve_issuable(type:, parent_path:, iid:) - parent = resolve_issuable_parent(parent_path) + parent = resolve_issuable_parent(type, parent_path) issuable_resolver(type, parent, context).resolve(iid: iid.to_s) end + private + def issuable_resolver(type, parent, context) resolver_class = "Resolvers::#{type.to_s.classify.pluralize}Resolver".constantize resolver_class.single.new(object: parent, context: context, field: nil) end - def resolve_issuable_parent(parent_path) + def resolve_issuable_parent(type, parent_path) + return unless type == :issue || type == :merge_request + resolve_project(full_path: parent_path) end end end + +Mutations::ResolvesIssuable.prepend_if_ee('::EE::Mutations::ResolvesIssuable') diff --git a/app/models/clusters/applications/runner.rb b/app/models/clusters/applications/runner.rb index 4886f2debb1..7d67e258991 100644 --- a/app/models/clusters/applications/runner.rb +++ b/app/models/clusters/applications/runner.rb @@ -3,7 +3,7 @@ module Clusters module Applications class Runner < ApplicationRecord - VERSION = '0.14.0' + VERSION = '0.15.0' self.table_name = 'clusters_applications_runners' diff --git a/app/models/member.rb b/app/models/member.rb index a87efdf63ff..5aa5655fc4a 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -468,6 +468,7 @@ class Member < ApplicationRecord # for a Member to be commited before attempting to update the highest role. # rubocop: disable CodeReuse/ServiceClass def update_highest_role + return unless Feature.enabled?(:highest_role_callback) return unless user_id.present? return unless previous_changes[:access_level].present? diff --git a/app/models/user.rb b/app/models/user.rb index 65ff4c98b15..8709bfb18fd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -217,6 +217,7 @@ class User < ApplicationRecord before_save :check_for_verified_email, if: ->(user) { user.email_changed? && !user.new_record? } before_validation :ensure_namespace_correct before_save :ensure_namespace_correct # in case validation is skipped + before_save :ensure_bio_is_assigned_to_user_details, if: :bio_changed? after_validation :set_username_errors after_update :username_changed_hook, if: :saved_change_to_username? after_destroy :post_destroy_hook @@ -1262,6 +1263,13 @@ class User < ApplicationRecord end end + # Temporary, will be removed when bio is fully migrated + def ensure_bio_is_assigned_to_user_details + return if Feature.disabled?(:migrate_bio_to_user_details, default_enabled: true) + + user_detail.bio = bio.to_s[0...255] # bio can be NULL in users, but cannot be NULL in user_details + end + def set_username_errors namespace_path_errors = self.errors.delete(:"namespace.path") self.errors[:username].concat(namespace_path_errors) if namespace_path_errors |