diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/boards/boards_util.js | 7 | ||||
-rw-r--r-- | app/assets/javascripts/boards/constants.js | 5 | ||||
-rw-r--r-- | app/assets/javascripts/deploy_freeze/store/actions.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/lib/logger/index.js | 6 | ||||
-rw-r--r-- | app/graphql/resolvers/concerns/issue_resolver_arguments.rb | 5 | ||||
-rw-r--r-- | app/graphql/types/boards/board_issuable_input_base_type.rb | 2 | ||||
-rw-r--r-- | app/graphql/types/issues/negated_issue_filter_input_type.rb | 3 | ||||
-rw-r--r-- | app/models/ci/pipeline_variable.rb | 2 | ||||
-rw-r--r-- | app/models/work_item/type.rb | 16 |
9 files changed, 37 insertions, 13 deletions
diff --git a/app/assets/javascripts/boards/boards_util.js b/app/assets/javascripts/boards/boards_util.js index 3219d74f85f..cdf25b2d428 100644 --- a/app/assets/javascripts/boards/boards_util.js +++ b/app/assets/javascripts/boards/boards_util.js @@ -1,6 +1,6 @@ import { sortBy, cloneDeep } from 'lodash'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; -import { ListType } from './constants'; +import { ListType, MilestoneIDs } from './constants'; export function getMilestone() { return null; @@ -108,7 +108,10 @@ export function formatIssueInput(issueInput, boardConfig) { return { ...issueInput, - milestoneId: milestoneId ? fullMilestoneId(milestoneId) : null, + milestoneId: + milestoneId && milestoneId !== MilestoneIDs.ANY + ? fullMilestoneId(milestoneId) + : issueInput?.milestoneId, labelIds: [...labelIds, ...(labels?.map((l) => fullLabelId(l)) || [])], assigneeIds: [...assigneeIds, ...(assigneeId ? [fullUserId(assigneeId)] : [])], }; diff --git a/app/assets/javascripts/boards/constants.js b/app/assets/javascripts/boards/constants.js index 16fb4596726..391e0d1fb0a 100644 --- a/app/assets/javascripts/boards/constants.js +++ b/app/assets/javascripts/boards/constants.js @@ -119,6 +119,11 @@ export const DraggableItemTypes = { list: 'list', }; +export const MilestoneIDs = { + NONE: 0, + ANY: -1, +}; + export default { BoardType, ListType, diff --git a/app/assets/javascripts/deploy_freeze/store/actions.js b/app/assets/javascripts/deploy_freeze/store/actions.js index a2056165cb2..1ac6781a0e3 100644 --- a/app/assets/javascripts/deploy_freeze/store/actions.js +++ b/app/assets/javascripts/deploy_freeze/store/actions.js @@ -1,5 +1,6 @@ import Api from '~/api'; import createFlash from '~/flash'; +import { logError } from '~/lib/logger'; import { __ } from '~/locale'; import * as types from './mutation_types'; @@ -63,8 +64,7 @@ export const deleteFreezePeriod = ({ state, commit }, { id }) => { }); commit(types.RECEIVE_DELETE_FREEZE_PERIOD_ERROR, id); - // eslint-disable-next-line no-console - console.error('[gitlab] Unable to delete deploy freeze:', e); + logError(`Unable to delete deploy freeze`, e); }); }; diff --git a/app/assets/javascripts/lib/logger/index.js b/app/assets/javascripts/lib/logger/index.js new file mode 100644 index 00000000000..0f5353fcbed --- /dev/null +++ b/app/assets/javascripts/lib/logger/index.js @@ -0,0 +1,6 @@ +/* eslint-disable no-console */ +export const LOG_PREFIX = '[gitlab]'; + +export const logError = (message = '', ...args) => { + console.error(LOG_PREFIX, `${message}\n`, ...args); +}; diff --git a/app/graphql/resolvers/concerns/issue_resolver_arguments.rb b/app/graphql/resolvers/concerns/issue_resolver_arguments.rb index 8d77c0f3a8d..9de36b5b7d1 100644 --- a/app/graphql/resolvers/concerns/issue_resolver_arguments.rb +++ b/app/graphql/resolvers/concerns/issue_resolver_arguments.rb @@ -30,7 +30,7 @@ module IssueResolverArguments description: 'Usernames of users assigned to the issue.' argument :assignee_id, GraphQL::Types::String, required: false, - description: 'ID of a user assigned to the issues, "none" and "any" values are supported.' + description: 'ID of a user assigned to the issues. Wildcard values "NONE" and "ANY" are supported.' argument :created_before, Types::TimeType, required: false, description: 'Issues created before this date.' @@ -59,6 +59,9 @@ module IssueResolverArguments argument :milestone_wildcard_id, ::Types::MilestoneWildcardIdEnum, required: false, description: 'Filter issues by milestone ID wildcard.' + argument :my_reaction_emoji, GraphQL::Types::String, + required: false, + description: 'Filter by reaction emoji applied by the current user. Wildcard values "NONE" and "ANY" are supported.' argument :not, Types::Issues::NegatedIssueFilterInputType, description: 'Negated arguments.', prepare: ->(negated_args, ctx) { negated_args.to_h }, diff --git a/app/graphql/types/boards/board_issuable_input_base_type.rb b/app/graphql/types/boards/board_issuable_input_base_type.rb index 326f73846d0..81dd21aebec 100644 --- a/app/graphql/types/boards/board_issuable_input_base_type.rb +++ b/app/graphql/types/boards/board_issuable_input_base_type.rb @@ -14,7 +14,7 @@ module Types argument :my_reaction_emoji, GraphQL::Types::String, required: false, - description: 'Filter by reaction emoji applied by the current user.' + description: 'Filter by reaction emoji applied by the current user. Wildcard values "NONE" and "ANY" are supported.' end end end diff --git a/app/graphql/types/issues/negated_issue_filter_input_type.rb b/app/graphql/types/issues/negated_issue_filter_input_type.rb index 5c43c5c33b5..4f620a5b3d9 100644 --- a/app/graphql/types/issues/negated_issue_filter_input_type.rb +++ b/app/graphql/types/issues/negated_issue_filter_input_type.rb @@ -26,6 +26,9 @@ module Types argument :milestone_wildcard_id, ::Types::NegatedMilestoneWildcardIdEnum, required: false, description: 'Filter by negated milestone wildcard values.' + argument :my_reaction_emoji, GraphQL::Types::String, + required: false, + description: 'Filter by reaction emoji applied by the current user.' end end end diff --git a/app/models/ci/pipeline_variable.rb b/app/models/ci/pipeline_variable.rb index a0e8886414b..3dca77af051 100644 --- a/app/models/ci/pipeline_variable.rb +++ b/app/models/ci/pipeline_variable.rb @@ -8,7 +8,7 @@ module Ci alias_attribute :secret_value, :value - validates :key, uniqueness: { scope: :pipeline_id } + validates :key, presence: true def hook_attrs { key: key, value: value } diff --git a/app/models/work_item/type.rb b/app/models/work_item/type.rb index 16cb7a8be45..03badf95908 100644 --- a/app/models/work_item/type.rb +++ b/app/models/work_item/type.rb @@ -9,14 +9,18 @@ class WorkItem::Type < ApplicationRecord include CacheMarkdownField + # Base types need to exist on the DB on app startup + # This constant is used by the DB seeder + BASE_TYPES = { + issue: { name: 'Issue', icon_name: 'issue-type-issue', enum_value: 0 }, + incident: { name: 'Incident', icon_name: 'issue-type-incident', enum_value: 1 }, + test_case: { name: 'Test Case', icon_name: 'issue-type-test-case', enum_value: 2 }, ## EE-only + requirement: { name: 'Requirement', icon_name: 'issue-type-requirements', enum_value: 3 } ## EE-only + }.freeze + cache_markdown_field :description, pipeline: :single_line - enum base_type: { - issue: 0, - incident: 1, - test_case: 2, ## EE-only - requirement: 3 ## EE-only - } + enum base_type: BASE_TYPES.transform_values { |value| value[:enum_value] } belongs_to :namespace, optional: true has_many :work_items, class_name: 'Issue', foreign_key: :work_item_type_id, inverse_of: :work_item_type |