From 96740a3316f0846e7092dbd9c575f22a0db09845 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 21 Apr 2021 00:11:06 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/boards/boards_util.js | 31 +++++++++++- app/assets/javascripts/boards/constants.js | 14 ++++++ app/assets/javascripts/boards/stores/actions.js | 18 +++---- .../pipeline_new/components/pipeline_new_form.vue | 1 + .../pipeline_new/components/refs_dropdown.vue | 3 +- .../components/states/mr_widget_rebase.vue | 2 +- app/controllers/projects/pipelines_controller.rb | 1 - app/helpers/in_product_marketing_helper.rb | 44 +++++++++++++--- .../notify/in_product_marketing_email.html.haml | 10 ++-- .../notify/in_product_marketing_email.text.erb | 2 +- .../projects/pipeline_schedules/_tabs.html.haml | 6 +-- app/views/projects/pipelines/new.html.haml | 58 ++++------------------ app/views/shared/builds/_tabs.html.haml | 8 +-- 13 files changed, 115 insertions(+), 83 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/boards/boards_util.js b/app/assets/javascripts/boards/boards_util.js index a8b870f9b8e..f53d41dd0f4 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, NOT_FILTER } from './constants'; +import { ListType, NOT_FILTER, AssigneeIdParamValues } from './constants'; export function getMilestone() { return null; @@ -186,6 +186,35 @@ export function transformNotFilters(filters) { }, {}); } +export function getSupportedParams(filters, supportedFilters) { + return supportedFilters.reduce((acc, f) => { + /** + * TODO the API endpoint for the classic boards + * accepts assignee wildcard value as 'assigneeId' param - + * while the GraphQL query accepts the value in 'assigneWildcardId' field. + * Once we deprecate the classics boards, + * we should change the filtered search bar to use 'asssigneeWildcardId' as a token name. + */ + if (f === 'assigneeId' && filters[f]) { + return AssigneeIdParamValues.includes(filters[f]) + ? { + ...acc, + assigneeWildcardId: filters[f].toUpperCase(), + } + : acc; + } + + if (filters[f]) { + return { + ...acc, + [f]: filters[f], + }; + } + + return acc; + }, {}); +} + // EE-specific feature. Find the implementation in the `ee/`-folder export function transformBoardConfig() { return ''; diff --git a/app/assets/javascripts/boards/constants.js b/app/assets/javascripts/boards/constants.js index 4ebd30fe67b..df5376cb2be 100644 --- a/app/assets/javascripts/boards/constants.js +++ b/app/assets/javascripts/boards/constants.js @@ -5,6 +5,20 @@ import boardBlockingIssuesQuery from './graphql/board_blocking_issues.query.grap import issueSetSubscriptionMutation from './graphql/issue_set_subscription.mutation.graphql'; import issueSetTitleMutation from './graphql/issue_set_title.mutation.graphql'; +export const SupportedFilters = [ + 'assigneeUsername', + 'authorUsername', + 'labelName', + 'milestoneTitle', + 'releaseTag', + 'search', + 'myReactionEmoji', + 'assigneeId', +]; + +/* eslint-disable-next-line @gitlab/require-i18n-strings */ +export const AssigneeIdParamValues = ['Any', 'None']; + export const issuableTypes = { issue: 'issue', epic: 'epic', diff --git a/app/assets/javascripts/boards/stores/actions.js b/app/assets/javascripts/boards/stores/actions.js index 8005414962c..4c9dee41e01 100644 --- a/app/assets/javascripts/boards/stores/actions.js +++ b/app/assets/javascripts/boards/stores/actions.js @@ -1,5 +1,4 @@ import * as Sentry from '@sentry/browser'; -import { pick } from 'lodash'; import createBoardListMutation from 'ee_else_ce/boards/graphql/board_list_create.mutation.graphql'; import boardListsQuery from 'ee_else_ce/boards/graphql/board_lists.query.graphql'; import issueMoveListMutation from 'ee_else_ce/boards/graphql/issue_move_list.mutation.graphql'; @@ -11,6 +10,7 @@ import { ISSUABLE, titleQueries, subscriptionQueries, + SupportedFilters, } from '~/boards/constants'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import createGqClient, { fetchPolicies } from '~/lib/graphql'; @@ -27,6 +27,7 @@ import { transformNotFilters, moveItemListHelper, getMoveData, + getSupportedParams, } from '../boards_util'; import boardLabelsQuery from '../graphql/board_labels.query.graphql'; import destroyBoardListMutation from '../graphql/board_list_destroy.mutation.graphql'; @@ -65,16 +66,11 @@ export default { }, setFilters: ({ commit }, filters) => { - const filterParams = pick(filters, [ - 'assigneeUsername', - 'authorUsername', - 'labelName', - 'milestoneTitle', - 'releaseTag', - 'search', - 'myReactionEmoji', - ]); - filterParams.not = transformNotFilters(filters); + const filterParams = { + ...getSupportedParams(filters, SupportedFilters), + not: transformNotFilters(filters), + }; + commit(types.SET_FILTERS, filterParams); }, diff --git a/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue b/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue index e44d80ee9d1..dae89c5f3d9 100644 --- a/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue +++ b/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue @@ -393,6 +393,7 @@ export default { v-model="variable.variable_type" :class="$options.formElementClasses" :options="$options.typeOptions" + data-testid="pipeline-form-ci-variable-type" />