Skip to content
Snippets Groups Projects
Commit dea6ebd3 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 94611567
No related branches found
No related tags found
No related merge requests found
Showing
with 62 additions and 80 deletions
Loading
Loading
@@ -209,7 +209,7 @@ review-qa-all:
when: manual
parallel: 5
script:
- export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/review-qa-all_master_report.json
- export KNAPSACK_REPORT_PATH=knapsack/master_report.json
- export KNAPSACK_TEST_FILE_PATTERN=qa/specs/features/**/*_spec.rb
- gitlab-qa Test::Instance::Any "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}" -- --format RspecJunitFormatter --out tmp/rspec-${CI_JOB_ID}.xml --format html --out tmp/rspec.htm --color --format documentation
 
Loading
Loading
Loading
Loading
@@ -2,9 +2,9 @@
 
## Canonical source
 
The canonical source of GitLab where development takes place is [hosted on GitLab.com](https://gitlab.com/gitlab-org/gitlab).
The canonical source of GitLab where all development takes place is [hosted on GitLab.com](https://gitlab.com/gitlab-org/gitlab).
 
A FOSS source of GitLab is hosted on a [mirrored, read-only project on GitLab.com](https://gitlab.com/gitlab-org/gitlab-foss/).
If you wish to clone a copy of GitLab without proprietary code, you can use the read-only mirror of GitLab located at https://gitlab.com/gitlab-org/gitlab-foss/. Please do not submit any issues and/or merge requests to this project.
 
## Free trial
 
Loading
Loading
export default {
data() {
return {
isCustomStageForm: false,
};
},
methods: {
showAddStageForm: () => {},
hideAddStageForm: () => {},
},
};
Loading
Loading
@@ -3,7 +3,6 @@ import Vue from 'vue';
import Cookies from 'js-cookie';
import { GlEmptyState } from '@gitlab/ui';
import filterMixins from 'ee_else_ce/analytics/cycle_analytics/mixins/filter_mixins';
import addStageMixin from 'ee_else_ce/analytics/cycle_analytics/mixins/add_stage_mixin';
import Flash from '../flash';
import { __ } from '~/locale';
import Translate from '../vue_shared/translate';
Loading
Loading
@@ -44,14 +43,8 @@ export default () => {
DateRangeDropdown: () =>
import('ee_component/analytics/shared/components/date_range_dropdown.vue'),
'stage-nav-item': stageNavItem,
CustomStageForm: () =>
import('ee_component/analytics/cycle_analytics/components/custom_stage_form.vue'),
AddStageButton: () =>
import('ee_component/analytics/cycle_analytics/components/add_stage_button.vue'),
CustomStageFormContainer: () =>
import('ee_component/analytics/cycle_analytics/components/custom_stage_form_container.vue'),
},
mixins: [filterMixins, addStageMixin],
mixins: [filterMixins],
data() {
return {
store: CycleAnalyticsStore,
Loading
Loading
@@ -131,7 +124,6 @@ export default () => {
return;
}
 
this.hideAddStageForm();
this.isLoadingStage = true;
this.store.setStageEvents([], stage);
this.store.setActiveStage(stage);
Loading
Loading
Loading
Loading
@@ -152,6 +152,14 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState, roo
branch: getters.branchName,
})
.then(() => {
commit(rootTypes.CLEAR_STAGED_CHANGES, null, { root: true });
commit(rootTypes.CLEAR_REPLACED_FILES, null, { root: true });
setTimeout(() => {
commit(rootTypes.SET_LAST_COMMIT_MSG, '', { root: true });
}, 5000);
if (state.shouldCreateMR) {
const { currentProject } = rootGetters;
const targetBranch = getters.isCreatingNewBranch
Loading
Loading
@@ -164,14 +172,6 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState, roo
{ root: true },
);
}
commit(rootTypes.CLEAR_STAGED_CHANGES, null, { root: true });
commit(rootTypes.CLEAR_REPLACED_FILES, null, { root: true });
setTimeout(() => {
commit(rootTypes.SET_LAST_COMMIT_MSG, '', { root: true });
}, 5000);
})
.then(() => {
if (rootGetters.lastOpenedFile) {
Loading
Loading
<script>
import { __ } from '~/locale';
import { s__, __ } from '~/locale';
import { GlLink, GlButton } from '@gitlab/ui';
import { GlAreaChart, GlLineChart, GlChartSeriesLabel } from '@gitlab/ui/dist/charts';
import dateFormat from 'dateformat';
Loading
Loading
@@ -52,6 +52,16 @@ export default {
required: false,
default: () => [],
},
legendAverageText: {
type: String,
required: false,
default: s__('Metrics|Avg'),
},
legendMaxText: {
type: String,
required: false,
default: s__('Metrics|Max'),
},
},
data() {
return {
Loading
Loading
@@ -260,7 +270,6 @@ export default {
<slot></slot>
</div>
</div>
<component
:is="glChartComponent"
ref="chart"
Loading
Loading
@@ -271,6 +280,8 @@ export default {
:thresholds="thresholds"
:width="width"
:height="height"
:average-text="legendAverageText"
:max-text="legendMaxText"
@updated="onChartUpdated"
>
<template v-if="tooltip.isDeployment">
Loading
Loading
Loading
Loading
@@ -81,7 +81,7 @@ module SubmoduleHelper
end
 
def relative_self_links(relative_path, commit, project)
relative_path.rstrip!
relative_path = relative_path.rstrip
absolute_project_path = "/" + project.full_path
 
# Resolve `relative_path` to target path
Loading
Loading
Loading
Loading
@@ -85,7 +85,7 @@ module Emails
@project = Project.find(project_id)
@results = results
 
mail(to: recipient(@user.id, @project.group), subject: subject('Imported issues')) do |format|
mail(to: @user.notification_email_for(@project.group), subject: subject('Imported issues')) do |format|
format.html { render layout: 'mailer' }
format.text { render layout: 'mailer' }
end
Loading
Loading
@@ -105,7 +105,7 @@ module Emails
def issue_thread_options(sender_id, recipient_id, reason)
{
from: sender(sender_id),
to: recipient(recipient_id, @project.group),
to: User.find(recipient_id).notification_email_for(@project.group),
subject: subject("#{@issue.title} (##{@issue.iid})"),
'X-GitLab-NotificationReason' => reason
}
Loading
Loading
Loading
Loading
@@ -13,7 +13,9 @@ module Emails
@member_source_type = member_source_type
@member_id = member_id
 
mail(to: recipient(recipient_id, notification_group),
user = User.find(recipient_id)
mail(to: user.notification_email_for(notification_group),
subject: subject("Request to join the #{member_source.human_name} #{member_source.model_name.singular}"))
end
 
Loading
Loading
@@ -21,7 +23,7 @@ module Emails
@member_source_type = member_source_type
@member_id = member_id
 
mail(to: recipient(member.user, notification_group),
mail(to: member.user.notification_email_for(notification_group),
subject: subject("Access to the #{member_source.human_name} #{member_source.model_name.singular} was granted"))
end
 
Loading
Loading
@@ -29,7 +31,9 @@ module Emails
@member_source_type = member_source_type
@member_source = member_source_class.find(source_id)
 
mail(to: recipient(user_id, notification_group),
user = User.find(user_id)
mail(to: user.notification_email_for(notification_group),
subject: subject("Access to the #{member_source.human_name} #{member_source.model_name.singular} was denied"))
end
 
Loading
Loading
@@ -47,7 +51,7 @@ module Emails
@member_id = member_id
return unless member.created_by
 
mail(to: recipient(member.created_by, notification_group),
mail(to: member.created_by.notification_email_for(notification_group),
subject: subject('Invitation accepted'))
end
 
Loading
Loading
@@ -58,7 +62,9 @@ module Emails
@member_source = member_source_class.find(source_id)
@invite_email = invite_email
 
mail(to: recipient(created_by_id, notification_group),
user = User.find(created_by_id)
mail(to: user.notification_email_for(notification_group),
subject: subject('Invitation declined'))
end
 
Loading
Loading
Loading
Loading
@@ -110,7 +110,7 @@ module Emails
def merge_request_thread_options(sender_id, recipient_id, reason = nil)
{
from: sender(sender_id),
to: recipient(recipient_id, @project.group),
to: User.find(recipient_id).notification_email_for(@project.group),
subject: subject("#{@merge_request.title} (#{@merge_request.to_reference})"),
'X-GitLab-NotificationReason' => reason
}
Loading
Loading
Loading
Loading
@@ -55,7 +55,7 @@ module Emails
def note_thread_options(recipient_id, reason)
{
from: sender(@note.author_id),
to: recipient(recipient_id, @project&.group || @group),
to: User.find(recipient_id).notification_email_for(@project&.group || @group),
subject: subject("#{@note.noteable.title} (#{@note.noteable.reference_link_text})"),
'X-GitLab-NotificationReason' => reason
}
Loading
Loading
Loading
Loading
@@ -7,7 +7,7 @@ module Emails
@project = domain.project
 
mail(
to: recipient(recipient.id, @project.group),
to: recipient.notification_email_for(@project.group),
subject: subject("GitLab Pages domain '#{domain.domain}' has been enabled")
)
end
Loading
Loading
@@ -17,7 +17,7 @@ module Emails
@project = domain.project
 
mail(
to: recipient(recipient.id, @project.group),
to: recipient.notification_email_for(@project.group),
subject: subject("GitLab Pages domain '#{domain.domain}' has been disabled")
)
end
Loading
Loading
@@ -27,7 +27,7 @@ module Emails
@project = domain.project
 
mail(
to: recipient(recipient.id, @project.group),
to: recipient.notification_email_for(@project.group),
subject: subject("Verification succeeded for GitLab Pages domain '#{domain.domain}'")
)
end
Loading
Loading
@@ -37,7 +37,7 @@ module Emails
@project = domain.project
 
mail(
to: recipient(recipient.id, @project.group),
to: recipient.notification_email_for(@project.group),
subject: subject("ACTION REQUIRED: Verification failed for GitLab Pages domain '#{domain.domain}'")
)
end
Loading
Loading
Loading
Loading
@@ -7,20 +7,20 @@ module Emails
@project = Project.find project_id
@target_url = project_url(@project)
@old_path_with_namespace = old_path_with_namespace
mail(to: recipient(user_id, @project.group),
mail(to: @user.notification_email_for(@project.group),
subject: subject("Project was moved"))
end
 
def project_was_exported_email(current_user, project)
@project = project
mail(to: recipient(current_user.id, project.group),
mail(to: current_user.notification_email_for(project.group),
subject: subject("Project was exported"))
end
 
def project_was_not_exported_email(current_user, project, errors)
@project = project
@errors = errors
mail(to: recipient(current_user.id, @project.group),
mail(to: current_user.notification_email_for(@project.group),
subject: subject("Project export error"))
end
 
Loading
Loading
@@ -28,7 +28,7 @@ module Emails
@project = project
@user = user
 
mail(to: recipient(user.id, project.group), subject: subject("Project cleanup has completed"))
mail(to: user.notification_email_for(project.group), subject: subject("Project cleanup has completed"))
end
 
def repository_cleanup_failure_email(project, user, error)
Loading
Loading
@@ -36,7 +36,7 @@ module Emails
@user = user
@error = error
 
mail(to: recipient(user.id, project.group), subject: subject("Project cleanup failure"))
mail(to: user.notification_email_for(project.group), subject: subject("Project cleanup failure"))
end
 
def repository_push_email(project_id, opts = {})
Loading
Loading
Loading
Loading
@@ -5,8 +5,9 @@ module Emails
def remote_mirror_update_failed_email(remote_mirror_id, recipient_id)
@remote_mirror = RemoteMirror.find_by_id(remote_mirror_id)
@project = @remote_mirror.project
user = User.find(recipient_id)
 
mail(to: recipient(recipient_id, @project.group), subject: subject('Remote mirror update failed'))
mail(to: user.notification_email_for(@project.group), subject: subject('Remote mirror update failed'))
end
end
end
Loading
Loading
@@ -71,20 +71,6 @@ class Notify < BaseMailer
address.format
end
 
# Look up a User's notification email for a particular context.
# Can look up by their ID or can accept a User object.
#
# recipient - User object OR a User ID
# notification_group - The parent group of the notification
#
# Returns a String containing the User's email address.
def recipient(recipient, notification_group = nil)
user = recipient if recipient.is_a?(User)
user ||= User.find(recipient)
user.notification_email_for(notification_group)
end
# Formats arguments into a String suitable for use as an email subject
#
# extra - Extra Strings to be inserted into the subject
Loading
Loading
Loading
Loading
@@ -245,7 +245,6 @@ class Project < ApplicationRecord
 
has_one :cluster_project, class_name: 'Clusters::Project'
has_many :clusters, through: :cluster_project, class_name: 'Clusters::Cluster'
has_many :cluster_ingresses, through: :clusters, source: :application_ingress, class_name: 'Clusters::Applications::Ingress'
has_many :kubernetes_namespaces, class_name: 'Clusters::KubernetesNamespace'
 
has_many :prometheus_metrics
Loading
Loading
Loading
Loading
@@ -17,7 +17,7 @@ module Issues
end
 
def can_add_link?
available? && !link_in_issue_description?
can? && !link_in_issue_description?
end
 
def remove_link
Loading
Loading
@@ -29,7 +29,7 @@ module Issues
end
 
def can_remove_link?
available? && link_in_issue_description?
can? && link_in_issue_description?
end
 
def parse_link(link)
Loading
Loading
@@ -75,14 +75,6 @@ module Issues
issue_description[/(\S+)\z/, 1]
end
 
def available?
feature_enabled? && can?
end
def feature_enabled?
Feature.enabled?(:issue_zoom_integration, project)
end
def can?
current_user.can?(:update_issue, project)
end
Loading
Loading
Loading
Loading
@@ -43,6 +43,7 @@ module Projects
shared_runners_enabled: @project.shared_runners_enabled,
namespace_id: target_namespace.id,
fork_network: fork_network,
ci_config_path: @project.ci_config_path,
# We need to set ci_default_git_depth to 0 for the forked project when
# @project.ci_default_git_depth is nil in order to keep the same behaviour
# and not get ProjectCiCdSetting::DEFAULT_GIT_DEPTH set on create
Loading
Loading
Loading
Loading
@@ -21,7 +21,7 @@
 
- if any_dashboard_nav_link?([:groups, :milestones, :activity, :snippets])
%li.header-more.dropdown
%a{ href: "#", data: { toggle: "dropdown" } }
%a{ href: "#", data: { toggle: "dropdown", qa_selector: 'more_dropdown' } }
= _('More')
= sprite_icon('angle-down', css_class: 'caret-down')
.dropdown-menu
Loading
Loading
@@ -42,7 +42,7 @@
 
- if dashboard_nav_link?(:snippets)
= nav_link(controller: 'dashboard/snippets') do
= link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets qa-snippets-link' do
= link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets', data: { qa_selector: 'snippets_link' } do
= _('Snippets')
 
= render_if_exists 'layouts/nav/sidebar/analytics_more_link'
Loading
Loading
---
title: Refactor email notification code
merge_request: 17741
author: briankabiro
type: other
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment