summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-21 00:11:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-21 00:11:06 +0000
commit96740a3316f0846e7092dbd9c575f22a0db09845 (patch)
tree2b85d9f8bf6fbab612ebb50541f3a453e452c751 /app
parent98f1353fcd07e45ef995c3cee14b659711a63221 (diff)
downloadgitlab-ce-96740a3316f0846e7092dbd9c575f22a0db09845.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/boards/boards_util.js31
-rw-r--r--app/assets/javascripts/boards/constants.js14
-rw-r--r--app/assets/javascripts/boards/stores/actions.js18
-rw-r--r--app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue1
-rw-r--r--app/assets/javascripts/pipeline_new/components/refs_dropdown.vue3
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue2
-rw-r--r--app/controllers/projects/pipelines_controller.rb1
-rw-r--r--app/helpers/in_product_marketing_helper.rb44
-rw-r--r--app/views/notify/in_product_marketing_email.html.haml10
-rw-r--r--app/views/notify/in_product_marketing_email.text.erb2
-rw-r--r--app/views/projects/pipeline_schedules/_tabs.html.haml6
-rw-r--r--app/views/projects/pipelines/new.html.haml58
-rw-r--r--app/views/shared/builds/_tabs.html.haml8
13 files changed, 115 insertions, 83 deletions
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"
/>
<gl-form-input
v-model="variable.key"
diff --git a/app/assets/javascripts/pipeline_new/components/refs_dropdown.vue b/app/assets/javascripts/pipeline_new/components/refs_dropdown.vue
index ed5c659d1df..d35d2010150 100644
--- a/app/assets/javascripts/pipeline_new/components/refs_dropdown.vue
+++ b/app/assets/javascripts/pipeline_new/components/refs_dropdown.vue
@@ -81,11 +81,12 @@ export default {
};
</script>
<template>
- <gl-dropdown :text="refShortName" block @show.once="loadRefs">
+ <gl-dropdown :text="refShortName" block data-testid="ref-select" @show.once="loadRefs">
<gl-search-box-by-type
v-model.trim="searchTerm"
:is-loading="isLoading"
:placeholder="__('Search refs')"
+ data-testid="search-refs"
/>
<gl-dropdown-section-header>{{ __('Branches') }}</gl-dropdown-section-header>
<gl-dropdown-item
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
index 33ca582583b..a82a8a22873 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
@@ -175,7 +175,7 @@ export default {
>
<gl-button
:loading="isMakingRequest"
- variant="success"
+ variant="confirm"
data-qa-selector="mr_rebase_button"
@click="rebase"
>
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index ee1e10221ec..6ed1fa53126 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -13,7 +13,6 @@ class Projects::PipelinesController < Projects::ApplicationController
before_action :authorize_create_pipeline!, only: [:new, :create, :config_variables]
before_action :authorize_update_pipeline!, only: [:retry, :cancel]
before_action do
- push_frontend_feature_flag(:new_pipeline_form, project, default_enabled: :yaml)
push_frontend_feature_flag(:pipeline_graph_layers_view, project, type: :development, default_enabled: :yaml)
push_frontend_feature_flag(:pipeline_filter_jobs, project, default_enabled: :yaml)
push_frontend_feature_flag(:graphql_pipeline_details, project, type: :development, default_enabled: :yaml)
diff --git a/app/helpers/in_product_marketing_helper.rb b/app/helpers/in_product_marketing_helper.rb
index 2574b57a82e..9e59a04d709 100644
--- a/app/helpers/in_product_marketing_helper.rb
+++ b/app/helpers/in_product_marketing_helper.rb
@@ -193,8 +193,12 @@ module InProductMarketingHelper
end
end
- def in_product_marketing_progress(track, series)
- s_('InProductMarketing|This is email %{series} of 3 in the %{track} series.') % { series: series + 1, track: track.to_s.humanize }
+ def in_product_marketing_progress(track, series, format: nil)
+ if Gitlab.com?
+ s_('InProductMarketing|This is email %{series} of 3 in the %{track} series.') % { series: series + 1, track: track.to_s.humanize }
+ else
+ s_('InProductMarketing|This is email %{series} of 3 in the %{track} series. To disable notification emails sent by your local GitLab instance, either contact your administrator or %{unsubscribe_link}.') % { series: series + 1, track: track.to_s.humanize, unsubscribe_link: unsubscribe_link(format) }
+ end
end
def footer_links(format: nil)
@@ -220,11 +224,9 @@ module InProductMarketingHelper
s_('InProductMarketing|%{strong_start}GitLab Inc.%{strong_end} 268 Bush Street, #350, San Francisco, CA 94104, USA').html_safe % strong_options(format)
end
- def unsubscribe(format: nil)
- parts = [
- s_('InProductMarketing|If you no longer wish to receive marketing emails from us,'),
- s_('InProductMarketing|you may %{unsubscribe_link} at any time.') % { unsubscribe_link: unsubscribe_link(format) }
- ]
+ def unsubscribe(track, series, format: nil)
+ parts = Gitlab.com? ? unsubscribe_com(format) : unsubscribe_self_managed(track, series, format)
+
case format
when :html
parts.join(' ')
@@ -235,6 +237,20 @@ module InProductMarketingHelper
private
+ def unsubscribe_com(format)
+ [
+ s_('InProductMarketing|If you no longer wish to receive marketing emails from us,'),
+ s_('InProductMarketing|you may %{unsubscribe_link} at any time.') % { unsubscribe_link: unsubscribe_link(format) }
+ ]
+ end
+
+ def unsubscribe_self_managed(track, series, format)
+ [
+ s_('InProductMarketing|To opt out of these onboarding emails, %{unsubscribe_link}.') % { unsubscribe_link: unsubscribe_link(format) },
+ s_("InProductMarketing|If you don't want to receive marketing emails directly from GitLab, %{marketing_preference_link}.") % { marketing_preference_link: marketing_preference_link(track, series, format) }
+ ]
+ end
+
def in_product_marketing_cta_text(track, series)
{
create: [
@@ -314,9 +330,23 @@ module InProductMarketingHelper
def unsubscribe_link(format)
unsubscribe_url = Gitlab.com? ? '%tag_unsubscribe_url%' : profile_notifications_url
+
link(s_('InProductMarketing|unsubscribe'), unsubscribe_url, format)
end
+ def marketing_preference_link(track, series, format)
+ params = {
+ utm_source: 'SM',
+ utm_medium: 'email',
+ utm_campaign: 'onboarding',
+ utm_term: "#{track}_#{series}"
+ }
+
+ preference_link = "https://about.gitlab.com/company/preference-center/?#{params.to_query}"
+
+ link(s_('InProductMarketing|update your preferences'), preference_link, format)
+ end
+
def link(text, link, format)
case format
when :html
diff --git a/app/views/notify/in_product_marketing_email.html.haml b/app/views/notify/in_product_marketing_email.html.haml
index 39f084efe40..015a12bbb6d 100644
--- a/app/views/notify/in_product_marketing_email.html.haml
+++ b/app/views/notify/in_product_marketing_email.html.haml
@@ -166,6 +166,10 @@
= about_link('mailers/in_product_marketing', 'gitlab-logo-gray-rgb.png', 200)
%tr
%td{ "aria-hidden" => "true", height: "30", style: "font-size: 0; line-height: 0;" }
+ %tr{ style: "background-color: #ffffff;" }
+ %td{ style: "color: #424242; padding: 10px 30px; text-align: center; font-family: 'Source Sans Pro', helvetica, arial, sans-serif;font-size: 16px; line-height: 22px; border: 1px solid #dddddd" }
+ %p
+ = in_product_marketing_progress(@track, @series, format: :html).html_safe
%tr
%td{ bgcolor: "#ffffff", height: "auto", style: "max-width: 600px; width: 100%; text-align: center; height: 200px; padding: 25px 15px; mso-line-height-rule: exactly; min-height: 40px; font-family: 'Source Sans Pro', helvetica, arial, sans-serif;", valign: "middle", width: "100%" }
= in_product_marketing_logo(@track, @series)
@@ -184,10 +188,6 @@
%td{ align: "center", style: "padding: 10px 20px 80px 20px; font-family: 'Source Sans Pro', helvetica, arial, sans-serif;" }
.cta_link= cta_link(@track, @series, @group, format: :html)
%tr{ style: "background-color: #ffffff;" }
- %td{ style: "color: #424242; padding: 10px 30px; text-align: center; font-family: 'Source Sans Pro', helvetica, arial, sans-serif;font-size: 16px; line-height: 22px; border: 1px solid #dddddd" }
- %p
- = in_product_marketing_progress(@track, @series)
- %tr{ style: "background-color: #ffffff;" }
%td{ align: "center", style: "padding:75px 20px 25px;" }
= about_link('', 'gitlab_logo.png', 80)
%tr{ style: "background-color: #ffffff;" }
@@ -202,4 +202,4 @@
%tr{ style: "background-color: #ffffff;" }
%td{ align: "left", style: "padding:20px 30px 20px 30px;" }
%span.footernav{ style: "color: #6e49cb; font-size: 14px; line-height: 20px; font-family: 'Source Sans Pro', helvetica, arial, sans-serif; color:#424242;" }
- = unsubscribe(format: :html).html_safe
+ = unsubscribe(@track, @series, format: :html).html_safe
diff --git a/app/views/notify/in_product_marketing_email.text.erb b/app/views/notify/in_product_marketing_email.text.erb
index ecc4c565b73..bc8315e49a0 100644
--- a/app/views/notify/in_product_marketing_email.text.erb
+++ b/app/views/notify/in_product_marketing_email.text.erb
@@ -20,4 +20,4 @@
<%= address %>
-<%= unsubscribe %>
+<%= unsubscribe(@track, @series) %>
diff --git a/app/views/projects/pipeline_schedules/_tabs.html.haml b/app/views/projects/pipeline_schedules/_tabs.html.haml
index 61f6ad34052..f69041e1eb1 100644
--- a/app/views/projects/pipeline_schedules/_tabs.html.haml
+++ b/app/views/projects/pipeline_schedules/_tabs.html.haml
@@ -2,17 +2,17 @@
%li{ class: active_when(scope.nil?) }>
= link_to schedule_path_proc.call(nil) do
= s_("PipelineSchedules|All")
- %span.badge.badge-pill.js-totalbuilds-count
+ %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm.js-totalbuilds-count
= number_with_delimiter(all_schedules.count(:id))
%li{ class: active_when(scope == 'active') }>
= link_to schedule_path_proc.call('active') do
= s_("PipelineSchedules|Active")
- %span.badge.badge-pill
+ %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm
= number_with_delimiter(all_schedules.active.count(:id))
%li{ class: active_when(scope == 'inactive') }>
= link_to schedule_path_proc.call('inactive') do
= s_("PipelineSchedules|Inactive")
- %span.badge.badge-pill
+ %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm
= number_with_delimiter(all_schedules.inactive.count(:id))
diff --git a/app/views/projects/pipelines/new.html.haml b/app/views/projects/pipelines/new.html.haml
index 14de982e239..e92f14fcc63 100644
--- a/app/views/projects/pipelines/new.html.haml
+++ b/app/views/projects/pipelines/new.html.haml
@@ -1,55 +1,17 @@
- breadcrumb_title _('Pipelines')
- page_title s_('Pipeline|Run pipeline')
-- settings_link = link_to _('CI/CD settings'), project_settings_ci_cd_path(@project)
%h3.page-title
= s_('Pipeline|Run pipeline')
%hr
-- if Feature.enabled?(:new_pipeline_form, @project, default_enabled: :yaml)
- #js-new-pipeline{ data: { project_id: @project.id,
- pipelines_path: project_pipelines_path(@project),
- config_variables_path: config_variables_namespace_project_pipelines_path(@project.namespace, @project),
- default_branch: @project.default_branch,
- ref_param: params[:ref] || @project.default_branch,
- var_param: params[:var].to_json,
- file_param: params[:file_var].to_json,
- project_refs_endpoint: refs_project_path(@project, sort: 'updated_desc'),
- settings_link: project_settings_ci_cd_path(@project),
- max_warnings: ::Gitlab::Ci::Warnings::MAX_LIMIT } }
-
-- else
- = form_for @pipeline, as: :pipeline, url: project_pipelines_path(@project), html: { id: "new-pipeline-form", class: "js-new-pipeline-form js-requires-input" } do |f|
- = form_errors(@pipeline)
- = pipeline_warnings(@pipeline)
- .form-group.row
- .col-sm-12
- = f.label :ref, s_('Pipeline|Run for'), class: 'col-form-label'
- = hidden_field_tag 'pipeline[ref]', params[:ref] || @project.default_branch
- = dropdown_tag(params[:ref] || @project.default_branch,
- options: { toggle_class: 'js-branch-select wide monospace',
- filter: true, dropdown_class: "dropdown-menu-selectable git-revision-dropdown", placeholder: s_("Pipeline|Search branches"),
- data: { selected: params[:ref] || @project.default_branch, field_name: 'pipeline[ref]' } })
- .form-text.text-muted
- = s_("Pipeline|Existing branch name or tag")
-
- .col-sm-12.gl-mt-3.js-ci-variable-list-section
- %label
- = s_('Pipeline|Variables')
- %ul.ci-variable-list
- - if params[:var]
- - params[:var].each do |variable|
- = render 'ci/variables/url_query_variable_row', form_field: 'pipeline', variable: variable
- - if params[:file_var]
- - params[:file_var].each do |variable|
- - variable.push("file")
- = render 'ci/variables/url_query_variable_row', form_field: 'pipeline', variable: variable
- = render 'ci/variables/variable_row', form_field: 'pipeline', only_key_value: true
- .form-text.text-muted
- = (s_("Pipeline|Specify variable values to be used in this run. The values specified in %{settings_link} will be used by default.") % {settings_link: settings_link}).html_safe
-
- .form-actions
- = f.submit s_('Pipeline|Run pipeline'), class: 'btn gl-button btn-confirm gl-mr-3 js-variables-save-button'
- = link_to _('Cancel'), project_pipelines_path(@project), class: 'btn gl-button btn-default'
-
- %script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe
+#js-new-pipeline{ data: { project_id: @project.id,
+ pipelines_path: project_pipelines_path(@project),
+ config_variables_path: config_variables_namespace_project_pipelines_path(@project.namespace, @project),
+ default_branch: @project.default_branch,
+ ref_param: params[:ref] || @project.default_branch,
+ var_param: params[:var].to_json,
+ file_param: params[:file_var].to_json,
+ project_refs_endpoint: refs_project_path(@project, sort: 'updated_desc'),
+ settings_link: project_settings_ci_cd_path(@project),
+ max_warnings: ::Gitlab::Ci::Warnings::MAX_LIMIT } }
diff --git a/app/views/shared/builds/_tabs.html.haml b/app/views/shared/builds/_tabs.html.haml
index 5c74e71b644..4973309edf5 100644
--- a/app/views/shared/builds/_tabs.html.haml
+++ b/app/views/shared/builds/_tabs.html.haml
@@ -2,23 +2,23 @@
%li{ class: active_when(scope.nil?) }>
= link_to build_path_proc.call(nil) do
All
- %span.badge.badge-pill.js-totalbuilds-count
+ %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm.js-totalbuilds-count
= limited_counter_with_delimiter(all_builds)
%li{ class: active_when(scope == 'pending') }>
= link_to build_path_proc.call('pending') do
Pending
- %span.badge.badge-pill
+ %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm
= limited_counter_with_delimiter(all_builds.pending)
%li{ class: active_when(scope == 'running') }>
= link_to build_path_proc.call('running') do
Running
- %span.badge.badge-pill
+ %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm
= limited_counter_with_delimiter(all_builds.running)
%li{ class: active_when(scope == 'finished') }>
= link_to build_path_proc.call('finished') do
Finished
- %span.badge.badge-pill
+ %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm
= limited_counter_with_delimiter(all_builds.finished)