Skip to content

Commit cbd6e78

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 07959a9 commit cbd6e78

File tree

73 files changed

+757
-202
lines changed

Some content is hidden

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

73 files changed

+757
-202
lines changed

.gitlab-ci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ variables:
254254
BUILD_ASSETS_IMAGE: "true" # Set it to "false" to disable assets image building, used in `build-assets-image`
255255
SIMPLECOV: "true"
256256

257+
# Temporary variable to enable new CSS compiler
258+
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/438278
259+
USE_NEW_CSS_PIPELINE: "true"
260+
257261
include:
258262
- local: .gitlab/ci/_skip.yml
259263
rules:

app/assets/javascripts/lib/utils/constants.js

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ export const BV_SHOW_TOOLTIP = 'bv::show::tooltip';
1010
export const BV_DROPDOWN_SHOW = 'bv::dropdown::show';
1111
export const BV_DROPDOWN_HIDE = 'bv::dropdown::hide';
1212

13-
export const DEFAULT_TH_CLASSES =
14-
'gl-bg-transparent! gl-border-b-solid! gl-border-b-gray-100! gl-p-5! gl-border-b-1!';
15-
1613
// We set the drawer's z-index to 252 to clear flash messages that might
1714
// be displayed in the page and that have a z-index of 251.
1815
export const DRAWER_Z_INDEX = 252;

app/assets/javascripts/lib/utils/table_utility.js

-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
import { convertToSnakeCase, convertToCamelCase } from '~/lib/utils/text_utility';
2-
import { DEFAULT_TH_CLASSES } from './constants';
3-
4-
/**
5-
* Deprecated: use thWidthPercent instead
6-
* Generates the table header classes to be used for GlTable fields.
7-
*
8-
* @param {Number} width - The column width as a percentage.
9-
* @returns {String} The classes to be used in GlTable fields object.
10-
*/
11-
export const thWidthClass = (width) => `gl-w-${width}p ${DEFAULT_TH_CLASSES}`;
122

