debian-mirror-gitlab/app/assets/javascripts/projects/project_delete_button.js

38 lines
915 B
JavaScript
Raw Normal View History

2020-07-28 23:09:34 +05:30
import Vue from 'vue';
2021-12-11 22:18:48 +05:30
import { parseBoolean } from '~/lib/utils/common_utils';
2020-10-24 23:57:45 +05:30
import ProjectDeleteButton from './components/project_delete_button.vue';
2020-07-28 23:09:34 +05:30
2020-10-24 23:57:45 +05:30
export default (selector = '#js-project-delete-button') => {
2020-07-28 23:09:34 +05:30
const el = document.querySelector(selector);
if (!el) return;
2021-12-11 22:18:48 +05:30
const {
confirmPhrase,
formPath,
isFork,
issuesCount,
mergeRequestsCount,
forksCount,
starsCount,
} = el.dataset;
2020-07-28 23:09:34 +05:30
// eslint-disable-next-line no-new
new Vue({
el,
render(createElement) {
2020-10-24 23:57:45 +05:30
return createElement(ProjectDeleteButton, {
2020-07-28 23:09:34 +05:30
props: {
confirmPhrase,
formPath,
2021-12-11 22:18:48 +05:30
isFork: parseBoolean(isFork),
issuesCount: parseInt(issuesCount, 10),
mergeRequestsCount: parseInt(mergeRequestsCount, 10),
forksCount: parseInt(forksCount, 10),
starsCount: parseInt(starsCount, 10),
2020-07-28 23:09:34 +05:30
},
});
},
});
};