diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-07 15:10:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-07 15:10:47 +0300 |
commit | bf57aa76628654e15c2035e21fb29ab39fdea131 (patch) | |
tree | feb486f23361470e6b3360472b96afc7525d184e /app | |
parent | d480c97736a444636eeb05266041a6e51649685d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
19 files changed, 32 insertions, 31 deletions
diff --git a/app/assets/javascripts/line_highlighter.js b/app/assets/javascripts/blob/line_highlighter.js index a1f59aa1b54..a1f59aa1b54 100644 --- a/app/assets/javascripts/line_highlighter.js +++ b/app/assets/javascripts/blob/line_highlighter.js diff --git a/app/assets/javascripts/groups_list.js b/app/assets/javascripts/groups/groups_list.js index 56a8cbf6d03..866dd7a61ff 100644 --- a/app/assets/javascripts/groups_list.js +++ b/app/assets/javascripts/groups/groups_list.js @@ -1,4 +1,4 @@ -import FilterableList from './filterable_list'; +import FilterableList from '~/filterable_list'; /** * Makes search request for groups when user types a value in the search input. diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/groups/landing.js index bfb4d9ce67b..bfb4d9ce67b 100644 --- a/app/assets/javascripts/landing.js +++ b/app/assets/javascripts/groups/landing.js diff --git a/app/assets/javascripts/transfer_edit.js b/app/assets/javascripts/groups/transfer_edit.js index bb15e11fd4c..bb15e11fd4c 100644 --- a/app/assets/javascripts/transfer_edit.js +++ b/app/assets/javascripts/groups/transfer_edit.js diff --git a/app/assets/javascripts/create_merge_request_dropdown.js b/app/assets/javascripts/issues/create_merge_request_dropdown.js index ae6e6bf02e4..5d36396bc6e 100644 --- a/app/assets/javascripts/create_merge_request_dropdown.js +++ b/app/assets/javascripts/issues/create_merge_request_dropdown.js @@ -3,13 +3,13 @@ import { init as initConfidentialMergeRequest, isConfidentialIssue, canCreateConfidentialMergeRequest, -} from './confidential_merge_request'; -import confidentialMergeRequestState from './confidential_merge_request/state'; -import DropLab from './filtered_search/droplab/drop_lab_deprecated'; -import ISetter from './filtered_search/droplab/plugins/input_setter'; -import createFlash from './flash'; -import axios from './lib/utils/axios_utils'; -import { __, sprintf } from './locale'; +} from '~/confidential_merge_request'; +import confidentialMergeRequestState from '~/confidential_merge_request/state'; +import DropLab from '~/filtered_search/droplab/drop_lab_deprecated'; +import ISetter from '~/filtered_search/droplab/plugins/input_setter'; +import createFlash from '~/flash'; +import axios from '~/lib/utils/axios_utils'; +import { __, sprintf } from '~/locale'; // Todo: Remove this when fixing issue in input_setter plugin const InputSetter = { ...ISetter }; diff --git a/app/assets/javascripts/issues/issue.js b/app/assets/javascripts/issues/issue.js index c471875654b..8e27f547b5c 100644 --- a/app/assets/javascripts/issues/issue.js +++ b/app/assets/javascripts/issues/issue.js @@ -1,11 +1,11 @@ import $ from 'jquery'; import { joinPaths } from '~/lib/utils/url_utility'; -import CreateMergeRequestDropdown from '~/create_merge_request_dropdown'; import createFlash from '~/flash'; import { EVENT_ISSUABLE_VUE_APP_CHANGE } from '~/issuable/constants'; import axios from '~/lib/utils/axios_utils'; import { addDelimiter } from '~/lib/utils/text_utility'; import { __ } from '~/locale'; +import CreateMergeRequestDropdown from './create_merge_request_dropdown'; export default class Issue { constructor() { diff --git a/app/assets/javascripts/pages/explore/groups/index.js b/app/assets/javascripts/pages/explore/groups/index.js index 808fcce46df..05078191e5c 100644 --- a/app/assets/javascripts/pages/explore/groups/index.js +++ b/app/assets/javascripts/pages/explore/groups/index.js @@ -1,6 +1,6 @@ -import GroupsList from '~/groups_list'; -import Landing from '~/landing'; -import initGroupsList from '../../../groups'; +import initGroupsList from '~/groups'; +import GroupsList from '~/groups/groups_list'; +import Landing from '~/groups/landing'; function exploreGroups() { new GroupsList(); // eslint-disable-line no-new diff --git a/app/assets/javascripts/pages/groups/edit/index.js b/app/assets/javascripts/pages/groups/edit/index.js index 69ecd52c6d3..f6155b2ab2f 100644 --- a/app/assets/javascripts/pages/groups/edit/index.js +++ b/app/assets/javascripts/pages/groups/edit/index.js @@ -2,13 +2,13 @@ import { GROUP_BADGE } from '~/badges/constants'; import dirtySubmitFactory from '~/dirty_submit/dirty_submit_factory'; import initFilePickers from '~/file_pickers'; import TransferDropdown from '~/groups/transfer_dropdown'; +import setupTransferEdit from '~/groups/transfer_edit'; import groupsSelect from '~/groups_select'; import { initCascadingSettingsLockPopovers } from '~/namespaces/cascading_settings'; import mountBadgeSettings from '~/pages/shared/mount_badge_settings'; import projectSelect from '~/project_select'; import initSearchSettings from '~/search_settings'; import initSettingsPanels from '~/settings_panels'; -import setupTransferEdit from '~/transfer_edit'; import initConfirmDanger from '~/init_confirm_danger'; document.addEventListener('DOMContentLoaded', () => { diff --git a/app/assets/javascripts/pages/projects/find_file/show/index.js b/app/assets/javascripts/pages/projects/find_file/show/index.js index a8225167c6b..f47888f0cb8 100644 --- a/app/assets/javascripts/pages/projects/find_file/show/index.js +++ b/app/assets/javascripts/pages/projects/find_file/show/index.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import ShortcutsFindFile from '~/behaviors/shortcuts/shortcuts_find_file'; -import ProjectFindFile from '~/project_find_file'; +import ProjectFindFile from '~/projects/project_find_file'; const findElement = document.querySelector('.js-file-finder'); const projectFindFile = new ProjectFindFile($('.file-finder-holder'), { diff --git a/app/assets/javascripts/pages/projects/imports/show/index.js b/app/assets/javascripts/pages/projects/imports/show/index.js index 8397826f8eb..21d07e04ddc 100644 --- a/app/assets/javascripts/pages/projects/imports/show/index.js +++ b/app/assets/javascripts/pages/projects/imports/show/index.js @@ -1,3 +1,3 @@ -import ProjectImport from '~/project_import'; +import ProjectImport from '~/projects/project_import'; new ProjectImport(); // eslint-disable-line no-new diff --git a/app/assets/javascripts/pages/projects/init_blob.js b/app/assets/javascripts/pages/projects/init_blob.js index 06aba866ccf..7db34816cfe 100644 --- a/app/assets/javascripts/pages/projects/init_blob.js +++ b/app/assets/javascripts/pages/projects/init_blob.js @@ -2,8 +2,8 @@ import ShortcutsBlob from '~/behaviors/shortcuts/shortcuts_blob'; import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; import BlobForkSuggestion from '~/blob/blob_fork_suggestion'; import BlobLinePermalinkUpdater from '~/blob/blob_line_permalink_updater'; +import LineHighlighter from '~/blob/line_highlighter'; import initBlobBundle from '~/blob_edit/blob_bundle'; -import LineHighlighter from '~/line_highlighter'; export default () => { new LineHighlighter(); // eslint-disable-line no-new diff --git a/app/assets/javascripts/pages/projects/new/index.js b/app/assets/javascripts/pages/projects/new/index.js index d89b4d0e0a3..5d830872ed9 100644 --- a/app/assets/javascripts/pages/projects/new/index.js +++ b/app/assets/javascripts/pages/projects/new/index.js @@ -1,5 +1,5 @@ import { initNewProjectCreation, initNewProjectUrlSelect } from '~/projects/new'; -import initProjectVisibilitySelector from '~/project_visibility'; +import initProjectVisibilitySelector from '~/projects/project_visibility'; import initProjectNew from '~/projects/project_new'; initProjectVisibilitySelector(); diff --git a/app/assets/javascripts/pages/projects/show/index.js b/app/assets/javascripts/pages/projects/show/index.js index 31d69a731fe..71c6773c176 100644 --- a/app/assets/javascripts/pages/projects/show/index.js +++ b/app/assets/javascripts/pages/projects/show/index.js @@ -1,16 +1,16 @@ import initTree from 'ee_else_ce/repository'; import Activities from '~/activities'; import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; -import { BlobViewer } from '~/blob/viewer/index'; +import { BlobViewer } from '~/blob/viewer'; import { initUploadForm } from '~/blob_edit/blob_bundle'; import initInviteMembersModal from '~/invite_members/init_invite_members_modal'; import initInviteMembersTrigger from '~/invite_members/init_invite_members_trigger'; import leaveByUrl from '~/namespaces/leave_by_url'; import initVueNotificationsDropdown from '~/notifications'; +import Star from '~/projects/star'; import { initUploadFileTrigger } from '~/projects/upload_file'; import initReadMore from '~/read_more'; import UserCallout from '~/user_callout'; -import Star from '../../../star'; initReadMore(); new Star(); // eslint-disable-line no-new diff --git a/app/assets/javascripts/project_find_file.js b/app/assets/javascripts/projects/project_find_file.js index d295c06928f..d295c06928f 100644 --- a/app/assets/javascripts/project_find_file.js +++ b/app/assets/javascripts/projects/project_find_file.js diff --git a/app/assets/javascripts/project_import.js b/app/assets/javascripts/projects/project_import.js index a51a2a2242f..27a218f1f52 100644 --- a/app/assets/javascripts/project_import.js +++ b/app/assets/javascripts/projects/project_import.js @@ -1,4 +1,4 @@ -import { visitUrl } from './lib/utils/url_utility'; +import { visitUrl } from '~/lib/utils/url_utility'; export default function projectImport() { setTimeout(() => { diff --git a/app/assets/javascripts/project_visibility.js b/app/assets/javascripts/projects/project_visibility.js index 1b57a69d464..1b57a69d464 100644 --- a/app/assets/javascripts/project_visibility.js +++ b/app/assets/javascripts/projects/project_visibility.js diff --git a/app/assets/javascripts/star.js b/app/assets/javascripts/projects/star.js index 7cba445d9b1..578e22ca25d 100644 --- a/app/assets/javascripts/star.js +++ b/app/assets/javascripts/projects/star.js @@ -1,8 +1,8 @@ import $ from 'jquery'; -import createFlash from './flash'; -import axios from './lib/utils/axios_utils'; -import { spriteIcon } from './lib/utils/common_utils'; -import { __, s__ } from './locale'; +import createFlash from '~/flash'; +import axios from '~/lib/utils/axios_utils'; +import { spriteIcon } from '~/lib/utils/common_utils'; +import { __, s__ } from '~/locale'; export default class Star { constructor(container = '.project-home-panel') { diff --git a/app/finders/user_recent_events_finder.rb b/app/finders/user_recent_events_finder.rb index 2473163290f..96120d9412f 100644 --- a/app/finders/user_recent_events_finder.rb +++ b/app/finders/user_recent_events_finder.rb @@ -49,9 +49,13 @@ class UserRecentEventsFinder # rubocop: disable CodeReuse/ActiveRecord def execute_optimized_multi(users) Gitlab::Pagination::Keyset::InOperatorOptimization::QueryBuilder.new( - scope: Event.reorder(:id), + scope: Event.reorder(id: :desc), array_scope: User.select(:id).where(id: users), - array_mapping_scope: -> (author_id_expression) { Event.where(Event.arel_table[:author_id].eq(author_id_expression)) }, + # Event model has a default scope { reorder(nil) } + # When a relation is rordered and used as a target when merging scope, + # its order takes a precedence and _overwrites_ the original scope's order. + # Thus we have to explicitly provide `reorder` for array_mapping_scope here. + array_mapping_scope: -> (author_id_expression) { Event.where(Event.arel_table[:author_id].eq(author_id_expression)).reorder(id: :desc) }, finder_query: -> (id_expression) { Event.where(Event.arel_table[:id].eq(id_expression)) } ) .execute diff --git a/app/helpers/snippets_helper.rb b/app/helpers/snippets_helper.rb index e9ef9146529..ca90d1e13c1 100644 --- a/app/helpers/snippets_helper.rb +++ b/app/helpers/snippets_helper.rb @@ -26,11 +26,8 @@ module SnippetsHelper return unless attrs = snippet_badge_attributes(snippet) icon_name, text = attrs - tag.span(class: %w[badge badge-gray]) do - concat(sprite_icon(icon_name, size: 14, css_class: 'gl-vertical-align-middle')) - concat(' ') - concat(text) - end + + gl_badge_tag(text, icon: icon_name) end def snippet_badge_attributes(snippet) |