133
/**
144
* Generates the table header class for width to be used for GlTable fields.

app/assets/javascripts/organizations/show/components/association_count_card.vue

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>
22
import { GlIcon, GlLink, GlCard } from '@gitlab/ui';
3-
import { numberToMetricPrefix } from '~/lib/utils/number_utils';
43
import { __ } from '~/locale';
54
65
export default {
@@ -16,7 +15,7 @@ export default {
1615
required: true,
1716
},
1817
count: {
19-
type: Number,
18+
type: String,
2019
required: true,
2120
},
2221
linkHref: {
@@ -29,11 +28,6 @@ export default {
2928
default: __('View all'),
3029
},
3130
},
32-
computed: {
33-
formattedCount() {
34-
return numberToMetricPrefix(this.count, 0);
35-
},
36-
},
3731
};
3832
</script>
3933

@@ -48,7 +42,7 @@ export default {
4842
</div>
4943
<span
5044
class="gl-font-size-h-display gl-font-weight-bold gl-line-height-ratio-1000 gl-mt-2 gl-display-block"
51-
>{{ formattedCount }}</span
45+
>{{ count }}</span
5246
>
5347
</gl-card>
5448
</template>

app/assets/javascripts/search/sidebar/constants/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export const SCOPE_NOTES = 'notes';
88
export const SCOPE_COMMITS = 'commits';
99
export const SCOPE_MILESTONES = 'milestones';
1010
export const SCOPE_WIKI_BLOBS = 'wiki_blobs';
11+
export const SCOPE_EPICS = 'epics';
12+
export const SCOPE_USERS = 'users';
1113

1214
export const LABEL_DEFAULT_CLASSES = [
1315
'gl-display-flex',

app/assets/javascripts/search/topbar/components/search_type_indicator.vue

+35-9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
ADVANCED_SEARCH_TYPE,
1010
BASIC_SEARCH_TYPE,
1111
SEARCH_LEVEL_PROJECT,
12+
SEARCH_LEVEL_GLOBAL,
13+
SEARCH_LEVEL_GROUP,
1214
} from '~/search/store/constants';
1315
import {
1416
ZOEKT_HELP_PAGE,
@@ -17,6 +19,8 @@ import {
1719
ZOEKT_HELP_PAGE_SYNTAX_ANCHOR,
1820
} from '../constants';
1921
22+
import { SCOPE_BLOB } from '../../sidebar/constants';
23+
2024
export default {
2125
name: 'SearchTypeIndicator',
2226
directives: {
@@ -40,7 +44,7 @@ export default {
4044
GlLink,
4145
},
4246
computed: {
43-
...mapState(['searchType', 'defaultBranchName', 'query', 'searchLevel']),
47+
...mapState(['searchType', 'defaultBranchName', 'query', 'searchLevel', 'query']),
4448
zoektHelpUrl() {
4549
return helpPagePath(ZOEKT_HELP_PAGE);
4650
},
@@ -58,17 +62,39 @@ export default {
5862
});
5963
},
6064
isZoekt() {
61-
return this.searchType === ZOEKT_SEARCH_TYPE;
65+
return this.searchType === ZOEKT_SEARCH_TYPE && this.query.scope === SCOPE_BLOB;
6266
},
6367
isAdvancedSearch() {
64-
return this.searchType === ADVANCED_SEARCH_TYPE;
68+
return (
69+
this.searchType === ADVANCED_SEARCH_TYPE ||
70+
(this.searchType === ZOEKT_SEARCH_TYPE && this.query.scope !== SCOPE_BLOB)
71+
);
6572
},
66-
isEnabled() {
67-
if (this.searchLevel !== SEARCH_LEVEL_PROJECT) {
68-
return true;
73+
searchTypeTestId() {
74+
if (this.isZoekt) {
75+
return ZOEKT_SEARCH_TYPE;
76+
}
77+
if (this.isAdvancedSearch) {
78+
return ADVANCED_SEARCH_TYPE;
6979
}
7080
71-
return !this.query.repository_ref || this.query.repository_ref === this.defaultBranchName;
81+
return BASIC_SEARCH_TYPE;
82+
},
83+
isEnabled() {
84+
const repoRef = this.query.repository_ref;
85+
switch (this.searchLevel) {
86+
case SEARCH_LEVEL_GLOBAL:
87+
case SEARCH_LEVEL_GROUP:
88+
return true;
89+
case SEARCH_LEVEL_PROJECT: {
90+
if (this.query.scope !== SCOPE_BLOB) {
91+
return true;
92+
}
93+
return !repoRef || repoRef === this.defaultBranchName;
94+
}
95+
default:
96+
return false;
97+
}
7298
},
7399
isBasicSearch() {
74100
return this.searchType === BASIC_SEARCH_TYPE;
@@ -94,14 +120,14 @@ export default {
94120
<template>
95121
<div class="gl-text-gray-600">
96122
<div v-if="isBasicSearch" data-testid="basic">&nbsp;</div>
97-
<div v-else-if="isEnabled" :data-testid="`${searchType}-enabled`">
123+
<div v-else-if="isEnabled" :data-testid="`${searchTypeTestId}-enabled`">
98124
<gl-sprintf :message="enabledMessage">
99125
<template #link="{ content }">
100126
<gl-link :href="helpUrl" target="_blank" data-testid="docs-link">{{ content }} </gl-link>
101127
</template>
102128
</gl-sprintf>
103129
</div>
104-
<div v-else :data-testid="`${searchType}-disabled`">
130+
<div v-else :data-testid="`${searchTypeTestId}-disabled`">
105131
<gl-sprintf :message="disabledMessage">
106132
<template #link="{ content }">
107133
<gl-link :href="helpUrl" target="_blank" data-testid="docs-link">{{ content }} </gl-link>

app/assets/stylesheets/framework/read_more.scss

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
position: relative;
2222
max-height: var(--read-more-height, #{$fallback - $height});
2323
scroll-padding-top: 1000vh; // Fix anchor scroll, keep it up top
24+
overflow: hidden;
2425
}
2526

2627
// only appears when size is > $height.

app/graphql/mutations/saved_replies/base.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Mutations
44
module SavedReplies
55
class Base < BaseMutation
6-
field :saved_reply, Types::SavedReplyType,
6+
field :saved_reply, ::Types::Users::SavedReplyType,
77
null: true,
88
description: 'Saved reply after mutation.'
99

app/graphql/mutations/saved_replies/destroy.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Destroy < Base
99

1010
argument :id, Types::GlobalIDType[::Users::SavedReply],
1111
required: true,
12-
description: copy_field_description(Types::SavedReplyType, :id)
12+
description: copy_field_description(::Types::Users::SavedReplyType, :id)
1313

1414
def resolve(id:)
1515
saved_reply = authorized_find!(id: id)

app/graphql/mutations/saved_replies/update.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ class Update < Base
99

1010
argument :id, Types::GlobalIDType[::Users::SavedReply],
1111
required: true,
12-
description: copy_field_description(Types::SavedReplyType, :id)
12+
description: copy_field_description(::Types::Users::SavedReplyType, :id)
1313

1414
argument :name, GraphQL::Types::String,
1515
required: true,
16-
description: copy_field_description(Types::SavedReplyType, :name)
16+
description: copy_field_description(::Types::SavedReplyType, :name)
1717

1818
argument :content, GraphQL::Types::String,
1919
required: true,
20-
description: copy_field_description(Types::SavedReplyType, :content)
20+
description: copy_field_description(::Types::SavedReplyType, :content)
2121

2222
def resolve(id:, name:, content:)
2323
saved_reply = authorized_find!(id: id)

app/graphql/resolvers/custom_emoji_resolver.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CustomEmojiResolver < BaseResolver
1717
type Types::CustomEmojiType, null: true
1818

1919
def resolve(**args)
20-
Groups::CustomEmojiFinder.new(object, args).execute
20+
::Groups::CustomEmojiFinder.new(object, args).execute
2121
end
2222
end
2323
end

app/graphql/resolvers/saved_reply_resolver.rb

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module Resolvers
44
class SavedReplyResolver < BaseResolver
5-
type Types::SavedReplyType, null: true
5+
type ::Types::Users::SavedReplyType, null: true
66

77
alias_method :target, :object
88

@@ -11,11 +11,7 @@ class SavedReplyResolver < BaseResolver
1111
description: 'ID of a saved reply.'
1212

1313
def resolve(id:)
14-
saved_reply = ::Users::SavedReply.find_saved_reply(user_id: current_user.id, id: id.model_id)
15-
16-
return unless saved_reply
17-
18-
saved_reply
14+
::Users::SavedReply.find_saved_reply(user_id: current_user.id, id: id.model_id)
1915
end
2016
end
2117
end

app/graphql/resolvers/users/groups_resolver.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class GroupsResolver < BaseResolver
2626
private
2727

2828
def resolve_groups(**args)
29-
Groups::UserGroupsFinder.new(current_user, object, args).execute
29+
::Groups::UserGroupsFinder.new(current_user, object, args).execute
3030
end
3131
end
3232
end

app/graphql/types/saved_reply_type.rb

-6
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@
22

33
module Types
44
class SavedReplyType < BaseObject
5-
graphql_name 'SavedReply'
6-
75
connection_type_class Types::CountableConnectionType
86

97
authorize :read_saved_replies
108

11-
field :id, Types::GlobalIDType[::Users::SavedReply],
12-
null: false,
13-
description: 'Global ID of the saved reply.'
14-
159
field :content, GraphQL::Types::String,
1610
null: false,
1711
description: 'Content of the saved reply.'

app/graphql/types/user_interface.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ module UserInterface
137137
complexity: 5,
138138
resolver: ::Resolvers::TimelogResolver
139139
field :saved_replies,
140-
Types::SavedReplyType.connection_type,
140+
::Types::Users::SavedReplyType.connection_type,
141141
null: true,
142142
description: 'Saved replies authored by the user.'
143143

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# frozen_string_literal: true
2+
3+
module Types
4+
module Users
5+
class SavedReplyType < ::Types::SavedReplyType
6+
graphql_name 'SavedReply'
7+
8+
authorize :read_saved_replies
9+
10+
field :id, Types::GlobalIDType[::Users::SavedReply],
11+
null: false,
12+
description: 'Global ID of the user saved reply.'
13+
end
14+
end
15+
end

app/models/integrations/teamcity.rb

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module Integrations
44
class Teamcity < BaseCi
55
include PushDataValidations
66
include ReactivelyCached
7+
include HasAvatar
78
prepend EnableSslVerification
89

910
TEAMCITY_SAAS_HOSTNAME = /\A[^\.]+\.teamcity\.com\z/i
@@ -91,6 +92,10 @@ def enable_ssl_verification
9192
original_value.nil? ? (new_record? || url_is_saas?) : original_value
9293
end
9394

95+
def attribution_notice
96+
'Copyright © 2024 JetBrains s.r.o. JetBrains TeamCity and the JetBrains TeamCity logo are registered trademarks of JetBrains s.r.o.'
97+
end
98+
9499
private
95100

96101
def url_is_saas?

app/models/integrations/youtrack.rb

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module Integrations
44
class Youtrack < BaseIssueTracker
55
include Integrations::HasIssueTrackerFields
6+
include HasAvatar
67

78
validates :project_url, :issues_url, presence: true, public_url: true, if: :activated?
89

@@ -15,16 +16,16 @@ def reference_pattern(only_long: false)
1516
end
1617

1718
def self.title
18-
'YouTrack'
19+
'JetBrains YouTrack'
1920
end
2021

2122
def self.description
22-
s_("IssueTracker|Use YouTrack as this project's issue tracker.")
23+
s_("IssueTracker|Use JetBrains YouTrack as this project's issue tracker.")
2324
end
2425

2526
def self.help
2627
docs_link = ActionController::Base.helpers.link_to _('Learn more.'), Rails.application.routes.url_helpers.help_page_url('user/project/integrations/youtrack'), target: '_blank', rel: 'noopener noreferrer'
27-
s_("IssueTracker|Use YouTrack as this project's issue tracker. %{docs_link}").html_safe % { docs_link: docs_link.html_safe }
28+
s_("IssueTracker|Use JetBrains YouTrack as this project's issue tracker. %{docs_link}").html_safe % { docs_link: docs_link.html_safe }
2829
end
2930

3031
def self.to_param
@@ -34,5 +35,9 @@ def self.to_param
3435
def self.fields
3536
super.select { %w[project_url issues_url].include?(_1.name) }
3637
end
38+
39+
def attribution_notice
40+
'Copyright © 2024 JetBrains s.r.o. JetBrains YouTrack and the JetBrains YouTrack logo are registered trademarks of JetBrains s.r.o.'
41+
end
3742
end
3843
end

app/models/note.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def retrieve_upload(_identifier, paths)
652652
end
653653

654654
def resource_parent
655-
project
655+
noteable.try(:resource_parent) || project
656656
end
657657

658658
def user_mentions
@@ -943,4 +943,4 @@ def set_internal_flag
943943
end
944944
end
945945

946-
Note.prepend_mod_with('Note')
946+
Note.prepend_mod

app/services/concerns/work_items/widgetable_service.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def interpret_quick_actions!(work_item, widget_params, attributes = {})
6666
original_description = description_param.fetch(:description, work_item.description)
6767

6868
description, command_params = QuickActions::InterpretService
69-
.new(work_item.project, current_user, {})
69+
.new(container: work_item.resource_parent, current_user: current_user)
7070
.execute(original_description, work_item)
7171

7272
description_param[:description] = description if description && description != original_description

app/services/groups/autocomplete_service.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def labels_as_hash(target)
4141
def commands(noteable)
4242
return [] unless noteable
4343

44-
QuickActions::InterpretService.new(nil, current_user).available_commands(noteable)
44+
QuickActions::InterpretService.new(container: group, current_user: current_user).available_commands(noteable)
4545
end
4646
end
4747
end

0 commit comments

Comments
 (0)