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>2021-06-15 00:10:22 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-15 00:10:22 +0300
commit5b829393a732143e31e2f9a62b6ca2cfb7ebb147 (patch)
tree85260ce9fd49ea62df0cea5b750f8c0db1b5a082 /app
parentf69bc1dab50e86440bb4ffdc507ca5efd94bf459 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/behaviors/shortcuts/keybindings.js7
-rw-r--r--app/assets/javascripts/behaviors/shortcuts/shortcuts.js14
-rw-r--r--app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue8
-rw-r--r--app/finders/pending_todos_finder.rb9
-rw-r--r--app/graphql/types/ci/runner_type.rb2
-rw-r--r--app/models/todo.rb1
-rw-r--r--app/services/discussions/resolve_service.rb7
-rw-r--r--app/services/todo_service.rb2
-rw-r--r--app/views/admin/application_settings/appearances/preview_sign_in.html.haml2
9 files changed, 47 insertions, 5 deletions
diff --git a/app/assets/javascripts/behaviors/shortcuts/keybindings.js b/app/assets/javascripts/behaviors/shortcuts/keybindings.js
index c63dba05f10..005ef103ded 100644
--- a/app/assets/javascripts/behaviors/shortcuts/keybindings.js
+++ b/app/assets/javascripts/behaviors/shortcuts/keybindings.js
@@ -105,6 +105,12 @@ export const TOGGLE_PERFORMANCE_BAR = {
defaultKeys: ['p b'], // eslint-disable-line @gitlab/require-i18n-strings
};
+export const HIDE_APPEARING_CONTENT = {
+ id: 'globalShortcuts.hideAppearingContent',
+ description: __('Hide tooltips or popovers'),
+ defaultKeys: ['esc'],
+};
+
export const TOGGLE_CANARY = {
id: 'globalShortcuts.toggleCanary',
description: __('Toggle GitLab Next'),
@@ -492,6 +498,7 @@ export const GLOBAL_SHORTCUTS_GROUP = {
GO_TO_YOUR_MERGE_REQUESTS,
GO_TO_YOUR_TODO_LIST,
TOGGLE_PERFORMANCE_BAR,
+ HIDE_APPEARING_CONTENT,
],
};
diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js
index 03cba78cf31..ac2a4184176 100644
--- a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js
+++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js
@@ -12,6 +12,7 @@ import {
START_SEARCH,
FOCUS_FILTER_BAR,
TOGGLE_PERFORMANCE_BAR,
+ HIDE_APPEARING_CONTENT,
TOGGLE_CANARY,
TOGGLE_MARKDOWN_PREVIEW,
GO_TO_YOUR_TODO_LIST,
@@ -78,6 +79,7 @@ export default class Shortcuts {
Mousetrap.bind(keysFor(START_SEARCH), Shortcuts.focusSearch);
Mousetrap.bind(keysFor(FOCUS_FILTER_BAR), this.focusFilter.bind(this));
Mousetrap.bind(keysFor(TOGGLE_PERFORMANCE_BAR), Shortcuts.onTogglePerfBar);
+ Mousetrap.bind(keysFor(HIDE_APPEARING_CONTENT), Shortcuts.hideAppearingContent);
Mousetrap.bind(keysFor(TOGGLE_CANARY), Shortcuts.onToggleCanary);
const findFileURL = document.body.dataset.findFile;
@@ -202,6 +204,18 @@ export default class Shortcuts {
}
}
+ static hideAppearingContent(e) {
+ const elements = document.querySelectorAll('.tooltip, .popover');
+
+ elements.forEach((element) => {
+ element.style.display = 'none';
+ });
+
+ if (e.preventDefault) {
+ e.preventDefault();
+ }
+ }
+
/**
* Initializes markdown editor shortcuts on the provided `<textarea>` element
*
diff --git a/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue b/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
index d900cfcdf2b..c16c29f3222 100644
--- a/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
+++ b/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
@@ -152,6 +152,9 @@ export default {
update(data) {
return data.project?.ciTemplate?.content || '';
},
+ result({ data }) {
+ this.updateCiConfig(data.project?.ciTemplate?.content || '');
+ },
error() {
this.reportFailure(LOAD_FAILURE_UNKNOWN);
},
@@ -170,9 +173,6 @@ export default {
isEmpty() {
return this.currentCiFileContent === '';
},
- templateOrCurrentContent() {
- return this.isNewCiConfigFile ? this.starterTemplate : this.currentCiFileContent;
- },
},
i18n: {
tabEdit: s__('Pipelines|Edit'),
@@ -280,7 +280,7 @@ export default {
/>
<pipeline-editor-home
:ci-config-data="ciConfigData"
- :ci-file-content="templateOrCurrentContent"
+ :ci-file-content="currentCiFileContent"
:is-new-ci-config-file="isNewCiConfigFile"
@commit="updateOnCommit"
@resetContent="resetContent"
diff --git a/app/finders/pending_todos_finder.rb b/app/finders/pending_todos_finder.rb
index d79a2340379..509370b49a8 100644
--- a/app/finders/pending_todos_finder.rb
+++ b/app/finders/pending_todos_finder.rb
@@ -26,6 +26,7 @@ class PendingTodosFinder
todos = by_project(todos)
todos = by_target_id(todos)
todos = by_target_type(todos)
+ todos = by_discussion(todos)
by_commit_id(todos)
end
@@ -60,4 +61,12 @@ class PendingTodosFinder
todos
end
end
+
+ def by_discussion(todos)
+ if (discussion = params[:discussion])
+ todos.for_note(discussion.notes)
+ else
+ todos
+ end
+ end
end
diff --git a/app/graphql/types/ci/runner_type.rb b/app/graphql/types/ci/runner_type.rb
index 3abed7289d5..837d91ef765 100644
--- a/app/graphql/types/ci/runner_type.rb
+++ b/app/graphql/types/ci/runner_type.rb
@@ -40,3 +40,5 @@ module Types
end
end
end
+
+Types::Ci::RunnerType.prepend_mod_with('Types::Ci::RunnerType')
diff --git a/app/models/todo.rb b/app/models/todo.rb
index 23685fb68e0..94a99603848 100644
--- a/app/models/todo.rb
+++ b/app/models/todo.rb
@@ -61,6 +61,7 @@ class Todo < ApplicationRecord
scope :for_author, -> (author) { where(author: author) }
scope :for_user, -> (user) { where(user: user) }
scope :for_project, -> (projects) { where(project: projects) }
+ scope :for_note, -> (notes) { where(note: notes) }
scope :for_undeleted_projects, -> { joins(:project).merge(Project.without_deleted) }
scope :for_group, -> (group) { where(group: group) }
scope :for_type, -> (type) { where(target_type: type) }
diff --git a/app/services/discussions/resolve_service.rb b/app/services/discussions/resolve_service.rb
index 3b733023eae..baf14aa8a03 100644
--- a/app/services/discussions/resolve_service.rb
+++ b/app/services/discussions/resolve_service.rb
@@ -47,9 +47,16 @@ module Discussions
MergeRequests::ResolvedDiscussionNotificationService.new(project: project, current_user: current_user).execute(merge_request)
end
+ resolve_user_todos_for(discussion)
SystemNoteService.discussion_continued_in_issue(discussion, project, current_user, follow_up_issue) if follow_up_issue
end
+ def resolve_user_todos_for(discussion)
+ return unless discussion.for_design?
+
+ TodoService.new.resolve_todos_for_target(discussion, current_user)
+ end
+
def first_discussion
@first_discussion ||= discussions.first
end
diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb
index fc6543a8efc..71bb813f384 100644
--- a/app/services/todo_service.rb
+++ b/app/services/todo_service.rb
@@ -316,6 +316,8 @@ class TodoService
attributes.merge!(target_id: nil, commit_id: target.id)
elsif target.is_a?(Issue)
attributes[:issue_type] = target.issue_type
+ elsif target.is_a?(Discussion)
+ attributes.merge!(target_type: nil, target_id: nil, discussion: target)
end
attributes
diff --git a/app/views/admin/application_settings/appearances/preview_sign_in.html.haml b/app/views/admin/application_settings/appearances/preview_sign_in.html.haml
index a317611862c..77c37abbeef 100644
--- a/app/views/admin/application_settings/appearances/preview_sign_in.html.haml
+++ b/app/views/admin/application_settings/appearances/preview_sign_in.html.haml
@@ -8,5 +8,5 @@
= label_tag :password
= password_field_tag :password, nil, class: "form-control gl-form-input bottom", title: _('This field is required.')
.form-group
- = button_tag _("Sign in"), class: "btn gl-button btn-confirm"
+ = button_tag _("Sign in"), class: "btn gl-button btn-confirm", type: "button"