diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/lib/utils/text_utility.js | 20 | ||||
-rw-r--r-- | app/assets/javascripts/releases/components/release_block_header.vue | 4 | ||||
-rw-r--r-- | app/assets/stylesheets/page_bundles/ide.scss | 5 | ||||
-rw-r--r-- | app/graphql/resolvers/issues_resolver.rb | 9 | ||||
-rw-r--r-- | app/models/project.rb | 6 | ||||
-rw-r--r-- | app/models/project_wiki.rb | 2 | ||||
-rw-r--r-- | app/models/repository.rb | 9 | ||||
-rw-r--r-- | app/models/snippet.rb | 2 |
8 files changed, 38 insertions, 19 deletions
diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js index 9ed286826cc..f857e618d89 100644 --- a/app/assets/javascripts/lib/utils/text_utility.js +++ b/app/assets/javascripts/lib/utils/text_utility.js @@ -142,11 +142,25 @@ export const stripHtml = (string, replace = '') => { }; /** - * Converts snake_case string to camelCase + * Converts a snake_cased string to camelCase. + * Leading and trailing underscores are ignored. * - * @param {*} string + * @param {String} string The snake_cased string to convert + * @returns {String} A camelCased version of the string + * + * @example + * + * // returns "aSnakeCasedString" + * convertToCamelCase('a_snake_cased_string') + * + * // returns "_leadingUnderscore" + * convertToCamelCase('_leading_underscore') + * + * // returns "trailingUnderscore_" + * convertToCamelCase('trailing_underscore_') */ -export const convertToCamelCase = string => string.replace(/(_\w)/g, s => s[1].toUpperCase()); +export const convertToCamelCase = string => + string.replace(/([a-z0-9])_([a-z0-9])/gi, (match, p1, p2) => `${p1}${p2.toUpperCase()}`); /** * Converts camelCase string to snake_case diff --git a/app/assets/javascripts/releases/components/release_block_header.vue b/app/assets/javascripts/releases/components/release_block_header.vue index f0d3f3f8c1d..0bc2a5ce2eb 100644 --- a/app/assets/javascripts/releases/components/release_block_header.vue +++ b/app/assets/javascripts/releases/components/release_block_header.vue @@ -20,10 +20,10 @@ export default { }, computed: { editLink() { - return this.release.Links?.editUrl; + return this.release._links?.editUrl; }, selfLink() { - return this.release.Links?.self; + return this.release._links?.self; }, }, }; diff --git a/app/assets/stylesheets/page_bundles/ide.scss b/app/assets/stylesheets/page_bundles/ide.scss index 4b838b1383e..a748c669ee8 100644 --- a/app/assets/stylesheets/page_bundles/ide.scss +++ b/app/assets/stylesheets/page_bundles/ide.scss @@ -994,11 +994,6 @@ $ide-commit-header-height: 48px; } .ide-context-header { - .ide-merge-requests-dropdown.dropdown-menu { - width: 385px; - max-height: initial; - } - .avatar-container { flex: 0 0 auto; margin-right: 0; diff --git a/app/graphql/resolvers/issues_resolver.rb b/app/graphql/resolvers/issues_resolver.rb index 664e0955535..ae77af32b5b 100644 --- a/app/graphql/resolvers/issues_resolver.rb +++ b/app/graphql/resolvers/issues_resolver.rb @@ -15,6 +15,15 @@ module Resolvers argument :label_name, GraphQL::STRING_TYPE.to_list_type, required: false, description: 'Labels applied to this issue' + argument :milestone_title, GraphQL::STRING_TYPE.to_list_type, + required: false, + description: 'Milestones applied to this issue' + argument :assignee_username, GraphQL::STRING_TYPE, + required: false, + description: 'Username of a user assigned to the issues' + argument :assignee_id, GraphQL::STRING_TYPE, + required: false, + description: 'ID of a user assigned to the issues, "none" and "any" values supported' argument :created_before, Types::TimeType, required: false, description: 'Issues created before this date' diff --git a/app/models/project.rb b/app/models/project.rb index 6ff5016be03..0f61d32eb8d 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -780,7 +780,7 @@ class Project < ApplicationRecord end def repository - @repository ||= Repository.new(full_path, self, disk_path: disk_path) + @repository ||= Repository.new(full_path, self, shard: repository_storage, disk_path: disk_path) end def cleanup @@ -1411,8 +1411,8 @@ class Project < ApplicationRecord # Expires various caches before a project is renamed. def expire_caches_before_rename(old_path) - repo = Repository.new(old_path, self) - wiki = Repository.new("#{old_path}.wiki", self) + repo = Repository.new(old_path, self, shard: repository_storage) + wiki = Repository.new("#{old_path}.wiki", self, shard: repository_storage, repo_type: Gitlab::GlRepository::WIKI) if repo.exists? repo.before_delete diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index 1abde5196de..7529047a73a 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -170,7 +170,7 @@ class ProjectWiki end def repository - @repository ||= Repository.new(full_path, @project, disk_path: disk_path, repo_type: Gitlab::GlRepository::WIKI) + @repository ||= Repository.new(full_path, @project, shard: repository_storage, disk_path: disk_path, repo_type: Gitlab::GlRepository::WIKI) end def default_branch diff --git a/app/models/repository.rb b/app/models/repository.rb index a53850bb068..beb65ff26fd 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -22,7 +22,7 @@ class Repository include Gitlab::RepositoryCacheAdapter - attr_accessor :full_path, :disk_path, :container, :repo_type + attr_accessor :full_path, :shard, :disk_path, :container, :repo_type delegate :ref_name_for_sha, to: :raw_repository delegate :bundle_to_disk, to: :raw_repository @@ -65,8 +65,9 @@ class Repository xcode_config: :xcode_project? }.freeze - def initialize(full_path, container, disk_path: nil, repo_type: Gitlab::GlRepository::PROJECT) + def initialize(full_path, container, shard:, disk_path: nil, repo_type: Gitlab::GlRepository::PROJECT) @full_path = full_path + @shard = shard @disk_path = disk_path || full_path @container = container @commit_cache = {} @@ -95,7 +96,7 @@ class Repository def path_to_repo @path_to_repo ||= begin - storage = Gitlab.config.repositories.storages[container.repository_storage] + storage = Gitlab.config.repositories.storages[shard] File.expand_path( File.join(storage.legacy_disk_path, disk_path + '.git') @@ -1181,7 +1182,7 @@ class Repository end def initialize_raw_repository - Gitlab::Git::Repository.new(container.repository_storage, + Gitlab::Git::Repository.new(shard, disk_path + '.git', repo_type.identifier_for_container(container), container.full_path) diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 8f162f17ac5..8bba79bd944 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -261,7 +261,7 @@ class Snippet < ApplicationRecord end def repository - @repository ||= Repository.new(full_path, self, disk_path: disk_path, repo_type: Gitlab::GlRepository::SNIPPET) + @repository ||= Repository.new(full_path, self, shard: repository_storage, disk_path: disk_path, repo_type: Gitlab::GlRepository::SNIPPET) end def storage |