2021-02-03 21:09:17 +00:00
|
|
|
<script>
|
|
|
|
import CommitSection from './components/commit/commit_section.vue';
|
|
|
|
import PipelineEditorHeader from './components/header/pipeline_editor_header.vue';
|
2021-02-14 18:09:20 +00:00
|
|
|
import PipelineEditorTabs from './components/pipeline_editor_tabs.vue';
|
2021-02-12 18:08:59 +00:00
|
|
|
import { TABS_WITH_COMMIT_FORM, CREATE_TAB } from './constants';
|
2021-02-03 21:09:17 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
CommitSection,
|
|
|
|
PipelineEditorHeader,
|
|
|
|
PipelineEditorTabs,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
ciConfigData: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
ciFileContent: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
isCiConfigDataLoading: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
2021-02-12 18:08:59 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
currentTab: CREATE_TAB,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
showCommitForm() {
|
|
|
|
return TABS_WITH_COMMIT_FORM.includes(this.currentTab);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
setCurrentTab(tabName) {
|
|
|
|
this.currentTab = tabName;
|
|
|
|
},
|
|
|
|
},
|
2021-02-03 21:09:17 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<pipeline-editor-header
|
|
|
|
:ci-config-data="ciConfigData"
|
|
|
|
:is-ci-config-data-loading="isCiConfigDataLoading"
|
|
|
|
/>
|
|
|
|
<pipeline-editor-tabs
|
|
|
|
:ci-config-data="ciConfigData"
|
|
|
|
:ci-file-content="ciFileContent"
|
|
|
|
:is-ci-config-data-loading="isCiConfigDataLoading"
|
|
|
|
v-on="$listeners"
|
2021-02-12 18:08:59 +00:00
|
|
|
@set-current-tab="setCurrentTab"
|
2021-02-03 21:09:17 +00:00
|
|
|
/>
|
2021-02-12 18:08:59 +00:00
|
|
|
<commit-section v-if="showCommitForm" :ci-file-content="ciFileContent" v-on="$listeners" />
|
2021-02-03 21:09:17 +00:00
|
|
|
</div>
|
|
|
|
</template>
|