Skip to content

Commit da10347

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 531cba7 commit da10347

File tree

37 files changed

+1676
-1348
lines changed

37 files changed

+1676
-1348
lines changed

GITLAB_KAS_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
02ff05833da52a69f4c16fa94e539c6f3ab306ea
1+
e8c0552b8152cf9363ccd1d9e9002225904d5202

app/assets/javascripts/admin/users/constants.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ export const TOKENS = [
7676
unique: true,
7777
options: [{ value: 'placeholder', title: s__('UserMapping|Placeholder') }],
7878
},
79+
{
80+
title: s__('AdminUsers|LDAP sync'),
81+
type: 'ldap_sync',
82+
token: GlFilteredSearchToken,
83+
operators: OPERATORS_IS,
84+
unique: true,
85+
options: [{ value: 'ldap_sync', title: __('True') }],
86+
},
7987
];
8088

8189
export const SOLO_OWNED_ORGANIZATIONS_REQUESTED_COUNT = 10;

app/assets/javascripts/gl_field_errors.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default class GlFieldErrors {
2121
'input[type=email]',
2222
'input[type=url]',
2323
'input[type=number]',
24+
'input[type=tel]',
2425
'textarea',
2526
'select',
2627
].join(',');

app/assets/javascripts/vue_shared/components/users_table/user_avatar.vue

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,13 @@ export default {
7171
<div v-if="user.note" class="gl-p-1 gl-text-subtle">
7272
<gl-icon v-gl-tooltip="userNoteShort" name="document" />
7373
</div>
74-
<div
75-
v-for="(badge, idx) in user.badges"
76-
:key="idx"
77-
class="gl-p-1"
78-
:class="{ 'gl-pb-0': glFeatures.simplifiedBadges }"
79-
>
80-
<gl-badge class="!gl-flex" :variant="badge.variant">{{ badge.text }}</gl-badge>
81-
</div>
8274
</template>
75+
76+
<div class="gl-flex gl-flex-wrap gl-pt-2">
77+
<div v-for="badge in user.badges" :key="badge.text" class="gl-pr-2">
78+
<gl-badge :variant="badge.variant">{{ badge.text }}</gl-badge>
79+
</div>
80+
</div>
8381
</gl-avatar-labeled>
8482
</div>
8583
</template>

app/controllers/admin/users_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def paginate_without_count?
327327
end
328328

329329
def users_with_included_associations(users)
330-
users.includes(:authorized_projects, :trusted_with_spam_attribute) # rubocop: disable CodeReuse/ActiveRecord
330+
users.includes(:authorized_projects, :trusted_with_spam_attribute, :identities) # rubocop: disable CodeReuse/ActiveRecord
331331
end
332332

333333
def admin_making_changes_for_another_user?

app/controllers/concerns/uploads_actions.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ module UploadsActions
1010

1111
UPLOAD_MOUNTS = %w[avatar attachment file logo pwa_icon header_logo favicon screenshot].freeze
1212

13+
# We need to avoid setting certain formats. For example, using the :js format
14+
# would trigger Rails' cross-origin JavaScript protection. To avoid this, we use
15+
# the :text format for JS files instead.
16+
CUSTOM_REQUEST_FORMAT_MAPPING = {
17+
js: :text
18+
}.freeze
19+
1320
included do
1421
prepend_before_action :set_request_format_from_path_extension
1522
rescue_from FileUploader::InvalidSecret, with: :render_404
@@ -85,7 +92,9 @@ def set_request_format_from_path_extension
8592

8693
format = Mime[match.captures.first]
8794

88-
request.format = format.symbol if format
95+
return if format.blank?
96+
97+
request.format = CUSTOM_REQUEST_FORMAT_MAPPING[format.symbol] || format.symbol
8998
end
9099

91100
def content_disposition

app/graphql/resolvers/organizations/organization_users_resolver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def organization_users
2828

2929
def preloads
3030
{
31-
user: [:user]
31+
user: [{ user: [:identities] }]
3232
}
3333
end
3434
end

app/helpers/users_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ def user_badges_in_admin_section(user)
141141
badges << { text: s_("AdminUsers|It's you!"), variant: 'muted' } if current_user == user
142142
badges << { text: s_("AdminUsers|Locked"), variant: 'warning' } if user.access_locked?
143143
badges << { text: s_("UserMapping|Placeholder"), variant: 'muted' } if user.placeholder?
144+
badges << { text: s_('AdminUsers|LDAP'), variant: 'info' } if user.ldap_user?
144145
end
145146
end
146147

app/models/user.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,7 @@ def blocked?
682682
scope :dormant, -> { with_state(:active).human_or_service_user.where('last_activity_on <= ?', Gitlab::CurrentSettings.deactivate_dormant_users_period.day.ago.to_date) }
683683
scope :with_no_activity, -> { with_state(:active).human_or_service_user.where(last_activity_on: nil).where('created_at <= ?', MINIMUM_DAYS_CREATED.day.ago.to_date) }
684684
scope :by_provider_and_extern_uid, ->(provider, extern_uid) { joins(:identities).merge(Identity.with_extern_uid(provider, extern_uid)) }
685+
scope :ldap, -> { joins(:identities).where('identities.provider LIKE ?', 'ldap%') }
685686
scope :by_ids, ->(ids) { where(id: ids) }
686687
scope :by_ids_or_usernames, ->(ids, usernames) { where(username: usernames).or(where(id: ids)) }
687688
scope :without_forbidden_states, -> { where.not(state: FORBIDDEN_SEARCH_STATES) }
@@ -886,12 +887,14 @@ def filter_items(filter_name)
886887
without_projects
887888
when 'external'
888889
external
889-
when "trusted"
890+
when 'trusted'
890891
trusted
891-
when "placeholder"
892+
when 'placeholder'
892893
placeholder
893-
when "without_placeholders"
894+
when 'without_placeholders'
894895
without_placeholders
896+
when 'ldap_sync'
897+
ldap
895898
else
896899
all_without_ghosts
897900
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: duo_code_review_full_file
3+
description:
4+
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/510266
5+
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/189314
6+
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/537556
7+
milestone: '18.0'
8+
group: group::code review
9+
type: beta
10+
default_enabled: false

0 commit comments

Comments
 (0)