diff options
Diffstat (limited to 'app/assets/javascripts/pages/admin/jobs/index/index.js')
-rw-r--r-- | app/assets/javascripts/pages/admin/jobs/index/index.js | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/app/assets/javascripts/pages/admin/jobs/index/index.js b/app/assets/javascripts/pages/admin/jobs/index/index.js index 9c2a255a1a3..52e4d5dd19f 100644 --- a/app/assets/javascripts/pages/admin/jobs/index/index.js +++ b/app/assets/javascripts/pages/admin/jobs/index/index.js @@ -1,12 +1,9 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; -import { BV_SHOW_MODAL } from '~/lib/utils/constants'; import Translate from '~/vue_shared/translate'; import createDefaultClient from '~/lib/graphql'; -import { CANCEL_JOBS_MODAL_ID } from '../components/constants'; -import CancelJobsModal from '../components/cancel_jobs_modal.vue'; -import AdminJobsTableApp from '../components/table/admin_jobs_table_app.vue'; -import cacheConfig from '../components/table/graphql/cache_config'; +import AdminJobsTableApp from '~/ci/admin/jobs_table/admin_jobs_table_app.vue'; +import cacheConfig from '~/ci/admin/jobs_table/graphql/cache_config'; Vue.use(Translate); Vue.use(VueApollo); @@ -17,35 +14,7 @@ const apolloProvider = new VueApollo({ defaultClient: client, }); -function initJobs() { - const buttonId = 'js-stop-jobs-button'; - const cancelJobsButton = document.getElementById(buttonId); - if (cancelJobsButton) { - // eslint-disable-next-line no-new - new Vue({ - el: `#js-${CANCEL_JOBS_MODAL_ID}`, - components: { - CancelJobsModal, - }, - mounted() { - cancelJobsButton.classList.remove('disabled'); - cancelJobsButton.addEventListener('click', () => { - this.$root.$emit(BV_SHOW_MODAL, CANCEL_JOBS_MODAL_ID, `#${buttonId}`); - }); - }, - render(createElement) { - return createElement(CANCEL_JOBS_MODAL_ID, { - props: { - url: cancelJobsButton.dataset.url, - modalId: CANCEL_JOBS_MODAL_ID, - }, - }); - }, - }); - } -} - -export function initAdminJobsApp() { +const initAdminJobsApp = () => { const containerEl = document.getElementById('admin-jobs-app'); if (!containerEl) return false; @@ -64,10 +33,6 @@ export function initAdminJobsApp() { return createElement(AdminJobsTableApp); }, }); -} +}; -if (gon.features.adminJobsVue) { - initAdminJobsApp(); -} else { - initJobs(); -} +initAdminJobsApp(); |