mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-08-19 01:23:09 +00:00
31 lines
741 B
JavaScript
31 lines
741 B
JavaScript
import Vue from 'vue';
|
|
import FilepathForm from './components/filepath_form.vue';
|
|
|
|
const getInputOptions = (el) => {
|
|
const { testid, qa_selector: qaSelector, ...options } = JSON.parse(el.dataset.inputOptions);
|
|
return {
|
|
...options,
|
|
'data-testid': testid,
|
|
};
|
|
};
|
|
|
|
export default ({ onTemplateSelected }) => {
|
|
const el = document.getElementById('js-template-selectors-menu');
|
|
|
|
return new Vue({
|
|
el,
|
|
render(h) {
|
|
return h(FilepathForm, {
|
|
props: {
|
|
inputOptions: getInputOptions(el),
|
|
templates: JSON.parse(el.dataset.templates),
|
|
initialTemplate: el.dataset.selected,
|
|
},
|
|
on: {
|
|
'template-selected': onTemplateSelected,
|
|
},
|
|
});
|
|
},
|
|
});
|
|
};
|