From dd1388bcdb2383df8aecc8dd22f8ae6bdd8473cd Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 20 Oct 2021 15:12:43 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../components/pipeline_editor_tabs.vue | 31 ++++++- .../javascripts/pipeline_editor/constants.js | 7 ++ .../pipeline_editor/pipeline_editor_home.vue | 2 +- .../projects/storage_counter/utils.js | 4 - app/models/namespace.rb | 4 +- .../ci/job_artifacts/create_service.rb | 4 - app/views/projects/pipelines/show.html.haml | 4 +- .../ci_synchronous_artifact_parsing.yml | 8 -- doc/integration/jira/connect-app.md | 93 ++++++++++--------- .../templates/Terraform.latest.gitlab-ci.yml | 7 +- .../Terraform/Base.latest.gitlab-ci.yml | 9 +- lib/gitlab/database/connection.rb | 27 ------ .../database/load_balancing/load_balancer.rb | 29 +++++- locale/gitlab.pot | 6 +- scripts/review_apps/review-apps.sh | 7 +- spec/frontend/fixtures/projects.rb | 26 ++++++ .../components/pipeline_editor_tabs_spec.js | 58 +++++++++++- .../pipeline_editor_app_spec.js | 68 +++++++------- .../pipeline_editor_home_spec.js | 1 - .../projects/storage_counter/mock_data.js | 27 +----- .../projects/storage_counter/utils_spec.js | 17 ++++ .../terraform_latest_gitlab_ci_yaml_spec.rb | 2 +- spec/lib/gitlab/database/connection_spec.rb | 11 --- .../load_balancing/load_balancer_spec.rb | 11 +++ spec/models/namespace_spec.rb | 18 +++- .../ci/job_artifacts/create_service_spec.rb | 12 --- 26 files changed, 299 insertions(+), 194 deletions(-) delete mode 100644 config/feature_flags/development/ci_synchronous_artifact_parsing.yml diff --git a/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue b/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue index f7c9f10ea46..07af2b848c2 100644 --- a/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue +++ b/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue @@ -3,6 +3,7 @@ import { GlAlert, GlLoadingIcon, GlTabs } from '@gitlab/ui'; import { s__ } from '~/locale'; import PipelineGraph from '~/pipelines/components/pipeline_graph/pipeline_graph.vue'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; +import { getParameterValues, setUrlParams, updateHistory } from '~/lib/utils/url_utility'; import { CREATE_TAB, EDITOR_APP_STATUS_EMPTY, @@ -12,6 +13,8 @@ import { EDITOR_APP_STATUS_VALID, LINT_TAB, MERGED_TAB, + TAB_QUERY_PARAM, + TABS_INDEX, VISUALIZE_TAB, } from '../constants'; import getAppStatus from '../graphql/queries/client/app_status.graphql'; @@ -42,6 +45,9 @@ export default { errorTexts: { loadMergedYaml: s__('Pipelines|Could not load merged YAML content'), }, + query: { + TAB_QUERY_PARAM, + }, tabConstants: { CREATE_TAB, LINT_TAB, @@ -98,15 +104,38 @@ export default { return this.appStatus === EDITOR_APP_STATUS_LOADING; }, }, + created() { + const [tabQueryParam] = getParameterValues(TAB_QUERY_PARAM); + + if (tabQueryParam && TABS_INDEX[tabQueryParam]) { + this.setDefaultTab(tabQueryParam); + } + }, methods: { setCurrentTab(tabName) { this.$emit('set-current-tab', tabName); }, + setDefaultTab(tabName) { + // We associate tab name with the index so that we can use tab name + // in other part of the app and load the corresponding tab closer to the + // actual component using a hash that binds the name to the indexes. + // This also means that if we ever changed tab order, we would justs need to + // update `TABS_INDEX` hash instead of all the instances in the app + // where we used the individual indexes + const newUrl = setUrlParams({ [TAB_QUERY_PARAM]: TABS_INDEX[tabName] }); + + this.setCurrentTab(tabName); + updateHistory({ url: newUrl, title: document.title, replace: true }); + }, }, };