diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-10 12:08:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-10 12:08:06 +0300 |
commit | 74c7e01089dc2245462723574b102665ef3a6440 (patch) | |
tree | be0bd4200e2d3b078848df12bc2fd21f821d8b0d /app | |
parent | 2332c320452fb5190ccee17a255af305c1bb931e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/security_configuration/components/training_provider_list.vue | 23 | ||||
-rw-r--r-- | app/graphql/mutations/work_items/create.rb | 2 | ||||
-rw-r--r-- | app/graphql/mutations/work_items/create_from_task.rb | 2 | ||||
-rw-r--r-- | app/graphql/mutations/work_items/delete.rb | 2 | ||||
-rw-r--r-- | app/graphql/mutations/work_items/update.rb | 2 | ||||
-rw-r--r-- | app/graphql/resolvers/work_item_resolver.rb | 2 | ||||
-rw-r--r-- | app/graphql/resolvers/work_items/types_resolver.rb | 2 | ||||
-rw-r--r-- | app/graphql/types/query_type.rb | 3 | ||||
-rw-r--r-- | app/models/label.rb | 12 |
9 files changed, 39 insertions, 11 deletions
diff --git a/app/assets/javascripts/security_configuration/components/training_provider_list.vue b/app/assets/javascripts/security_configuration/components/training_provider_list.vue index 4b40e5a1e1d..bfdabc10227 100644 --- a/app/assets/javascripts/security_configuration/components/training_provider_list.vue +++ b/app/assets/javascripts/security_configuration/components/training_provider_list.vue @@ -1,5 +1,13 @@ <script> -import { GlAlert, GlCard, GlToggle, GlLink, GlSkeletonLoader } from '@gitlab/ui'; +import { + GlAlert, + GlTooltipDirective, + GlCard, + GlToggle, + GlLink, + GlSkeletonLoader, + GlIcon, +} from '@gitlab/ui'; import * as Sentry from '@sentry/browser'; import Tracking from '~/tracking'; import { __, s__ } from '~/locale'; @@ -25,6 +33,9 @@ const i18n = { 'Could not save configuration. Please refresh the page, or try again later.', ), primaryTraining: s__('SecurityTraining|Primary Training'), + primaryTrainingDescription: s__( + 'SecurityTraining|Training from this partner takes precedence when more than one training partner is enabled.', + ), }; // Fetch the svg path from the GraphQL query once this issue is resolved @@ -45,6 +56,10 @@ export default { GlToggle, GlLink, GlSkeletonLoader, + GlIcon, + }, + directives: { + GlTooltip: GlTooltipDirective, }, mixins: [Tracking.mixin()], inject: ['projectFullPath'], @@ -251,7 +266,6 @@ export default { :id="`security-training-provider-${provider.id}`" type="radio" :checked="provider.isPrimary" - name="radio-group-name" class="custom-control-input" :disabled="!provider.isEnabled" @change="setPrimaryProvider(provider)" @@ -262,6 +276,11 @@ export default { > {{ $options.i18n.primaryTraining }} </label> + <gl-icon + v-gl-tooltip="$options.i18n.primaryTrainingDescription" + name="information-o" + class="gl-ml-2 gl-cursor-help" + /> </div> </div> </div> diff --git a/app/graphql/mutations/work_items/create.rb b/app/graphql/mutations/work_items/create.rb index 81454db62b1..48f0f470988 100644 --- a/app/graphql/mutations/work_items/create.rb +++ b/app/graphql/mutations/work_items/create.rb @@ -33,7 +33,7 @@ module Mutations def resolve(project_path:, **attributes) project = authorized_find!(project_path) - unless Feature.enabled?(:work_items, project) + unless Feature.enabled?(:work_items, project, default_enabled: :yaml) return { errors: ['`work_items` feature flag disabled for this project'] } end diff --git a/app/graphql/mutations/work_items/create_from_task.rb b/app/graphql/mutations/work_items/create_from_task.rb index e55726fc0ac..16d1e646167 100644 --- a/app/graphql/mutations/work_items/create_from_task.rb +++ b/app/graphql/mutations/work_items/create_from_task.rb @@ -31,7 +31,7 @@ module Mutations def resolve(id:, work_item_data:) work_item = authorized_find!(id: id) - unless Feature.enabled?(:work_items, work_item.project) + unless Feature.enabled?(:work_items, work_item.project, default_enabled: :yaml) return { errors: ['`work_items` feature flag disabled for this project'] } end diff --git a/app/graphql/mutations/work_items/delete.rb b/app/graphql/mutations/work_items/delete.rb index 71792a802c0..f32354878ec 100644 --- a/app/graphql/mutations/work_items/delete.rb +++ b/app/graphql/mutations/work_items/delete.rb @@ -20,7 +20,7 @@ module Mutations def resolve(id:) work_item = authorized_find!(id: id) - unless Feature.enabled?(:work_items, work_item.project) + unless Feature.enabled?(:work_items, work_item.project, default_enabled: :yaml) return { errors: ['`work_items` feature flag disabled for this project'] } end diff --git a/app/graphql/mutations/work_items/update.rb b/app/graphql/mutations/work_items/update.rb index 3ab9ba2d502..2700cbdb709 100644 --- a/app/graphql/mutations/work_items/update.rb +++ b/app/graphql/mutations/work_items/update.rb @@ -28,7 +28,7 @@ module Mutations def resolve(id:, **attributes) work_item = authorized_find!(id: id) - unless Feature.enabled?(:work_items, work_item.project) + unless Feature.enabled?(:work_items, work_item.project, default_enabled: :yaml) return { errors: ['`work_items` feature flag disabled for this project'] } end diff --git a/app/graphql/resolvers/work_item_resolver.rb b/app/graphql/resolvers/work_item_resolver.rb index 6eb23916d83..7cf52339815 100644 --- a/app/graphql/resolvers/work_item_resolver.rb +++ b/app/graphql/resolvers/work_item_resolver.rb @@ -12,7 +12,7 @@ module Resolvers def resolve(id:) work_item = authorized_find!(id: id) - return unless Feature.enabled?(:work_items, work_item.project) + return unless Feature.enabled?(:work_items, work_item.project, default_enabled: :yaml) work_item end diff --git a/app/graphql/resolvers/work_items/types_resolver.rb b/app/graphql/resolvers/work_items/types_resolver.rb index acdcfe5ee70..67a9d57d42f 100644 --- a/app/graphql/resolvers/work_items/types_resolver.rb +++ b/app/graphql/resolvers/work_items/types_resolver.rb @@ -11,7 +11,7 @@ module Resolvers ' Argument is experimental and can be removed in the future without notice.' def resolve(taskable: nil) - return unless Feature.enabled?(:work_items, object) + return unless Feature.enabled?(:work_items, object, default_enabled: :yaml) # This will require a finder in the future when groups/projects get their work item types # All groups/projects use the default types for now diff --git a/app/graphql/types/query_type.rb b/app/graphql/types/query_type.rb index 78e62d810f2..cc46c7e86e4 100644 --- a/app/graphql/types/query_type.rb +++ b/app/graphql/types/query_type.rb @@ -90,7 +90,8 @@ module Types field :work_item, Types::WorkItemType, null: true, resolver: Resolvers::WorkItemResolver, - description: 'Find a work item. Returns `null` if `work_items` feature flag is disabled.' + description: 'Find a work item. Returns `null` if `work_items` feature flag is disabled.' \ + ' The feature is experimental and is subject to change without notice.' field :merge_request, Types::MergeRequestType, null: true, diff --git a/app/models/label.rb b/app/models/label.rb index b08b5bd63d5..4c9f071f43a 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -217,11 +217,19 @@ class Label < ApplicationRecord end def title=(value) - write_attribute(:title, sanitize_value(value)) if value.present? + if value.blank? + super + else + write_attribute(:title, sanitize_value(value)) + end end def description=(value) - write_attribute(:description, sanitize_value(value)) if value.present? + if value.blank? + super + else + write_attribute(:description, sanitize_value(value)) + end end ## |