Skip to content

Commit ce3c924

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent c9e2b67 commit ce3c924

File tree

93 files changed

+1276
-743
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1276
-743
lines changed

.gitlab/ci/rules.gitlab-ci.yml

+58-39
Large diffs are not rendered by default.

.rubocop_todo/layout/line_continuation_spacing.yml

-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ Layout/LineContinuationSpacing:
9696
- 'lib/api/go_proxy.rb'
9797
- 'lib/api/groups.rb'
9898
- 'lib/api/issue_links.rb'
99-
- 'lib/api/metrics/dashboard/annotations.rb'
10099
- 'lib/gitlab/auth/user_access_denied_reason.rb'
101100
- 'lib/gitlab/background_migration/populate_operation_visibility_permissions_from_operations.rb'
102101
- 'lib/gitlab/ci/parsers/security/validators/schema_validator.rb'

.rubocop_todo/layout/line_end_string_concatenation_indentation.yml

-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,6 @@ Layout/LineEndStringConcatenationIndentation:
464464
- 'lib/api/groups.rb'
465465
- 'lib/api/issue_links.rb'
466466
- 'lib/api/metadata.rb'
467-
- 'lib/api/metrics/dashboard/annotations.rb'
468467
- 'lib/api/ml/mlflow/registered_models.rb'
469468
- 'lib/api/ml/mlflow/runs.rb'
470469
- 'lib/api/releases.rb'

.rubocop_todo/layout/line_length.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ Layout/LineLength:
325325
- 'app/models/integrations/harbor.rb'
326326
- 'app/models/integrations/jenkins.rb'
327327
- 'app/models/integrations/mattermost.rb'
328+
- 'app/models/integrations/matrix.rb'
328329
- 'app/models/integrations/microsoft_teams.rb'
329330
- 'app/models/integrations/pipelines_email.rb'
330331
- 'app/models/integrations/pivotaltracker.rb'
@@ -4029,8 +4030,6 @@ Layout/LineLength:
40294030
- 'spec/requests/api/members_spec.rb'
40304031
- 'spec/requests/api/merge_request_diffs_spec.rb'
40314032
- 'spec/requests/api/merge_requests_spec.rb'
4032-
- 'spec/requests/api/metrics/dashboard/annotations_spec.rb'
4033-
- 'spec/requests/api/metrics/user_starred_dashboards_spec.rb'
40344033
- 'spec/requests/api/notes_spec.rb'
40354034
- 'spec/requests/api/notification_settings_spec.rb'
40364035
- 'spec/requests/api/npm_project_packages_spec.rb'

.rubocop_todo/rails/output_safety.yml

-14
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,16 @@ Rails/OutputSafety:
4646
- 'app/mailers/notify.rb'
4747
- 'app/models/concerns/restricted_signup.rb'
4848
- 'app/models/integrations/apple_app_store.rb'
49-
- 'app/models/integrations/asana.rb'
50-
- 'app/models/integrations/bamboo.rb'
51-
- 'app/models/integrations/bugzilla.rb'
5249
- 'app/models/integrations/campfire.rb'
5350
- 'app/models/integrations/clickup.rb'
5451
- 'app/models/integrations/confluence.rb'
5552
- 'app/models/integrations/custom_issue_tracker.rb'
5653
- 'app/models/integrations/datadog.rb'
5754
- 'app/models/integrations/discord.rb'
58-
- 'app/models/integrations/ewm.rb'
5955
- 'app/models/integrations/external_wiki.rb'
6056
- 'app/models/integrations/google_play.rb'
6157
- 'app/models/integrations/hangouts_chat.rb'
6258
- 'app/models/integrations/irker.rb'
63-
- 'app/models/integrations/jenkins.rb'
64-
- 'app/models/integrations/mattermost.rb'
65-
- 'app/models/integrations/pivotaltracker.rb'
66-
- 'app/models/integrations/pumble.rb'
67-
- 'app/models/integrations/redmine.rb'
68-
- 'app/models/integrations/squash_tm.rb'
69-
- 'app/models/integrations/telegram.rb'
70-
- 'app/models/integrations/unify_circuit.rb'
71-
- 'app/models/integrations/webex_teams.rb'
72-
- 'app/models/integrations/youtrack.rb'
7359
- 'app/presenters/ci/pipeline_presenter.rb'
7460
- 'app/presenters/key_presenter.rb'
7561
- 'app/presenters/project_presenter.rb'

