Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-18 18:08:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-18 18:08:15 +0300
commite35f91f05bc00106dda3b9268c462db14c7f8ad6 (patch)
tree1f7f775565d9c8355819a9598f9d0262fb0ff26b /app
parent48650fe1bfc1e3d20ec3a5702ef4d64e9fe69912 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/ide/components/ide_review.vue2
-rw-r--r--app/assets/javascripts/performance_bar/components/detailed_metric.vue4
-rw-r--r--app/controllers/groups_controller.rb2
-rw-r--r--app/controllers/projects_controller.rb2
-rw-r--r--app/graphql/mutations/snippets/create.rb9
-rw-r--r--app/models/project.rb1
-rw-r--r--app/models/project_services/webex_teams_service.rb57
-rw-r--r--app/models/service.rb2
-rw-r--r--app/presenters/ci/build_runner_presenter.rb7
-rw-r--r--app/views/shared/_recaptcha_form.html.haml2
10 files changed, 82 insertions, 6 deletions
diff --git a/app/assets/javascripts/ide/components/ide_review.vue b/app/assets/javascripts/ide/components/ide_review.vue
index 901b8892e80..62dbfea2088 100644
--- a/app/assets/javascripts/ide/components/ide_review.vue
+++ b/app/assets/javascripts/ide/components/ide_review.vue
@@ -43,7 +43,7 @@ export default {
<template>
<ide-tree-list :viewer-type="viewer" header-class="ide-review-header">
- <template slot="header">
+ <template #header>
<div class="ide-review-button-holder">
{{ __('Review') }}
<editor-mode-dropdown
diff --git a/app/assets/javascripts/performance_bar/components/detailed_metric.vue b/app/assets/javascripts/performance_bar/components/detailed_metric.vue
index 24ae900b445..e1a0e2df0e0 100644
--- a/app/assets/javascripts/performance_bar/components/detailed_metric.vue
+++ b/app/assets/javascripts/performance_bar/components/detailed_metric.vue
@@ -116,7 +116,9 @@ export default {
</template>
</table>
- <div slot="footer"></div>
+ <template #footer>
+ <div></div>
+ </template>
</gl-modal>
{{ title }}
<request-warning :html-id="htmlId" :warnings="warnings" />
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 2cf5d61ec3a..d5f2239b16a 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -146,7 +146,7 @@ class GroupsController < Groups::ApplicationController
export_service = Groups::ImportExport::ExportService.new(group: @group, user: current_user)
if export_service.async_execute
- redirect_to edit_group_path(@group), notice: _('Group export started. A download link will be sent by email.')
+ redirect_to edit_group_path(@group), notice: _('Group export started. A download link will be sent by email and made available on this page.')
else
redirect_to edit_group_path(@group), alert: _('Group export could not be started.')
end
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 36d14d22ce6..f6eb0101ae0 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -201,7 +201,7 @@ class ProjectsController < Projects::ApplicationController
redirect_to(
edit_project_path(@project, anchor: 'js-export-project'),
- notice: _("Project export started. A download link will be sent by email.")
+ notice: _("Project export started. A download link will be sent by email and made available on this page.")
)
end
diff --git a/app/graphql/mutations/snippets/create.rb b/app/graphql/mutations/snippets/create.rb
index 266a123de82..6fc223fbee7 100644
--- a/app/graphql/mutations/snippets/create.rb
+++ b/app/graphql/mutations/snippets/create.rb
@@ -36,6 +36,10 @@ module Mutations
required: false,
description: 'The project full path the snippet is associated with'
+ argument :uploaded_files, [GraphQL::STRING_TYPE],
+ required: false,
+ description: 'The paths to files uploaded in the snippet description'
+
def resolve(args)
project_path = args.delete(:project_path)
@@ -45,9 +49,14 @@ module Mutations
raise_resource_not_available_error!
end
+ # We need to rename `uploaded_files` into `files` because
+ # it's the expected key param
+ args[:files] = args.delete(:uploaded_files)
+
service_response = ::Snippets::CreateService.new(project,
context[:current_user],
args).execute
+
snippet = service_response.payload[:snippet]
{
diff --git a/app/models/project.rb b/app/models/project.rb
index 362a01106c1..c0dd2eb8584 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -177,6 +177,7 @@ class Project < ApplicationRecord
has_one :packagist_service
has_one :hangouts_chat_service
has_one :unify_circuit_service
+ has_one :webex_teams_service
has_one :root_of_fork_network,
foreign_key: 'root_project_id',
diff --git a/app/models/project_services/webex_teams_service.rb b/app/models/project_services/webex_teams_service.rb
new file mode 100644
index 00000000000..1d791b19486
--- /dev/null
+++ b/app/models/project_services/webex_teams_service.rb
@@ -0,0 +1,57 @@
+# frozen_string_literal: true
+
+class WebexTeamsService < ChatNotificationService
+ def title
+ 'Webex Teams'
+ end
+
+ def description
+ 'Receive event notifications in Webex Teams'
+ end
+
+ def self.to_param
+ 'webex_teams'
+ end
+
+ def help
+ 'This service sends notifications about projects events to a Webex Teams conversation.<br />
+ To set up this service:
+ <ol>
+ <li><a href="https://apphub.webex.com/teams/applications/incoming-webhooks-cisco-systems">Set up an incoming webhook for your conversation</a>. All notifications will come to this conversation.</li>
+ <li>Paste the <strong>Webhook URL</strong> into the field below.</li>
+ <li>Select events below to enable notifications.</li>
+ </ol>'
+ end
+
+ def event_field(event)
+ end
+
+ def default_channel_placeholder
+ end
+
+ def self.supported_events
+ %w[push issue confidential_issue merge_request note confidential_note tag_push
+ pipeline wiki_page]
+ end
+
+ def default_fields
+ [
+ { type: 'text', name: 'webhook', placeholder: "e.g. https://api.ciscospark.com/v1/webhooks/incoming/…", required: true },
+ { type: 'checkbox', name: 'notify_only_broken_pipelines' },
+ { type: 'select', name: 'branches_to_be_notified', choices: branch_choices }
+ ]
+ end
+
+ private
+
+ def notify(message, opts)
+ header = { 'Content-Type' => 'application/json' }
+ response = Gitlab::HTTP.post(webhook, headers: header, body: { markdown: message.pretext }.to_json)
+
+ response if response.success?
+ end
+
+ def custom_data(data)
+ super(data).merge(markdown: true)
+ end
+end
diff --git a/app/models/service.rb b/app/models/service.rb
index 38cefc2df6e..fb4d9a77077 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -12,7 +12,7 @@ class Service < ApplicationRecord
alerts asana assembla bamboo bugzilla buildkite campfire custom_issue_tracker discord
drone_ci emails_on_push external_wiki flowdock hangouts_chat hipchat irker jira
mattermost mattermost_slash_commands microsoft_teams packagist pipelines_email
- pivotaltracker prometheus pushover redmine slack slack_slash_commands teamcity unify_circuit youtrack
+ pivotaltracker prometheus pushover redmine slack slack_slash_commands teamcity unify_circuit webex_teams youtrack
].freeze
DEV_SERVICE_NAMES = %w[
diff --git a/app/presenters/ci/build_runner_presenter.rb b/app/presenters/ci/build_runner_presenter.rb
index f63fd3c50c4..5e35bfc79ef 100644
--- a/app/presenters/ci/build_runner_presenter.rb
+++ b/app/presenters/ci/build_runner_presenter.rb
@@ -97,6 +97,13 @@ module Ci
end
def persistent_ref_exist?
+ ##
+ # Persistent refs for pipelines definitely exist from GitLab 12.4,
+ # hence, we don't need to check the ref existence before passing it to runners.
+ # Checking refs pressurizes gitaly node and should be avoided.
+ # Issue: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/2143
+ return true if Feature.enabled?(:ci_skip_persistent_ref_existence_check)
+
pipeline.persistent_ref.exist?
end
diff --git a/app/views/shared/_recaptcha_form.html.haml b/app/views/shared/_recaptcha_form.html.haml
index 10f358402c1..245a86721eb 100644
--- a/app/views/shared/_recaptcha_form.html.haml
+++ b/app/views/shared/_recaptcha_form.html.haml
@@ -17,4 +17,4 @@
- if has_submit
.row-content-block.footer-block
- = f.submit "Submit #{humanized_resource_name}", class: 'btn btn-success'
+ = f.submit _("Submit %{humanized_resource_name}") % { humanized_resource_name: humanized_resource_name }, class: 'btn btn-success'