debian-mirror-gitlab/app/assets/javascripts/pipelines/pipeline_details_failed_jobs.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
830 B
JavaScript
Raw Normal View History

2022-07-16 23:28:13 +05:30
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),
},
});
},
});
};