diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/assets/javascripts/ci_lint/index.js | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-13.6.0-rc42.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/assets/javascripts/ci_lint/index.js')
-rw-r--r-- | app/assets/javascripts/ci_lint/index.js | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/app/assets/javascripts/ci_lint/index.js b/app/assets/javascripts/ci_lint/index.js index c41e6d47d75..e4cda4cb369 100644 --- a/app/assets/javascripts/ci_lint/index.js +++ b/app/assets/javascripts/ci_lint/index.js @@ -1,48 +1,18 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; -import axios from '~/lib/utils/axios_utils'; import createDefaultClient from '~/lib/graphql'; import CiLint from './components/ci_lint.vue'; +import resolvers from './graphql/resolvers'; Vue.use(VueApollo); -const resolvers = { - Mutation: { - lintCI: (_, { endpoint, content, dry_run }) => { - return axios.post(endpoint, { content, dry_run }).then(({ data }) => ({ - valid: data.valid, - errors: data.errors, - warnings: data.warnings, - jobs: data.jobs.map(job => ({ - name: job.name, - stage: job.stage, - beforeScript: job.before_script, - script: job.script, - afterScript: job.after_script, - tagList: job.tag_list, - environment: job.environment, - when: job.when, - allowFailure: job.allow_failure, - only: { - refs: job.only.refs, - __typename: 'CiLintJobOnlyPolicy', - }, - except: job.except, - __typename: 'CiLintJob', - })), - __typename: 'CiLintContent', - })); - }, - }, -}; - const apolloProvider = new VueApollo({ defaultClient: createDefaultClient(resolvers), }); export default (containerId = '#js-ci-lint') => { const containerEl = document.querySelector(containerId); - const { endpoint, helpPagePath } = containerEl.dataset; + const { endpoint, lintHelpPagePath, pipelineSimulationHelpPagePath } = containerEl.dataset; return new Vue({ el: containerEl, @@ -51,7 +21,8 @@ export default (containerId = '#js-ci-lint') => { return createElement(CiLint, { props: { endpoint, - helpPagePath, + lintHelpPagePath, + pipelineSimulationHelpPagePath, }, }); }, |