Commit 35fa1eb3 authored by Sarah GP's avatar Sarah GP

Make validator utility

Remove from two, add to one
parent 466d3efd
......@@ -4,7 +4,7 @@ import LinksLayer from '../graph_shared/links_layer.vue';
import { DOWNSTREAM, MAIN, UPSTREAM, ONE_COL_WIDTH } from './constants';
import LinkedPipelinesColumn from './linked_pipelines_column.vue';
import StageColumnComponent from './stage_column_component.vue';
import { reportToSentry } from './utils';
import { reportToSentry, validateConfigPaths } from './utils';
export default {
name: 'PipelineGraph',
......@@ -18,11 +18,7 @@ export default {
configPaths: {
type: Object,
required: true,
validator(value) {
return (
Object.keys(value).includes('graphqlResourceEtag') && value.graphqlResourceEtag.length > 0
);
},
validator: validateConfigPaths,
},
pipeline: {
type: Object,
......
......@@ -8,6 +8,7 @@ import {
reportToSentry,
toggleQueryPollingByVisibility,
unwrapPipelineData,
validateConfigPaths,
} from './utils';
export default {
......@@ -23,9 +24,7 @@ export default {
configPaths: {
type: Object,
required: true,
validator(value) {
return Object.keys(value).includes('graphqlResourceEtag');
},
validator: validateConfigPaths,
},
linkedPipelines: {
type: Array,
......
......@@ -77,4 +77,12 @@ const unwrapPipelineData = (mainPipelineProjectPath, data) => {
};
};
export { getQueryHeaders, reportToSentry, toggleQueryPollingByVisibility, unwrapPipelineData };
const validateConfigPaths = (value) => value.graphqlResourceEtag?.length > 0;
export {
getQueryHeaders,
reportToSentry,
toggleQueryPollingByVisibility,
unwrapPipelineData,
validateConfigPaths,
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment