2020-07-20 17:09:23 -04:00
|
|
|
import Vue from 'vue';
|
|
|
|
import PipelineNewForm from './components/pipeline_new_form.vue';
|
2020-12-02 16:09:44 -05:00
|
|
|
import formatRefs from './utils/format_refs';
|
2020-07-20 17:09:23 -04:00
|
|
|
|
|
|
|
export default () => {
|
|
|
|
const el = document.getElementById('js-new-pipeline');
|
|
|
|
const {
|
|
|
|
projectId,
|
|
|
|
pipelinesPath,
|
2020-10-16 11:08:46 -04:00
|
|
|
configVariablesPath,
|
2020-12-02 16:09:44 -05:00
|
|
|
defaultBranch,
|
2020-07-20 17:09:23 -04:00
|
|
|
refParam,
|
|
|
|
varParam,
|
|
|
|
fileParam,
|
2020-12-02 16:09:44 -05:00
|
|
|
branchRefs,
|
|
|
|
tagRefs,
|
2020-07-20 17:09:23 -04:00
|
|
|
settingsLink,
|
2020-09-15 17:09:35 -04:00
|
|
|
maxWarnings,
|
2020-07-20 17:09:23 -04:00
|
|
|
} = el?.dataset;
|
|
|
|
|
|
|
|
const variableParams = JSON.parse(varParam);
|
|
|
|
const fileParams = JSON.parse(fileParam);
|
2020-12-02 16:09:44 -05:00
|
|
|
const branches = formatRefs(JSON.parse(branchRefs), 'branch');
|
|
|
|
const tags = formatRefs(JSON.parse(tagRefs), 'tag');
|
2020-07-20 17:09:23 -04:00
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
render(createElement) {
|
|
|
|
return createElement(PipelineNewForm, {
|
|
|
|
props: {
|
|
|
|
projectId,
|
|
|
|
pipelinesPath,
|
2020-10-16 11:08:46 -04:00
|
|
|
configVariablesPath,
|
2020-12-02 16:09:44 -05:00
|
|
|
defaultBranch,
|
2020-07-20 17:09:23 -04:00
|
|
|
refParam,
|
|
|
|
variableParams,
|
|
|
|
fileParams,
|
2020-12-02 16:09:44 -05:00
|
|
|
branches,
|
|
|
|
tags,
|
2020-07-20 17:09:23 -04:00
|
|
|
settingsLink,
|
2020-09-15 17:09:35 -04:00
|
|
|
maxWarnings: Number(maxWarnings),
|
2020-07-20 17:09:23 -04:00
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|