.rubocop_todo/rspec/before_all_role_assignment.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1158,8 +1158,6 @@ RSpec/BeforeAllRoleAssignment:
11581158
- 'spec/requests/api/maven_packages_spec.rb'
11591159
- 'spec/requests/api/merge_request_approvals_spec.rb'
11601160
- 'spec/requests/api/merge_requests_spec.rb'
1161-
- 'spec/requests/api/metrics/dashboard/annotations_spec.rb'
1162-
- 'spec/requests/api/metrics/user_starred_dashboards_spec.rb'
11631161
- 'spec/requests/api/nuget_group_packages_spec.rb'
11641162
- 'spec/requests/api/package_files_spec.rb'
11651163
- 'spec/requests/api/pages/internal_access_spec.rb'

.rubocop_todo/rspec/context_wording.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,6 @@ RSpec/ContextWording:
22682268
- 'spec/requests/api/members_spec.rb'
22692269
- 'spec/requests/api/merge_request_diffs_spec.rb'
22702270
- 'spec/requests/api/merge_requests_spec.rb'
2271-
- 'spec/requests/api/metrics/user_starred_dashboards_spec.rb'
22722271
- 'spec/requests/api/notes_spec.rb'
22732272
- 'spec/requests/api/npm_project_packages_spec.rb'
22742273
- 'spec/requests/api/nuget_group_packages_spec.rb'

.rubocop_todo/rspec/named_subject.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2597,6 +2597,7 @@ RSpec/NamedSubject:
25972597
- 'spec/models/integrations/irker_spec.rb'
25982598
- 'spec/models/integrations/jenkins_spec.rb'
25992599
- 'spec/models/integrations/mattermost_slash_commands_spec.rb'
2600+
- 'spec/models/integrations/matrix_spec.rb'
26002601
- 'spec/models/integrations/pipelines_email_spec.rb'
26012602
- 'spec/models/integrations/pivotaltracker_spec.rb'
26022603
- 'spec/models/integrations/pushover_spec.rb'

