Commit efc85c39 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent b2c3dfc64645
......@@ -42,7 +42,7 @@ export default class Playable extends Node {
},
{
tag: `${this.mediaType}[src]`,
getAttrs: el => ({ src: el.getAttribute('src'), alt: el.dataset.title }),
getAttrs: el => ({ src: el.src, alt: el.dataset.title }),
},
];
......
<script>
import Icon from '~/vue_shared/components/icon.vue';
import { n__ } from '~/locale';
import { isNumber } from 'underscore';
export default {
components: { Icon },
......@@ -16,7 +17,7 @@ export default {
diffFilesLength: {
type: Number,
required: false,
default: null,
default: 0,
},
},
computed: {
......@@ -26,6 +27,9 @@ export default {
isCompareVersionsHeader() {
return Boolean(this.diffFilesLength);
},
hasDiffFiles() {
return isNumber(this.diffFilesLength) && this.diffFilesLength >= 0;
},
},
};
</script>
......@@ -38,7 +42,7 @@ export default {
'd-inline-flex': !isCompareVersionsHeader,
}"
>
<div v-if="diffFilesLength !== null" class="diff-stats-group">
<div v-if="hasDiffFiles" class="diff-stats-group">
<icon name="doc-code" class="diff-stats-icon text-secondary" />
<strong>{{ diffFilesLength }} {{ filesText }}</strong>
</div>
......
import LengthValidator from '~/pages/sessions/new/length_validator';
import NoEmojiValidator from '~/emoji/no_emoji_validator';
document.addEventListener('DOMContentLoaded', () => {
new LengthValidator(); // eslint-disable-line no-new
new NoEmojiValidator(); // eslint-disable-line no-new
});
......@@ -47,6 +47,7 @@
}
.prometheus-graphs-header {
.monitor-environment-dropdown-header header,
.monitor-dashboard-dropdown-header header {
font-size: $gl-font-size;
}
......
......@@ -8,27 +8,26 @@ class Projects::ProjectMembersController < Projects::ApplicationController
# Authorize
before_action :authorize_admin_project_member!, except: [:index, :leave, :request_access]
# rubocop: disable CodeReuse/ActiveRecord
def index
@sort = params[:sort].presence || sort_value_name
@skip_groups = @project.invited_group_ids
@skip_groups += @project.group.self_and_ancestors_ids if @project.group
@group_links = @project.project_group_links
@group_links = @group_links.search(params[:search]) if params[:search].present?
@skip_groups = @group_links.pluck(:group_id)
@skip_groups << @project.namespace_id unless @project.personal?
@skip_groups += @project.group.ancestors.pluck(:id) if @project.group
@project_members = MembersFinder.new(@project, current_user)
.execute(include_relations: requested_relations, params: params.merge(sort: @sort))
@project_members = MembersFinder.new(@project, current_user).execute(include_relations: requested_relations)
@project_members = present_members(@project_members.page(params[:page]))
if params[:search].present?
@project_members = @project_members.joins(:user).merge(User.search(params[:search]))
@group_links = @group_links.where(group_id: @project.invited_groups.search(params[:search]).select(:id))
end
@requesters = present_members(
AccessRequestsFinder.new(@project).execute(current_user)
)
@project_members = present_members(@project_members.sort_by_attribute(@sort).page(params[:page]))
@requesters = present_members(AccessRequestsFinder.new(@project).execute(current_user))
@project_member = @project.project_members.new
end
# rubocop: enable CodeReuse/ActiveRecord
def import
@projects = current_user.authorized_projects.order_id_desc
......
......@@ -56,7 +56,6 @@ def welcome
return redirect_to stored_location_or_dashboard_or_almost_there_path(current_user) if current_user.role.present? && !current_user.setup_for_company.nil?
current_user.name = nil if current_user.name == current_user.username
render layout: 'devise_experimental_separate_sign_up_flow'
end
def update_registration
......@@ -68,7 +67,7 @@ def update_registration
set_flash_message! :notice, :signed_up
redirect_to stored_location_or_dashboard_or_almost_there_path(current_user)
else
render :welcome, layout: 'devise_experimental_separate_sign_up_flow'
render :welcome
end
end
......
# frozen_string_literal: true
class MembersFinder
attr_reader :project, :current_user, :group
# Params can be any of the following:
# sort: string
# search: string
def initialize(project, current_user)
@project = project
......@@ -9,28 +11,39 @@ def initialize(project, current_user)
@group = project.group
end
def execute(include_relations: [:inherited, :direct])
def execute(include_relations: [:inherited, :direct], params: {})
members = find_members(include_relations, params)
filter_members(members, params)
end
def can?(*args)
Ability.allowed?(*args)
end
private
attr_reader :project, :current_user, :group
def find_members(include_relations, params)
project_members = project.project_members
project_members = project_members.non_invite unless can?(current_user, :admin_project, project)
return project_members if include_relations == [:direct]
union_members = group_union_members(include_relations)
union_members << project_members if include_relations.include?(:direct)
if union_members.any?
distinct_union_of_members(union_members)
else
project_members
end
end
return project_members unless union_members.any?
def can?(*args)
Ability.allowed?(*args)
distinct_union_of_members(union_members)
end
private
def filter_members(members, params)
members = members.search(params[:search]) if params[:search].present?
members = members.sort_by_attribute(params[:sort]) if params[:sort].present?
members
end
def group_union_members(include_relations)
[].tap do |members|
......
......@@ -18,7 +18,7 @@ def commit_committer_link(commit, options = {})
end
def commit_to_html(commit, ref, project)
render 'projects/commits/commit',
render 'projects/commits/commit.html',
commit: commit,
ref: ref,
project: project
......
......@@ -40,7 +40,7 @@ def on_merge_request_commit?
# Returns an array of at most 16 highlighted lines above a diff note
def truncated_diff_lines(highlight: true, diff_limit: nil)
return [] unless on_text?
return [] if diff_line.nil? && first_note.is_a?(LegacyDiffNote)
return [] if diff_line.nil?
diff_limit = [diff_limit, NUMBER_OF_TRUNCATED_DIFF_LINES].compact.min
lines = highlight ? highlighted_diff_lines : diff_lines
......
......@@ -31,6 +31,10 @@ def self.default_access
DEVELOPER
end
def self.search(query)
joins(:group).merge(Group.search(query))
end
def human_access
self.class.access_options.key(self.group_access)
end
......
......@@ -12,7 +12,9 @@ def execute
service = Projects::HousekeepingService.new(@project)
service.execute do
repository.delete_all_refs_except(RESERVED_REF_PREFIXES)
import_failure_service.with_retry(action: 'delete_all_refs') do
repository.delete_all_refs_except(RESERVED_REF_PREFIXES)
end
end
# Right now we don't actually have a way to know if a project
......@@ -26,6 +28,10 @@ def execute
private
def import_failure_service
@import_failure_service ||= Gitlab::ImportExport::ImportFailureService.new(@project)
end
def repository
@repository ||= @project.repository
end
......
......@@ -96,7 +96,7 @@ def new_file_content(suggestion, blob)
end
def suggestion_commit_message(project)
project.suggestion_commit_message || DEFAULT_SUGGESTION_COMMIT_MESSAGE
project.suggestion_commit_message.presence || DEFAULT_SUGGESTION_COMMIT_MESSAGE
end
def processed_suggestion_commit_message(suggestion)
......
---
title: Support require_password_to_approve in project merge request approvals API
merge_request: 24016
author:
type: added
---
title: Fix Merge Request comments when some notes are corrupt
merge_request: 23786
author:
type: fixed
---
title: Display operations feature flag internal ids
merge_request: 23914
author:
type: added
---
title: Fix showing 'NaN files' when a MR diff does not have any changes
merge_request: 24002
author:
type: fixed
---
title: Fix applying the suggestions with an empty custom message
merge_request: 24144
author:
type: fixed
......@@ -25,7 +25,10 @@ GET /projects/:id/approvals
{
"approvals_before_merge": 2,
"reset_approvals_on_push": true,
"disable_overriding_approvers_per_merge_request": false
"disable_overriding_approvers_per_merge_request": false,
"merge_requests_author_approval": true,
"merge_requests_disable_committers_approval": false,
"require_password_to_approve": true
}
```
......@@ -50,6 +53,7 @@ POST /projects/:id/approvals
| `disable_overriding_approvers_per_merge_request` | boolean | no | Allow/Disallow overriding approvers per MR |
| `merge_requests_author_approval` | boolean | no | Allow/Disallow authors from self approving merge requests; `true` means authors cannot self approve |
| `merge_requests_disable_committers_approval` | boolean | no | Allow/Disallow committers from self approving merge requests |
| `require_password_to_approve` | boolean | no | Require approver to enter a password in order to authenticate before adding the approval |
```json
{
......@@ -57,7 +61,8 @@ POST /projects/:id/approvals
"reset_approvals_on_push": true,
"disable_overriding_approvers_per_merge_request": false,
"merge_requests_author_approval": false,
"merge_requests_disable_committers_approval": false
"merge_requests_disable_committers_approval": false,
"require_password_to_approve": true
}
```
......@@ -441,7 +446,10 @@ PUT /projects/:id/approvers
],
"approvals_before_merge": 2,
"reset_approvals_on_push": true,
"disable_overriding_approvers_per_merge_request": false
"disable_overriding_approvers_per_merge_request": false,
"merge_requests_author_approval": true,
"merge_requests_disable_committers_approval": false,
"require_password_to_approve": true
}
```
......
......@@ -16,7 +16,7 @@ def identify
matches << :console if console?
matches << :sidekiq if sidekiq?
matches << :rake if rake?
matches << :rspec if rspec?
matches << :test_suite if test_suite?
if matches.one?
matches.first
......@@ -48,8 +48,8 @@ def rake?
!!(defined?(::Rake) && Rake.application.top_level_tasks.any?)
end
def rspec?
Rails.env.test? && process_name == 'rspec'
def test_suite?
Rails.env.test?
end
def console?
......@@ -64,10 +64,6 @@ def multi_threaded?
puma? || sidekiq?
end
def process_name
File.basename($0)
end
def max_threads
if puma?
Puma.cli_config.options[:max_threads]
......
......@@ -10258,6 +10258,9 @@ msgstr ""
msgid "In order to gather accurate feature usage data, it can take 1 to 2 weeks to see your index."
msgstr ""
msgid "In order to personalize your experience with GitLab<br>we would like to know a bit more about you."
msgstr ""
msgid "In order to tailor your experience with GitLab we<br>would like to know a bit more about you."
msgstr ""
......@@ -10806,6 +10809,9 @@ msgstr ""
msgid "June"
msgstr ""
msgid "Just me"
msgstr ""
msgid "Key"
msgstr ""
......@@ -12290,6 +12296,9 @@ msgstr ""
msgid "Multiple uploaders found: %{uploader_types}"
msgstr ""
msgid "My company or team"
msgstr ""
msgid "My-Reaction"
msgstr ""
......@@ -19484,6 +19493,9 @@ msgstr ""
msgid "This user will be the author of all events in the activity feed that are the result of an update, like new branches being created or new commits being pushed to existing branches. Upon creation or when reassigning you can only assign yourself to be the mirror user."
msgstr ""
msgid "This will help us personalize your onboarding experience."
msgstr ""
msgid "This will redirect you to an external sign in page."
msgstr ""
......@@ -21278,6 +21290,9 @@ msgstr ""
msgid "Welcome to GitLab, %{first_name}!"
msgstr ""
msgid "Welcome to GitLab.com<br>@%{name}!"
msgstr ""
msgid "Welcome to the Guided GitLab Tour"
msgstr ""
......@@ -21337,6 +21352,9 @@ msgstr ""
msgid "Who will be able to see this group?"
msgstr ""
msgid "Who will be using this GitLab subscription?"
msgstr ""
msgid "Wiki"
msgstr ""
......@@ -22051,6 +22069,9 @@ msgstr ""
msgid "Your password reset token has expired."
msgstr ""
msgid "Your profile"
msgstr ""
msgid "Your project limit is %{limit} projects! Please contact your administrator to increase it"
msgstr ""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment