debian-mirror-gitlab/app/assets/javascripts/pipelines/pipeline_details_failed_jobs.js
2022-07-16 19:58:13 +02:00

36 lines
830 B
JavaScript

import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import FailedJobsApp from './components/jobs/failed_jobs_app.vue';
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
export const createPipelineFailedJobsApp = (selector) => {
const containerEl = document.querySelector(selector);
if (!containerEl) {
return false;
}
const { fullPath, pipelineIid, failedJobsSummaryData } = containerEl.dataset;
return new Vue({
el: containerEl,
apolloProvider,
provide: {
fullPath,
pipelineIid,
},
render(createElement) {
return createElement(FailedJobsApp, {
props: {
failedJobsSummary: JSON.parse(failedJobsSummaryData),
},
});
},
});
};