2021-03-11 19:13:27 +05:30
|
|
|
import Vue from 'vue';
|
2022-11-25 23:54:43 +05:30
|
|
|
import { parseBoolean } from '~/lib/utils/common_utils';
|
2021-03-11 19:13:27 +05:30
|
|
|
import CompareApp from './components/app.vue';
|
|
|
|
|
|
|
|
export default function init() {
|
|
|
|
const el = document.getElementById('js-compare-selector');
|
2021-04-17 20:07:23 +05:30
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
const {
|
2022-08-27 11:52:29 +05:30
|
|
|
sourceProjectRefsPath,
|
|
|
|
targetProjectRefsPath,
|
2021-03-11 19:13:27 +05:30
|
|
|
paramsFrom,
|
|
|
|
paramsTo,
|
2022-11-25 23:54:43 +05:30
|
|
|
straight,
|
2021-03-11 19:13:27 +05:30
|
|
|
projectCompareIndexPath,
|
|
|
|
projectMergeRequestPath,
|
|
|
|
createMrPath,
|
2022-08-27 11:52:29 +05:30
|
|
|
sourceProject,
|
|
|
|
targetProject,
|
2021-10-27 15:23:28 +05:30
|
|
|
projectsFrom,
|
2021-03-11 19:13:27 +05:30
|
|
|
} = el.dataset;
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
components: {
|
2021-10-27 15:23:28 +05:30
|
|
|
CompareApp,
|
2021-03-11 19:13:27 +05:30
|
|
|
},
|
|
|
|
render(createElement) {
|
2021-10-27 15:23:28 +05:30
|
|
|
return createElement(CompareApp, {
|
2021-03-11 19:13:27 +05:30
|
|
|
props: {
|
2022-08-27 11:52:29 +05:30
|
|
|
sourceProjectRefsPath,
|
|
|
|
targetProjectRefsPath,
|
2021-03-11 19:13:27 +05:30
|
|
|
paramsFrom,
|
|
|
|
paramsTo,
|
2022-11-25 23:54:43 +05:30
|
|
|
straight: parseBoolean(straight),
|
2021-03-11 19:13:27 +05:30
|
|
|
projectCompareIndexPath,
|
|
|
|
projectMergeRequestPath,
|
|
|
|
createMrPath,
|
2022-08-27 11:52:29 +05:30
|
|
|
sourceProject: JSON.parse(sourceProject),
|
|
|
|
targetProject: JSON.parse(targetProject),
|
2021-10-27 15:23:28 +05:30
|
|
|
projects: JSON.parse(projectsFrom),
|
2021-03-11 19:13:27 +05:30
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|