From 3ab7e70965fd198aafefc5c1a0eaf7b695f6cabc Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 21 Jun 2021 09:10:07 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../javascripts/boards/stores/actions.js | 5 +- .../javascripts/boards/stores/boards_store.js | 11 +- .../filtered_search_manager.js | 4 +- app/assets/javascripts/flash.js | 26 ---- .../components/issuables_list_app.vue | 11 +- .../javascripts/lib/utils/common_utils.js | 47 ------- .../javascripts/lib/utils/url_utility.js | 49 ++++++++ .../members_filtered_search_bar.vue | 6 +- .../members/components/members_tabs.vue | 4 +- .../commits/components/author_select.vue | 5 +- app/models/integrations/pivotaltracker.rb | 17 ++- app/models/member.rb | 2 +- .../shared/_index.html.haml | 13 +- .../protected_tags/shared/_index.html.haml | 12 +- .../gitlab/github_import/object_importer.rb | 15 ++- app/workers/concerns/worker_attributes.rb | 3 +- .../github_import/import_diff_note_worker.rb | 4 + .../github_import/import_issue_worker.rb | 4 + .../github_import/import_lfs_object_worker.rb | 4 + .../github_import/import_note_worker.rb | 4 + .../import_pull_request_merged_by_worker.rb | 4 + .../import_pull_request_review_worker.rb | 4 + .../import_pull_request_worker.rb | 4 + .../stage/finish_import_worker.rb | 3 +- doc/administration/auth/okta.md | 9 -- .../geo/replication/remove_geo_node.md | 9 -- .../geo/replication/updating_the_geo_nodes.md | 4 +- .../monitoring/prometheus/gitlab_metrics.md | 2 +- doc/api/services.md | 20 +-- doc/ci/chatops/README.md | 9 -- doc/ci/docker/README.md | 9 -- .../index.md | 2 +- ...and-deploy-python-application-to-heroku.md | 9 -- ...t-and-deploy-ruby-application-to-heroku.md | 9 -- doc/ci/examples/test-clojure-application.md | 9 -- doc/ci/quick_start/README.md | 9 -- doc/ci/services/README.md | 9 -- doc/ci/services/gitlab.md | 2 +- doc/ci/ssh_keys/README.md | 9 -- doc/development/documentation/index.md | 3 - doc/development/feature_flags/development.md | 9 -- doc/development/feature_flags/process.md | 6 +- doc/development/new_fe_guide/dependencies.md | 9 -- doc/development/usage_ping.md | 9 -- doc/downgrade_ee_to_ce/README.md | 9 -- doc/gitlab-basics/README.md | 9 -- doc/gitlab-basics/create-project.md | 9 -- doc/gitlab-basics/fork-project.md | 9 -- doc/install/README.md | 9 -- doc/integration/google_workspace_saml.md | 9 -- doc/intro/README.md | 9 -- doc/legal/README.md | 9 -- .../incident_management/alert_integrations.md | 9 -- doc/raketasks/README.md | 9 -- doc/security/cicd_environment_variables.md | 9 -- doc/university/README.md | 9 -- doc/university/training/gitlab_flow.md | 9 -- .../training/topics/cherry_picking.md | 9 -- doc/university/training/topics/tags.md | 9 -- doc/update/README.md | 9 -- doc/user/admin_area/analytics/user_cohorts.md | 9 -- doc/user/admin_area/credentials_inventory.md | 2 +- .../settings/account_and_limit_settings.md | 9 +- doc/user/application_security/index.md | 1 - doc/user/profile/personal_access_tokens.md | 10 +- .../img/project_integrations_v13_3.png | Bin 38249 -> 0 bytes .../integrations/jira_cloud_configuration.md | 9 -- .../integrations/jira_server_configuration.md | 9 -- doc/user/project/integrations/overview.md | 6 +- .../project/integrations/pivotal_tracker.md | 47 +++++++ .../work_in_progress_merge_requests.md | 9 -- .../project/new_ci_build_permissions_model.md | 9 -- doc/user/project/protected_branches.md | 33 +++-- doc/user/project/protected_tags.md | 19 ++- .../project/settings/project_access_tokens.md | 5 +- .../sidekiq_server_middleware.rb | 45 ++++--- .../importer/diff_notes_importer.rb | 4 + .../github_import/importer/issues_importer.rb | 4 + .../importer/lfs_objects_importer.rb | 6 + .../github_import/importer/notes_importer.rb | 4 + .../importer/pull_requests_importer.rb | 4 + .../pull_requests_merged_by_importer.rb | 6 + .../pull_requests_reviews_importer.rb | 8 ++ lib/gitlab/github_import/object_counter.rb | 56 +++++++++ .../github_import/parallel_scheduling.rb | 6 + .../sidekiq_logging/structured_logger.rb | 2 +- .../sidekiq_middleware/server_metrics.rb | 15 ++- locale/gitlab.pot | 39 +++++- scripts/lint-doc.sh | 4 +- .../user_activates_pivotaltracker_spec.rb | 4 +- spec/frontend/flash_spec.js | 115 ----------------- spec/frontend/lib/utils/common_utils_spec.js | 36 ------ spec/frontend/lib/utils/url_utility_spec.js | 39 ++++++ .../sidekiq_server_middleware_spec.rb | 41 +++--- .../github_import/object_counter_spec.rb | 24 ++++ .../github_import/parallel_scheduling_spec.rb | 4 + spec/lib/gitlab/github_import_spec.rb | 2 +- .../sidekiq_logging/structured_logger_spec.rb | 4 +- .../sidekiq_middleware/server_metrics_spec.rb | 117 ++++++++++-------- ...ue_index_on_cycle_analytics_stages_spec.rb | 4 + spec/models/member_spec.rb | 14 +++ .../github_import/object_importer_spec.rb | 11 +- .../stage/finish_import_worker_spec.rb | 4 + 103 files changed, 615 insertions(+), 745 deletions(-) delete mode 100644 doc/administration/auth/okta.md delete mode 100644 doc/administration/geo/replication/remove_geo_node.md delete mode 100644 doc/ci/chatops/README.md delete mode 100644 doc/ci/docker/README.md delete mode 100644 doc/ci/examples/test-and-deploy-python-application-to-heroku.md delete mode 100644 doc/ci/examples/test-and-deploy-ruby-application-to-heroku.md delete mode 100644 doc/ci/examples/test-clojure-application.md delete mode 100644 doc/ci/quick_start/README.md delete mode 100644 doc/ci/services/README.md delete mode 100644 doc/ci/ssh_keys/README.md delete mode 100644 doc/development/feature_flags/development.md delete mode 100644 doc/development/new_fe_guide/dependencies.md delete mode 100644 doc/development/usage_ping.md delete mode 100644 doc/downgrade_ee_to_ce/README.md delete mode 100644 doc/gitlab-basics/README.md delete mode 100644 doc/gitlab-basics/create-project.md delete mode 100644 doc/gitlab-basics/fork-project.md delete mode 100644 doc/install/README.md delete mode 100644 doc/integration/google_workspace_saml.md delete mode 100644 doc/intro/README.md delete mode 100644 doc/legal/README.md delete mode 100644 doc/operations/incident_management/alert_integrations.md delete mode 100644 doc/raketasks/README.md delete mode 100644 doc/security/cicd_environment_variables.md delete mode 100644 doc/university/README.md delete mode 100644 doc/university/training/gitlab_flow.md delete mode 100644 doc/university/training/topics/cherry_picking.md delete mode 100644 doc/university/training/topics/tags.md delete mode 100644 doc/update/README.md delete mode 100644 doc/user/admin_area/analytics/user_cohorts.md delete mode 100644 doc/user/project/integrations/img/project_integrations_v13_3.png delete mode 100644 doc/user/project/integrations/jira_cloud_configuration.md delete mode 100644 doc/user/project/integrations/jira_server_configuration.md create mode 100644 doc/user/project/integrations/pivotal_tracker.md delete mode 100644 doc/user/project/merge_requests/work_in_progress_merge_requests.md delete mode 100644 doc/user/project/new_ci_build_permissions_model.md create mode 100644 lib/gitlab/github_import/object_counter.rb create mode 100644 spec/lib/gitlab/github_import/object_counter_spec.rb diff --git a/app/assets/javascripts/boards/stores/actions.js b/app/assets/javascripts/boards/stores/actions.js index d4893f9eca7..65adb56f6d4 100644 --- a/app/assets/javascripts/boards/stores/actions.js +++ b/app/assets/javascripts/boards/stores/actions.js @@ -18,7 +18,9 @@ import createBoardListMutation from 'ee_else_ce/boards/graphql/board_list_create import issueMoveListMutation from 'ee_else_ce/boards/graphql/issue_move_list.mutation.graphql'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import createGqClient, { fetchPolicies } from '~/lib/graphql'; -import { convertObjectPropsToCamelCase, urlParamsToObject } from '~/lib/utils/common_utils'; +import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; +// eslint-disable-next-line import/no-deprecated +import { urlParamsToObject } from '~/lib/utils/url_utility'; import { s__ } from '~/locale'; import { formatBoardLists, @@ -74,6 +76,7 @@ export default { performSearch({ dispatch }) { dispatch( 'setFilters', + // eslint-disable-next-line import/no-deprecated convertObjectPropsToCamelCase(urlParamsToObject(window.location.search)), ); diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js index 092f81ad279..49c40c7776a 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js +++ b/app/assets/javascripts/boards/stores/boards_store.js @@ -7,13 +7,9 @@ import BoardsStoreEE from 'ee_else_ce/boards/stores/boards_store_ee'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import createDefaultClient from '~/lib/graphql'; import axios from '~/lib/utils/axios_utils'; -import { - urlParamsToObject, - getUrlParamsArray, - parseBoolean, - convertObjectPropsToCamelCase, -} from '~/lib/utils/common_utils'; -import { mergeUrlParams } from '~/lib/utils/url_utility'; +import { parseBoolean, convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; +// eslint-disable-next-line import/no-deprecated +import { mergeUrlParams, urlParamsToObject, getUrlParamsArray } from '~/lib/utils/url_utility'; import { ListType, flashAnimationDuration } from '../constants'; import eventHub from '../eventhub'; import ListAssignee from '../models/assignee'; @@ -601,6 +597,7 @@ const boardsStore = { getListIssues(list, emptyIssues = true) { const data = { + // eslint-disable-next-line import/no-deprecated ...urlParamsToObject(this.filter.path), page: list.page, }; diff --git a/app/assets/javascripts/filtered_search/filtered_search_manager.js b/app/assets/javascripts/filtered_search/filtered_search_manager.js index 707205a6502..bdc83a537d3 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_manager.js +++ b/app/assets/javascripts/filtered_search/filtered_search_manager.js @@ -1,7 +1,7 @@ import { last } from 'lodash'; import recentSearchesStorageKeys from 'ee_else_ce/filtered_search/recent_searches_storage_keys'; import IssuableFilteredSearchTokenKeys from '~/filtered_search/issuable_filtered_search_token_keys'; -import { getParameterByName, getUrlParamsArray } from '~/lib/utils/common_utils'; +import { getParameterByName } from '~/lib/utils/common_utils'; import { ENTER_KEY_CODE, BACKSPACE_KEY_CODE, @@ -12,7 +12,7 @@ import { import { __ } from '~/locale'; import createFlash from '../flash'; import { addClassIfElementExists } from '../lib/utils/dom_utils'; -import { visitUrl } from '../lib/utils/url_utility'; +import { visitUrl, getUrlParamsArray } from '../lib/utils/url_utility'; import FilteredSearchContainer from './container'; import DropdownUtils from './dropdown_utils'; import eventHub from './event_hub'; diff --git a/app/assets/javascripts/flash.js b/app/assets/javascripts/flash.js index 2edb6e79d3b..46fbe5170b9 100644 --- a/app/assets/javascripts/flash.js +++ b/app/assets/javascripts/flash.js @@ -125,34 +125,8 @@ const createFlash = function createFlash({ return flashContainer; }; -/* - * Flash banner supports different types of Flash configurations - * along with ability to provide actionConfig which can be used to show - * additional action or link on banner next to message - * - * @param {String} message Flash message text - * @param {String} type Type of Flash, it can be `notice`, `success`, `warning` or `alert` (default) - * @param {Object} parent Reference to parent element under which Flash needs to appear - * @param {Object} actionConfig Map of config to show action on banner - * @param {String} href URL to which action config should point to (default: '#') - * @param {String} title Title of action - * @param {Function} clickHandler Method to call when action is clicked on - * @param {Boolean} fadeTransition Boolean to determine whether to fade the alert out - */ -const deprecatedCreateFlash = function deprecatedCreateFlash( - message, - type, - parent, - actionConfig, - fadeTransition, - addBodyClass, -) { - return createFlash({ message, type, parent, actionConfig, fadeTransition, addBodyClass }); -}; - export { createFlash as default, - deprecatedCreateFlash, createFlashEl, createAction, hideFlash, diff --git a/app/assets/javascripts/issues_list/components/issuables_list_app.vue b/app/assets/javascripts/issues_list/components/issuables_list_app.vue index bd0f5463b0b..673507ce9f7 100644 --- a/app/assets/javascripts/issues_list/components/issuables_list_app.vue +++ b/app/assets/javascripts/issues_list/components/issuables_list_app.vue @@ -8,13 +8,9 @@ import { import { toNumber, omit } from 'lodash'; import createFlash from '~/flash'; import axios from '~/lib/utils/axios_utils'; -import { - scrollToElement, - urlParamsToObject, - historyPushState, - getParameterByName, -} from '~/lib/utils/common_utils'; -import { setUrlParams } from '~/lib/utils/url_utility'; +import { scrollToElement, historyPushState, getParameterByName } from '~/lib/utils/common_utils'; +// eslint-disable-next-line import/no-deprecated +import { setUrlParams, urlParamsToObject } from '~/lib/utils/url_utility'; import { __ } from '~/locale'; import initManualOrdering from '~/manual_ordering'; import FilteredSearchBar from '~/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue'; @@ -271,6 +267,7 @@ export default { }); }, getQueryObject() { + // eslint-disable-next-line import/no-deprecated return urlParamsToObject(window.location.search); }, onPaginate(newPage) { diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js index ebdfd09e2d7..3080a6b282a 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js +++ b/app/assets/javascripts/lib/utils/common_utils.js @@ -162,53 +162,6 @@ export const parseUrlPathname = (url) => { return parsedUrl.pathname.charAt(0) === '/' ? parsedUrl.pathname : `/${parsedUrl.pathname}`; }; -const splitPath = (path = '') => path.replace(/^\?/, '').split('&'); - -export const urlParamsToArray = (path = '') => - splitPath(path) - .filter((param) => param.length > 0) - .map((param) => { - const split = param.split('='); - return [decodeURI(split[0]), split[1]].join('='); - }); - -export const getUrlParamsArray = () => urlParamsToArray(window.location.search); - -/** - * Accepts encoding string which includes query params being - * sent to URL. - * - * @param {string} path Query param string - * - * @returns {object} Query params object containing key-value pairs - * with both key and values decoded into plain string. - */ -export const urlParamsToObject = (path = '') => - splitPath(path).reduce((dataParam, filterParam) => { - if (filterParam === '') { - return dataParam; - } - - const data = dataParam; - let [key, value] = filterParam.split('='); - key = /%\w+/g.test(key) ? decodeURIComponent(key) : key; - const isArray = key.includes('[]'); - key = key.replace('[]', ''); - value = decodeURIComponent(value.replace(/\+/g, ' ')); - - if (isArray) { - if (!data[key]) { - data[key] = []; - } - - data[key].push(value); - } else { - data[key] = value; - } - - return data; - }, {}); - export const isMetaKey = (e) => e.metaKey || e.ctrlKey || e.altKey || e.shiftKey; // Identify following special clicks diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js index 48abc072675..a4b3e51b944 100644 --- a/app/assets/javascripts/lib/utils/url_utility.js +++ b/app/assets/javascripts/lib/utils/url_utility.js @@ -409,6 +409,55 @@ export function getWebSocketUrl(path) { return `${getWebSocketProtocol()}//${joinPaths(window.location.host, path)}`; } +const splitPath = (path = '') => path.replace(/^\?/, '').split('&'); + +export const urlParamsToArray = (path = '') => + splitPath(path) + .filter((param) => param.length > 0) + .map((param) => { + const split = param.split('='); + return [decodeURI(split[0]), split[1]].join('='); + }); + +export const getUrlParamsArray = () => urlParamsToArray(window.location.search); + +/** + * Accepts encoding string which includes query params being + * sent to URL. + * + * @param {string} path Query param string + * + * @returns {object} Query params object containing key-value pairs + * with both key and values decoded into plain string. + * + * @deprecated Please use `queryToObject(query, { gatherArrays: true });` instead. See https://gitlab.com/gitlab-org/gitlab/-/issues/328845 + */ +export const urlParamsToObject = (path = '') => + splitPath(path).reduce((dataParam, filterParam) => { + if (filterParam === '') { + return dataParam; + } + + const data = dataParam; + let [key, value] = filterParam.split('='); + key = /%\w+/g.test(key) ? decodeURIComponent(key) : key; + const isArray = key.includes('[]'); + key = key.replace('[]', ''); + value = decodeURIComponent(value.replace(/\+/g, ' ')); + + if (isArray) { + if (!data[key]) { + data[key] = []; + } + + data[key].push(value); + } else { + data[key] = value; + } + + return data; + }, {}); + /** * Convert search query into an object * diff --git a/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue b/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue index cc0533391df..f20cd463cbd 100644 --- a/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue +++ b/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue @@ -1,8 +1,9 @@