diff options
Diffstat (limited to 'app')
10 files changed, 39 insertions, 12 deletions
diff --git a/app/assets/javascripts/boards/filtered_search_boards.js b/app/assets/javascripts/boards/filtered_search_boards.js index b1b4b1c5508..ca85e54eb89 100644 --- a/app/assets/javascripts/boards/filtered_search_boards.js +++ b/app/assets/javascripts/boards/filtered_search_boards.js @@ -1,6 +1,6 @@ import IssuableFilteredSearchTokenKeys from 'ee_else_ce/filtered_search/issuable_filtered_search_token_keys'; import FilteredSearchContainer from '../filtered_search/container'; -import FilteredSearchManager from '../filtered_search/filtered_search_manager'; +import FilteredSearchManager from 'ee_else_ce/filtered_search/filtered_search_manager'; import boardsStore from './stores/boards_store'; export default class FilteredSearchBoards extends FilteredSearchManager { diff --git a/app/assets/javascripts/filtered_search/filtered_search_manager.js b/app/assets/javascripts/filtered_search/filtered_search_manager.js index 724f80f8866..30eea372a35 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_manager.js +++ b/app/assets/javascripts/filtered_search/filtered_search_manager.js @@ -710,13 +710,17 @@ export default class FilteredSearchManager { } } - search(state = null) { - const paths = []; + getSearchTokens() { const searchQuery = DropdownUtils.getSearchQuery(); this.saveCurrentSearchQuery(); const tokenKeys = this.filteredSearchTokenKeys.getKeys(); - const { tokens, searchToken } = this.tokenizer.processTokens(searchQuery, tokenKeys); + return this.tokenizer.processTokens(searchQuery, tokenKeys); + } + + search(state = null) { + const paths = []; + const { tokens, searchToken } = this.getSearchTokens(); const currentState = state || getParameterByName('state') || 'opened'; paths.push(`state=${currentState}`); diff --git a/app/assets/javascripts/pages/search/init_filtered_search.js b/app/assets/javascripts/pages/search/init_filtered_search.js index 7fdf4ee0bf3..e54e32199f0 100644 --- a/app/assets/javascripts/pages/search/init_filtered_search.js +++ b/app/assets/javascripts/pages/search/init_filtered_search.js @@ -1,4 +1,4 @@ -import FilteredSearchManager from '~/filtered_search/filtered_search_manager'; +import FilteredSearchManager from 'ee_else_ce/filtered_search/filtered_search_manager'; export default ({ page, diff --git a/app/assets/javascripts/snippets/components/snippet_title.vue b/app/assets/javascripts/snippets/components/snippet_title.vue index 1fc0423a06c..06484ad5110 100644 --- a/app/assets/javascripts/snippets/components/snippet_title.vue +++ b/app/assets/javascripts/snippets/components/snippet_title.vue @@ -20,7 +20,11 @@ export default { <h2 class="snippet-title prepend-top-0 mb-3" data-qa-selector="snippet_title"> {{ snippet.title }} </h2> - <div v-if="snippet.description" class="description" data-qa-selector="snippet_description"> + <div + v-if="snippet.description" + class="description" + data-qa-selector="snippet_description_field" + > <div class="md js-snippet-description" v-html="snippet.descriptionHtml"></div> </div> diff --git a/app/assets/stylesheets/utilities.scss b/app/assets/stylesheets/utilities.scss index 3fcf9a74cb2..e072adc54cf 100644 --- a/app/assets/stylesheets/utilities.scss +++ b/app/assets/stylesheets/utilities.scss @@ -7,6 +7,12 @@ #{'.text-#{$variant}-#{$suffix}'} { color: $color; } + + #{'.hover-text-#{$variant}-#{$suffix}'} { + &:hover { + color: $color; + } + } } } diff --git a/app/controllers/groups/registry/repositories_controller.rb b/app/controllers/groups/registry/repositories_controller.rb index 16aa6e50320..14651e0794a 100644 --- a/app/controllers/groups/registry/repositories_controller.rb +++ b/app/controllers/groups/registry/repositories_controller.rb @@ -9,7 +9,9 @@ module Groups respond_to do |format| format.html format.json do - @images = ContainerRepositoriesFinder.new(user: current_user, subject: group).execute.with_api_entity_associations + @images = ContainerRepositoriesFinder.new(user: current_user, subject: group, params: params.slice(:name)) + .execute + .with_api_entity_associations track_event(:list_repositories) diff --git a/app/controllers/projects/registry/repositories_controller.rb b/app/controllers/projects/registry/repositories_controller.rb index 2418ea97409..19d0cb9acdc 100644 --- a/app/controllers/projects/registry/repositories_controller.rb +++ b/app/controllers/projects/registry/repositories_controller.rb @@ -10,7 +10,8 @@ module Projects respond_to do |format| format.html format.json do - @images = project.container_repositories + @images = ContainerRepositoriesFinder.new(user: current_user, subject: project, params: params.slice(:name)) + .execute track_event(:list_repositories) diff --git a/app/finders/container_repositories_finder.rb b/app/finders/container_repositories_finder.rb index 34921df840b..5109efb361b 100644 --- a/app/finders/container_repositories_finder.rb +++ b/app/finders/container_repositories_finder.rb @@ -3,17 +3,18 @@ class ContainerRepositoriesFinder VALID_SUBJECTS = [Group, Project].freeze - def initialize(user:, subject:) + def initialize(user:, subject:, params: {}) @user = user @subject = subject + @params = params end def execute raise ArgumentError, "invalid subject_type" unless valid_subject_type? return unless authorized? - return project_repositories if @subject.is_a?(Project) - return group_repositories if @subject.is_a?(Group) + repositories = @subject.is_a?(Project) ? project_repositories : group_repositories + filter_by_image_name(repositories) end private @@ -32,6 +33,12 @@ class ContainerRepositoriesFinder ContainerRepository.for_group_and_its_subgroups(@subject) end + def filter_by_image_name(repositories) + return repositories unless @params[:name] + + repositories.search_by_name(@params[:name]) + end + def authorized? Ability.allowed?(@user, :read_container_image, @subject) end diff --git a/app/models/container_repository.rb b/app/models/container_repository.rb index 3bff7cb06c1..455c672cea3 100644 --- a/app/models/container_repository.rb +++ b/app/models/container_repository.rb @@ -2,6 +2,7 @@ class ContainerRepository < ApplicationRecord include Gitlab::Utils::StrongMemoize + include Gitlab::SQL::Pattern belongs_to :project @@ -17,6 +18,7 @@ class ContainerRepository < ApplicationRecord scope :for_group_and_its_subgroups, ->(group) do where(project_id: Project.for_group_and_its_subgroups(group).with_container_registry.select(:id)) end + scope :search_by_name, ->(query) { fuzzy_search(query, [:name], use_minimum_char_limit: false) } def self.exists_by_path?(path) where( diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml index 2176d163489..1bf0c8eb031 100644 --- a/app/views/projects/issues/_issue.html.haml +++ b/app/views/projects/issues/_issue.html.haml @@ -6,12 +6,13 @@ = check_box_tag dom_id(issue, "selected"), nil, false, 'data-id' => issue.id, class: "selected-issuable" .issuable-info-container .issuable-main-info - .issue-title.title + .issue-title.title.d-flex.align-items-center %span.issue-title-text.js-onboarding-issue-item{ dir: "auto" } - if issue.confidential? %span.has-tooltip{ title: _('Confidential') } = confidential_icon(issue) = link_to issue.title, issue_path(issue) + = render_if_exists 'projects/issues/subepic_flag', issue: issue - if issue.tasks? %span.task-status.d-none.d-sm-inline-block |