app/assets/javascripts/pages/users/activity_calendar.js

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export default class ActivityCalendar {
6161
constructor({
6262
container,
6363
activitiesContainer,
64+
recentActivitiesContainer,
6465
timestamps,
6566
calendarActivitiesPath,
6667
utcOffset = 0,
@@ -91,6 +92,7 @@ export default class ActivityCalendar {
9192
this.months = [];
9293
this.firstDayOfWeek = firstDayOfWeek;
9394
this.activitiesContainer = activitiesContainer;
95+
this.recentActivitiesContainer = recentActivitiesContainer;
9496
this.container = container;
9597
this.onClickDay = onClickDay;
9698

@@ -276,6 +278,8 @@ export default class ActivityCalendar {
276278
.empty()
277279
.append(loadingIconForLegacyJS({ size: 'lg' }));
278280

281+
$(this.recentActivitiesContainer).hide();
282+
279283
axios
280284
.get(this.calendarActivitiesPath, {
281285
params: {
@@ -300,6 +304,7 @@ export default class ActivityCalendar {
300304
} else {
301305
this.currentSelectedDate = '';
302306
$(this.activitiesContainer).html('');
307+
$(this.recentActivitiesContainer).show();
303308
}
304309
}
305310
}

app/assets/javascripts/pages/users/user_tabs.js

+1
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ export default class UserTabs {
267267
new ActivityCalendar({
268268
container: '.tab-pane.active .js-contrib-calendar',
269269
activitiesContainer: '.tab-pane.active .user-calendar-activities',
270+
recentActivitiesContainer: '.tab-pane.active .overview-content-list',
270271
timestamps: data,
271272
calendarActivitiesPath,
272273
utcOffset,

app/assets/javascripts/vue_shared/components/crud_component.vue

+8-3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ export default {
3737
isFormVisible: false,
3838
};
3939
},
40+
computed: {
41+
displayedCount() {
42+
return this.icon && !this.count ? '0' : this.count;
43+
},
44+
},
4045
methods: {
4146
toggleForm() {
4247
this.isFormVisible = !this.isFormVisible;
@@ -64,12 +69,12 @@ export default {
6469
>
6570
{{ title }}
6671
<span
67-
v-if="count"
72+
v-if="displayedCount"
6873
class="gl-inline-flex gl-items-center gl-gap-2 gl-text-sm gl-text-secondary"
6974
data-testid="crud-count"
7075
>
71-
<gl-icon v-if="icon" :name="icon" />
72-
{{ count }}
76+
<gl-icon v-if="icon" :name="icon" data-testid="crud-icon" />
77+
{{ displayedCount }}
7378
</span>
7479
</h2>
7580
<p

app/components/layouts/settings_section_component.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%section.settings-section{ id: @id, data: (@testid ? { testid: @testid } : {}) }
1+
%section.settings-section{ options_attrs }
22
.settings-sticky-header
33
.settings-sticky-header-inner
44
%h2.gl-heading-2{ class: '!gl-mb-2' }

app/components/layouts/settings_section_component.rb

+16-1
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,30 @@ class SettingsSectionComponent < ViewComponent::Base
66
# @param [String] description
77
# @param [String] id
88
# @param [String] testid
9-
def initialize(heading, description: nil, id: nil, testid: nil)
9+
# @param [Hash] options
10+
def initialize(heading, description: nil, id: nil, testid: nil, options: nil)
1011
@heading = heading
1112
@description = description
1213
@id = id
1314
@testid = testid
15+
@options = options || {}
1416
end
1517

1618
renders_one :heading
1719
renders_one :description
1820
renders_one :body
21+
22+
def options_attrs
23+
data = @options[:data] || {}
24+
data[:testid] ||= @testid
25+
26+
attrs = {
27+
class: [@options[:class]].flatten.compact,
28+
data: data
29+
}
30+
attrs[:id] = @id if @id
31+
32+
@options.merge(attrs)
33+
end
1934
end
2035
end

app/controllers/import/source_users_controller.rb

+27-22
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class SourceUsersController < ApplicationController
66

77
before_action :source_user
88
before_action :check_current_user_matches_invite!
9+
before_action :check_source_user_status!
910

1011
respond_to :html
1112
feature_category :importers
@@ -14,28 +15,37 @@ def accept
1415
if source_user.accept
1516
# TODO: This is where we enqueue the job to assign the contributions.
1617

17-
redirect_to(root_path, notice: format(mapping_decision_notice('approved'), invite_details))
18+
flash[:raw] = banner('accept_invite')
19+
redirect_to(dashboard_groups_path)
1820
else
19-
redirect_to(root_path, alert: _('The invitation could not be accepted.'))
21+
redirect_to(dashboard_groups_path, alert: s_('UserMapping|The invitation could not be accepted.'))
2022
end
2123
end
2224

2325
def decline
2426
if source_user.reject
25-
redirect_to(root_path, notice: format(mapping_decision_notice('rejected'), invite_details))
27+
flash[:raw] = banner('reject_invite')
28+
redirect_to(dashboard_groups_path)
2629
else
27-
redirect_to(root_path, alert: _('The invitation could not be declined.'))
30+
redirect_to(dashboard_groups_path, alert: s_('UserMapping|The invitation could not be declined.'))
2831
end
2932
end
3033

31-
def show
32-
redirect_to(root_path, alert: _('The invitation is not valid')) unless source_user.awaiting_approval?
33-
end
34+
def show; end
3435

3536
private
3637

38+
def check_source_user_status!
39+
return if source_user.awaiting_approval?
40+
41+
redirect_to(dashboard_groups_path, alert: s_('UserMapping|The invitation is not valid'))
42+
end
43+
3744
def check_current_user_matches_invite!
38-
not_found unless current_user_matches_invite?
45+
return if current_user_matches_invite?
46+
47+
flash[:raw] = banner('cancel_invite')
48+
redirect_to(dashboard_groups_path)
3949
end
4050

4151
def current_user_matches_invite?
@@ -47,24 +57,19 @@ def source_user
4757
end
4858
strong_memoize_attr :source_user
4959

50-
def invite_details
51-
{
52-
source_username: source_user.source_username,
53-
source_hostname: source_user.source_hostname,
54-
destination_group: source_user.namespace.name
55-
}
56-
end
57-
5860
def check_feature_flag!
5961
not_found unless Feature.enabled?(:importer_user_mapping, current_user)
6062
end
6163

62-
# TODO: This is a placeholder for the proper UI to be provided
63-
# in a follow-up MR.
64-
def mapping_decision_notice(decision)
65-
"You have #{decision} the reassignment of contributions from " \
66-
"%{source_username} on %{source_hostname} " \
67-
"to yourself on %{destination_group}."
64+
def banner(partial)
65+
render_to_string(
66+
partial: partial,
67+
layout: false,
68+
formats: :html,
69+
locals: {
70+
source_user: source_user
71+
}
72+
).html_safe # rubocop: disable Rails/OutputSafety -- render_to_string already makes the string safe
6873
end
6974
end
7075
end

app/models/integration.rb

+13-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Integration < ApplicationRecord
2121
INTEGRATION_NAMES = %w[
2222
asana assembla bamboo bugzilla buildkite campfire clickup confluence custom_issue_tracker
2323
datadog diffblue_cover discord drone_ci emails_on_push ewm external_wiki
24-
gitlab_slack_application hangouts_chat harbor irker jira jira_cloud_app
24+
gitlab_slack_application hangouts_chat harbor irker jira jira_cloud_app matrix
2525
mattermost mattermost_slash_commands microsoft_teams packagist phorge pipelines_email
2626
pivotaltracker prometheus pumble pushover redmine slack slack_slash_commands squash_tm teamcity telegram
2727
unify_circuit webex_teams youtrack zentao
@@ -745,6 +745,18 @@ def toggle!
745745

746746
private
747747

748+
def self.build_help_page_url(url_path, help_text, options = {})
749+
docs_link = ActionController::Base.helpers.link_to(
750+
'',
751+
Rails.application.routes.url_helpers.help_page_url(url_path, **options),
752+
target: '_blank',
753+
rel: 'noopener noreferrer'
754+
)
755+
tag_pair_docs_link = tag_pair(docs_link, :link_start, :link_end)
756+
757+
safe_format(help_text + s_(" %{link_start}Learn More%{link_end}."), tag_pair_docs_link)
758+
end
759+
748760
# Ancestors sorted by hierarchy depth in bottom-top order.
749761
def self.sorted_ancestors(scope)
750762
if scope.root_ancestor.use_traversal_ids?

app/models/integrations/asana.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ def self.description
3232
end
3333

3434
def self.help
35-
docs_link = ActionController::Base.helpers.link_to _('Learn more.'), Rails.application.routes.url_helpers.help_page_url('user/project/integrations/asana'), target: '_blank', rel: 'noopener noreferrer'
36-
s_('Add commit messages as comments to Asana tasks. %{docs_link}').html_safe % { docs_link: docs_link.html_safe }
35+
build_help_page_url('user/project/integrations/asana', s_('Add commit messages as comments to Asana tasks.'))
3736
end
3837

3938
def self.to_param

app/models/integrations/bamboo.rb

+4-9
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,11 @@ def self.description
5353
end
5454

5555
def self.help
56-
docs_link = ActionController::Base.helpers.link_to(
57-
_('Learn more.'),
58-
Rails.application.routes.url_helpers.help_page_url('user/project/integrations/bamboo'),
59-
target: '_blank',
60-
rel: 'noopener noreferrer'
56+
build_help_page_url(
57+
'user/project/integrations/bamboo',
58+
s_('BambooService|Run CI/CD pipelines with Atlassian Bamboo. You must set up automatic revision ' \
59+
'labeling and a repository trigger in Bamboo.')
6160
)
62-
format(
63-
s_('BambooService|Run CI/CD pipelines with Atlassian Bamboo. You must set up automatic revision labeling and ' \
64-
'a repository trigger in Bamboo. %{docs_link}').html_safe,
65-
docs_link: docs_link.html_safe)
6661
end
6762

6863
def self.to_param

app/models/integrations/bugzilla.rb

+3-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ def self.description
1616
end
1717

1818
def self.help
19-
docs_link = ActionController::Base.helpers.link_to _('Learn more.'),
20-
Rails.application.routes.url_helpers.help_page_url('user/project/integrations/bugzilla'),
21-
target: '_blank',
22-
rel: 'noopener noreferrer'
23-
format(s_("IssueTracker|Use Bugzilla as this project's issue tracker. %{docs_link}").html_safe,
24-
docs_link: docs_link.html_safe)
19+
build_help_page_url(
20+
'user/project/integrations/bugzilla', s_("IssueTracker|Use Bugzilla as this project's issue tracker.")
21+
)
2522
end
2623

2724
def self.to_param

app/models/integrations/ewm.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ def self.description
1919
end
2020

2121
def self.help
22-
docs_link = ActionController::Base.helpers.link_to _('Learn more.'), Rails.application.routes.url_helpers.help_page_url('user/project/integrations/ewm'), target: '_blank', rel: 'noopener noreferrer'
23-
s_("IssueTracker|Use IBM Engineering Workflow Management as this project's issue tracker. %{docs_link}").html_safe % { docs_link: docs_link.html_safe }
22+
build_help_page_url(
23+
'user/project/integrations/ewm',
24+
s_("IssueTracker|Use IBM Engineering Workflow Management as this project's issue tracker.")
25+
)
2426
end
2527

2628
def self.to_param

app/models/integrations/jenkins.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ def self.description
7878
end
7979

8080
def self.help
81-
docs_link = ActionController::Base.helpers.link_to _('Learn more.'), Rails.application.routes.url_helpers.help_page_url('integration/jenkins'), target: '_blank', rel: 'noopener noreferrer'
82-
s_('Run CI/CD pipelines with Jenkins when you push to a repository, or when a merge request is created, updated, or merged. %{docs_link}').html_safe % { docs_link: docs_link.html_safe }
81+
build_help_page_url(
82+
'integration/jenkins',
83+
s_("Run CI/CD pipelines with Jenkins when you push to a repository, or when a merge request is created, updated, or merged.")
84+
)
8385
end
8486

8587
def self.to_param

0 commit comments

Comments
 (0)