diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-09 03:10:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-09 03:10:30 +0300 |
commit | e1e7e4ae8034d25b34c159b9088022458b9cb9b0 (patch) | |
tree | 92e27e2e9d9af6de7894a2b9ab4199955d62f298 /app/assets/javascripts/pipeline_editor | |
parent | a0cbad8bf4239004a472b704b5eb33d56898e816 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/pipeline_editor')
3 files changed, 15 insertions, 16 deletions
diff --git a/app/assets/javascripts/pipeline_editor/components/text_editor.vue b/app/assets/javascripts/pipeline_editor/components/text_editor.vue index 6954ba3d6ff..6ef0ef591d8 100644 --- a/app/assets/javascripts/pipeline_editor/components/text_editor.vue +++ b/app/assets/javascripts/pipeline_editor/components/text_editor.vue @@ -7,6 +7,7 @@ export default { EditorLite, }, inheritAttrs: false, + inject: ['projectPath', 'projectNamespace'], props: { ciConfigPath: { type: String, @@ -17,20 +18,15 @@ export default { required: false, default: null, }, - projectPath: { - type: String, - required: true, - }, }, methods: { onEditorReady() { const editorInstance = this.$refs.editor.getEditor(); - const [projectNamespace, projectPath] = this.projectPath.split('/'); editorInstance.use(new CiSchemaExtension()); editorInstance.registerCiSchema({ - projectPath, - projectNamespace, + projectPath: this.projectPath, + projectNamespace: this.projectNamespace, ref: this.commitSha, }); }, diff --git a/app/assets/javascripts/pipeline_editor/index.js b/app/assets/javascripts/pipeline_editor/index.js index df093be9b92..583ba555080 100644 --- a/app/assets/javascripts/pipeline_editor/index.js +++ b/app/assets/javascripts/pipeline_editor/index.js @@ -15,12 +15,17 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { } const { + // props ciConfigPath, commitSha, defaultBranch, newMergeRequestPath, + + // `provide/inject` data lintHelpPagePath, + projectFullPath, projectPath, + projectNamespace, ymlHelpPagePath, } = el?.dataset; @@ -35,6 +40,9 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { apolloProvider, provide: { lintHelpPagePath, + projectFullPath, + projectPath, + projectNamespace, ymlHelpPagePath, }, render(h) { @@ -44,7 +52,6 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { commitSha, defaultBranch, newMergeRequestPath, - projectPath, }, }); }, diff --git a/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue b/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue index 87327a46f17..2880d649075 100644 --- a/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue +++ b/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue @@ -39,11 +39,8 @@ export default { ValidationSegment, }, mixins: [glFeatureFlagsMixin()], + inject: ['projectFullPath'], props: { - projectPath: { - type: String, - required: true, - }, defaultBranch: { type: String, required: false, @@ -84,7 +81,7 @@ export default { query: getBlobContent, variables() { return { - projectPath: this.projectPath, + projectPath: this.projectFullPath, path: this.ciConfigPath, ref: this.defaultBranch, }; @@ -107,7 +104,7 @@ export default { }, variables() { return { - projectPath: this.projectPath, + projectPath: this.projectFullPath, content: this.contentModel, }; }, @@ -244,7 +241,7 @@ export default { } = await this.$apollo.mutate({ mutation: commitCiFileMutation, variables: { - projectPath: this.projectPath, + projectPath: this.projectFullPath, branch, startBranch: this.defaultBranch, message, @@ -318,7 +315,6 @@ export default { v-model="contentModel" :ci-config-path="ciConfigPath" :commit-sha="lastCommitSha" - :project-path="projectPath" /> </editor-tab> <editor-tab |