From 3cccd102ba543e02725d247893729e5c73b38295 Mon Sep 17 00:00:00 2001
From: GitLab Bot
Date: Wed, 20 Apr 2022 10:00:54 +0000
Subject: Add latest changes from gitlab-org/gitlab@14-10-stable-ee
---
.../components/graph/graph_component_wrapper.vue | 1 +
.../pipelines/components/graph/job_item.vue | 3 +-
.../pipelines/components/graph/linked_pipeline.vue | 4 +-
.../components/graph/stage_column_component.vue | 4 +-
.../pipelines/components/header_component.vue | 4 +-
.../components/jobs_shared/job_name_component.vue | 2 +-
.../pipelines/components/pipeline_tabs.vue | 50 +++++
.../components/pipelines_list/empty_state.vue | 2 +-
.../pipelines_list/empty_state/ci_templates.vue | 81 ++++++++
.../empty_state/pipelines_ci_templates.vue | 173 ++++++++++++++++
.../pipelines_list/pipeline_triggerer.vue | 22 +--
.../components/pipelines_list/pipeline_url.vue | 11 ++
.../pipelines_list/pipelines_ci_templates.vue | 219 ---------------------
.../components/pipelines_list/pipelines_table.vue | 6 +-
.../components/pipelines_list/time_ago.vue | 32 +--
.../tokens/pipeline_trigger_author_token.vue | 8 +-
.../queries/get_pipeline_jobs.query.graphql | 2 +-
.../pipelines/pipeline_details_bundle.js | 77 ++++----
app/assets/javascripts/pipelines/pipeline_tabs.js | 44 +++++
.../pipelines/services/pipelines_service.js | 2 +-
.../pipelines/stores/pipelines_store.js | 2 +-
.../pipelines/stores/test_reports/actions.js | 1 +
.../pipelines/stores/test_reports/utils.js | 2 +-
23 files changed, 443 insertions(+), 309 deletions(-)
create mode 100644 app/assets/javascripts/pipelines/components/pipeline_tabs.vue
create mode 100644 app/assets/javascripts/pipelines/components/pipelines_list/empty_state/ci_templates.vue
create mode 100644 app/assets/javascripts/pipelines/components/pipelines_list/empty_state/pipelines_ci_templates.vue
delete mode 100644 app/assets/javascripts/pipelines/components/pipelines_list/pipelines_ci_templates.vue
create mode 100644 app/assets/javascripts/pipelines/pipeline_tabs.js
(limited to 'app/assets/javascripts/pipelines')
diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue
index e995d400907..534ad25a35d 100644
--- a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue
+++ b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue
@@ -273,6 +273,7 @@ export default {
diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/tokens/pipeline_trigger_author_token.vue b/app/assets/javascripts/pipelines/components/pipelines_list/tokens/pipeline_trigger_author_token.vue
index 33115d72b9c..746cf238646 100644
--- a/app/assets/javascripts/pipelines/components/pipelines_list/tokens/pipeline_trigger_author_token.vue
+++ b/app/assets/javascripts/pipelines/components/pipelines_list/tokens/pipeline_trigger_author_token.vue
@@ -83,13 +83,7 @@ export default {
@input="searchAuthors"
>
-
+
{{ activeUser ? activeUser.name : inputValue }}
diff --git a/app/assets/javascripts/pipelines/graphql/queries/get_pipeline_jobs.query.graphql b/app/assets/javascripts/pipelines/graphql/queries/get_pipeline_jobs.query.graphql
index 5fe47e09d9c..641ec7a3cf6 100644
--- a/app/assets/javascripts/pipelines/graphql/queries/get_pipeline_jobs.query.graphql
+++ b/app/assets/javascripts/pipelines/graphql/queries/get_pipeline_jobs.query.graphql
@@ -1,4 +1,4 @@
-#import "~/graphql_shared/fragments/pageInfo.fragment.graphql"
+#import "~/graphql_shared/fragments/page_info.fragment.graphql"
query getPipelineJobs($fullPath: ID!, $iid: ID!, $after: String) {
project(fullPath: $fullPath) {
diff --git a/app/assets/javascripts/pipelines/pipeline_details_bundle.js b/app/assets/javascripts/pipelines/pipeline_details_bundle.js
index 801f71cb364..338de65e795 100644
--- a/app/assets/javascripts/pipelines/pipeline_details_bundle.js
+++ b/app/assets/javascripts/pipelines/pipeline_details_bundle.js
@@ -13,6 +13,7 @@ const SELECTORS = {
PIPELINE_GRAPH: '#js-pipeline-graph-vue',
PIPELINE_HEADER: '#js-pipeline-header-vue',
PIPELINE_NOTIFICATION: '#js-pipeline-notification',
+ PIPELINE_TABS: '#js-pipeline-tabs',
PIPELINE_TESTS: '#js-pipeline-tests-detail',
PIPELINE_JOBS: '#js-pipeline-jobs-vue',
};
@@ -28,22 +29,6 @@ export default async function initPipelineDetailsBundle() {
});
}
- try {
- createPipelinesDetailApp(SELECTORS.PIPELINE_GRAPH, apolloProvider, dataset);
- } catch {
- createFlash({
- message: __('An error occurred while loading the pipeline.'),
- });
- }
-
- try {
- createPipelineHeaderApp(SELECTORS.PIPELINE_HEADER, apolloProvider, dataset.graphqlResourceEtag);
- } catch {
- createFlash({
- message: __('An error occurred while loading a section of this page.'),
- });
- }
-
try {
createPipelineNotificationApp(SELECTORS.PIPELINE_NOTIFICATION, apolloProvider);
} catch {
@@ -52,27 +37,47 @@ export default async function initPipelineDetailsBundle() {
});
}
- try {
- createDagApp(apolloProvider);
- } catch {
- createFlash({
- message: __('An error occurred while loading the Needs tab.'),
- });
- }
+ if (gon.features?.pipelineTabsVue) {
+ const { createPipelineTabs } = await import('./pipeline_tabs');
- try {
- createTestDetails(SELECTORS.PIPELINE_TESTS);
- } catch {
- createFlash({
- message: __('An error occurred while loading the Test Reports tab.'),
- });
- }
+ try {
+ createPipelineTabs(SELECTORS.PIPELINE_TABS, apolloProvider);
+ } catch {
+ createFlash({
+ message: __('An error occurred while loading a section of this page.'),
+ });
+ }
+ } else {
+ try {
+ createPipelinesDetailApp(SELECTORS.PIPELINE_GRAPH, apolloProvider, dataset);
+ } catch {
+ createFlash({
+ message: __('An error occurred while loading the pipeline.'),
+ });
+ }
- try {
- createPipelineJobsApp(SELECTORS.PIPELINE_JOBS);
- } catch {
- createFlash({
- message: __('An error occurred while loading the Jobs tab.'),
- });
+ try {
+ createDagApp(apolloProvider);
+ } catch {
+ createFlash({
+ message: __('An error occurred while loading the Needs tab.'),
+ });
+ }
+
+ try {
+ createTestDetails(SELECTORS.PIPELINE_TESTS);
+ } catch {
+ createFlash({
+ message: __('An error occurred while loading the Test Reports tab.'),
+ });
+ }
+
+ try {
+ createPipelineJobsApp(SELECTORS.PIPELINE_JOBS);
+ } catch {
+ createFlash({
+ message: __('An error occurred while loading the Jobs tab.'),
+ });
+ }
}
}
diff --git a/app/assets/javascripts/pipelines/pipeline_tabs.js b/app/assets/javascripts/pipelines/pipeline_tabs.js
new file mode 100644
index 00000000000..ff88c6215e5
--- /dev/null
+++ b/app/assets/javascripts/pipelines/pipeline_tabs.js
@@ -0,0 +1,44 @@
+import Vue from 'vue';
+import VueApollo from 'vue-apollo';
+import PipelineTabs from 'ee_else_ce/pipelines/components/pipeline_tabs.vue';
+import { reportToSentry } from './utils';
+
+Vue.use(VueApollo);
+
+const createPipelineTabs = (selector, apolloProvider) => {
+ const el = document.querySelector(selector);
+
+ if (!el) return;
+
+ const { dataset } = document.querySelector(selector);
+ const {
+ canGenerateCodequalityReports,
+ codequalityReportDownloadPath,
+ downloadablePathForReportType,
+ exposeSecurityDashboard,
+ exposeLicenseScanningData,
+ } = dataset;
+ // eslint-disable-next-line no-new
+ new Vue({
+ el: selector,
+ components: {
+ PipelineTabs,
+ },
+ apolloProvider,
+ provide: {
+ canGenerateCodequalityReports: JSON.parse(canGenerateCodequalityReports),
+ codequalityReportDownloadPath,
+ downloadablePathForReportType,
+ exposeSecurityDashboard: JSON.parse(exposeSecurityDashboard),
+ exposeLicenseScanningData: JSON.parse(exposeLicenseScanningData),
+ },
+ errorCaptured(err, _vm, info) {
+ reportToSentry('pipeline_tabs', `error: ${err}, info: ${info}`);
+ },
+ render(createElement) {
+ return createElement(PipelineTabs);
+ },
+ });
+};
+
+export { createPipelineTabs };
diff --git a/app/assets/javascripts/pipelines/services/pipelines_service.js b/app/assets/javascripts/pipelines/services/pipelines_service.js
index 523ca13b6c3..3ec563c95bb 100644
--- a/app/assets/javascripts/pipelines/services/pipelines_service.js
+++ b/app/assets/javascripts/pipelines/services/pipelines_service.js
@@ -1,5 +1,5 @@
import Api from '~/api';
-import axios from '../../lib/utils/axios_utils';
+import axios from '~/lib/utils/axios_utils';
import { validateParams } from '../utils';
export default class PipelinesService {
diff --git a/app/assets/javascripts/pipelines/stores/pipelines_store.js b/app/assets/javascripts/pipelines/stores/pipelines_store.js
index a4bbada89c8..765441560d8 100644
--- a/app/assets/javascripts/pipelines/stores/pipelines_store.js
+++ b/app/assets/javascripts/pipelines/stores/pipelines_store.js
@@ -1,4 +1,4 @@
-import { parseIntPagination, normalizeHeaders } from '../../lib/utils/common_utils';
+import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils';
export default class PipelinesStore {
constructor() {
diff --git a/app/assets/javascripts/pipelines/stores/test_reports/actions.js b/app/assets/javascripts/pipelines/stores/test_reports/actions.js
index 7b28d48b5b6..b7f590a7b3c 100644
--- a/app/assets/javascripts/pipelines/stores/test_reports/actions.js
+++ b/app/assets/javascripts/pipelines/stores/test_reports/actions.js
@@ -30,6 +30,7 @@ export const fetchTestSuite = ({ state, commit, dispatch }, index) => {
dispatch('toggleLoading');
+ // eslint-disable-next-line camelcase
const { build_ids = [] } = state.testReports?.test_suites?.[index] || {};
// Replacing `/:suite_name.json` with the name of the suite. Including the extra characters
// to ensure that we replace exactly the template part of the URL string
diff --git a/app/assets/javascripts/pipelines/stores/test_reports/utils.js b/app/assets/javascripts/pipelines/stores/test_reports/utils.js
index 63a58798958..6b616601bc5 100644
--- a/app/assets/javascripts/pipelines/stores/test_reports/utils.js
+++ b/app/assets/javascripts/pipelines/stores/test_reports/utils.js
@@ -1,4 +1,4 @@
-import { __, sprintf } from '../../../locale';
+import { __, sprintf } from '~/locale';
import { TestStatus } from '../../constants';
/**
--
cgit v1.2.3