Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/pipelines/utils.js')
-rw-r--r--app/assets/javascripts/pipelines/utils.js17
1 files changed, 7 insertions, 10 deletions
diff --git a/app/assets/javascripts/pipelines/utils.js b/app/assets/javascripts/pipelines/utils.js
index 588d15495ab..b8276327843 100644
--- a/app/assets/javascripts/pipelines/utils.js
+++ b/app/assets/javascripts/pipelines/utils.js
@@ -1,12 +1,7 @@
import * as Sentry from '@sentry/browser';
import { pickBy } from 'lodash';
-import { getParameterValues } from '~/lib/utils/url_utility';
-import {
- NEEDS_PROPERTY,
- SUPPORTED_FILTER_PARAMETERS,
- TAB_QUERY_PARAM,
- validPipelineTabNames,
-} from './constants';
+import { parseUrlPathname } from '~/lib/utils/url_utility';
+import { NEEDS_PROPERTY, SUPPORTED_FILTER_PARAMETERS, validPipelineTabNames } from './constants';
/*
The following functions are the main engine in transforming the data as
received from the endpoint into the format the d3 graph expects.
@@ -145,10 +140,12 @@ export const reportMessageToSentry = (component, message, context) => {
};
export const getPipelineDefaultTab = (url) => {
- const [tabQueryValue] = getParameterValues(TAB_QUERY_PARAM, url);
+ const strippedUrl = parseUrlPathname(url);
+ const regexp = /\w*$/;
+ const [tabName] = strippedUrl.match(regexp);
- if (tabQueryValue && validPipelineTabNames.includes(tabQueryValue)) {
- return tabQueryValue;
+ if (tabName && validPipelineTabNames.includes(tabName)) {
+ return tabName;
}
return null;