2023-11-09 02:32:43 +08:00
|
|
|
|
2023-10-24 18:54:58 +08:00
|
|
|
import PerfectScrollbar from 'vue3-perfect-scrollbar';
|
|
|
|
import { createApp } from 'vue/dist/vue.esm-bundler.js';
|
|
|
|
import 'vue3-perfect-scrollbar/dist/vue3-perfect-scrollbar.css';
|
2023-05-03 19:39:10 +08:00
|
|
|
import AssignItemsToTaskModalContainer from '../../vue/assign_items_to_tasks_modal/container.vue';
|
2023-11-10 02:17:51 +08:00
|
|
|
import { mountWithTurbolinks } from './helpers/turbolinks.js';
|
2023-05-03 19:39:10 +08:00
|
|
|
|
|
|
|
function initAssignItemsToTaskModalComponent() {
|
|
|
|
const container = $('.assign-items-to-task-modal-container');
|
|
|
|
if (container.length) {
|
2023-10-24 18:54:58 +08:00
|
|
|
const app = createApp({
|
2023-05-03 19:39:10 +08:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
visibility: false,
|
2023-10-12 21:46:13 +08:00
|
|
|
rowsToAssign: [],
|
2023-05-03 19:39:10 +08:00
|
|
|
urls: {
|
|
|
|
assign: container.data('assign-url'),
|
|
|
|
projects: container.data('projects-url'),
|
|
|
|
experiments: container.data('experiments-url'),
|
2023-05-08 15:57:31 +08:00
|
|
|
tasks: container.data('tasks-url')
|
2023-05-03 19:39:10 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
2023-10-12 21:46:13 +08:00
|
|
|
showModal(repositoryRows) {
|
|
|
|
this.rowsToAssign = repositoryRows;
|
2023-05-17 22:11:27 +08:00
|
|
|
this.visibility = true;
|
|
|
|
},
|
2023-05-03 19:39:10 +08:00
|
|
|
closeModal() {
|
|
|
|
this.visibility = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2023-10-24 18:54:58 +08:00
|
|
|
app.component('AssignItemsToTaskModalContainer', AssignItemsToTaskModalContainer);
|
|
|
|
app.use(PerfectScrollbar);
|
|
|
|
app.config.globalProperties.i18n = window.I18n;
|
2023-11-10 02:17:51 +08:00
|
|
|
window.AssignItemsToTaskModalComponentContainer = mountWithTurbolinks(app, '.assign-items-to-task-modal-container');
|
2023-05-03 19:39:10 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
initAssignItemsToTaskModalComponent();
|