Provide all snippet sources configuration paths

parent 628f2706
...@@ -3,6 +3,7 @@ import Vue from 'vue'; ...@@ -3,6 +3,7 @@ import Vue from 'vue';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql'; import createDefaultClient from '~/lib/graphql';
import { resetServiceWorkersPublicPath } from '../lib/utils/webpack'; import { resetServiceWorkersPublicPath } from '../lib/utils/webpack';
import { CODE_SNIPPET_SOURCE_SETTINGS } from './components/code_snippet_alert/constants';
import getCommitSha from './graphql/queries/client/commit_sha.graphql'; import getCommitSha from './graphql/queries/client/commit_sha.graphql';
import getCurrentBranch from './graphql/queries/client/current_branch.graphql'; import getCurrentBranch from './graphql/queries/client/current_branch.graphql';
import { resolvers } from './graphql/resolvers'; import { resolvers } from './graphql/resolvers';
...@@ -35,9 +36,15 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { ...@@ -35,9 +36,15 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
projectPath, projectPath,
projectNamespace, projectNamespace,
ymlHelpPagePath, ymlHelpPagePath,
apiFuzzingConfigurationPath,
} = el?.dataset; } = el?.dataset;
const provideCodeSnippetConfigurationPaths = Object.fromEntries(
Object.values(CODE_SNIPPET_SOURCE_SETTINGS).map(({ configurationPathInjectKey }) => [
configurationPathInjectKey,
el.dataset[configurationPathInjectKey],
]),
);
Vue.use(VueApollo); Vue.use(VueApollo);
const apolloProvider = new VueApollo({ const apolloProvider = new VueApollo({
...@@ -72,7 +79,7 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { ...@@ -72,7 +79,7 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
projectPath, projectPath,
projectNamespace, projectNamespace,
ymlHelpPagePath, ymlHelpPagePath,
apiFuzzingConfigurationPath, ...provideCodeSnippetConfigurationPaths,
}, },
render(h) { render(h) {
return h(PipelineEditorApp); return h(PipelineEditorApp);
......
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